ForgePatch/patches/minecraft/net/minecraft/entity/monster/SlimeEntity.java.patch

46 lines
1.7 KiB
Diff

--- a/net/minecraft/entity/monster/SlimeEntity.java
+++ b/net/minecraft/entity/monster/SlimeEntity.java
@@ -127,6 +127,7 @@
if (this.field_70122_E && !this.field_175452_bi) {
int i = this.func_70809_q();
+ if (spawnCustomParticles()) i = 0; // don't spawn particles if it's handled by the implementation itself
for(int j = 0; j < i * 8; ++j) {
float f = this.field_70146_Z.nextFloat() * ((float)Math.PI * 2F);
float f1 = this.field_70146_Z.nextFloat() * 0.5F + 0.5F;
@@ -178,9 +179,10 @@
return (EntityType<? extends SlimeEntity>)super.func_200600_R();
}
- public void func_70106_y() {
+ @Override
+ public void remove(boolean keepData) {
int i = this.func_70809_q();
- if (!this.field_70170_p.field_72995_K && i > 1 && this.func_233643_dh_()) {
+ if (!this.field_70170_p.field_72995_K && i > 1 && this.func_233643_dh_() && !this.field_70128_L) {
ITextComponent itextcomponent = this.func_200201_e();
boolean flag = this.func_175446_cd();
float f = (float)i / 4.0F;
@@ -204,7 +206,7 @@
}
}
- super.func_70106_y();
+ super.remove(keepData);
}
public void func_70108_f(Entity p_70108_1_) {
@@ -324,6 +326,12 @@
return super.func_213305_a(p_213305_1_).func_220313_a(0.255F * (float)this.func_70809_q());
}
+ /**
+ * Called when the slime spawns particles on landing, see onUpdate.
+ * Return true to prevent the spawning of the default particles.
+ */
+ protected boolean spawnCustomParticles() { return false; }
+
static class AttackGoal extends Goal {
private final SlimeEntity field_179466_a;
private int field_179465_b;