Skip to content

Commit 0d00ab0

Browse files
committed
No particle effects on non-vanilla saplings, supposedly kicking clients
1 parent 3ad3f09 commit 0d00ab0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/tterrag/treesimulator/TickHandlerTGS.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ public void tickStart(EnumSet<TickType> type, Object... tickData)
6363

6464
BonemealEvent event = new BonemealEvent(player, player.worldObj, player.worldObj.getBlockId(pos[0], pos[1], pos[2]), pos[0], pos[1], pos[2]);
6565
MinecraftForge.EVENT_BUS.post(event);
66-
67-
if ((double)player.worldObj.rand.nextFloat() < 0.45D)
68-
((BlockSapling)Block.blocksList[player.worldObj.getBlockId(pos[0], pos[1], pos[2])]).markOrGrowMarked(player.worldObj, pos[0], pos[1], pos[2], player.worldObj.rand);
6966

70-
if (TreeSimulator.showParticles)
67+
BlockSapling sapling = (BlockSapling) Block.blocksList[player.worldObj.getBlockId(pos[0], pos[1], pos[2])];
68+
69+
if ((double)player.worldObj.rand.nextFloat() < 0.45D)
70+
sapling.markOrGrowMarked(player.worldObj, pos[0], pos[1], pos[2], player.worldObj.rand);
71+
72+
if (TreeSimulator.showParticles && sapling.blockID == Block.sapling.blockID)
7173
sendPacket(pos[0], pos[1], pos[2], player.worldObj, basePlayer);
7274

7375
movementCounter = 0;

0 commit comments

Comments
 (0)