mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 23:47:38 +01:00
Ghostbusters
- Patched up yet another set of entry points to kinetic source loops
This commit is contained in:
parent
939c640e14
commit
5de2e1ea9d
3 changed files with 10 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
||||||
package com.simibubi.create.content.contraptions.base;
|
package com.simibubi.create.content.contraptions.base;
|
||||||
|
|
||||||
import com.simibubi.create.foundation.item.ItemDescription.Palette;
|
import com.simibubi.create.foundation.item.ItemDescription.Palette;
|
||||||
|
import com.simibubi.create.foundation.utility.Debug;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
@ -10,6 +11,7 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.text.StringTextComponent;
|
||||||
import net.minecraft.world.IBlockReader;
|
import net.minecraft.world.IBlockReader;
|
||||||
import net.minecraft.world.IWorld;
|
import net.minecraft.world.IWorld;
|
||||||
import net.minecraft.world.IWorldReader;
|
import net.minecraft.world.IWorldReader;
|
||||||
|
@ -54,7 +56,7 @@ public abstract class KineticBlock extends Block implements IRotate {
|
||||||
TileEntity tileEntity = worldIn.getTileEntity(pos);
|
TileEntity tileEntity = worldIn.getTileEntity(pos);
|
||||||
if (tileEntity instanceof KineticTileEntity) {
|
if (tileEntity instanceof KineticTileEntity) {
|
||||||
KineticTileEntity kineticTileEntity = (KineticTileEntity) tileEntity;
|
KineticTileEntity kineticTileEntity = (KineticTileEntity) tileEntity;
|
||||||
kineticTileEntity.preventSpeedUpdate = false;
|
kineticTileEntity.preventSpeedUpdate = 0;
|
||||||
|
|
||||||
if (oldState.getBlock() != state.getBlock())
|
if (oldState.getBlock() != state.getBlock())
|
||||||
return;
|
return;
|
||||||
|
@ -63,7 +65,7 @@ public abstract class KineticBlock extends Block implements IRotate {
|
||||||
if (!areStatesKineticallyEquivalent(oldState, state))
|
if (!areStatesKineticallyEquivalent(oldState, state))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
kineticTileEntity.preventSpeedUpdate = true;
|
kineticTileEntity.preventSpeedUpdate = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,8 +96,8 @@ public abstract class KineticBlock extends Block implements IRotate {
|
||||||
return;
|
return;
|
||||||
KineticTileEntity kte = (KineticTileEntity) tileEntity;
|
KineticTileEntity kte = (KineticTileEntity) tileEntity;
|
||||||
|
|
||||||
if (kte.preventSpeedUpdate) {
|
if (kte.preventSpeedUpdate > 0) {
|
||||||
kte.preventSpeedUpdate = false;
|
kte.preventSpeedUpdate--;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ public abstract class KineticTileEntity extends SmartTileEntity
|
||||||
public @Nullable BlockPos source;
|
public @Nullable BlockPos source;
|
||||||
public boolean networkDirty;
|
public boolean networkDirty;
|
||||||
public boolean updateSpeed;
|
public boolean updateSpeed;
|
||||||
public boolean preventSpeedUpdate;
|
public int preventSpeedUpdate;
|
||||||
|
|
||||||
protected KineticEffectHandler effects;
|
protected KineticEffectHandler effects;
|
||||||
protected float speed;
|
protected float speed;
|
||||||
|
|
|
@ -89,8 +89,7 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean areStatesKineticallyEquivalent(BlockState oldState, BlockState newState) {
|
protected boolean areStatesKineticallyEquivalent(BlockState oldState, BlockState newState) {
|
||||||
return super.areStatesKineticallyEquivalent(oldState.with(CASING, false), newState.with(CASING, false))
|
return super.areStatesKineticallyEquivalent(oldState, newState) && oldState.get(PART) == newState.get(PART);
|
||||||
&& oldState.get(PART) == newState.get(PART);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -381,7 +380,8 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
|
||||||
public static void initBelt(World world, BlockPos pos) {
|
public static void initBelt(World world, BlockPos pos) {
|
||||||
if (world.isRemote)
|
if (world.isRemote)
|
||||||
return;
|
return;
|
||||||
if (world instanceof ServerWorld && ((ServerWorld) world).getChunkProvider().getChunkGenerator() instanceof DebugChunkGenerator)
|
if (world instanceof ServerWorld && ((ServerWorld) world).getChunkProvider()
|
||||||
|
.getChunkGenerator() instanceof DebugChunkGenerator)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BlockState state = world.getBlockState(pos);
|
BlockState state = world.getBlockState(pos);
|
||||||
|
|
Loading…
Reference in a new issue