From 5de2e1ea9d84cae21cca8c81cdbfbb4b70c3e37c Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sat, 10 Apr 2021 03:26:38 +0200 Subject: [PATCH] Ghostbusters - Patched up yet another set of entry points to kinetic source loops --- .../create/content/contraptions/base/KineticBlock.java | 10 ++++++---- .../content/contraptions/base/KineticTileEntity.java | 2 +- .../content/contraptions/relays/belt/BeltBlock.java | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticBlock.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticBlock.java index 36a74f631..8b28d9cce 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticBlock.java @@ -1,6 +1,7 @@ package com.simibubi.create.content.contraptions.base; import com.simibubi.create.foundation.item.ItemDescription.Palette; +import com.simibubi.create.foundation.utility.Debug; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -10,6 +11,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.StringTextComponent; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.IWorldReader; @@ -54,7 +56,7 @@ public abstract class KineticBlock extends Block implements IRotate { TileEntity tileEntity = worldIn.getTileEntity(pos); if (tileEntity instanceof KineticTileEntity) { KineticTileEntity kineticTileEntity = (KineticTileEntity) tileEntity; - kineticTileEntity.preventSpeedUpdate = false; + kineticTileEntity.preventSpeedUpdate = 0; if (oldState.getBlock() != state.getBlock()) return; @@ -63,7 +65,7 @@ public abstract class KineticBlock extends Block implements IRotate { if (!areStatesKineticallyEquivalent(oldState, state)) return; - kineticTileEntity.preventSpeedUpdate = true; + kineticTileEntity.preventSpeedUpdate = 2; } } @@ -94,8 +96,8 @@ public abstract class KineticBlock extends Block implements IRotate { return; KineticTileEntity kte = (KineticTileEntity) tileEntity; - if (kte.preventSpeedUpdate) { - kte.preventSpeedUpdate = false; + if (kte.preventSpeedUpdate > 0) { + kte.preventSpeedUpdate--; return; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java index d91befd6a..eed822ab4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java @@ -50,7 +50,7 @@ public abstract class KineticTileEntity extends SmartTileEntity public @Nullable BlockPos source; public boolean networkDirty; public boolean updateSpeed; - public boolean preventSpeedUpdate; + public int preventSpeedUpdate; protected KineticEffectHandler effects; protected float speed; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java index af1a272c4..fca461c3c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java @@ -89,8 +89,7 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE