diff --git a/src/main/java/techreborn/blockentity/machine/misc/DrainBlockEntity.java b/src/main/java/techreborn/blockentity/machine/misc/DrainBlockEntity.java new file mode 100644 index 000000000..1934ba8cc --- /dev/null +++ b/src/main/java/techreborn/blockentity/machine/misc/DrainBlockEntity.java @@ -0,0 +1,32 @@ +package techreborn.blockentity.machine.misc; + +import net.minecraft.block.entity.BlockEntityType; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.inventory.Inventory; +import reborncore.api.IListInfoProvider; +import reborncore.api.blockentity.InventoryProvider; +import reborncore.client.containerBuilder.IContainerProvider; +import reborncore.client.containerBuilder.builder.BuiltContainer; +import reborncore.common.blockentity.MachineBaseBlockEntity; +import techreborn.init.TRBlockEntities; + +public class DrainBlockEntity extends MachineBaseBlockEntity implements InventoryProvider, IListInfoProvider, IContainerProvider { + + public DrainBlockEntity(){ + this(TRBlockEntities.DRAIN); + } + + public DrainBlockEntity(BlockEntityType blockEntityTypeIn) { + super(blockEntityTypeIn); + } + + @Override + public Inventory getInventory() { + return null; + } + + @Override + public BuiltContainer createContainer(int syncID, PlayerEntity player) { + return null; + } +} diff --git a/src/main/java/techreborn/events/StackToolTipHandler.java b/src/main/java/techreborn/events/StackToolTipHandler.java index cfab32963..589a8a183 100644 --- a/src/main/java/techreborn/events/StackToolTipHandler.java +++ b/src/main/java/techreborn/events/StackToolTipHandler.java @@ -51,12 +51,19 @@ import techreborn.items.ItemUpgrade; import techreborn.utils.ToolTipAssistUtils; import techreborn.utils.WIP; +import java.util.ArrayList; import java.util.List; public class StackToolTipHandler implements ItemTooltipCallback { + private static ArrayList wipBlocks = new ArrayList<>(); + public static void setup() { ItemTooltipCallback.EVENT.register(new StackToolTipHandler()); + + // WIP injection + wipBlocks.add(TRContent.Machine.DRAIN.block); + } @Override @@ -67,7 +74,7 @@ public class StackToolTipHandler implements ItemTooltipCallback { // Machine info and upgrades helper section Block block = Block.getBlockFromItem(item); - if(block instanceof WIP){ + if(wipBlocks.contains(block) || block instanceof WIP){ components.add(new LiteralText(Formatting.RED + StringUtils.t("techreborn.tooltip.wip"))); } diff --git a/src/main/java/techreborn/init/TRBlockEntities.java b/src/main/java/techreborn/init/TRBlockEntities.java index 4ceee67cb..b51561932 100644 --- a/src/main/java/techreborn/init/TRBlockEntities.java +++ b/src/main/java/techreborn/init/TRBlockEntities.java @@ -33,6 +33,7 @@ import net.minecraft.util.registry.Registry; import org.apache.commons.lang3.Validate; import techreborn.TechReborn; import techreborn.blockentity.cable.CableBlockEntity; +import techreborn.blockentity.machine.misc.DrainBlockEntity; import techreborn.blockentity.machine.multiblock.casing.MachineCasingBlockEntity; import techreborn.blockentity.machine.multiblock.FusionControlComputerBlockEntity; import techreborn.blockentity.generator.LightningRodBlockEntity; @@ -82,6 +83,7 @@ public class TRBlockEntities { public static final BlockEntityType DIGITAL_CHEST = register(DigitalChestBlockEntity.class, "digital_chest", TRContent.Machine.DIGITAL_CHEST); public static final BlockEntityType CREATIVE_QUANTUM_CHEST = register(CreativeQuantumChestBlockEntity.class, "creative_quantum_chest", TRContent.Machine.CREATIVE_QUANTUM_CHEST); public static final BlockEntityType CREATIVE_QUANTUM_TANK = register(CreativeQuantumTankBlockEntity.class, "creative_quantum_tank", TRContent.Machine.CREATIVE_QUANTUM_TANK); + public static final BlockEntityType DRAIN = register(DrainBlockEntity.class, "drain", TRContent.Machine.DRAIN); public static final BlockEntityType THERMAL_GEN = register(ThermalGeneratorBlockEntity.class, "thermal_generator", TRContent.Machine.THERMAL_GENERATOR); public static final BlockEntityType INDUSTRIAL_CENTRIFUGE = register(IndustrialCentrifugeBlockEntity.class, "industrial_centrifuge", TRContent.Machine.INDUSTRIAL_CENTRIFUGE); public static final BlockEntityType ROLLING_MACHINE = register(RollingMachineBlockEntity.class, "rolling_machine", TRContent.Machine.ROLLING_MACHINE); diff --git a/src/main/java/techreborn/init/TRContent.java b/src/main/java/techreborn/init/TRContent.java index c636a8642..5bd84c0a7 100644 --- a/src/main/java/techreborn/init/TRContent.java +++ b/src/main/java/techreborn/init/TRContent.java @@ -39,6 +39,7 @@ import team.reborn.energy.EnergySide; import team.reborn.energy.EnergyTier; import techreborn.TechReborn; import techreborn.blockentity.machine.misc.ChargeOMatBlockEntity; +import techreborn.blockentity.machine.misc.DrainBlockEntity; import techreborn.blockentity.storage.fluid.CreativeQuantumTankBlockEntity; import techreborn.blockentity.storage.fluid.QuantumTankBlockEntity; import techreborn.blockentity.machine.tier3.IndustrialCentrifugeBlockEntity; @@ -500,6 +501,7 @@ public class TRContent { WATER_MILL(new GenericGeneratorBlock(null, WaterMillBlockEntity::new)), WIND_MILL(new GenericGeneratorBlock(null, WindMillBlockEntity::new)), + DRAIN(new GenericMachineBlock(null, DrainBlockEntity::new)), //TODO DEPRECATED DIGITAL_CHEST(new OldBlock(null, DigitalChestBlockEntity::new)), diff --git a/src/main/resources/assets/techreborn/blockstates/drain.json b/src/main/resources/assets/techreborn/blockstates/drain.json new file mode 100644 index 000000000..5dd20ced1 --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/drain.json @@ -0,0 +1,5 @@ +{ + "variants": { + "": { "model": "techreborn:block/machines/tier0_machines/drain" } + } +} diff --git a/src/main/resources/assets/techreborn/lang/en_us.json b/src/main/resources/assets/techreborn/lang/en_us.json index b6c605847..921ab6e88 100644 --- a/src/main/resources/assets/techreborn/lang/en_us.json +++ b/src/main/resources/assets/techreborn/lang/en_us.json @@ -40,6 +40,7 @@ "block.techreborn.industrial_grinder": "Industrial Grinder", "block.techreborn.chunk_loader": "Industrial Chunkloader", "block.techreborn.diesel_generator": "Diesel Generator", + "block.techreborn.drain": "Drain", "block.techreborn.industrial_electrolyzer": "Industrial Electrolyzer", "block.techreborn.assembly_machine": "Assembling Machine", "block.techreborn.semi_fluid_generator": "Semi Fluid Generator", diff --git a/src/main/resources/assets/techreborn/models/block/machines/tier0_machines/drain.json b/src/main/resources/assets/techreborn/models/block/machines/tier0_machines/drain.json new file mode 100644 index 000000000..6490e112c --- /dev/null +++ b/src/main/resources/assets/techreborn/models/block/machines/tier0_machines/drain.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "top": "techreborn:block/machines/tier0_machines/fluid_drain_top", + "side": "techreborn:block/machines/tier0_machines/fluid_drain_side", + "bottom": "techreborn:block/machines/tier0_machines/fluid_drain_bottom" + } +} diff --git a/src/main/resources/assets/techreborn/models/item/drain.json b/src/main/resources/assets/techreborn/models/item/drain.json new file mode 100644 index 000000000..7f977ea81 --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/drain.json @@ -0,0 +1,4 @@ +{ + "parent": "techreborn:block/machines/tier0_machines/drain" +} + diff --git a/src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/fluid_drain_bottom.png b/src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/fluid_drain_bottom.png new file mode 100644 index 000000000..75d10f991 Binary files /dev/null and b/src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/fluid_drain_bottom.png differ diff --git a/src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/fluid_drain_side.png b/src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/fluid_drain_side.png new file mode 100644 index 000000000..e69521213 Binary files /dev/null and b/src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/fluid_drain_side.png differ diff --git a/src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/fluid_drain_top.png b/src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/fluid_drain_top.png new file mode 100644 index 000000000..e9acc9b23 Binary files /dev/null and b/src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/fluid_drain_top.png differ diff --git a/src/main/resources/data/techreborn/loot_tables/blocks/drain.json b/src/main/resources/data/techreborn/loot_tables/blocks/drain.json new file mode 100644 index 000000000..31b24e32c --- /dev/null +++ b/src/main/resources/data/techreborn/loot_tables/blocks/drain.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "techreborn:drain" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file