diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 07280a38b..c46ec6649 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -1809,6 +1809,7 @@ "create.display_source.redstone_power.progress_bar": "Progress Bar", "create.display_source.boiler.not_enough_space": "Not enough space ", "create.display_source.boiler.for_boiler_status": "for Boiler Status", + "create.display_source.computer_display_source": "From Computer", "create.display_target.line": "Line %1$s", "create.display_target.page": "Page %1$s", @@ -1831,6 +1832,8 @@ "create.super_glue.not_enough": "Not enough glue in inventory", "create.super_glue.success": "Applying Glue...", + "create.gui.attached_computer.controlled": "This device is being controlled by a computer", + "create.gui.attached_computer.hint": "To use device manually, disconnect all computers and modems", "create.gui.config.overlay1": "Hi :)", "create.gui.config.overlay2": "This is a sample overlay", "create.gui.config.overlay3": "Click or drag with your mouse", diff --git a/src/generated/resources/data/create/tags/blocks/safe_nbt.json b/src/generated/resources/data/create/tags/blocks/safe_nbt.json index 3c18772a3..4e678d26c 100644 --- a/src/generated/resources/data/create/tags/blocks/safe_nbt.json +++ b/src/generated/resources/data/create/tags/blocks/safe_nbt.json @@ -19,10 +19,8 @@ "create:andesite_belt_funnel", "create:brass_funnel", "create:brass_belt_funnel", - "create:creative_crate", "create:redstone_link", "create:analog_lever", - "create:placard", "create:pulse_repeater", "create:pulse_extender", "create:clipboard", diff --git a/src/main/java/com/simibubi/create/compat/computercraft/AbstractComputerBehaviour.java b/src/main/java/com/simibubi/create/compat/computercraft/AbstractComputerBehaviour.java index a8620450b..ef2777d1a 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/AbstractComputerBehaviour.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/AbstractComputerBehaviour.java @@ -1,20 +1,20 @@ package com.simibubi.create.compat.computercraft; -import com.simibubi.create.foundation.tileEntity.SmartTileEntity; -import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; -import com.simibubi.create.foundation.tileEntity.behaviour.BehaviourType; +import com.simibubi.create.foundation.blockEntity.BlockEntityBehaviour; +import com.simibubi.create.foundation.blockEntity.SmartBlockEntity; +import com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType; import net.minecraft.nbt.CompoundTag; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; -public class AbstractComputerBehaviour extends TileEntityBehaviour { +public class AbstractComputerBehaviour extends BlockEntityBehaviour { public static final BehaviourType TYPE = new BehaviourType<>(); boolean hasAttachedComputer; - public AbstractComputerBehaviour(SmartTileEntity te) { + public AbstractComputerBehaviour(SmartBlockEntity te) { super(te); this.hasAttachedComputer = false; } 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 3181217fe..0b40217ab 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/AttachedComputerPacket.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/AttachedComputerPacket.java @@ -1,13 +1,13 @@ package com.simibubi.create.compat.computercraft; -import com.simibubi.create.foundation.networking.TileEntityDataPacket; -import com.simibubi.create.foundation.tileEntity.SmartTileEntity; -import com.simibubi.create.foundation.tileEntity.SyncedTileEntity; +import com.simibubi.create.foundation.blockEntity.SmartBlockEntity; +import com.simibubi.create.foundation.blockEntity.SyncedBlockEntity; +import com.simibubi.create.foundation.networking.BlockEntityDataPacket; import net.minecraft.core.BlockPos; import net.minecraft.network.FriendlyByteBuf; -public class AttachedComputerPacket extends TileEntityDataPacket { +public class AttachedComputerPacket extends BlockEntityDataPacket { private final boolean hasAttachedComputer; @@ -27,8 +27,8 @@ public class AttachedComputerPacket extends TileEntityDataPacket fallbackFactory; - private static Function computerFactory; + private static Function fallbackFactory; + private static Function computerFactory; - public static AbstractComputerBehaviour behaviour(SmartTileEntity ste) { + public static AbstractComputerBehaviour behaviour(SmartBlockEntity sbe) { if (computerFactory == null) - return fallbackFactory.apply(ste); - return computerFactory.apply(ste); + return fallbackFactory.apply(sbe); + return computerFactory.apply(sbe); } } diff --git a/src/main/java/com/simibubi/create/compat/computercraft/FallbackComputerBehaviour.java b/src/main/java/com/simibubi/create/compat/computercraft/FallbackComputerBehaviour.java index 2e1a3da77..7e58c270d 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/FallbackComputerBehaviour.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/FallbackComputerBehaviour.java @@ -1,10 +1,10 @@ package com.simibubi.create.compat.computercraft; -import com.simibubi.create.foundation.tileEntity.SmartTileEntity; +import com.simibubi.create.foundation.blockEntity.SmartBlockEntity; public class FallbackComputerBehaviour extends AbstractComputerBehaviour { - public FallbackComputerBehaviour(SmartTileEntity te) { + public FallbackComputerBehaviour(SmartBlockEntity te) { super(te); } diff --git a/src/main/java/com/simibubi/create/compat/computercraft/implementation/ComputerBehaviour.java b/src/main/java/com/simibubi/create/compat/computercraft/implementation/ComputerBehaviour.java index dfe1f504d..43c8a7211 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/implementation/ComputerBehaviour.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/implementation/ComputerBehaviour.java @@ -7,13 +7,13 @@ import com.simibubi.create.compat.computercraft.implementation.peripherals.Speed import com.simibubi.create.compat.computercraft.implementation.peripherals.SpeedGaugePeripheral; import com.simibubi.create.compat.computercraft.implementation.peripherals.StationPeripheral; import com.simibubi.create.compat.computercraft.implementation.peripherals.StressGaugePeripheral; -import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerTileEntity; -import com.simibubi.create.content.contraptions.relays.advanced.sequencer.SequencedGearshiftTileEntity; -import com.simibubi.create.content.contraptions.relays.gauge.SpeedGaugeTileEntity; -import com.simibubi.create.content.contraptions.relays.gauge.StressGaugeTileEntity; -import com.simibubi.create.content.logistics.block.display.DisplayLinkTileEntity; -import com.simibubi.create.content.logistics.trains.management.edgePoint.station.StationTileEntity; -import com.simibubi.create.foundation.tileEntity.SmartTileEntity; +import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerBlockEntity; +import com.simibubi.create.content.contraptions.relays.advanced.sequencer.SequencedGearshiftBlockEntity; +import com.simibubi.create.content.contraptions.relays.gauge.SpeedGaugeBlockEntity; +import com.simibubi.create.content.contraptions.relays.gauge.StressGaugeBlockEntity; +import com.simibubi.create.content.logistics.block.display.DisplayLinkBlockEntity; +import com.simibubi.create.content.logistics.trains.management.edgePoint.station.StationBlockEntity; +import com.simibubi.create.foundation.blockEntity.SmartBlockEntity; import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraftforge.common.capabilities.Capability; @@ -30,23 +30,23 @@ public class ComputerBehaviour extends AbstractComputerBehaviour { LazyOptional peripheral; NonNullSupplier peripheralSupplier; - public ComputerBehaviour(SmartTileEntity te) { + public ComputerBehaviour(SmartBlockEntity te) { super(te); this.peripheralSupplier = getPeripheralFor(te); } - public static NonNullSupplier getPeripheralFor(SmartTileEntity te) { - if (te instanceof SpeedControllerTileEntity scte) + public static NonNullSupplier getPeripheralFor(SmartBlockEntity te) { + if (te instanceof SpeedControllerBlockEntity scte) return () -> new SpeedControllerPeripheral(scte, scte.targetSpeed); - if (te instanceof DisplayLinkTileEntity dlte) + if (te instanceof DisplayLinkBlockEntity dlte) return () -> new DisplayLinkPeripheral(dlte); - if (te instanceof SequencedGearshiftTileEntity sgte) + if (te instanceof SequencedGearshiftBlockEntity sgte) return () -> new SequencedGearshiftPeripheral(sgte); - if (te instanceof SpeedGaugeTileEntity sgte) + if (te instanceof SpeedGaugeBlockEntity sgte) return () -> new SpeedGaugePeripheral(sgte); - if (te instanceof StressGaugeTileEntity sgte) + if (te instanceof StressGaugeBlockEntity sgte) return () -> new StressGaugePeripheral(sgte); - if (te instanceof StationTileEntity ste) + if (te instanceof StationBlockEntity ste) return () -> new StationPeripheral(ste); throw new IllegalArgumentException("No peripheral available for " + te.getType() 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 0e9275227..cff49977e 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 @@ -4,8 +4,8 @@ import java.util.concurrent.atomic.AtomicInteger; import org.jetbrains.annotations.NotNull; +import com.simibubi.create.content.logistics.block.display.DisplayLinkBlockEntity; import com.simibubi.create.content.logistics.block.display.DisplayLinkContext; -import com.simibubi.create.content.logistics.block.display.DisplayLinkTileEntity; import com.simibubi.create.content.logistics.block.display.target.DisplayTargetStats; import dan200.computercraft.api.lua.LuaFunction; @@ -13,13 +13,13 @@ import net.minecraft.nbt.ListTag; import net.minecraft.nbt.StringTag; import net.minecraft.nbt.Tag; -public class DisplayLinkPeripheral extends SyncedPeripheral { +public class DisplayLinkPeripheral extends SyncedPeripheral { public static final String TAG_KEY = "ComputerSourceList"; private final AtomicInteger cursorX = new AtomicInteger(); private final AtomicInteger cursorY = new AtomicInteger(); - public DisplayLinkPeripheral(DisplayLinkTileEntity tile) { + public DisplayLinkPeripheral(DisplayLinkBlockEntity tile) { super(tile); } 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 8addb181e..26574bd7f 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 @@ -4,16 +4,16 @@ import org.jetbrains.annotations.NotNull; import com.simibubi.create.content.contraptions.relays.advanced.sequencer.Instruction; import com.simibubi.create.content.contraptions.relays.advanced.sequencer.InstructionSpeedModifiers; -import com.simibubi.create.content.contraptions.relays.advanced.sequencer.SequencedGearshiftTileEntity; +import com.simibubi.create.content.contraptions.relays.advanced.sequencer.SequencedGearshiftBlockEntity; import com.simibubi.create.content.contraptions.relays.advanced.sequencer.SequencerInstructions; import dan200.computercraft.api.lua.IArguments; import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.api.lua.LuaFunction; -public class SequencedGearshiftPeripheral extends SyncedPeripheral { +public class SequencedGearshiftPeripheral extends SyncedPeripheral { - public SequencedGearshiftPeripheral(SequencedGearshiftTileEntity tile) { + public SequencedGearshiftPeripheral(SequencedGearshiftBlockEntity tile) { super(tile); } 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 2aba811f0..a10f594f7 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 @@ -2,16 +2,16 @@ package com.simibubi.create.compat.computercraft.implementation.peripherals; import org.jetbrains.annotations.NotNull; -import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerTileEntity; -import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour; +import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerBlockEntity; +import com.simibubi.create.foundation.blockEntity.behaviour.scrollvalue.ScrollValueBehaviour; import dan200.computercraft.api.lua.LuaFunction; -public class SpeedControllerPeripheral extends SyncedPeripheral { +public class SpeedControllerPeripheral extends SyncedPeripheral { private final ScrollValueBehaviour targetSpeed; - public SpeedControllerPeripheral(SpeedControllerTileEntity tile, ScrollValueBehaviour targetSpeed) { + public SpeedControllerPeripheral(SpeedControllerBlockEntity tile, ScrollValueBehaviour targetSpeed) { super(tile); this.targetSpeed = targetSpeed; } diff --git a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SpeedGaugePeripheral.java b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SpeedGaugePeripheral.java index a13b02cd5..a2ff521c5 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SpeedGaugePeripheral.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/implementation/peripherals/SpeedGaugePeripheral.java @@ -2,13 +2,13 @@ package com.simibubi.create.compat.computercraft.implementation.peripherals; import org.jetbrains.annotations.NotNull; -import com.simibubi.create.content.contraptions.relays.gauge.SpeedGaugeTileEntity; +import com.simibubi.create.content.contraptions.relays.gauge.SpeedGaugeBlockEntity; import dan200.computercraft.api.lua.LuaFunction; -public class SpeedGaugePeripheral extends SyncedPeripheral { +public class SpeedGaugePeripheral extends SyncedPeripheral { - public SpeedGaugePeripheral(SpeedGaugeTileEntity tile) { + public SpeedGaugePeripheral(SpeedGaugeBlockEntity tile) { super(tile); } 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 3de8e979b..552304fb8 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 @@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull; import com.simibubi.create.compat.computercraft.implementation.CreateLuaTable; import com.simibubi.create.content.logistics.trains.entity.Train; import com.simibubi.create.content.logistics.trains.management.edgePoint.station.GlobalStation; -import com.simibubi.create.content.logistics.trains.management.edgePoint.station.StationTileEntity; +import com.simibubi.create.content.logistics.trains.management.edgePoint.station.StationBlockEntity; import com.simibubi.create.content.logistics.trains.management.edgePoint.station.TrainEditPacket; import com.simibubi.create.content.logistics.trains.management.schedule.Schedule; import com.simibubi.create.foundation.networking.AllPackets; @@ -30,9 +30,9 @@ import net.minecraft.nbt.StringTag; import net.minecraft.nbt.Tag; import net.minecraftforge.network.PacketDistributor; -public class StationPeripheral extends SyncedPeripheral { +public class StationPeripheral extends SyncedPeripheral { - public StationPeripheral(StationTileEntity tile) { + public StationPeripheral(StationBlockEntity tile) { super(tile); } @@ -129,7 +129,7 @@ public class StationPeripheral extends SyncedPeripheral { public final void setTrainName(String name) throws LuaException { Train train = getTrainOrThrow(); train.name = Components.literal(name); - AllPackets.channel.send(PacketDistributor.ALL.noArg(), new TrainEditPacket.TrainEditReturnPacket(train.id, name, train.icon.getId())); + AllPackets.getChannel().send(PacketDistributor.ALL.noArg(), new TrainEditPacket.TrainEditReturnPacket(train.id, name, train.icon.getId())); } @LuaFunction 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 b712bd6da..480ad12ab 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 @@ -2,13 +2,13 @@ package com.simibubi.create.compat.computercraft.implementation.peripherals; import org.jetbrains.annotations.NotNull; -import com.simibubi.create.content.contraptions.relays.gauge.StressGaugeTileEntity; +import com.simibubi.create.content.contraptions.relays.gauge.StressGaugeBlockEntity; import dan200.computercraft.api.lua.LuaFunction; -public class StressGaugePeripheral extends SyncedPeripheral { +public class StressGaugePeripheral extends SyncedPeripheral { - public StressGaugePeripheral(StressGaugeTileEntity tile) { + public StressGaugePeripheral(StressGaugeBlockEntity tile) { super(tile); } 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 a6371063d..59b378619 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 @@ -7,14 +7,14 @@ import org.jetbrains.annotations.Nullable; import com.simibubi.create.compat.computercraft.AttachedComputerPacket; import com.simibubi.create.compat.computercraft.implementation.ComputerBehaviour; +import com.simibubi.create.foundation.blockEntity.SmartBlockEntity; import com.simibubi.create.foundation.networking.AllPackets; -import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraftforge.network.PacketDistributor; -public abstract class SyncedPeripheral implements IPeripheral { +public abstract class SyncedPeripheral implements IPeripheral { protected final T tile; private final AtomicInteger computers = new AtomicInteger(); @@ -39,7 +39,7 @@ public abstract class SyncedPeripheral implements IPe boolean hasAttachedComputer = computers.get() > 0; tile.getBehaviour(ComputerBehaviour.TYPE).setHasAttachedComputer(hasAttachedComputer); - AllPackets.channel.send(PacketDistributor.ALL.noArg(), new AttachedComputerPacket(tile.getBlockPos(), hasAttachedComputer)); + AllPackets.getChannel().send(PacketDistributor.ALL.noArg(), new AttachedComputerPacket(tile.getBlockPos(), hasAttachedComputer)); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/AbstractStationScreen.java b/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/AbstractStationScreen.java index dea096157..2db8e7cdc 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/AbstractStationScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/AbstractStationScreen.java @@ -41,9 +41,9 @@ public abstract class AbstractStationScreen extends AbstractSimiScreen { @Override protected void init() { - if (te.computerBehaviour.hasAttachedComputer()) + if (blockEntity.computerBehaviour.hasAttachedComputer()) minecraft.setScreen(new ComputerScreen(title, () -> Components.literal(station.name), - this::renderAdditional, this, te.computerBehaviour::hasAttachedComputer)); + this::renderAdditional, this, blockEntity.computerBehaviour::hasAttachedComputer)); setWindowSize(background.width, background.height); super.init(); @@ -81,9 +81,9 @@ public abstract class AbstractStationScreen extends AbstractSimiScreen { public void tick() { super.tick(); - if (te.computerBehaviour.hasAttachedComputer()) + if (blockEntity.computerBehaviour.hasAttachedComputer()) minecraft.setScreen(new ComputerScreen(title, () -> Components.literal(station.name), - this::renderAdditional, this, te.computerBehaviour::hasAttachedComputer)); + this::renderAdditional, this, blockEntity.computerBehaviour::hasAttachedComputer)); } @Override diff --git a/src/main/java/com/simibubi/create/events/ClientEvents.java b/src/main/java/com/simibubi/create/events/ClientEvents.java index a2baade8a..a98047339 100644 --- a/src/main/java/com/simibubi/create/events/ClientEvents.java +++ b/src/main/java/com/simibubi/create/events/ClientEvents.java @@ -295,14 +295,14 @@ public class ClientEvents { if (AllFluids.CHOCOLATE.get() .isSame(fluid)) { - event.scaleFarPlaneDistance(1f / 32f * AllConfigs.CLIENT.chocolateTransparencyMultiplier.getF()); + event.scaleFarPlaneDistance(1f / 32f * AllConfigs.client().chocolateTransparencyMultiplier.getF()); event.setCanceled(true); return; } if (AllFluids.HONEY.get() .isSame(fluid)) { - event.scaleFarPlaneDistance(1f / 8f * AllConfigs.CLIENT.honeyTransparencyMultiplier.getF()); + event.scaleFarPlaneDistance(1f / 8f * AllConfigs.client().honeyTransparencyMultiplier.getF()); event.setCanceled(true); return; } diff --git a/src/main/java/com/simibubi/create/gametest/infrastructure/CreateGameTestHelper.java b/src/main/java/com/simibubi/create/gametest/infrastructure/CreateGameTestHelper.java index 51b86f548..9a3a27162 100644 --- a/src/main/java/com/simibubi/create/gametest/infrastructure/CreateGameTestHelper.java +++ b/src/main/java/com/simibubi/create/gametest/infrastructure/CreateGameTestHelper.java @@ -4,34 +4,23 @@ import java.util.Arrays; import java.util.List; import java.util.Optional; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; + +import com.simibubi.create.AllBlockEntityTypes; +import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelBlockEntity.SelectionMode; +import com.simibubi.create.content.logistics.block.redstone.NixieTubeBlockEntity; +import com.simibubi.create.foundation.blockEntity.BlockEntityBehaviour; +import com.simibubi.create.foundation.blockEntity.IMultiBlockEntityContainer; +import com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType; +import com.simibubi.create.foundation.blockEntity.behaviour.scrollvalue.ScrollOptionBehaviour; +import com.simibubi.create.foundation.blockEntity.behaviour.scrollvalue.ScrollValueBehaviour; +import com.simibubi.create.foundation.item.ItemHelper; import com.simibubi.create.foundation.mixin.accessor.GameTestHelperAccessor; +import com.simibubi.create.foundation.utility.RegisteredObjects; import it.unimi.dsi.fastutil.objects.Object2LongArrayMap; import it.unimi.dsi.fastutil.objects.Object2LongMap; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.LeverBlock; -import net.minecraftforge.fluids.FluidStack; - -import net.minecraftforge.fluids.capability.CapabilityFluidHandler; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction; -import net.minecraftforge.items.CapabilityItemHandler; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; - -import org.jetbrains.annotations.Contract; - -import com.simibubi.create.AllTileEntities; -import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelTileEntity.SelectionMode; -import com.simibubi.create.content.logistics.block.redstone.NixieTubeTileEntity; -import com.simibubi.create.foundation.item.ItemHelper; -import com.simibubi.create.foundation.tileEntity.IMultiTileContainer; -import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; -import com.simibubi.create.foundation.tileEntity.behaviour.BehaviourType; -import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollOptionBehaviour; -import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour; -import com.simibubi.create.foundation.utility.RegisteredObjects; - import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Registry; @@ -44,14 +33,21 @@ import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.ItemLike; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.LeverBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.levelgen.structure.BoundingBox; import net.minecraft.world.phys.Vec3; - -import org.jetbrains.annotations.NotNull; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.CapabilityFluidHandler; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.ItemHandlerHelper; /** * A helper class expanding the functionality of {@link GameTestHelper}. @@ -91,7 +87,7 @@ public class CreateGameTestHelper extends GameTestHelper { } public void assertNixiePower(BlockPos pos, int strength) { - NixieTubeTileEntity nixie = getBlockEntity(AllTileEntities.NIXIE_TUBE.get(), pos); + NixieTubeBlockEntity nixie = getBlockEntity(AllBlockEntityTypes.NIXIE_TUBE.get(), pos); int actualStrength = nixie.getRedstoneStrength(); if (actualStrength != strength) fail("Expected nixie tube at %s to have power of %s, got %s".formatted(pos, strength, actualStrength)); @@ -146,20 +142,20 @@ public class CreateGameTestHelper extends GameTestHelper { } /** - * Given any segment of an {@link IMultiTileContainer}, get the controller for it. + * Given any segment of an {@link IMultiBlockEntityContainer}, get the controller for it. */ - public T getControllerBlockEntity(BlockEntityType type, BlockPos anySegment) { - T be = getBlockEntity(type, anySegment).getControllerTE(); + public T getControllerBlockEntity(BlockEntityType type, BlockPos anySegment) { + T be = getBlockEntity(type, anySegment).getControllerBE(); if (be == null) fail("Could not get block entity controller with type [%s] from pos [%s]".formatted(RegisteredObjects.getKeyOrThrow(type), anySegment)); return be; } /** - * Get the expected {@link TileEntityBehaviour} from the given position, failing if not present. + * Get the expected {@link BlockEntityBehaviour} from the given position, failing if not present. */ - public T getBehavior(BlockPos pos, BehaviourType type) { - T behavior = TileEntityBehaviour.get(getLevel(), absolutePos(pos), type); + public T getBehavior(BlockPos pos, BehaviourType type) { + T behavior = BlockEntityBehaviour.get(getLevel(), absolutePos(pos), type); if (behavior == null) fail("Behavior at " + pos + " missing, expected " + type.getName()); return behavior; diff --git a/src/main/java/com/simibubi/create/gametest/tests/TestFluids.java b/src/main/java/com/simibubi/create/gametest/tests/TestFluids.java index 0624e29d5..8e4d06f06 100644 --- a/src/main/java/com/simibubi/create/gametest/tests/TestFluids.java +++ b/src/main/java/com/simibubi/create/gametest/tests/TestFluids.java @@ -1,12 +1,10 @@ package com.simibubi.create.gametest.tests; -import com.simibubi.create.AllTileEntities; +import com.simibubi.create.AllBlockEntityTypes; import com.simibubi.create.content.contraptions.fluids.actors.HosePulleyFluidHandler; -import com.simibubi.create.content.contraptions.relays.gauge.SpeedGaugeTileEntity; -import com.simibubi.create.content.contraptions.relays.gauge.StressGaugeTileEntity; - +import com.simibubi.create.content.contraptions.relays.gauge.SpeedGaugeBlockEntity; +import com.simibubi.create.content.contraptions.relays.gauge.StressGaugeBlockEntity; import com.simibubi.create.gametest.infrastructure.CreateGameTestHelper; - import com.simibubi.create.gametest.infrastructure.GameTestGroup; import net.minecraft.core.BlockPos; @@ -95,8 +93,8 @@ public class TestFluids { BlockPos stressometer = new BlockPos(5, 2, 5); BlockPos speedometer = new BlockPos(4, 2, 5); helper.succeedWhen(() -> { - StressGaugeTileEntity stress = helper.getBlockEntity(AllTileEntities.STRESSOMETER.get(), stressometer); - SpeedGaugeTileEntity speed = helper.getBlockEntity(AllTileEntities.SPEEDOMETER.get(), speedometer); + StressGaugeBlockEntity stress = helper.getBlockEntity(AllBlockEntityTypes.STRESSOMETER.get(), stressometer); + SpeedGaugeBlockEntity speed = helper.getBlockEntity(AllBlockEntityTypes.SPEEDOMETER.get(), speedometer); float capacity = stress.getNetworkCapacity(); helper.assertCloseEnoughTo(capacity, 2048); float rotationSpeed = Mth.abs(speed.getSpeed()); diff --git a/src/main/java/com/simibubi/create/gametest/tests/TestItems.java b/src/main/java/com/simibubi/create/gametest/tests/TestItems.java index 43dc317e3..fe41664e7 100644 --- a/src/main/java/com/simibubi/create/gametest/tests/TestItems.java +++ b/src/main/java/com/simibubi/create/gametest/tests/TestItems.java @@ -5,18 +5,18 @@ import java.util.Locale; import java.util.Map; import java.util.stream.Stream; +import com.simibubi.create.AllBlockEntityTypes; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; -import com.simibubi.create.AllTileEntities; -import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelTileEntity.SelectionMode; -import com.simibubi.create.content.logistics.block.depot.DepotTileEntity; -import com.simibubi.create.content.logistics.block.redstone.NixieTubeTileEntity; +import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelBlockEntity.SelectionMode; +import com.simibubi.create.content.logistics.block.depot.DepotBlockEntity; +import com.simibubi.create.content.logistics.block.redstone.NixieTubeBlockEntity; +import com.simibubi.create.content.logistics.trains.management.display.FlapDisplayBlockEntity; import com.simibubi.create.content.logistics.trains.management.display.FlapDisplayLayout; import com.simibubi.create.content.logistics.trains.management.display.FlapDisplaySection; -import com.simibubi.create.content.logistics.trains.management.display.FlapDisplayTileEntity; +import com.simibubi.create.foundation.utility.Components; import com.simibubi.create.gametest.infrastructure.CreateGameTestHelper; import com.simibubi.create.gametest.infrastructure.GameTestGroup; -import com.simibubi.create.foundation.utility.Components; import it.unimi.dsi.fastutil.objects.Object2LongMap; import net.minecraft.Util; @@ -53,9 +53,9 @@ public class TestItems { public static void armPurgatory(CreateGameTestHelper helper) { BlockPos lever = new BlockPos(2, 3, 2); BlockPos depot1Pos = new BlockPos(3, 2, 1); - DepotTileEntity depot1 = helper.getBlockEntity(AllTileEntities.DEPOT.get(), depot1Pos); + DepotBlockEntity depot1 = helper.getBlockEntity(AllBlockEntityTypes.DEPOT.get(), depot1Pos); BlockPos depot2Pos = new BlockPos(1, 2, 1); - DepotTileEntity depot2 = helper.getBlockEntity(AllTileEntities.DEPOT.get(), depot2Pos); + DepotBlockEntity depot2 = helper.getBlockEntity(AllBlockEntityTypes.DEPOT.get(), depot2Pos); helper.pullLever(lever); helper.succeedWhen(() -> { helper.assertSecondsPassed(5); @@ -234,12 +234,12 @@ public class TestItems { BlockPos chest = new BlockPos(3, 2, 1); long totalChestItems = helper.getTotalItems(chest); BlockPos chestNixiePos = new BlockPos(2, 3, 1); - NixieTubeTileEntity chestNixie = helper.getBlockEntity(AllTileEntities.NIXIE_TUBE.get(), chestNixiePos); + NixieTubeBlockEntity chestNixie = helper.getBlockEntity(AllBlockEntityTypes.NIXIE_TUBE.get(), chestNixiePos); BlockPos doubleChest = new BlockPos(2, 2, 3); long totalDoubleChestItems = helper.getTotalItems(doubleChest); BlockPos doubleChestNixiePos = new BlockPos(1, 3, 3); - NixieTubeTileEntity doubleChestNixie = helper.getBlockEntity(AllTileEntities.NIXIE_TUBE.get(), doubleChestNixiePos); + NixieTubeBlockEntity doubleChestNixie = helper.getBlockEntity(AllBlockEntityTypes.NIXIE_TUBE.get(), doubleChestNixiePos); helper.succeedWhen(() -> { String chestNixieText = chestNixie.getFullText().getString(); @@ -256,16 +256,16 @@ public class TestItems { @GameTest(template = "depot_display", timeoutTicks = CreateGameTestHelper.TEN_SECONDS) public static void depotDisplay(CreateGameTestHelper helper) { BlockPos displayPos = new BlockPos(5, 3, 1); - List depots = Stream.of( + List depots = Stream.of( new BlockPos(2, 2, 1), new BlockPos(1, 2, 1) - ).map(pos -> helper.getBlockEntity(AllTileEntities.DEPOT.get(), pos)).toList(); + ).map(pos -> helper.getBlockEntity(AllBlockEntityTypes.DEPOT.get(), pos)).toList(); List levers = List.of( new BlockPos(2, 5, 0), new BlockPos(1, 5, 0) ); levers.forEach(helper::pullLever); - FlapDisplayTileEntity display = helper.getBlockEntity(AllTileEntities.FLAP_DISPLAY.get(), displayPos).getController(); + FlapDisplayBlockEntity display = helper.getBlockEntity(AllBlockEntityTypes.FLAP_DISPLAY.get(), displayPos).getController(); helper.succeedWhen(() -> { for (int i = 0; i < 2; i++) { FlapDisplayLayout line = display.getLines().get(i); @@ -273,7 +273,7 @@ public class TestItems { line.getSections().stream().map(FlapDisplaySection::getText).forEach(textComponent::append); String text = textComponent.getString().toLowerCase(Locale.ROOT).trim(); - DepotTileEntity depot = depots.get(i); + DepotBlockEntity depot = depots.get(i); ItemStack item = depot.getHeldItem(); String name = Registry.ITEM.getKey(item.getItem()).getPath(); diff --git a/src/main/java/com/simibubi/create/gametest/tests/TestMisc.java b/src/main/java/com/simibubi/create/gametest/tests/TestMisc.java index 829bd3d4b..cfd3209c9 100644 --- a/src/main/java/com/simibubi/create/gametest/tests/TestMisc.java +++ b/src/main/java/com/simibubi/create/gametest/tests/TestMisc.java @@ -1,11 +1,12 @@ package com.simibubi.create.gametest.tests; -import com.simibubi.create.AllTileEntities; -import com.simibubi.create.content.schematics.SchematicExport; -import com.simibubi.create.content.schematics.block.SchematicannonTileEntity; -import com.simibubi.create.content.schematics.block.SchematicannonTileEntity.State; -import com.simibubi.create.content.schematics.item.SchematicItem; +import static com.simibubi.create.gametest.infrastructure.CreateGameTestHelper.FIFTEEN_SECONDS; +import com.simibubi.create.AllBlockEntityTypes; +import com.simibubi.create.content.schematics.SchematicExport; +import com.simibubi.create.content.schematics.block.SchematicannonBlockEntity; +import com.simibubi.create.content.schematics.block.SchematicannonBlockEntity.State; +import com.simibubi.create.content.schematics.item.SchematicItem; import com.simibubi.create.gametest.infrastructure.CreateGameTestHelper; import com.simibubi.create.gametest.infrastructure.GameTestGroup; @@ -20,8 +21,6 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; -import static com.simibubi.create.gametest.infrastructure.CreateGameTestHelper.FIFTEEN_SECONDS; - @GameTestGroup(path = "misc") public class TestMisc { @GameTest(template = "schematicannon", timeoutTicks = FIFTEEN_SECONDS) @@ -41,7 +40,7 @@ public class TestMisc { schematic.getOrCreateTag().put("Anchor", NbtUtils.writeBlockPos(anchor)); // setup cannon BlockPos cannonPos = new BlockPos(3, 2, 6); - SchematicannonTileEntity cannon = helper.getBlockEntity(AllTileEntities.SCHEMATICANNON.get(), cannonPos); + SchematicannonBlockEntity cannon = helper.getBlockEntity(AllBlockEntityTypes.SCHEMATICANNON.get(), cannonPos); cannon.inventory.setStackInSlot(0, schematic); // run cannon.state = State.RUNNING; diff --git a/src/main/resources/assets/create/lang/default/interface.json b/src/main/resources/assets/create/lang/default/interface.json index de2d84281..db0568ce7 100644 --- a/src/main/resources/assets/create/lang/default/interface.json +++ b/src/main/resources/assets/create/lang/default/interface.json @@ -963,6 +963,7 @@ "create.display_source.redstone_power.progress_bar": "Progress Bar", "create.display_source.boiler.not_enough_space": "Not enough space ", "create.display_source.boiler.for_boiler_status": "for Boiler Status", + "create.display_source.computer_display_source": "From Computer", "create.display_target.line": "Line %1$s", "create.display_target.page": "Page %1$s", @@ -985,6 +986,9 @@ "create.super_glue.not_enough": "Not enough glue in inventory", "create.super_glue.success": "Applying Glue...", + "create.gui.attached_computer.controlled": "This device is being controlled by a computer", + "create.gui.attached_computer.hint": "To use device manually, disconnect all computers and modems", + "create.gui.config.overlay1": "Hi :)", "create.gui.config.overlay2": "This is a sample overlay", "create.gui.config.overlay3": "Click or drag with your mouse",