From 7f52bc654732f56c5c530841a6cca3b8792f1b3a Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Mon, 28 Dec 2015 20:16:39 +0100 Subject: [PATCH] Add a hook for custom particle spawning for slimes --- .../entity/monster/EntitySlime.java.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch index 351ba4598..8bd8f7dce 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch @@ -1,5 +1,14 @@ --- ../src-base/minecraft/net/minecraft/entity/monster/EntitySlime.java +++ ../src-work/minecraft/net/minecraft/entity/monster/EntitySlime.java +@@ -111,7 +111,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 * 2.0F; @@ -271,7 +271,7 @@ BlockPos blockpos = new BlockPos(MathHelper.func_76128_c(this.field_70165_t), 0, MathHelper.func_76128_c(this.field_70161_v)); Chunk chunk = this.field_70170_p.func_175726_f(blockpos); @@ -9,3 +18,18 @@ { return false; } +@@ -336,6 +336,14 @@ + return super.func_180482_a(p_180482_1_, p_180482_2_); + } + ++ /* ======================================== FORGE START =====================================*/ ++ /** ++ * 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; } ++ /* ======================================== FORGE END =====================================*/ ++ + static class AISlimeAttack extends EntityAIBase + { + private EntitySlime field_179466_a;