XpNoCooldown and combineXpOrbs refactor (#1149)
* - 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
This commit is contained in:
1 parent
4af1d66450
commit
28a5e7acf1
6 files changed
+54
-204
No files matched your search
@@ -0,0 +1,28 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user