From 761f1095200a8f336a3bcd9e49fca52b078f4403 Mon Sep 17 00:00:00 2001 From: PepperCode1 <44146161+PepperCode1@users.noreply.github.com> Date: Wed, 24 May 2023 07:59:45 -0700 Subject: [PATCH] Remove more tiles --- .../com/simibubi/create/AllRecipeTypes.java | 2 +- .../computercraft/AttachedComputerPacket.java | 10 +++--- .../implementation/ComputerBehaviour.java | 24 ++++++------- .../peripherals/DisplayLinkPeripheral.java | 24 ++++++------- .../SequencedGearshiftPeripheral.java | 14 ++++---- .../SpeedControllerPeripheral.java | 4 +-- .../peripherals/SpeedGaugePeripheral.java | 6 ++-- .../peripherals/StationPeripheral.java | 34 +++++++++---------- .../peripherals/StressGaugePeripheral.java | 8 ++--- .../peripherals/SyncedPeripheral.java | 16 ++++----- .../content/contraptions/Contraption.java | 8 ++--- .../ContraptionControlsMovingInteraction.java | 8 ++--- .../ContraptionControlsRenderer.java | 4 +-- .../bearing/BearingContraption.java | 4 +-- .../contraptions/elevator/ElevatorColumn.java | 26 +++++++------- .../elevator/ElevatorContraption.java | 4 +-- .../elevator/ElevatorPulleyBlockEntity.java | 4 +-- .../pulley/PulleyBlockEntity.java | 26 +++++++------- .../decoration/copycat/CopycatBlock.java | 4 +-- .../decoration/girder/GirderBlock.java | 4 +-- .../SlidingDoorMovementBehaviour.java | 10 +++--- .../steamWhistle/WhistleBlockEntity.java | 4 +-- .../content/fluids/tank/BoilerData.java | 4 +-- .../fluids/tank/FluidTankBlockEntity.java | 4 +-- .../crusher/CrushingWheelControllerBlock.java | 14 ++++---- .../steamEngine/SteamEngineBlockEntity.java | 4 +-- .../logistics/chute/ChuteBlockEntity.java | 2 +- .../displayLink/DisplayLinkBlock.java | 8 ++--- .../source/CurrentFloorDisplaySource.java | 4 +-- .../source/FillLevelDisplaySource.java | 4 +-- .../source/ObservedTrainNameSource.java | 4 +-- .../source/StationSummaryDisplaySource.java | 4 +-- .../source/StopWatchDisplaySource.java | 4 +-- .../source/TimeOfDayDisplaySource.java | 4 +-- .../source/TrainStatusDisplaySource.java | 4 +-- .../target/DisplayBoardTarget.java | 4 +-- .../trains/bogey/AbstractBogeyBlock.java | 30 ++++++++-------- .../bogey/BogeyBlockEntityRenderer.java | 6 ++-- .../trains/entity/CarriageContraption.java | 6 ++-- .../create/content/trains/entity/Train.java | 10 +++--- .../content/trains/entity/TrainMigration.java | 2 +- .../content/trains/entity/TrainRelocator.java | 2 +- .../trains/entity/TravellingPoint.java | 2 +- .../trains/graph/TrackGraphHelper.java | 6 ++-- .../trains/station/StationBlockEntity.java | 20 +++++------ .../content/trains/track/TrackBlock.java | 24 ++++++------- .../trains/track/TrackBlockEntity.java | 8 ++--- .../content/trains/track/TrackBlockItem.java | 2 +- .../trains/track/TrackTargetingBehaviour.java | 4 +-- .../simibubi/create/foundation/block/IBE.java | 4 +-- 50 files changed, 221 insertions(+), 221 deletions(-) diff --git a/src/main/java/com/simibubi/create/AllRecipeTypes.java b/src/main/java/com/simibubi/create/AllRecipeTypes.java index 6e4763256..4ed505f9e 100644 --- a/src/main/java/com/simibubi/create/AllRecipeTypes.java +++ b/src/main/java/com/simibubi/create/AllRecipeTypes.java @@ -25,8 +25,8 @@ import com.simibubi.create.content.kinetics.press.PressingRecipe; import com.simibubi.create.content.kinetics.saw.CuttingRecipe; import com.simibubi.create.content.processing.basin.BasinRecipe; import com.simibubi.create.content.processing.recipe.ProcessingRecipeBuilder.ProcessingRecipeFactory; -import com.simibubi.create.content.processing.sequenced.SequencedAssemblyRecipeSerializer; import com.simibubi.create.content.processing.recipe.ProcessingRecipeSerializer; +import com.simibubi.create.content.processing.sequenced.SequencedAssemblyRecipeSerializer; import com.simibubi.create.foundation.recipe.IRecipeTypeInfo; import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.RegisteredObjects; diff --git a/src/main/java/com/simibubi/create/compat/computercraft/AttachedComputerPacket.java b/src/main/java/com/simibubi/create/compat/computercraft/AttachedComputerPacket.java index 0b40217ab..0304e864b 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/AttachedComputerPacket.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/AttachedComputerPacket.java @@ -11,8 +11,8 @@ public class AttachedComputerPacket extends BlockEntityDataPacket getPeripheralFor(SmartBlockEntity te) { - if (te instanceof SpeedControllerBlockEntity scte) - return () -> new SpeedControllerPeripheral(scte, scte.targetSpeed); - if (te instanceof DisplayLinkBlockEntity dlte) - return () -> new DisplayLinkPeripheral(dlte); - if (te instanceof SequencedGearshiftBlockEntity sgte) - return () -> new SequencedGearshiftPeripheral(sgte); - if (te instanceof SpeedGaugeBlockEntity sgte) - return () -> new SpeedGaugePeripheral(sgte); - if (te instanceof StressGaugeBlockEntity sgte) - return () -> new StressGaugePeripheral(sgte); - if (te instanceof StationBlockEntity ste) - return () -> new StationPeripheral(ste); + if (te instanceof SpeedControllerBlockEntity scbe) + return () -> new SpeedControllerPeripheral(scbe, scbe.targetSpeed); + if (te instanceof DisplayLinkBlockEntity dlbe) + return () -> new DisplayLinkPeripheral(dlbe); + if (te instanceof SequencedGearshiftBlockEntity sgbe) + return () -> new SequencedGearshiftPeripheral(sgbe); + if (te instanceof SpeedGaugeBlockEntity sgbe) + return () -> new SpeedGaugePeripheral(sgbe); + if (te instanceof StressGaugeBlockEntity sgbe) + return () -> new StressGaugePeripheral(sgbe); + if (te instanceof StationBlockEntity sbe) + return () -> new StationPeripheral(sbe); throw new IllegalArgumentException("No peripheral available for " + te.getType() .getRegistryName()); diff --git a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/DisplayLinkPeripheral.java b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/DisplayLinkPeripheral.java index 0a65701ca..2d1c9d29b 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/DisplayLinkPeripheral.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/DisplayLinkPeripheral.java @@ -19,8 +19,8 @@ public class DisplayLinkPeripheral extends SyncedPeripheral cursorY.get()) tag.set(cursorY.get(), StringTag.valueOf("")); - synchronized (tile) { - tile.getSourceConfig().put(TAG_KEY, tag); + synchronized (blockEntity) { + blockEntity.getSourceConfig().put(TAG_KEY, tag); } } @LuaFunction public final void clear() { - synchronized (tile) { - tile.getSourceConfig().put(TAG_KEY, new ListTag()); + synchronized (blockEntity) { + blockEntity.getSourceConfig().put(TAG_KEY, new ListTag()); } } @LuaFunction(mainThread = true) public final void update() { - tile.tickSource(); + blockEntity.tickSource(); } @NotNull diff --git a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SequencedGearshiftPeripheral.java b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SequencedGearshiftPeripheral.java index 35bd35cc9..9d83359f8 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SequencedGearshiftPeripheral.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SequencedGearshiftPeripheral.java @@ -13,8 +13,8 @@ import dan200.computercraft.api.lua.LuaFunction; public class SequencedGearshiftPeripheral extends SyncedPeripheral { - public SequencedGearshiftPeripheral(SequencedGearshiftBlockEntity tile) { - super(tile); + public SequencedGearshiftPeripheral(SequencedGearshiftBlockEntity blockEntity) { + super(blockEntity); } @LuaFunction(mainThread = true) @@ -29,20 +29,20 @@ public class SequencedGearshiftPeripheral extends SyncedPeripheral 1 ? arguments.getInt(1) : 1; - this.tile.getInstructions().clear(); + this.blockEntity.getInstructions().clear(); - this.tile.getInstructions().add(new Instruction( + this.blockEntity.getInstructions().add(new Instruction( instructionType, InstructionSpeedModifiers.getByModifier(speedModifier), Math.abs(arguments.getInt(0)))); - this.tile.getInstructions().add(new Instruction(SequencerInstructions.END)); + this.blockEntity.getInstructions().add(new Instruction(SequencerInstructions.END)); - this.tile.run(0); + this.blockEntity.run(0); } @NotNull diff --git a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SpeedControllerPeripheral.java b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SpeedControllerPeripheral.java index 4b4f90741..233a81e97 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SpeedControllerPeripheral.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SpeedControllerPeripheral.java @@ -11,8 +11,8 @@ public class SpeedControllerPeripheral extends SyncedPeripheral { - public SpeedGaugePeripheral(SpeedGaugeBlockEntity tile) { - super(tile); + public SpeedGaugePeripheral(SpeedGaugeBlockEntity blockEntity) { + super(blockEntity); } @LuaFunction public final float getSpeed() { - return this.tile.getSpeed(); + return this.blockEntity.getSpeed(); } @NotNull diff --git a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/StationPeripheral.java b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/StationPeripheral.java index a676e60f9..230ade2a6 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/StationPeripheral.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/StationPeripheral.java @@ -32,54 +32,54 @@ import net.minecraftforge.network.PacketDistributor; public class StationPeripheral extends SyncedPeripheral { - public StationPeripheral(StationBlockEntity tile) { - super(tile); + public StationPeripheral(StationBlockEntity blockEntity) { + super(blockEntity); } @LuaFunction(mainThread = true) public final void assemble() throws LuaException { - if (!tile.isAssembling()) + if (!blockEntity.isAssembling()) throw new LuaException("station must be in assembly mode"); - tile.assemble(null); + blockEntity.assemble(null); - if (tile.getStation() == null || tile.getStation().getPresentTrain() == null) + if (blockEntity.getStation() == null || blockEntity.getStation().getPresentTrain() == null) throw new LuaException("failed to assemble train"); - if (!tile.exitAssemblyMode()) + if (!blockEntity.exitAssemblyMode()) throw new LuaException("failed to exit assembly mode"); } @LuaFunction(mainThread = true) public final void disassemble() throws LuaException { - if (tile.isAssembling()) + if (blockEntity.isAssembling()) throw new LuaException("station must not be in assembly mode"); getTrainOrThrow(); - if (!tile.enterAssemblyMode(null)) + if (!blockEntity.enterAssemblyMode(null)) throw new LuaException("could not disassemble train"); } @LuaFunction(mainThread = true) public final void setAssemblyMode(boolean assemblyMode) throws LuaException { if (assemblyMode) { - if (!tile.enterAssemblyMode(null)) + if (!blockEntity.enterAssemblyMode(null)) throw new LuaException("failed to enter assembly mode"); } else { - if (!tile.exitAssemblyMode()) + if (!blockEntity.exitAssemblyMode()) throw new LuaException("failed to exit assembly mode"); } } @LuaFunction public final boolean isInAssemblyMode() { - return tile.isAssembling(); + return blockEntity.isAssembling(); } @LuaFunction public final String getStationName() throws LuaException { - GlobalStation station = tile.getStation(); + GlobalStation station = blockEntity.getStation(); if (station == null) throw new LuaException("station is not connected to a track"); @@ -88,13 +88,13 @@ public class StationPeripheral extends SyncedPeripheral { @LuaFunction(mainThread = true) public final void setStationName(String name) throws LuaException { - if (!tile.updateName(name)) + if (!blockEntity.updateName(name)) throw new LuaException("could not set station name"); } @LuaFunction public final boolean isTrainPresent() throws LuaException { - GlobalStation station = tile.getStation(); + GlobalStation station = blockEntity.getStation(); if (station == null) throw new LuaException("station is not connected to a track"); @@ -103,7 +103,7 @@ public class StationPeripheral extends SyncedPeripheral { @LuaFunction public final boolean isTrainImminent() throws LuaException { - GlobalStation station = tile.getStation(); + GlobalStation station = blockEntity.getStation(); if (station == null) throw new LuaException("station is not connected to a track"); @@ -112,7 +112,7 @@ public class StationPeripheral extends SyncedPeripheral { @LuaFunction public final boolean isTrainEnroute() throws LuaException { - GlobalStation station = tile.getStation(); + GlobalStation station = blockEntity.getStation(); if (station == null) throw new LuaException("station is not connected to a track"); @@ -158,7 +158,7 @@ public class StationPeripheral extends SyncedPeripheral { } private @NotNull Train getTrainOrThrow() throws LuaException { - GlobalStation station = tile.getStation(); + GlobalStation station = blockEntity.getStation(); if (station == null) throw new LuaException("station is not connected to a track"); diff --git a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/StressGaugePeripheral.java b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/StressGaugePeripheral.java index d35a4de66..19c45a162 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/StressGaugePeripheral.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/StressGaugePeripheral.java @@ -8,18 +8,18 @@ import dan200.computercraft.api.lua.LuaFunction; public class StressGaugePeripheral extends SyncedPeripheral { - public StressGaugePeripheral(StressGaugeBlockEntity tile) { - super(tile); + public StressGaugePeripheral(StressGaugeBlockEntity blockEntity) { + super(blockEntity); } @LuaFunction public final float getStress() { - return this.tile.getNetworkStress(); + return this.blockEntity.getNetworkStress(); } @LuaFunction public final float getStressCapacity() { - return this.tile.getNetworkCapacity(); + return this.blockEntity.getNetworkCapacity(); } @NotNull diff --git a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SyncedPeripheral.java b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SyncedPeripheral.java index 404260074..7c0b1f7b1 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SyncedPeripheral.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SyncedPeripheral.java @@ -16,30 +16,30 @@ import net.minecraftforge.network.PacketDistributor; public abstract class SyncedPeripheral implements IPeripheral { - protected final T tile; + protected final T blockEntity; private final AtomicInteger computers = new AtomicInteger(); - public SyncedPeripheral(T tile) { - this.tile = tile; + public SyncedPeripheral(T blockEntity) { + this.blockEntity = blockEntity; } @Override public void attach(@NotNull IComputerAccess computer) { computers.incrementAndGet(); - updateTile(); + updateBlockEntity(); } @Override public void detach(@NotNull IComputerAccess computer) { computers.decrementAndGet(); - updateTile(); + updateBlockEntity(); } - private void updateTile() { + private void updateBlockEntity() { boolean hasAttachedComputer = computers.get() > 0; - tile.getBehaviour(ComputerBehaviour.TYPE).setHasAttachedComputer(hasAttachedComputer); - AllPackets.getChannel().send(PacketDistributor.ALL.noArg(), new AttachedComputerPacket(tile.getBlockPos(), hasAttachedComputer)); + blockEntity.getBehaviour(ComputerBehaviour.TYPE).setHasAttachedComputer(hasAttachedComputer); + AllPackets.getChannel().send(PacketDistributor.ALL.noArg(), new AttachedComputerPacket(blockEntity.getBlockPos(), hasAttachedComputer)); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/Contraption.java b/src/main/java/com/simibubi/create/content/contraptions/Contraption.java index 0c3f084a1..edd763513 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/Contraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/Contraption.java @@ -323,8 +323,8 @@ public abstract class Contraption { if (AllBlocks.BELT.has(state)) moveBelt(pos, frontier, visited, state); - if (AllBlocks.WINDMILL_BEARING.has(state) && world.getBlockEntity(pos)instanceof WindmillBearingBlockEntity wbte) - wbte.disassembleForMovement(); + if (AllBlocks.WINDMILL_BEARING.has(state) && world.getBlockEntity(pos)instanceof WindmillBearingBlockEntity wbbe) + wbbe.disassembleForMovement(); if (AllBlocks.GANTRY_CARRIAGE.has(state)) moveGantryPinion(world, pos, frontier, visited, state); @@ -894,8 +894,8 @@ public abstract class Contraption { return; be.setLevel(world); modelData.put(info.pos, be.getModelData()); - if (be instanceof KineticBlockEntity kte) - kte.setSpeed(0); + if (be instanceof KineticBlockEntity kbe) + kbe.setSpeed(0); be.getBlockState(); MovementBehaviour movementBehaviour = AllMovementBehaviours.getBehaviour(info.state); diff --git a/src/main/java/com/simibubi/create/content/contraptions/actors/contraptionControls/ContraptionControlsMovingInteraction.java b/src/main/java/com/simibubi/create/content/contraptions/actors/contraptionControls/ContraptionControlsMovingInteraction.java index f979d87b0..bbc5cf56f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/actors/contraptionControls/ContraptionControlsMovingInteraction.java +++ b/src/main/java/com/simibubi/create/content/contraptions/actors/contraptionControls/ContraptionControlsMovingInteraction.java @@ -41,8 +41,8 @@ public class ContraptionControlsMovingInteraction extends MovingInteractionBehav if (contraption instanceof ElevatorContraption ec) return elevatorInteraction(localPos, contraptionEntity, ec, ctx); if (contraptionEntity.level.isClientSide()) { - if (contraption.presentBlockEntities.get(ctx.localPos)instanceof ContraptionControlsBlockEntity cte) - cte.pressButton(); + if (contraption.presentBlockEntities.get(ctx.localPos) instanceof ContraptionControlsBlockEntity cbe) + cbe.pressButton(); return true; } @@ -119,8 +119,8 @@ public class ContraptionControlsMovingInteraction extends MovingInteractionBehav return true; AllPackets.getChannel().sendToServer(new ElevatorTargetFloorPacket(contraptionEntity, efs.currentTargetY)); - if (contraption.presentBlockEntities.get(ctx.localPos)instanceof ContraptionControlsBlockEntity cte) - cte.pressButton(); + if (contraption.presentBlockEntities.get(ctx.localPos) instanceof ContraptionControlsBlockEntity cbe) + cbe.pressButton(); return true; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/actors/contraptionControls/ContraptionControlsRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/actors/contraptionControls/ContraptionControlsRenderer.java index 6eae07487..66548a08f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/actors/contraptionControls/ContraptionControlsRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/actors/contraptionControls/ContraptionControlsRenderer.java @@ -103,8 +103,8 @@ public class ContraptionControlsRenderer extends SmartBlockEntityRenderer capture) { BlockState state = capture.getKey().state; - if (AllBlocks.COPYCAT_PANEL.has(state) && capture.getRight()instanceof CopycatBlockEntity cte) - return cte.getMaterial(); + if (AllBlocks.COPYCAT_PANEL.has(state) && capture.getRight() instanceof CopycatBlockEntity cbe) + return cbe.getMaterial(); return state; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorColumn.java b/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorColumn.java index 6a4715198..348c2f23e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorColumn.java +++ b/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorColumn.java @@ -54,16 +54,16 @@ public class ElevatorColumn { public void markDirty() { for (BlockPos pos : getContacts()) { BlockEntity blockEntity = level.getBlockEntity(pos); - if (blockEntity instanceof ElevatorContactBlockEntity ecte) - ecte.setChanged(); + if (blockEntity instanceof ElevatorContactBlockEntity ecbe) + ecbe.setChanged(); } } public void floorReached(LevelAccessor level, String name) { getContacts().stream() .forEach(p -> { - if (level.getBlockEntity(p)instanceof ElevatorContactBlockEntity ecte) - ecte.updateDisplayedFloor(name); + if (level.getBlockEntity(p) instanceof ElevatorContactBlockEntity ecbe) + ecbe.updateDisplayedFloor(name); }); } @@ -72,8 +72,8 @@ public class ElevatorColumn { public List>> compileNamesList() { return getContacts().stream() .map(p -> { - if (level.getBlockEntity(p)instanceof ElevatorContactBlockEntity ecte) - return IntAttached.with(p.getY(), ecte.getNames()); + if (level.getBlockEntity(p) instanceof ElevatorContactBlockEntity ecbe) + return IntAttached.with(p.getY(), ecbe.getNames()); return null; }) .filter(Objects::nonNull) @@ -126,13 +126,13 @@ public class ElevatorColumn { Integer y = contacts.get(i); BlockPos pos = contactAt(y); - if (!(level.getBlockEntity(pos)instanceof ElevatorContactBlockEntity ecte)) + if (!(level.getBlockEntity(pos) instanceof ElevatorContactBlockEntity ecbe)) continue; Integer currentLevel = null; - if (!ecte.shortName.isBlank()) { - Integer tryValueOf = tryValueOf(ecte.shortName); + if (!ecbe.shortName.isBlank()) { + Integer tryValueOf = tryValueOf(ecbe.shortName); if (tryValueOf != null) currentLevel = tryValueOf; if (currentLevel == null) @@ -146,13 +146,13 @@ public class ElevatorColumn { for (int peekI = i + 1; peekI < contacts.size(); peekI++) { BlockPos peekPos = contactAt(contacts.get(peekI)); - if (!(level.getBlockEntity(peekPos)instanceof ElevatorContactBlockEntity peekEcte)) + if (!(level.getBlockEntity(peekPos) instanceof ElevatorContactBlockEntity peekEcbe)) continue; - Integer tryValueOf = tryValueOf(peekEcte.shortName); + Integer tryValueOf = tryValueOf(peekEcbe.shortName); if (tryValueOf == null) continue; if (currentLevel != null && currentLevel >= tryValueOf) { - peekEcte.shortName = ""; + peekEcbe.shortName = ""; break; } nextLevel = tryValueOf; @@ -162,7 +162,7 @@ public class ElevatorColumn { if (currentLevel == null) currentLevel = nextLevel != null ? nextLevel - 1 : 0; - ecte.updateName(String.valueOf(currentLevel), ecte.longName); + ecbe.updateName(String.valueOf(currentLevel), ecbe.longName); prevLevel = currentLevel; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorContraption.java b/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorContraption.java index 1d1448bb5..d1c1df426 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorContraption.java @@ -141,10 +141,10 @@ public class ElevatorContraption extends PulleyContraption { public void broadcastFloorData(Level level, BlockPos contactPos) { ElevatorColumn column = ElevatorColumn.get(level, getGlobalColumn()); - if (!(world.getBlockEntity(contactPos)instanceof ElevatorContactBlockEntity ecte)) + if (!(world.getBlockEntity(contactPos) instanceof ElevatorContactBlockEntity ecbe)) return; if (column != null) - column.floorReached(level, ecte.shortName); + column.floorReached(level, ecbe.shortName); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorPulleyBlockEntity.java b/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorPulleyBlockEntity.java index 43d6b61b3..faa722ffd 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorPulleyBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorPulleyBlockEntity.java @@ -290,8 +290,8 @@ public class ElevatorPulleyBlockEntity extends PulleyBlockEntity { continue; pos = pos.offset(anchor); if (level.getBlockEntity(new BlockPos(pos.getX(), worldPosition.getY(), - pos.getZ()))instanceof ElevatorPulleyBlockEntity pte) - pte.startMirroringOther(worldPosition); + pos.getZ())) instanceof ElevatorPulleyBlockEntity pbe) + pbe.startMirroringOther(worldPosition); } ElevatorColumn column = ElevatorColumn.getOrCreate(level, contraption.getGlobalColumn()); diff --git a/src/main/java/com/simibubi/create/content/contraptions/pulley/PulleyBlockEntity.java b/src/main/java/com/simibubi/create/content/contraptions/pulley/PulleyBlockEntity.java index 15202a275..c0a70d75f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/pulley/PulleyBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/pulley/PulleyBlockEntity.java @@ -158,8 +158,8 @@ public class PulleyBlockEntity extends LinearActuatorBlockEntity implements Thre continue; pos = pos.offset(anchor); if (level.getBlockEntity( - new BlockPos(pos.getX(), worldPosition.getY(), pos.getZ()))instanceof PulleyBlockEntity pte) - pte.startMirroringOther(worldPosition); + new BlockPos(pos.getX(), worldPosition.getY(), pos.getZ())) instanceof PulleyBlockEntity pbe) + pbe.startMirroringOther(worldPosition); } } } @@ -307,14 +307,14 @@ public class PulleyBlockEntity extends LinearActuatorBlockEntity implements Thre public void startMirroringOther(BlockPos parent) { if (parent.equals(worldPosition)) return; - if (!(level.getBlockEntity(parent)instanceof PulleyBlockEntity pte)) + if (!(level.getBlockEntity(parent) instanceof PulleyBlockEntity pbe)) return; - if (pte.getType() != getType()) + if (pbe.getType() != getType()) return; - if (pte.mirrorChildren == null) - pte.mirrorChildren = new ArrayList<>(); - pte.mirrorChildren.add(worldPosition); - pte.notifyUpdate(); + if (pbe.mirrorChildren == null) + pbe.mirrorChildren = new ArrayList<>(); + pbe.mirrorChildren.add(worldPosition); + pbe.notifyUpdate(); mirrorParent = parent; try { @@ -328,12 +328,12 @@ public class PulleyBlockEntity extends LinearActuatorBlockEntity implements Thre if (mirrorChildren == null) return; for (BlockPos blockPos : mirrorChildren) { - if (!(level.getBlockEntity(blockPos)instanceof PulleyBlockEntity pte)) + if (!(level.getBlockEntity(blockPos) instanceof PulleyBlockEntity pbe)) continue; - pte.offset = offset; - pte.disassemble(); - pte.mirrorParent = null; - pte.notifyUpdate(); + pbe.offset = offset; + pbe.disassemble(); + pbe.mirrorParent = null; + pbe.notifyUpdate(); } mirrorChildren.clear(); notifyUpdate(); diff --git a/src/main/java/com/simibubi/create/content/decoration/copycat/CopycatBlock.java b/src/main/java/com/simibubi/create/content/decoration/copycat/CopycatBlock.java index fe1c8ee7f..e46439049 100644 --- a/src/main/java/com/simibubi/create/content/decoration/copycat/CopycatBlock.java +++ b/src/main/java/com/simibubi/create/content/decoration/copycat/CopycatBlock.java @@ -272,8 +272,8 @@ public abstract class CopycatBlock extends Block implements IBE tes = context.contraption.presentBlockEntities; - if (!(tes.get(context.localPos)instanceof SlidingDoorBlockEntity doorTE)) + if (!(tes.get(context.localPos) instanceof SlidingDoorBlockEntity sdbe)) return; - boolean wasSettled = doorTE.animation.settled(); - doorTE.animation.chase(open ? 1 : 0, .15f, Chaser.LINEAR); - doorTE.animation.tickChaser(); + boolean wasSettled = sdbe.animation.settled(); + sdbe.animation.chase(open ? 1 : 0, .15f, Chaser.LINEAR); + sdbe.animation.tickChaser(); - if (!wasSettled && doorTE.animation.settled() && !open) + if (!wasSettled && sdbe.animation.settled() && !open) context.world.playLocalSound(context.position.x, context.position.y, context.position.z, SoundEvents.IRON_DOOR_CLOSE, SoundSource.BLOCKS, .125f, 1, false); } diff --git a/src/main/java/com/simibubi/create/content/decoration/steamWhistle/WhistleBlockEntity.java b/src/main/java/com/simibubi/create/content/decoration/steamWhistle/WhistleBlockEntity.java index 583aafe25..70b8fecce 100644 --- a/src/main/java/com/simibubi/create/content/decoration/steamWhistle/WhistleBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/decoration/steamWhistle/WhistleBlockEntity.java @@ -186,8 +186,8 @@ public class WhistleBlockEntity extends SmartBlockEntity implements IHaveGoggleI source = new WeakReference<>(null); Direction facing = WhistleBlock.getAttachedDirection(getBlockState()); BlockEntity be = level.getBlockEntity(worldPosition.relative(facing)); - if (be instanceof FluidTankBlockEntity tankTe) - source = new WeakReference<>(tank = tankTe); + if (be instanceof FluidTankBlockEntity tankBe) + source = new WeakReference<>(tank = tankBe); } if (tank == null) return null; diff --git a/src/main/java/com/simibubi/create/content/fluids/tank/BoilerData.java b/src/main/java/com/simibubi/create/content/fluids/tank/BoilerData.java index 6d29979b1..4b9be558f 100644 --- a/src/main/java/com/simibubi/create/content/fluids/tank/BoilerData.java +++ b/src/main/java/com/simibubi/create/content/fluids/tank/BoilerData.java @@ -327,8 +327,8 @@ public class BoilerData { if (AllBlocks.STEAM_WHISTLE.has(attachedState) && WhistleBlock.getAttachedDirection(attachedState) .getOpposite() == d) { - if (level.getBlockEntity(attachedPos)instanceof WhistleBlockEntity wte) - whistlePitches.add(wte.getPitchId()); + if (level.getBlockEntity(attachedPos) instanceof WhistleBlockEntity wbe) + whistlePitches.add(wbe.getPitchId()); } } } diff --git a/src/main/java/com/simibubi/create/content/fluids/tank/FluidTankBlockEntity.java b/src/main/java/com/simibubi/create/content/fluids/tank/FluidTankBlockEntity.java index 60a53eb5b..8db966bfb 100644 --- a/src/main/java/com/simibubi/create/content/fluids/tank/FluidTankBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/fluids/tank/FluidTankBlockEntity.java @@ -315,8 +315,8 @@ public class FluidTankBlockEntity extends SmartBlockEntity implements IHaveGoggl for (int xOffset = 0; xOffset < width; xOffset++) for (int zOffset = 0; zOffset < width; zOffset++) if (level.getBlockEntity( - worldPosition.offset(xOffset, yOffset, zOffset))instanceof FluidTankBlockEntity fte) - fte.refreshCapability(); + worldPosition.offset(xOffset, yOffset, zOffset)) instanceof FluidTankBlockEntity fbe) + fbe.refreshCapability(); } if (changed) { diff --git a/src/main/java/com/simibubi/create/content/kinetics/crusher/CrushingWheelControllerBlock.java b/src/main/java/com/simibubi/create/content/kinetics/crusher/CrushingWheelControllerBlock.java index c7ef51c7a..f6066648a 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/crusher/CrushingWheelControllerBlock.java +++ b/src/main/java/com/simibubi/create/content/kinetics/crusher/CrushingWheelControllerBlock.java @@ -146,15 +146,15 @@ public class CrushingWheelControllerBlock extends DirectionalBlock implements IB if (neighbour.getValue(BlockStateProperties.AXIS) == d.getAxis()) continue; BlockEntity adjBE = world.getBlockEntity(pos.relative(d)); - if (!(adjBE instanceof CrushingWheelBlockEntity cwte)) + if (!(adjBE instanceof CrushingWheelBlockEntity cwbe)) continue; - be.crushingspeed = Math.abs(cwte.getSpeed() / 50f); + be.crushingspeed = Math.abs(cwbe.getSpeed() / 50f); be.sendData(); - - cwte.award(AllAdvancements.CRUSHING_WHEEL); - if (cwte.getSpeed() > 255) - cwte.award(AllAdvancements.CRUSHER_MAXED); - + + cwbe.award(AllAdvancements.CRUSHING_WHEEL); + if (cwbe.getSpeed() > 255) + cwbe.award(AllAdvancements.CRUSHER_MAXED); + break; } }); diff --git a/src/main/java/com/simibubi/create/content/kinetics/steamEngine/SteamEngineBlockEntity.java b/src/main/java/com/simibubi/create/content/kinetics/steamEngine/SteamEngineBlockEntity.java index 5fb937cc4..f0dd30fcd 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/steamEngine/SteamEngineBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/kinetics/steamEngine/SteamEngineBlockEntity.java @@ -166,8 +166,8 @@ public class SteamEngineBlockEntity extends SmartBlockEntity implements IHaveGog source = new WeakReference<>(null); Direction facing = SteamEngineBlock.getFacing(getBlockState()); BlockEntity be = level.getBlockEntity(worldPosition.relative(facing.getOpposite())); - if (be instanceof FluidTankBlockEntity tankTe) - source = new WeakReference<>(tank = tankTe); + if (be instanceof FluidTankBlockEntity tankBe) + source = new WeakReference<>(tank = tankBe); } if (tank == null) return null; diff --git a/src/main/java/com/simibubi/create/content/logistics/chute/ChuteBlockEntity.java b/src/main/java/com/simibubi/create/content/logistics/chute/ChuteBlockEntity.java index a34826373..0a1a4fd5f 100644 --- a/src/main/java/com/simibubi/create/content/logistics/chute/ChuteBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/chute/ChuteBlockEntity.java @@ -782,7 +782,7 @@ public class ChuteBlockEntity extends SmartBlockEntity implements IHaveGoggleInf // // @Override // public Direction getAirflowOriginSide() { - // return world != null && !(world.getTileEntity(pos.down()) instanceof + // return world != null && !(world.getBlockEntity(pos.down()) instanceof // IAirCurrentSource) // && getBlockState().get(ChuteBlock.FACING) == Direction.DOWN ? Direction.DOWN // : Direction.UP; diff --git a/src/main/java/com/simibubi/create/content/redstone/displayLink/DisplayLinkBlock.java b/src/main/java/com/simibubi/create/content/redstone/displayLink/DisplayLinkBlock.java index 976dd552b..0601fe82f 100644 --- a/src/main/java/com/simibubi/create/content/redstone/displayLink/DisplayLinkBlock.java +++ b/src/main/java/com/simibubi/create/content/redstone/displayLink/DisplayLinkBlock.java @@ -86,14 +86,14 @@ public class DisplayLinkBlock extends WrenchableDirectionalBlock implements IBE< continue; BlockEntity blockEntity = level.getBlockEntity(offsetPos); - if (!(blockEntity instanceof DisplayLinkBlockEntity dgte)) + if (!(blockEntity instanceof DisplayLinkBlockEntity dlbe)) continue; - if (dgte.activeSource == null) + if (dlbe.activeSource == null) continue; - if (dgte.getDirection() != d.getOpposite()) + if (dlbe.getDirection() != d.getOpposite()) continue; - callback.accept(dgte); + callback.accept(dlbe); } } diff --git a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/CurrentFloorDisplaySource.java b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/CurrentFloorDisplaySource.java index 19012cea4..b61a5856a 100644 --- a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/CurrentFloorDisplaySource.java +++ b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/CurrentFloorDisplaySource.java @@ -11,9 +11,9 @@ public class CurrentFloorDisplaySource extends SingleLineDisplaySource { @Override protected MutableComponent provideLine(DisplayLinkContext context, DisplayTargetStats stats) { - if (!(context.getSourceBlockEntity() instanceof ElevatorContactBlockEntity ecte)) + if (!(context.getSourceBlockEntity() instanceof ElevatorContactBlockEntity ecbe)) return EMPTY_LINE; - return Components.literal(ecte.lastReportedCurrentFloor); + return Components.literal(ecbe.lastReportedCurrentFloor); } @Override diff --git a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/FillLevelDisplaySource.java b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/FillLevelDisplaySource.java index 0918cc1d4..c62551edd 100644 --- a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/FillLevelDisplaySource.java +++ b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/FillLevelDisplaySource.java @@ -14,9 +14,9 @@ public class FillLevelDisplaySource extends PercentOrProgressBarDisplaySource { @Override protected Float getProgress(DisplayLinkContext context) { BlockEntity be = context.getSourceBlockEntity(); - if (!(be instanceof ThresholdSwitchBlockEntity sste)) + if (!(be instanceof ThresholdSwitchBlockEntity tsbe)) return null; - return sste.currentLevel; + return tsbe.currentLevel; } @Override diff --git a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/ObservedTrainNameSource.java b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/ObservedTrainNameSource.java index e8ba86669..2503d00d6 100644 --- a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/ObservedTrainNameSource.java +++ b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/ObservedTrainNameSource.java @@ -15,9 +15,9 @@ public class ObservedTrainNameSource extends SingleLineDisplaySource { @Override protected MutableComponent provideLine(DisplayLinkContext context, DisplayTargetStats stats) { - if (!(context.getSourceBlockEntity() instanceof TrackObserverBlockEntity observerTE)) + if (!(context.getSourceBlockEntity() instanceof TrackObserverBlockEntity observerBE)) return EMPTY_LINE; - TrackObserver observer = observerTE.getObserver(); + TrackObserver observer = observerBE.getObserver(); if (observer == null) return EMPTY_LINE; UUID currentTrain = observer.getCurrentTrain(); diff --git a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/StationSummaryDisplaySource.java b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/StationSummaryDisplaySource.java index b6655a4ff..f56ddfffd 100644 --- a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/StationSummaryDisplaySource.java +++ b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/StationSummaryDisplaySource.java @@ -172,9 +172,9 @@ public class StationSummaryDisplaySource extends DisplaySource { if (conf.contains("Filter")) return; - if (!(context.getSourceBlockEntity() instanceof StationBlockEntity stationTe)) + if (!(context.getSourceBlockEntity() instanceof StationBlockEntity stationBe)) return; - GlobalStation station = stationTe.getStation(); + GlobalStation station = stationBe.getStation(); if (station == null) return; conf.putString("Filter", station.name); diff --git a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/StopWatchDisplaySource.java b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/StopWatchDisplaySource.java index fffa5ba6c..5b47472a9 100644 --- a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/StopWatchDisplaySource.java +++ b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/StopWatchDisplaySource.java @@ -12,9 +12,9 @@ public class StopWatchDisplaySource extends SingleLineDisplaySource { @Override protected MutableComponent provideLine(DisplayLinkContext context, DisplayTargetStats stats) { - if (!(context.getSourceBlockEntity()instanceof CuckooClockBlockEntity ccte)) + if (!(context.getSourceBlockEntity() instanceof CuckooClockBlockEntity ccbe)) return TimeOfDayDisplaySource.EMPTY_TIME; - if (ccte.getSpeed() == 0) + if (ccbe.getSpeed() == 0) return TimeOfDayDisplaySource.EMPTY_TIME; if (!context.sourceConfig() diff --git a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/TimeOfDayDisplaySource.java b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/TimeOfDayDisplaySource.java index 8be2ea74e..ec95ba5c8 100644 --- a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/TimeOfDayDisplaySource.java +++ b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/TimeOfDayDisplaySource.java @@ -22,9 +22,9 @@ public class TimeOfDayDisplaySource extends SingleLineDisplaySource { protected MutableComponent provideLine(DisplayLinkContext context, DisplayTargetStats stats) { if (!(context.level()instanceof ServerLevel sLevel)) return EMPTY_TIME; - if (!(context.getSourceBlockEntity() instanceof CuckooClockBlockEntity ccte)) + if (!(context.getSourceBlockEntity() instanceof CuckooClockBlockEntity ccbe)) return EMPTY_TIME; - if (ccte.getSpeed() == 0) + if (ccbe.getSpeed() == 0) return EMPTY_TIME; boolean c12 = context.sourceConfig() diff --git a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/TrainStatusDisplaySource.java b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/TrainStatusDisplaySource.java index c36153570..b2656a125 100644 --- a/src/main/java/com/simibubi/create/content/redstone/displayLink/source/TrainStatusDisplaySource.java +++ b/src/main/java/com/simibubi/create/content/redstone/displayLink/source/TrainStatusDisplaySource.java @@ -15,9 +15,9 @@ public class TrainStatusDisplaySource extends SingleLineDisplaySource { @Override protected MutableComponent provideLine(DisplayLinkContext context, DisplayTargetStats stats) { - if (!(context.getSourceBlockEntity() instanceof StationBlockEntity observerTE)) + if (!(context.getSourceBlockEntity() instanceof StationBlockEntity observerBE)) return EMPTY_LINE; - GlobalStation observer = observerTE.getStation(); + GlobalStation observer = observerBE.getStation(); if (observer == null) return EMPTY_LINE; Train currentTrain = observer.getPresentTrain(); diff --git a/src/main/java/com/simibubi/create/content/redstone/displayLink/target/DisplayBoardTarget.java b/src/main/java/com/simibubi/create/content/redstone/displayLink/target/DisplayBoardTarget.java index 87f8660b3..ba2ae4053 100644 --- a/src/main/java/com/simibubi/create/content/redstone/displayLink/target/DisplayBoardTarget.java +++ b/src/main/java/com/simibubi/create/content/redstone/displayLink/target/DisplayBoardTarget.java @@ -90,10 +90,10 @@ public class DisplayBoardTarget extends DisplayTarget { AABB baseShape = super.getMultiblockBounds(level, pos); BlockEntity be = level.getBlockEntity(pos); - if (!(be instanceof FlapDisplayBlockEntity fdte)) + if (!(be instanceof FlapDisplayBlockEntity fdbe)) return baseShape; - FlapDisplayBlockEntity controller = fdte.getController(); + FlapDisplayBlockEntity controller = fdbe.getController(); if (controller == null) return baseShape; diff --git a/src/main/java/com/simibubi/create/content/trains/bogey/AbstractBogeyBlock.java b/src/main/java/com/simibubi/create/content/trains/bogey/AbstractBogeyBlock.java index aa174ad29..0dabab51d 100644 --- a/src/main/java/com/simibubi/create/content/trains/bogey/AbstractBogeyBlock.java +++ b/src/main/java/com/simibubi/create/content/trains/bogey/AbstractBogeyBlock.java @@ -137,9 +137,9 @@ public abstract class AbstractBogeyBlock ext public abstract BogeyStyle getDefaultStyle(); /** - * Legacy system doesn't capture bogey tile entities when constructing a train + * Legacy system doesn't capture bogey block entities when constructing a train */ - public boolean captureTileEntityForTrain() { + public boolean captureBlockEntityForTrain() { return false; } @@ -198,11 +198,11 @@ public abstract class AbstractBogeyBlock ext BlockEntity be = level.getBlockEntity(pos); - if (!(be instanceof AbstractBogeyBlockEntity sbte)) + if (!(be instanceof AbstractBogeyBlockEntity sbbe)) return InteractionResult.FAIL; player.getCooldowns().addCooldown(stack.getItem(), 20); - BogeyStyle currentStyle = sbte.getStyle(); + BogeyStyle currentStyle = sbbe.getStyle(); BogeySizes.BogeySize size = getSize(); @@ -217,21 +217,21 @@ public abstract class AbstractBogeyBlock ext size = size.increment(); } - sbte.setBogeyStyle(style); + sbbe.setBogeyStyle(style); CompoundTag defaultData = style.defaultData; - sbte.setBogeyData(sbte.getBogeyData().merge(defaultData)); + sbbe.setBogeyData(sbbe.getBogeyData().merge(defaultData)); if (size == getSize()) { player.displayClientMessage(Lang.translateDirect("bogey.style.updated_style") .append(": ").append(style.displayName), true); } else { - CompoundTag oldData = sbte.getBogeyData(); - level.setBlock(pos, this.getStateOfSize(sbte, size), 3); + CompoundTag oldData = sbbe.getBogeyData(); + level.setBlock(pos, this.getStateOfSize(sbbe, size), 3); BlockEntity newBlockEntity = level.getBlockEntity(pos); - if (!(newBlockEntity instanceof AbstractBogeyBlockEntity newTileEntity)) + if (!(newBlockEntity instanceof AbstractBogeyBlockEntity newBlockEntity1)) return InteractionResult.FAIL; - newTileEntity.setBogeyData(oldData); + newBlockEntity1.setBogeyData(oldData); player.displayClientMessage(Lang.translateDirect("bogey.style.updated_style_and_size") .append(": ").append(style.displayName), true); } @@ -276,9 +276,9 @@ public abstract class AbstractBogeyBlock ext } public BlockState getNextSize(Level level, BlockPos pos) { - BlockEntity te = level.getBlockEntity(pos); - if (te instanceof AbstractBogeyBlockEntity sbte) - return this.getNextSize(sbte); + BlockEntity be = level.getBlockEntity(pos); + if (be instanceof AbstractBogeyBlockEntity sbbe) + return this.getNextSize(sbbe); return level.getBlockState(pos); } @@ -319,8 +319,8 @@ public abstract class AbstractBogeyBlock ext public BogeyStyle getNextStyle(Level level, BlockPos pos) { BlockEntity te = level.getBlockEntity(pos); - if (te instanceof AbstractBogeyBlockEntity sbte) - return this.getNextStyle(sbte.getStyle()); + if (te instanceof AbstractBogeyBlockEntity sbbe) + return this.getNextStyle(sbbe.getStyle()); return getDefaultStyle(); } diff --git a/src/main/java/com/simibubi/create/content/trains/bogey/BogeyBlockEntityRenderer.java b/src/main/java/com/simibubi/create/content/trains/bogey/BogeyBlockEntityRenderer.java index 2b1ec674c..e570fa26b 100644 --- a/src/main/java/com/simibubi/create/content/trains/bogey/BogeyBlockEntityRenderer.java +++ b/src/main/java/com/simibubi/create/content/trains/bogey/BogeyBlockEntityRenderer.java @@ -16,10 +16,10 @@ public class BogeyBlockEntityRenderer extends SafeBlockEn protected void renderSafe(T be, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { BlockState blockState = be.getBlockState(); - if (be instanceof AbstractBogeyBlockEntity sbte) { - float angle = sbte.getVirtualAngle(partialTicks); + if (be instanceof AbstractBogeyBlockEntity sbbe) { + float angle = sbbe.getVirtualAngle(partialTicks); if (blockState.getBlock() instanceof AbstractBogeyBlock bogey) - bogey.render(blockState, angle, ms, partialTicks, buffer, light, overlay, sbte.getStyle(), sbte.getBogeyData()); + bogey.render(blockState, angle, ms, partialTicks, buffer, light, overlay, sbbe.getStyle(), sbbe.getBogeyData()); } } diff --git a/src/main/java/com/simibubi/create/content/trains/entity/CarriageContraption.java b/src/main/java/com/simibubi/create/content/trains/entity/CarriageContraption.java index f935a485f..f8be4a9c0 100644 --- a/src/main/java/com/simibubi/create/content/trains/entity/CarriageContraption.java +++ b/src/main/java/com/simibubi/create/content/trains/entity/CarriageContraption.java @@ -163,12 +163,12 @@ public class CarriageContraption extends Contraption { } if (blockState.getBlock() instanceof AbstractBogeyBlock bogey) { - boolean captureTE = bogey.captureTileEntityForTrain(); + boolean captureBE = bogey.captureBlockEntityForTrain(); bogeys++; if (bogeys == 2) secondBogeyPos = pos; - return Pair.of(new StructureBlockInfo(pos, blockState, captureTE ? getBlockEntityNBT(world, pos) : null), - captureTE ? world.getBlockEntity(pos) : null); + return Pair.of(new StructureBlockInfo(pos, blockState, captureBE ? getBlockEntityNBT(world, pos) : null), + captureBE ? world.getBlockEntity(pos) : null); } if (AllBlocks.BLAZE_BURNER.has(blockState) diff --git a/src/main/java/com/simibubi/create/content/trains/entity/Train.java b/src/main/java/com/simibubi/create/content/trains/entity/Train.java index ff7d16dcf..612c8fd7c 100644 --- a/src/main/java/com/simibubi/create/content/trains/entity/Train.java +++ b/src/main/java/com/simibubi/create/content/trains/entity/Train.java @@ -29,12 +29,12 @@ import com.simibubi.create.content.trains.bogey.AbstractBogeyBlockEntity; import com.simibubi.create.content.trains.entity.Carriage.DimensionalCarriageEntity; import com.simibubi.create.content.trains.entity.TravellingPoint.IEdgePointListener; import com.simibubi.create.content.trains.entity.TravellingPoint.SteerDirection; -import com.simibubi.create.content.trains.graph.TrackGraphLocation; import com.simibubi.create.content.trains.graph.DimensionPalette; import com.simibubi.create.content.trains.graph.EdgeData; import com.simibubi.create.content.trains.graph.EdgePointType; import com.simibubi.create.content.trains.graph.TrackEdge; import com.simibubi.create.content.trains.graph.TrackGraph; +import com.simibubi.create.content.trains.graph.TrackGraphLocation; import com.simibubi.create.content.trains.graph.TrackNode; import com.simibubi.create.content.trains.observer.TrackObserver; import com.simibubi.create.content.trains.schedule.ScheduleRuntime; @@ -740,9 +740,9 @@ public class Train { Vec3 bogeyPosition = bogey.getAnchorPosition(); if (bogeyPosition == null) continue; BlockEntity be = level.getBlockEntity(new BlockPos(bogeyPosition)); - if (!(be instanceof AbstractBogeyBlockEntity sbte)) + if (!(be instanceof AbstractBogeyBlockEntity sbbe)) continue; - sbte.setBogeyData(bogey.bogeyData); + sbbe.setBogeyData(bogey.bogeyData); } offset += carriage.bogeySpacing; @@ -755,8 +755,8 @@ public class Train { if (currentStation != null) { currentStation.cancelReservation(this); BlockPos blockEntityPos = currentStation.getBlockEntityPos(); - if (level.getBlockEntity(blockEntityPos) instanceof StationBlockEntity ste) - ste.lastDisassembledTrainName = name.copy(); + if (level.getBlockEntity(blockEntityPos) instanceof StationBlockEntity sbe) + sbe.lastDisassembledTrainName = name.copy(); } Create.RAILWAYS.removeTrain(id); diff --git a/src/main/java/com/simibubi/create/content/trains/entity/TrainMigration.java b/src/main/java/com/simibubi/create/content/trains/entity/TrainMigration.java index 8e90ef857..2153b1cc4 100644 --- a/src/main/java/com/simibubi/create/content/trains/entity/TrainMigration.java +++ b/src/main/java/com/simibubi/create/content/trains/entity/TrainMigration.java @@ -2,10 +2,10 @@ package com.simibubi.create.content.trains.entity; import java.util.Map.Entry; -import com.simibubi.create.content.trains.graph.TrackGraphLocation; import com.simibubi.create.content.trains.graph.DimensionPalette; import com.simibubi.create.content.trains.graph.TrackEdge; import com.simibubi.create.content.trains.graph.TrackGraph; +import com.simibubi.create.content.trains.graph.TrackGraphLocation; import com.simibubi.create.content.trains.graph.TrackNode; import com.simibubi.create.content.trains.graph.TrackNodeLocation; import com.simibubi.create.foundation.utility.Couple; diff --git a/src/main/java/com/simibubi/create/content/trains/entity/TrainRelocator.java b/src/main/java/com/simibubi/create/content/trains/entity/TrainRelocator.java index 118a79d47..9f21d6ab3 100644 --- a/src/main/java/com/simibubi/create/content/trains/entity/TrainRelocator.java +++ b/src/main/java/com/simibubi/create/content/trains/entity/TrainRelocator.java @@ -22,10 +22,10 @@ import com.simibubi.create.content.trains.entity.TravellingPoint.IEdgePointListe import com.simibubi.create.content.trains.entity.TravellingPoint.ITrackSelector; import com.simibubi.create.content.trains.entity.TravellingPoint.ITurnListener; import com.simibubi.create.content.trains.entity.TravellingPoint.SteerDirection; -import com.simibubi.create.content.trains.graph.TrackGraphLocation; import com.simibubi.create.content.trains.graph.TrackEdge; import com.simibubi.create.content.trains.graph.TrackGraph; import com.simibubi.create.content.trains.graph.TrackGraphHelper; +import com.simibubi.create.content.trains.graph.TrackGraphLocation; import com.simibubi.create.content.trains.graph.TrackNode; import com.simibubi.create.content.trains.track.BezierTrackPointLocation; import com.simibubi.create.content.trains.track.ITrackBlock; diff --git a/src/main/java/com/simibubi/create/content/trains/entity/TravellingPoint.java b/src/main/java/com/simibubi/create/content/trains/entity/TravellingPoint.java index b88fe9319..2ac9e964c 100644 --- a/src/main/java/com/simibubi/create/content/trains/entity/TravellingPoint.java +++ b/src/main/java/com/simibubi/create/content/trains/entity/TravellingPoint.java @@ -16,11 +16,11 @@ import java.util.function.Predicate; import javax.annotation.Nullable; import com.simibubi.create.Create; -import com.simibubi.create.content.trains.graph.TrackGraphLocation; import com.simibubi.create.content.trains.graph.DimensionPalette; import com.simibubi.create.content.trains.graph.EdgeData; import com.simibubi.create.content.trains.graph.TrackEdge; import com.simibubi.create.content.trains.graph.TrackGraph; +import com.simibubi.create.content.trains.graph.TrackGraphLocation; import com.simibubi.create.content.trains.graph.TrackNode; import com.simibubi.create.content.trains.graph.TrackNodeLocation; import com.simibubi.create.content.trains.signal.TrackEdgePoint; diff --git a/src/main/java/com/simibubi/create/content/trains/graph/TrackGraphHelper.java b/src/main/java/com/simibubi/create/content/trains/graph/TrackGraphHelper.java index 203cdcc71..a29a6f29d 100644 --- a/src/main/java/com/simibubi/create/content/trains/graph/TrackGraphHelper.java +++ b/src/main/java/com/simibubi/create/content/trains/graph/TrackGraphHelper.java @@ -149,11 +149,11 @@ public class TrackGraphHelper { BezierTrackPointLocation targetBezier) { BlockState state = level.getBlockState(pos); - if (!(state.getBlock()instanceof ITrackBlock track)) + if (!(state.getBlock() instanceof ITrackBlock track)) return null; - if (!(level.getBlockEntity(pos)instanceof TrackBlockEntity trackTE)) + if (!(level.getBlockEntity(pos) instanceof TrackBlockEntity trackBE)) return null; - BezierConnection bc = trackTE.getConnections() + BezierConnection bc = trackBE.getConnections() .get(targetBezier.curveTarget()); if (bc == null || !bc.isPrimary()) return null; diff --git a/src/main/java/com/simibubi/create/content/trains/station/StationBlockEntity.java b/src/main/java/com/simibubi/create/content/trains/station/StationBlockEntity.java index a915ae21d..44657b81f 100644 --- a/src/main/java/com/simibubi/create/content/trains/station/StationBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/trains/station/StationBlockEntity.java @@ -36,10 +36,10 @@ import com.simibubi.create.content.trains.entity.CarriageContraption; import com.simibubi.create.content.trains.entity.Train; import com.simibubi.create.content.trains.entity.TrainPacket; import com.simibubi.create.content.trains.entity.TravellingPoint; -import com.simibubi.create.content.trains.graph.TrackGraphLocation; import com.simibubi.create.content.trains.graph.EdgePointType; import com.simibubi.create.content.trains.graph.TrackEdge; import com.simibubi.create.content.trains.graph.TrackGraph; +import com.simibubi.create.content.trains.graph.TrackGraphLocation; import com.simibubi.create.content.trains.graph.TrackNode; import com.simibubi.create.content.trains.graph.TrackNodeLocation; import com.simibubi.create.content.trains.graph.TrackNodeLocation.DiscoveredLocation; @@ -296,18 +296,18 @@ public class StationBlockEntity extends SmartBlockEntity implements ITransformab if (!(blockState.getBlock() instanceof AbstractBogeyBlock bogey)) continue; BlockEntity be = level.getBlockEntity(bogeyPos); - if (!(be instanceof AbstractBogeyBlockEntity oldTE)) + if (!(be instanceof AbstractBogeyBlockEntity oldBE)) continue; - CompoundTag oldData = oldTE.getBogeyData(); - BlockState newBlock = bogey.getNextSize(oldTE); + CompoundTag oldData = oldBE.getBogeyData(); + BlockState newBlock = bogey.getNextSize(oldBE); if (newBlock.getBlock() == bogey) player.displayClientMessage(Lang.translateDirect("bogey.style.no_other_sizes") .withStyle(ChatFormatting.RED), true); level.setBlock(bogeyPos, newBlock, 3); BlockEntity newEntity = level.getBlockEntity(bogeyPos); - if (!(newEntity instanceof AbstractBogeyBlockEntity newTE)) + if (!(newEntity instanceof AbstractBogeyBlockEntity newBE)) continue; - newTE.setBogeyData(oldData); + newBE.setBogeyData(oldData); bogey.playRotateSound(level, bogeyPos); return true; } @@ -748,9 +748,9 @@ public class StationBlockEntity extends SmartBlockEntity implements ITransformab AbstractBogeyBlock typeOfFirstBogey = bogeyTypes[bogeyIndex]; boolean firstBogeyIsUpsideDown = upsideDownBogeys[bogeyIndex]; BlockPos firstBogeyPos = contraption.anchor; - AbstractBogeyBlockEntity firstBogeyTileEntity = (AbstractBogeyBlockEntity) level.getBlockEntity(firstBogeyPos); + AbstractBogeyBlockEntity firstBogeyBlockEntity = (AbstractBogeyBlockEntity) level.getBlockEntity(firstBogeyPos); CarriageBogey firstBogey = - new CarriageBogey(typeOfFirstBogey, firstBogeyIsUpsideDown, firstBogeyTileEntity.getBogeyData(), points.get(pointIndex), points.get(pointIndex + 1)); + new CarriageBogey(typeOfFirstBogey, firstBogeyIsUpsideDown, firstBogeyBlockEntity.getBogeyData(), points.get(pointIndex), points.get(pointIndex + 1)); CarriageBogey secondBogey = null; BlockPos secondBogeyPos = contraption.getSecondBogeyPos(); int bogeySpacing = 0; @@ -762,10 +762,10 @@ public class StationBlockEntity extends SmartBlockEntity implements ITransformab contraptions.size() + 1); return; } - AbstractBogeyBlockEntity secondBogeyTileEntity = + AbstractBogeyBlockEntity secondBogeyBlockEntity = (AbstractBogeyBlockEntity) level.getBlockEntity(secondBogeyPos); bogeySpacing = bogeyLocations[bogeyIndex + 1] - bogeyLocations[bogeyIndex]; - secondBogey = new CarriageBogey(bogeyTypes[bogeyIndex + 1], upsideDownBogeys[bogeyIndex + 1], secondBogeyTileEntity.getBogeyData(), + secondBogey = new CarriageBogey(bogeyTypes[bogeyIndex + 1], upsideDownBogeys[bogeyIndex + 1], secondBogeyBlockEntity.getBogeyData(), points.get(pointIndex + 2), points.get(pointIndex + 3)); bogeyIndex++; diff --git a/src/main/java/com/simibubi/create/content/trains/track/TrackBlock.java b/src/main/java/com/simibubi/create/content/trains/track/TrackBlock.java index 6b674f9dc..027b981e5 100644 --- a/src/main/java/com/simibubi/create/content/trains/track/TrackBlock.java +++ b/src/main/java/com/simibubi/create/content/trains/track/TrackBlock.java @@ -279,8 +279,8 @@ public class TrackBlock extends Block level.setBlock(pos, state.setValue(SHAPE, TrackShape.asPortal(d)) .setValue(HAS_BE, true), 3); BlockEntity be = level.getBlockEntity(pos); - if (be instanceof TrackBlockEntity tte) - tte.bind(otherLevel.dimension(), otherTrackPos); + if (be instanceof TrackBlockEntity tbe) + tbe.bind(otherLevel.dimension(), otherTrackPos); otherLevel.setBlock(otherTrackPos, state.setValue(SHAPE, TrackShape.asPortal(otherTrack.getFace())) .setValue(HAS_BE, true), 3); @@ -401,24 +401,24 @@ public class TrackBlock extends Block return list; BlockEntity blockEntity = world.getBlockEntity(pos); - if (!(blockEntity instanceof TrackBlockEntity trackTE)) + if (!(blockEntity instanceof TrackBlockEntity trackBE)) return list; - Map connections = trackTE.getConnections(); + Map connections = trackBE.getConnections(); connections.forEach((connectedPos, bc) -> ITrackBlock.addToListIfConnected(connectedTo, list, (d, b) -> d == 1 ? Vec3.atLowerCornerOf(bc.tePositions.get(b)) : bc.starts.get(b), bc.normals::get, b -> world instanceof Level l ? l.dimension() : Level.OVERWORLD, bc::yOffsetAt, null, bc, (b, v) -> ITrackBlock.getMaterialSimple(world, v, bc.getMaterial()))); - if (trackTE.boundLocation == null || !(world instanceof ServerLevel level)) + if (trackBE.boundLocation == null || !(world instanceof ServerLevel level)) return list; - ResourceKey otherDim = trackTE.boundLocation.getFirst(); + ResourceKey otherDim = trackBE.boundLocation.getFirst(); ServerLevel otherLevel = level.getServer() .getLevel(otherDim); if (otherLevel == null) return list; - BlockPos boundPos = trackTE.boundLocation.getSecond(); + BlockPos boundPos = trackBE.boundLocation.getSecond(); BlockState boundState = otherLevel.getBlockState(boundPos); if (!AllTags.AllBlockTags.TRACKS.matches(boundState)) return list; @@ -626,9 +626,9 @@ public class TrackBlock extends Block Level level = context.getLevel(); if (!level.isClientSide && !player.isCreative() && state.getValue(HAS_BE)) { BlockEntity blockEntity = level.getBlockEntity(context.getClickedPos()); - if (blockEntity instanceof TrackBlockEntity trackTE) { - trackTE.cancelDrops = true; - trackTE.connections.values() + if (blockEntity instanceof TrackBlockEntity trackBE) { + trackBE.cancelDrops = true; + trackBE.connections.values() .forEach(bc -> bc.addItemsToPlayer(player)); } } @@ -705,8 +705,8 @@ public class TrackBlock extends Block Vec3 normal = null; Vec3 offset = null; - if (bezierPoint != null && world.getBlockEntity(pos) instanceof TrackBlockEntity trackTE) { - BezierConnection bc = trackTE.connections.get(bezierPoint.curveTarget()); + if (bezierPoint != null && world.getBlockEntity(pos) instanceof TrackBlockEntity trackBE) { + BezierConnection bc = trackBE.connections.get(bezierPoint.curveTarget()); if (bc != null) { double length = Mth.floor(bc.getLength() * 2); int seg = bezierPoint.segment() + 1; diff --git a/src/main/java/com/simibubi/create/content/trains/track/TrackBlockEntity.java b/src/main/java/com/simibubi/create/content/trains/track/TrackBlockEntity.java index 30381e9b1..982242ec5 100644 --- a/src/main/java/com/simibubi/create/content/trains/track/TrackBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/trains/track/TrackBlockEntity.java @@ -108,14 +108,14 @@ public class TrackBlockEntity extends SmartBlockEntity implements ITransformable } BlockEntity blockEntity = level.getBlockEntity(key); - if (!(blockEntity instanceof TrackBlockEntity trackTE) || blockEntity.isRemoved()) { + if (!(blockEntity instanceof TrackBlockEntity trackBE) || blockEntity.isRemoved()) { invalid.add(key); continue; } - if (!trackTE.connections.containsKey(worldPosition)) { - trackTE.addConnection(bc.secondary()); - trackTE.tilt.tryApplySmoothing(); + if (!trackBE.connections.containsKey(worldPosition)) { + trackBE.addConnection(bc.secondary()); + trackBE.tilt.tryApplySmoothing(); } } diff --git a/src/main/java/com/simibubi/create/content/trains/track/TrackBlockItem.java b/src/main/java/com/simibubi/create/content/trains/track/TrackBlockItem.java index 70b72764e..898f07216 100644 --- a/src/main/java/com/simibubi/create/content/trains/track/TrackBlockItem.java +++ b/src/main/java/com/simibubi/create/content/trains/track/TrackBlockItem.java @@ -59,7 +59,7 @@ public class TrackBlockItem extends BlockItem { Vec3 lookAngle = player.getLookAngle(); if (!isFoil(stack)) { - if (state.getBlock()instanceof TrackBlock track && track.getTrackAxes(level, pos, state) + if (state.getBlock() instanceof TrackBlock track && track.getTrackAxes(level, pos, state) .size() > 1) { if (!level.isClientSide) player.displayClientMessage(Lang.translateDirect("track.junction_start") diff --git a/src/main/java/com/simibubi/create/content/trains/track/TrackTargetingBehaviour.java b/src/main/java/com/simibubi/create/content/trains/track/TrackTargetingBehaviour.java index 5f190cf5c..006c7b981 100644 --- a/src/main/java/com/simibubi/create/content/trains/track/TrackTargetingBehaviour.java +++ b/src/main/java/com/simibubi/create/content/trains/track/TrackTargetingBehaviour.java @@ -269,8 +269,8 @@ public class TrackTargetingBehaviour extends BlockEnti public BlockPos getPositionForMapMarker() { BlockPos target = targetTrack.offset(blockEntity.getBlockPos()); - if (targetBezier != null && getWorld().getBlockEntity(target) instanceof TrackBlockEntity tte) { - BezierConnection bc = tte.getConnections() + if (targetBezier != null && getWorld().getBlockEntity(target) instanceof TrackBlockEntity tbe) { + BezierConnection bc = tbe.getConnections() .get(targetBezier.curveTarget()); if (bc == null) return target; diff --git a/src/main/java/com/simibubi/create/foundation/block/IBE.java b/src/main/java/com/simibubi/create/foundation/block/IBE.java index bac603f65..b616490d4 100644 --- a/src/main/java/com/simibubi/create/foundation/block/IBE.java +++ b/src/main/java/com/simibubi/create/foundation/block/IBE.java @@ -44,8 +44,8 @@ public interface IBE extends EntityBlock { if (blockState.is(newBlockState.getBlock()) && newBlockState.hasBlockEntity()) return; BlockEntity blockEntity = level.getBlockEntity(pos); - if (blockEntity instanceof SmartBlockEntity ste) - ste.destroy(); + if (blockEntity instanceof SmartBlockEntity sbe) + sbe.destroy(); level.removeBlockEntity(pos); }