* - Fix xpNoCooldown to work as it did in 1.17- - Remove XPcombine - Use vanilla merge methods * Remove debug code * fix: rollback sort carpet.mixins.json * rework: nerf xp cooldown absorption a little * remove: combineXpOrbs fix: xpCooldown * revert renames * fix newlines * fix: wrong implementation for absorption * add missing `private` keyword * fix: player xp cooldown set wrongly * fix: injection point to be within condition
29 lines
909 B
Java
29 lines
909 B
Java
package carpet.mixins;
|
|
|
|
import carpet.CarpetSettings;
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.entity.player.PlayerEntity;
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
import org.spongepowered.asm.mixin.Shadow;
|
|
import org.spongepowered.asm.mixin.injection.At;
|
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
|
|
|
import java.util.List;
|
|
|
|
@Mixin(PlayerEntity.class)
|
|
public abstract class PlayerEntity_xpNoCooldownMixin {
|
|
|
|
@Shadow
|
|
protected abstract void collideWithEntity(Entity entity);
|
|
|
|
@Redirect(method = "tickMovement",at = @At(value = "INVOKE", target = "java/util/List.add(Ljava/lang/Object;)Z"))
|
|
public boolean processXpOrbCollisions(List<Entity> instance, Object e) {
|
|
Entity entity = (Entity) e;
|
|
if (CarpetSettings.xpNoCooldown) {
|
|
this.collideWithEntity(entity);
|
|
return true;
|
|
}
|
|
return instance.add(entity);
|
|
}
|
|
}
|