From 2e3101b87a3baa2f4e4ba7f1672b324faf7a6818 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Tue, 9 May 2023 19:38:03 +0200 Subject: [PATCH] Fivepointone-ify --- .../java/com/simibubi/create/AllTags.java | 1 + .../logistics/trains/AbstractBogeyBlock.java | 22 +++++++++---------- .../trains/GlobalRailwayManager.java | 2 +- .../trains/StandardBogeyRenderer.java | 17 ++++++-------- .../logistics/trains/TrackMaterial.java | 5 +++-- .../trains/entity/CarriageContraption.java | 2 +- .../logistics/trains/entity/Train.java | 4 ++-- .../edgePoint/station/StationBlockEntity.java | 12 +++++----- .../track/AbstractBogeyBlockEntity.java | 13 ++++++----- 9 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/main/java/com/simibubi/create/AllTags.java b/src/main/java/com/simibubi/create/AllTags.java index 2255e036a..dceb62717 100644 --- a/src/main/java/com/simibubi/create/AllTags.java +++ b/src/main/java/com/simibubi/create/AllTags.java @@ -14,6 +14,7 @@ import net.minecraft.tags.BlockTags; import net.minecraft.tags.FluidTags; import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; +import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Block; diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/AbstractBogeyBlock.java b/src/main/java/com/simibubi/create/content/logistics/trains/AbstractBogeyBlock.java index 3f86c660c..dff97a9ef 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/AbstractBogeyBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/AbstractBogeyBlock.java @@ -9,6 +9,8 @@ import java.util.Set; import javax.annotation.Nullable; +import org.jetbrains.annotations.NotNull; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.mojang.blaze3d.vertex.PoseStack; @@ -22,10 +24,10 @@ import com.simibubi.create.content.logistics.trains.entity.BogeyStyle; import com.simibubi.create.content.logistics.trains.entity.Carriage; import com.simibubi.create.content.logistics.trains.entity.CarriageBogey; import com.simibubi.create.content.logistics.trains.entity.TravellingPoint; -import com.simibubi.create.content.logistics.trains.track.AbstractBogeyTileEntity; +import com.simibubi.create.content.logistics.trains.track.AbstractBogeyBlockEntity; import com.simibubi.create.content.schematics.ISpecialBlockItemRequirement; import com.simibubi.create.content.schematics.ItemRequirement; -import com.simibubi.create.foundation.block.ITE; +import com.simibubi.create.foundation.block.IBE; import com.simibubi.create.foundation.block.ProperWaterloggedBlock; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.Lang; @@ -59,9 +61,7 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.registries.ForgeRegistries; -import org.jetbrains.annotations.NotNull; - -public abstract class AbstractBogeyBlock extends Block implements ITE, ProperWaterloggedBlock, ISpecialBlockItemRequirement, IWrenchable { +public abstract class AbstractBogeyBlock extends Block implements IBE, ProperWaterloggedBlock, ISpecialBlockItemRequirement, IWrenchable { public static final EnumProperty AXIS = BlockStateProperties.HORIZONTAL_AXIS; static final List BOGEYS = new ArrayList<>(); public BogeySizes.BogeySize size; @@ -199,7 +199,7 @@ public abstract class AbstractBogeyBlock exte BlockEntity be = level.getBlockEntity(pos); - if (!(be instanceof AbstractBogeyTileEntity sbte)) + if (!(be instanceof AbstractBogeyBlockEntity sbte)) return InteractionResult.FAIL; player.getCooldowns().addCooldown(stack.getItem(), 20); @@ -230,7 +230,7 @@ public abstract class AbstractBogeyBlock exte CompoundTag oldData = sbte.getBogeyData(); level.setBlock(pos, this.getStateOfSize(sbte, size), 3); BlockEntity newBlockEntity = level.getBlockEntity(pos); - if (!(newBlockEntity instanceof AbstractBogeyTileEntity newTileEntity)) + if (!(newBlockEntity instanceof AbstractBogeyBlockEntity newTileEntity)) return InteractionResult.FAIL; newTileEntity.setBogeyData(oldData); player.displayClientMessage(Lang.translateDirect("bogey.style.updated_style_and_size") @@ -278,7 +278,7 @@ public abstract class AbstractBogeyBlock exte public BlockState getNextSize(Level level, BlockPos pos) { BlockEntity te = level.getBlockEntity(pos); - if (te instanceof AbstractBogeyTileEntity sbte) + if (te instanceof AbstractBogeyBlockEntity sbte) return this.getNextSize(sbte); return level.getBlockState(pos); } @@ -304,7 +304,7 @@ public abstract class AbstractBogeyBlock exte return target; } - public BlockState getNextSize(AbstractBogeyTileEntity sbte) { + public BlockState getNextSize(AbstractBogeyBlockEntity sbte) { BogeySizes.BogeySize size = this.getSize(); BogeyStyle style = sbte.getStyle(); BlockState nextBlock = style.getNextBlock(size).defaultBlockState(); @@ -312,7 +312,7 @@ public abstract class AbstractBogeyBlock exte return nextBlock; } - public BlockState getStateOfSize(AbstractBogeyTileEntity sbte, BogeySizes.BogeySize size) { + public BlockState getStateOfSize(AbstractBogeyBlockEntity sbte, BogeySizes.BogeySize size) { BogeyStyle style = sbte.getStyle(); BlockState state = style.getBlockOfSize(size).defaultBlockState(); return copyProperties(sbte.getBlockState(), state); @@ -320,7 +320,7 @@ public abstract class AbstractBogeyBlock exte public BogeyStyle getNextStyle(Level level, BlockPos pos) { BlockEntity te = level.getBlockEntity(pos); - if (te instanceof AbstractBogeyTileEntity sbte) + if (te instanceof AbstractBogeyBlockEntity sbte) return this.getNextStyle(sbte.getStyle()); return getDefaultStyle(); } diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/GlobalRailwayManager.java b/src/main/java/com/simibubi/create/content/logistics/trains/GlobalRailwayManager.java index d1301a381..046edb367 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/GlobalRailwayManager.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/GlobalRailwayManager.java @@ -273,7 +273,7 @@ public class GlobalRailwayManager { } private static boolean isTrackGraphDebugExtended() { - return AllConfigs.CLIENT.showExtendedTrackGraphOnF3.get(); + return AllConfigs.client().showExtendedTrackGraphOnF3.get(); } public GlobalRailwayManager sided(LevelAccessor level) { diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/StandardBogeyRenderer.java b/src/main/java/com/simibubi/create/content/logistics/trains/StandardBogeyRenderer.java index d49625a2f..cfd779dd2 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/StandardBogeyRenderer.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/StandardBogeyRenderer.java @@ -1,10 +1,16 @@ package com.simibubi.create.content.logistics.trains; +import static com.simibubi.create.AllPartialModels.BOGEY_DRIVE; +import static com.simibubi.create.AllPartialModels.BOGEY_FRAME; +import static com.simibubi.create.AllPartialModels.BOGEY_PIN; +import static com.simibubi.create.AllPartialModels.BOGEY_PISTON; +import static com.simibubi.create.AllPartialModels.LARGE_BOGEY_WHEELS; +import static com.simibubi.create.AllPartialModels.SMALL_BOGEY_WHEELS; + import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.util.transform.Transform; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; - import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.relays.elementary.ShaftBlock; import com.simibubi.create.foundation.utility.AngleHelper; @@ -13,15 +19,6 @@ import com.simibubi.create.foundation.utility.Iterate; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; -import org.jetbrains.annotations.Nullable; - -import static com.simibubi.create.AllBlockPartials.LARGE_BOGEY_WHEELS; -import static com.simibubi.create.AllBlockPartials.BOGEY_PIN; -import static com.simibubi.create.AllBlockPartials.BOGEY_DRIVE; -import static com.simibubi.create.AllBlockPartials.BOGEY_PISTON; -import static com.simibubi.create.AllBlockPartials.SMALL_BOGEY_WHEELS; -import static com.simibubi.create.AllBlockPartials.BOGEY_FRAME; - public class StandardBogeyRenderer { public static class CommonStandardBogeyRenderer extends BogeyRenderer.CommonRenderer { @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/TrackMaterial.java b/src/main/java/com/simibubi/create/content/logistics/trains/TrackMaterial.java index 03794a220..e3136a7f7 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/TrackMaterial.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/TrackMaterial.java @@ -9,8 +9,8 @@ import java.util.Map; import java.util.function.Supplier; import com.jozufozu.flywheel.core.PartialModel; -import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllPartialModels; import com.simibubi.create.Create; import com.simibubi.create.content.logistics.trains.track.TrackBlock; import com.tterrag.registrate.util.nullness.NonNullSupplier; @@ -139,6 +139,7 @@ public class TrackMaterial { @OnlyIn(Dist.CLIENT) public record TrackModelHolder(PartialModel tie, PartialModel segment_left, PartialModel segment_right) { - static final TrackModelHolder DEFAULT = new TrackModelHolder(AllBlockPartials.TRACK_TIE, AllBlockPartials.TRACK_SEGMENT_LEFT, AllBlockPartials.TRACK_SEGMENT_RIGHT); + static final TrackModelHolder DEFAULT = new TrackModelHolder(AllPartialModels.TRACK_TIE, + AllPartialModels.TRACK_SEGMENT_LEFT, AllPartialModels.TRACK_SEGMENT_RIGHT); } } diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/entity/CarriageContraption.java b/src/main/java/com/simibubi/create/content/logistics/trains/entity/CarriageContraption.java index cc8df1801..de323e7ec 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/entity/CarriageContraption.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/entity/CarriageContraption.java @@ -167,7 +167,7 @@ public class CarriageContraption extends Contraption { bogeys++; if (bogeys == 2) secondBogeyPos = pos; - return Pair.of(new StructureBlockInfo(pos, blockState, captureTE ? getTileEntityNBT(world, pos) : null), + return Pair.of(new StructureBlockInfo(pos, blockState, captureTE ? getBlockEntityNBT(world, pos) : null), captureTE ? world.getBlockEntity(pos) : null); } diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/entity/Train.java b/src/main/java/com/simibubi/create/content/logistics/trains/entity/Train.java index e91fc85f5..7190ccfe0 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/entity/Train.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/entity/Train.java @@ -17,7 +17,7 @@ import java.util.function.Consumer; import javax.annotation.Nullable; -import com.simibubi.create.content.logistics.trains.track.AbstractBogeyTileEntity; +import com.simibubi.create.content.logistics.trains.track.AbstractBogeyBlockEntity; import net.minecraft.world.level.block.entity.BlockEntity; @@ -741,7 +741,7 @@ public class Train { Vec3 bogeyPosition = bogey.getAnchorPosition(); if (bogeyPosition == null) continue; BlockEntity be = level.getBlockEntity(new BlockPos(bogeyPosition)); - if (!(be instanceof AbstractBogeyTileEntity sbte)) + if (!(be instanceof AbstractBogeyBlockEntity sbte)) continue; sbte.setBogeyData(bogey.bogeyData); } diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/StationBlockEntity.java b/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/StationBlockEntity.java index 7803d7cd5..b162d47ff 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/StationBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/StationBlockEntity.java @@ -39,7 +39,7 @@ import com.simibubi.create.content.logistics.trains.management.edgePoint.EdgePoi import com.simibubi.create.content.logistics.trains.management.edgePoint.TrackTargetingBehaviour; import com.simibubi.create.content.logistics.trains.management.schedule.Schedule; import com.simibubi.create.content.logistics.trains.management.schedule.ScheduleItem; -import com.simibubi.create.content.logistics.trains.track.AbstractBogeyTileEntity; +import com.simibubi.create.content.logistics.trains.track.AbstractBogeyBlockEntity; import com.simibubi.create.foundation.advancement.AllAdvancements; import com.simibubi.create.foundation.block.ProperWaterloggedBlock; import com.simibubi.create.foundation.blockEntity.BlockEntityBehaviour; @@ -285,7 +285,7 @@ public class StationBlockEntity extends SmartBlockEntity implements ITransformab if (!(blockState.getBlock() instanceof AbstractBogeyBlock bogey)) continue; BlockEntity be = level.getBlockEntity(bogeyPos); - if (!(be instanceof AbstractBogeyTileEntity oldTE)) + if (!(be instanceof AbstractBogeyBlockEntity oldTE)) continue; CompoundTag oldData = oldTE.getBogeyData(); BlockState newBlock = bogey.getNextSize(oldTE); @@ -294,7 +294,7 @@ public class StationBlockEntity extends SmartBlockEntity implements ITransformab .withStyle(ChatFormatting.RED), true); level.setBlock(bogeyPos, newBlock, 3); BlockEntity newEntity = level.getBlockEntity(bogeyPos); - if (!(newEntity instanceof AbstractBogeyTileEntity newTE)) + if (!(newEntity instanceof AbstractBogeyBlockEntity newTE)) continue; newTE.setBogeyData(oldData); bogey.playRotateSound(level, bogeyPos); @@ -636,7 +636,7 @@ public class StationBlockEntity extends SmartBlockEntity implements ITransformab AbstractBogeyBlock typeOfFirstBogey = bogeyTypes[bogeyIndex]; boolean firstBogeyIsUpsideDown = upsideDownBogeys[bogeyIndex]; BlockPos firstBogeyPos = contraption.anchor; - AbstractBogeyTileEntity firstBogeyTileEntity = (AbstractBogeyTileEntity) level.getBlockEntity(firstBogeyPos); + AbstractBogeyBlockEntity firstBogeyTileEntity = (AbstractBogeyBlockEntity) level.getBlockEntity(firstBogeyPos); CarriageBogey firstBogey = new CarriageBogey(typeOfFirstBogey, firstBogeyIsUpsideDown, firstBogeyTileEntity.getBogeyData(), points.get(pointIndex), points.get(pointIndex + 1)); CarriageBogey secondBogey = null; @@ -650,8 +650,8 @@ public class StationBlockEntity extends SmartBlockEntity implements ITransformab contraptions.size() + 1); return; } - AbstractBogeyTileEntity secondBogeyTileEntity = - (AbstractBogeyTileEntity) level.getBlockEntity(secondBogeyPos); + AbstractBogeyBlockEntity secondBogeyTileEntity = + (AbstractBogeyBlockEntity) level.getBlockEntity(secondBogeyPos); bogeySpacing = bogeyLocations[bogeyIndex + 1] - bogeyLocations[bogeyIndex]; secondBogey = new CarriageBogey(bogeyTypes[bogeyIndex + 1], upsideDownBogeys[bogeyIndex + 1], secondBogeyTileEntity.getBogeyData(), points.get(pointIndex + 2), points.get(pointIndex + 3)); diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/track/AbstractBogeyBlockEntity.java b/src/main/java/com/simibubi/create/content/logistics/trains/track/AbstractBogeyBlockEntity.java index 8ec37da45..548e99151 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/track/AbstractBogeyBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/track/AbstractBogeyBlockEntity.java @@ -1,9 +1,13 @@ package com.simibubi.create.content.logistics.trains.track; +import static com.simibubi.create.content.logistics.trains.entity.CarriageBogey.UPSIDE_DOWN_KEY; + +import org.jetbrains.annotations.NotNull; + import com.simibubi.create.AllBogeyStyles; import com.simibubi.create.content.logistics.trains.AbstractBogeyBlock; import com.simibubi.create.content.logistics.trains.entity.BogeyStyle; -import com.simibubi.create.foundation.tileEntity.CachedRenderBBTileEntity; +import com.simibubi.create.foundation.blockEntity.CachedRenderBBBlockEntity; import com.simibubi.create.foundation.utility.NBTHelper; import com.simibubi.create.foundation.utility.animation.LerpedFloat; @@ -14,17 +18,14 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; -import org.jetbrains.annotations.NotNull; -import static com.simibubi.create.content.logistics.trains.entity.CarriageBogey.UPSIDE_DOWN_KEY; - -public abstract class AbstractBogeyTileEntity extends CachedRenderBBTileEntity { +public abstract class AbstractBogeyBlockEntity extends CachedRenderBBBlockEntity { public static final String BOGEY_STYLE_KEY = "BogeyStyle"; public static final String BOGEY_DATA_KEY = "BogeyData"; private CompoundTag bogeyData; - public AbstractBogeyTileEntity(BlockEntityType type, BlockPos pos, BlockState state) { + public AbstractBogeyBlockEntity(BlockEntityType type, BlockPos pos, BlockState state) { super(type, pos, state); }