Tile -> BlockEntity + some more refactors

This commit is contained in:
modmuss50 2019-07-22 12:45:13 +01:00
parent 7f8674f1ca
commit dbc89adaf7
193 changed files with 3194 additions and 3214 deletions

View file

@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.api.blockentity.IMachineGuiHandler;
import java.util.Arrays;
import java.util.stream.Stream;

View file

@ -31,135 +31,133 @@ import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.mixin.extensions.ContainerExtensions;
import techreborn.client.container.ContainerDestructoPack;
import techreborn.client.gui.*;
import techreborn.tiles.TileChargeOMat;
import techreborn.tiles.TileDigitalChest;
import techreborn.tiles.TileIndustrialCentrifuge;
import techreborn.tiles.fusionReactor.TileFusionControlComputer;
import techreborn.tiles.generator.TilePlasmaGenerator;
import techreborn.tiles.generator.advanced.TileDieselGenerator;
import techreborn.tiles.generator.advanced.TileGasTurbine;
import techreborn.tiles.generator.advanced.TileSemiFluidGenerator;
import techreborn.tiles.generator.advanced.TileThermalGenerator;
import techreborn.tiles.generator.basic.TileSolidFuelGenerator;
import techreborn.tiles.machine.iron.TileIronAlloyFurnace;
import techreborn.tiles.machine.iron.TileIronFurnace;
import techreborn.tiles.machine.multiblock.*;
import techreborn.tiles.machine.tier1.*;
import techreborn.tiles.machine.tier3.TileChunkLoader;
import techreborn.tiles.machine.tier3.TileMatterFabricator;
import techreborn.tiles.machine.tier3.TileQuantumChest;
import techreborn.tiles.machine.tier3.TileQuantumTank;
import techreborn.tiles.storage.TileAdjustableSU;
import techreborn.tiles.storage.TileHighVoltageSU;
import techreborn.tiles.storage.TileLowVoltageSU;
import techreborn.tiles.storage.TileMediumVoltageSU;
import techreborn.tiles.storage.idsu.TileInterdimensionalSU;
import techreborn.tiles.storage.lesu.TileLapotronicSU;
import techreborn.blockentity.ChargeOMatBlockEntity;
import techreborn.blockentity.DigitalChestBlockEntity;
import techreborn.blockentity.IndustrialCentrifugeBlockEntity;
import techreborn.blockentity.fusionReactor.FusionControlComputerBlockEntity;
import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
import techreborn.blockentity.generator.advanced.DieselGeneratorBlockEntity;
import techreborn.blockentity.generator.advanced.GasTurbineBlockEntity;
import techreborn.blockentity.generator.advanced.SemiFluidGeneratorBlockEntity;
import techreborn.blockentity.generator.advanced.ThermalGeneratorBlockEntity;
import techreborn.blockentity.generator.basic.SolidFuelGeneratorBlockEntity;
import techreborn.blockentity.machine.iron.IronAlloyFurnaceBlockEntity;
import techreborn.blockentity.machine.iron.IronFurnaceBlockEntity;
import techreborn.blockentity.machine.multiblock.*;
import techreborn.blockentity.machine.tier1.*;
import techreborn.blockentity.machine.tier3.ChunkLoaderBlockEntity;
import techreborn.blockentity.machine.tier3.MatterFabricatorBlockEntity;
import techreborn.blockentity.machine.tier3.QuantumChestBlockEntity;
import techreborn.blockentity.machine.tier3.QuantumTankBlockEntity;
import techreborn.blockentity.storage.AdjustableSUBlockEntity;
import techreborn.blockentity.storage.HighVoltageSUBlockEntity;
import techreborn.blockentity.storage.LowVoltageSUBlockEntity;
import techreborn.blockentity.storage.MediumVoltageSUBlockEntity;
import techreborn.blockentity.storage.idsu.InterdimensionalSUBlockEntity;
import techreborn.blockentity.storage.lesu.LapotronicSUBlockEntity;
public class GuiHandler {
public static void register(){
EGui.stream().forEach(gui -> ContainerProviderRegistry.INSTANCE.registerFactory(gui.getID(), (syncID, identifier, playerEntity, packetByteBuf) -> {
final BlockEntity tile = playerEntity.world.getBlockEntity(packetByteBuf.readBlockPos());
return ((IContainerProvider) tile).createContainer(syncID, playerEntity);
final BlockEntity blockEntity = playerEntity.world.getBlockEntity(packetByteBuf.readBlockPos());
return ((IContainerProvider) blockEntity).createContainer(syncID, playerEntity);
}));
EGui.stream().forEach(gui -> ScreenProviderRegistry.INSTANCE.registerFactory(gui.getID(), (syncID, identifier, playerEntity, packetByteBuf) -> getClientGuiElement(EGui.byID(identifier), playerEntity, packetByteBuf.readBlockPos(), syncID)));
}
private static AbstractContainerScreen getClientGuiElement(final EGui gui, final PlayerEntity player, BlockPos pos, int syncID) {
final BlockEntity tile = player.world.getBlockEntity(pos);
final BlockEntity blockEntity = player.world.getBlockEntity(pos);
switch (gui) {
case AESU:
return new GuiAESU(syncID, player, (TileAdjustableSU) tile);
return new GuiAESU(syncID, player, (AdjustableSUBlockEntity) blockEntity);
case ALLOY_FURNACE:
return new GuiAlloyFurnace(syncID, player, (TileIronAlloyFurnace) tile);
return new GuiAlloyFurnace(syncID, player, (IronAlloyFurnaceBlockEntity) blockEntity);
case ALLOY_SMELTER:
return new GuiAlloySmelter(syncID, player, (TileAlloySmelter) tile);
return new GuiAlloySmelter(syncID, player, (AlloySmelterBlockEntity) blockEntity);
case ASSEMBLING_MACHINE:
return new GuiAssemblingMachine(syncID, player, (TileAssemblingMachine) tile);
return new GuiAssemblingMachine(syncID, player, (AssemblingMachineBlockEntity) blockEntity);
case LOW_VOLTAGE_SU:
return new GuiBatbox(syncID, player, (TileLowVoltageSU) tile);
return new GuiBatbox(syncID, player, (LowVoltageSUBlockEntity) blockEntity);
case BLAST_FURNACE:
return new GuiBlastFurnace(syncID, player, (TileIndustrialBlastFurnace) tile);
return new GuiBlastFurnace(syncID, player, (IndustrialBlastFurnaceBlockEntity) blockEntity);
case CENTRIFUGE:
return new GuiCentrifuge(syncID, player, (TileIndustrialCentrifuge) tile);
return new GuiCentrifuge(syncID, player, (IndustrialCentrifugeBlockEntity) blockEntity);
case CHARGEBENCH:
return new GuiChargeBench(syncID, player, (TileChargeOMat) tile);
return new GuiChargeBench(syncID, player, (ChargeOMatBlockEntity) blockEntity);
case CHEMICAL_REACTOR:
return new GuiChemicalReactor(syncID, player, (TileChemicalReactor) tile);
return new GuiChemicalReactor(syncID, player, (ChemicalReactorBlockEntity) blockEntity);
case CHUNK_LOADER:
return new GuiChunkLoader(syncID, player, (TileChunkLoader) tile);
return new GuiChunkLoader(syncID, player, (ChunkLoaderBlockEntity) blockEntity);
case COMPRESSOR:
return new GuiCompressor(syncID, player, (TileCompressor) tile);
return new GuiCompressor(syncID, player, (CompressorBlockEntity) blockEntity);
case DESTRUCTOPACK:
return new GuiDestructoPack(new ContainerDestructoPack(player));
return new GuiDestructoPack(new ContainerDestructoPack(syncID, player));
case DIESEL_GENERATOR:
return new GuiDieselGenerator(syncID, player, (TileDieselGenerator) tile);
return new GuiDieselGenerator(syncID, player, (DieselGeneratorBlockEntity) blockEntity);
case DIGITAL_CHEST:
return new GuiDigitalChest(syncID, player, (TileDigitalChest) tile);
return new GuiDigitalChest(syncID, player, (DigitalChestBlockEntity) blockEntity);
case ELECTRIC_FURNACE:
return new GuiElectricFurnace(syncID, player, (TileElectricFurnace) tile);
return new GuiElectricFurnace(syncID, player, (ElectricFurnaceBlockEntity) blockEntity);
case EXTRACTOR:
return new GuiExtractor(syncID, player, (TileExtractor) tile);
return new GuiExtractor(syncID, player, (ExtractorBlockEntity) blockEntity);
case FUSION_CONTROLLER:
return new GuiFusionReactor(syncID, player, (TileFusionControlComputer) tile);
return new GuiFusionReactor(syncID, player, (FusionControlComputerBlockEntity) blockEntity);
case GAS_TURBINE:
return new GuiGasTurbine(syncID, player, (TileGasTurbine) tile);
return new GuiGasTurbine(syncID, player, (GasTurbineBlockEntity) blockEntity);
case GENERATOR:
return new GuiGenerator(syncID, player, (TileSolidFuelGenerator) tile);
return new GuiGenerator(syncID, player, (SolidFuelGeneratorBlockEntity) blockEntity);
case GRINDER:
return new GuiGrinder(syncID, player, (TileGrinder) tile);
return new GuiGrinder(syncID, player, (GrinderBlockEntity) blockEntity);
case IDSU:
return new GuiIDSU(syncID, player, (TileInterdimensionalSU) tile);
return new GuiIDSU(syncID, player, (InterdimensionalSUBlockEntity) blockEntity);
case IMPLOSION_COMPRESSOR:
return new GuiImplosionCompressor(syncID, player, (TileImplosionCompressor) tile);
return new GuiImplosionCompressor(syncID, player, (ImplosionCompressorBlockEntity) blockEntity);
case INDUSTRIAL_ELECTROLYZER:
return new GuiIndustrialElectrolyzer(syncID, player, (TileIndustrialElectrolyzer) tile);
return new GuiIndustrialElectrolyzer(syncID, player, (IndustrialElectrolyzerBlockEntity) blockEntity);
case INDUSTRIAL_GRINDER:
return new GuiIndustrialGrinder(syncID, player, (TileIndustrialGrinder) tile);
return new GuiIndustrialGrinder(syncID, player, (IndustrialGrinderBlockEntity) blockEntity);
case IRON_FURNACE:
return new GuiIronFurnace(syncID, player, (TileIronFurnace) tile);
return new GuiIronFurnace(syncID, player, (IronFurnaceBlockEntity) blockEntity);
case LESU:
return new GuiLESU(syncID, player, (TileLapotronicSU) tile);
return new GuiLESU(syncID, player, (LapotronicSUBlockEntity) blockEntity);
case MATTER_FABRICATOR:
return new GuiMatterFabricator(syncID, player, (TileMatterFabricator) tile);
return new GuiMatterFabricator(syncID, player, (MatterFabricatorBlockEntity) blockEntity);
case MEDIUM_VOLTAGE_SU:
return new GuiMFE(syncID, player, (TileMediumVoltageSU) tile);
return new GuiMFE(syncID, player, (MediumVoltageSUBlockEntity) blockEntity);
case HIGH_VOLTAGE_SU:
return new GuiMFSU(syncID, player, (TileHighVoltageSU) tile);
return new GuiMFSU(syncID, player, (HighVoltageSUBlockEntity) blockEntity);
case QUANTUM_CHEST:
return new GuiQuantumChest(syncID, player, (TileQuantumChest) tile);
return new GuiQuantumChest(syncID, player, (QuantumChestBlockEntity) blockEntity);
case QUANTUM_TANK:
return new GuiQuantumTank(syncID, player, (TileQuantumTank) tile);
return new GuiQuantumTank(syncID, player, (QuantumTankBlockEntity) blockEntity);
case RECYCLER:
return new GuiRecycler(syncID, player, (TileRecycler) tile);
return new GuiRecycler(syncID, player, (RecyclerBlockEntity) blockEntity);
case ROLLING_MACHINE:
return new GuiRollingMachine(syncID, player, (TileRollingMachine) tile);
return new GuiRollingMachine(syncID, player, (RollingMachineBlockEntity) blockEntity);
case SAWMILL:
return new GuiIndustrialSawmill(syncID, player, (TileIndustrialSawmill) tile);
return new GuiIndustrialSawmill(syncID, player, (IndustrialSawmillBlockEntity) blockEntity);
case SCRAPBOXINATOR:
return new GuiScrapboxinator(syncID, player, (TileScrapboxinator) tile);
return new GuiScrapboxinator(syncID, player, (ScrapboxinatorBlockEntity) blockEntity);
case SEMIFLUID_GENERATOR:
return new GuiSemifluidGenerator(syncID, player, (TileSemiFluidGenerator) tile);
return new GuiSemifluidGenerator(syncID, player, (SemiFluidGeneratorBlockEntity) blockEntity);
case THERMAL_GENERATOR:
return new GuiThermalGenerator(syncID, player, (TileThermalGenerator) tile);
return new GuiThermalGenerator(syncID, player, (ThermalGeneratorBlockEntity) blockEntity);
case VACUUM_FREEZER:
return new GuiVacuumFreezer(syncID, player, (TileVacuumFreezer) tile);
return new GuiVacuumFreezer(syncID, player, (VacuumFreezerBlockEntity) blockEntity);
case AUTO_CRAFTING_TABLE:
return new GuiAutoCrafting(syncID, player, (TileAutoCraftingTable) tile);
return new GuiAutoCrafting(syncID, player, (AutoCraftingTableBlockEntity) blockEntity);
case PLASMA_GENERATOR:
return new GuiPlasmaGenerator(syncID, player, (TilePlasmaGenerator) tile);
return new GuiPlasmaGenerator(syncID, player, (PlasmaGeneratorBlockEntity) blockEntity);
case DISTILLATION_TOWER:
return new GuiDistillationTower(syncID, player, (TileDistillationTower) tile);
return new GuiDistillationTower(syncID, player, (DistillationTowerBlockEntity) blockEntity);
case FLUID_REPLICATOR:
return new GuiFluidReplicator(syncID, player, (TileFluidReplicator) tile);
return new GuiFluidReplicator(syncID, player, (FluidReplicatorBlockEntity) blockEntity);
default:
break;

View file

@ -24,22 +24,21 @@
package techreborn.client.container;
import net.minecraft.container.Container;
import net.minecraft.container.Slot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.text.LiteralText;
import reborncore.client.gui.slots.SlotFilteredVoid;
import reborncore.common.container.RebornContainer;
import reborncore.common.util.RebornInventory;
import techreborn.init.TRContent;
public class ContainerDestructoPack extends RebornContainer {
public class ContainerDestructoPack extends Container {
private PlayerEntity player;
private RebornInventory<?> inv;
public ContainerDestructoPack(PlayerEntity player) {
super(null, new LiteralText("destructopack"));
public ContainerDestructoPack(int syncID, PlayerEntity player) {
super(null, syncID);
this.player = player;
inv = new RebornInventory<>(1, "destructopack", 64, null);
buildContainer();

View file

@ -32,15 +32,15 @@ import reborncore.client.gui.builder.widget.GuiButtonUpDown;
import reborncore.common.network.NetworkManager;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.packets.ServerboundPackets;
import techreborn.tiles.storage.TileAdjustableSU;
import techreborn.blockentity.storage.AdjustableSUBlockEntity;
public class GuiAESU extends GuiBase {
TileAdjustableSU tile;
AdjustableSUBlockEntity blockEntity;
public GuiAESU(int syncID, final PlayerEntity player, final TileAdjustableSU aesu) {
public GuiAESU(int syncID, final PlayerEntity player, final AdjustableSUBlockEntity aesu) {
super(player, aesu, aesu.createContainer(syncID, player));
this.tile = aesu;
this.blockEntity = aesu;
}
@Override
@ -51,7 +51,7 @@ public class GuiAESU extends GuiBase {
this.drawSlot(62, 45, layer);
this.drawSlot(98, 45, layer);
this.drawArmourSlots(8, 18, layer);
this.builder.drawEnergyOutput(this, 171, 61, this.tile.getCurrentOutput(), layer);
this.builder.drawEnergyOutput(this, 171, 61, this.blockEntity.getCurrentOutput(), layer);
this.builder.drawUpDownButtons(this, 121, 79, layer);
}
@ -63,13 +63,13 @@ public class GuiAESU extends GuiBase {
if(GuiBase.slotConfigType == SlotConfigType.NONE){
GlStateManager.pushMatrix();
GlStateManager.scaled(0.6, 0.6, 1);
drawCentredString(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) tile.getEnergy()) + "/"
+ PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) tile.getMaxPower()) + " "
drawCentredString(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy()) + "/"
+ PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getMaxPower()) + " "
+ PowerSystem.getDisplayPower().abbreviation, 35, 0, 58, layer);
GlStateManager.popMatrix();
}
builder.drawMultiEnergyBar(this, 81, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawMultiEnergyBar(this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
buttons.add(new GuiButtonUpDown(121, 79, this, layer, this::onClick));
buttons.add(new GuiButtonUpDown(121 + 12, 79, this, layer, this::onClick));
@ -78,6 +78,6 @@ public class GuiAESU extends GuiBase {
}
public void onClick(ButtonWidget button){
NetworkManager.sendToServer(ServerboundPackets.createPacketAesu(1, tile));
NetworkManager.sendToServer(ServerboundPackets.createPacketAesu(1, blockEntity));
}
}

View file

@ -31,16 +31,16 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.text.LiteralText;
import net.minecraft.util.Identifier;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import techreborn.tiles.machine.iron.TileIronAlloyFurnace;
import techreborn.blockentity.machine.iron.IronAlloyFurnaceBlockEntity;
public class GuiAlloyFurnace extends AbstractContainerScreen<BuiltContainer> {
private static final Identifier texture = new Identifier("techreborn",
"textures/gui/alloy_furnace.png");
TileIronAlloyFurnace alloyfurnace;
IronAlloyFurnaceBlockEntity alloyfurnace;
public GuiAlloyFurnace(int syncID, final PlayerEntity player, final TileIronAlloyFurnace alloyFurnace) {
public GuiAlloyFurnace(int syncID, final PlayerEntity player, final IronAlloyFurnaceBlockEntity alloyFurnace) {
super(alloyFurnace.createContainer(syncID, player), player.inventory, new LiteralText("techreborn.alloy_furnace"));
this.containerWidth = 176;
this.containerHeight = 167;
@ -66,7 +66,7 @@ public class GuiAlloyFurnace extends AbstractContainerScreen<BuiltContainer> {
@Override
protected void drawForeground(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translate("tile.techreborn.iron_alloy_furnace.name");
final String name = I18n.translate("blockEntity.techreborn.iron_alloy_furnace.name");
this.font.draw(name, this.containerWidth / 2 - this.font.getStringWidth(name) / 2, 6,
4210752);
this.font.draw(I18n.translate("container.inventory", new Object[0]), 8,

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileAlloySmelter;
import techreborn.blockentity.machine.tier1.AlloySmelterBlockEntity;
public class GuiAlloySmelter extends GuiBase {
TileAlloySmelter tile;
AlloySmelterBlockEntity blockEntity;
public GuiAlloySmelter(int syncID, final PlayerEntity player, final TileAlloySmelter tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiAlloySmelter(int syncID, final PlayerEntity player, final AlloySmelterBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@ -58,8 +58,8 @@ public class GuiAlloySmelter extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileAssemblingMachine;
import techreborn.blockentity.machine.tier1.AssemblingMachineBlockEntity;
public class GuiAssemblingMachine extends GuiBase {
TileAssemblingMachine tile;
AssemblingMachineBlockEntity blockEntity;
public GuiAssemblingMachine(int syncID, final PlayerEntity player, final TileAssemblingMachine tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiAssemblingMachine(int syncID, final PlayerEntity player, final AssemblingMachineBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -60,7 +60,7 @@ public class GuiAssemblingMachine extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -33,7 +33,7 @@ import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import reborncore.common.network.NetworkManager;
import techreborn.packets.ServerboundPackets;
import techreborn.tiles.machine.tier1.TileAutoCraftingTable;
import techreborn.blockentity.machine.tier1.AutoCraftingTableBlockEntity;
/**
* Created by modmuss50 on 20/06/2017.
@ -42,11 +42,11 @@ public class GuiAutoCrafting extends GuiBase {
static final Identifier RECIPE_BOOK_TEXTURE = new Identifier("textures/gui/recipe_book.png");
boolean showGui = true;
TileAutoCraftingTable tileAutoCraftingTable;
AutoCraftingTableBlockEntity blockEntityAutoCraftingTable;
public GuiAutoCrafting(int syncID, PlayerEntity player, TileAutoCraftingTable tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tileAutoCraftingTable = tile;
public GuiAutoCrafting(int syncID, PlayerEntity player, AutoCraftingTableBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntityAutoCraftingTable = blockEntity;
}
public void renderItemStack(ItemStack stack, int x, int y) {
@ -56,14 +56,14 @@ public class GuiAutoCrafting extends GuiBase {
@Override
protected void drawForeground(int mouseX, int mouseY) {
super.drawForeground(mouseX, mouseY);
Recipe recipe = tileAutoCraftingTable.getIRecipe();
Recipe recipe = blockEntityAutoCraftingTable.getIRecipe();
if (recipe != null) {
renderItemStack(recipe.getOutput(), 95, 42);
}
final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tileAutoCraftingTable.getProgress(), tileAutoCraftingTable.getMaxProgress(), 120, 44, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 26, (int) tileAutoCraftingTable.getEnergy(), (int) tileAutoCraftingTable.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawProgressBar(this, blockEntityAutoCraftingTable.getProgress(), blockEntityAutoCraftingTable.getMaxProgress(), 120, 44, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 26, (int) blockEntityAutoCraftingTable.getEnergy(), (int) blockEntityAutoCraftingTable.getMaxPower(), mouseX, mouseY, 0, layer);
}
@Override
@ -79,13 +79,13 @@ public class GuiAutoCrafting extends GuiBase {
drawOutputSlot(95, 42, layer);
drawString("Inventory", 8, 82, 4210752, layer);
builder.drawLockButton(this, 145, 4, mouseX, mouseY, layer, tileAutoCraftingTable.locked);
builder.drawLockButton(this, 145, 4, mouseX, mouseY, layer, blockEntityAutoCraftingTable.locked);
}
@Override
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
if (isPointInRect(145, 4, 20, 12, mouseX, mouseY)) {
NetworkManager.sendToServer(ServerboundPackets.createPacketAutoCraftingTableLock(tileAutoCraftingTable, !tileAutoCraftingTable.locked));
NetworkManager.sendToServer(ServerboundPackets.createPacketAutoCraftingTableLock(blockEntityAutoCraftingTable, !blockEntityAutoCraftingTable.locked));
return true;
}
return super.mouseClicked(mouseX, mouseY, mouseButton);

View file

@ -28,15 +28,15 @@ import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.tiles.storage.TileLowVoltageSU;
import techreborn.blockentity.storage.LowVoltageSUBlockEntity;
public class GuiBatbox extends GuiBase {
TileLowVoltageSU tile;
LowVoltageSUBlockEntity blockEntity;
public GuiBatbox(int syncID, final PlayerEntity player, final TileLowVoltageSU tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiBatbox(int syncID, final PlayerEntity player, final LowVoltageSUBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -56,10 +56,10 @@ public class GuiBatbox extends GuiBase {
if(GuiBase.slotConfigType == SlotConfigType.NONE){
GlStateManager.pushMatrix();
GlStateManager.scaled(0.6, 0.6, 5);
drawCentredString(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) tile.getEnergy()) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) tile.getMaxPower()) + " " + PowerSystem.getDisplayPower().abbreviation, 35, 0, 58, layer);
drawCentredString(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy()) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getMaxPower()) + " " + PowerSystem.getDisplayPower().abbreviation, 35, 0, 58, layer);
GlStateManager.popMatrix();
}
builder.drawMultiEnergyBar(this, 81, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawMultiEnergyBar(this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -37,29 +37,29 @@ import reborncore.client.multiblock.Multiblock;
import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.client.multiblock.MultiblockSet;
import techreborn.init.TRContent;
import techreborn.tiles.machine.multiblock.TileIndustrialBlastFurnace;
import techreborn.blockentity.machine.multiblock.IndustrialBlastFurnaceBlockEntity;
public class GuiBlastFurnace extends GuiBase {
public TileIndustrialBlastFurnace tile;
public IndustrialBlastFurnaceBlockEntity blockEntity;
boolean hasMultiBlock;
public GuiBlastFurnace(int syncID, final PlayerEntity player, final TileIndustrialBlastFurnace tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiBlastFurnace(int syncID, final PlayerEntity player, final IndustrialBlastFurnaceBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
public void init() {
super.init();
this.hasMultiBlock = this.tile.getCachedHeat() != 0;
this.hasMultiBlock = this.blockEntity.getCachedHeat() != 0;
ClientProxy.multiblockRenderEvent.setMultiblock(null);
}
@Override
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
super.drawBackground(f, mouseX, mouseY);
this.hasMultiBlock = this.tile.getCachedHeat() != 0;
this.hasMultiBlock = this.blockEntity.getCachedHeat() != 0;
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
final GuiBase.Layer layer = Layer.BACKGROUND;
@ -79,12 +79,12 @@ public class GuiBlastFurnace extends GuiBase {
@Override
protected void drawForeground(final int mouseX, final int mouseY) {
super.drawForeground(mouseX, mouseY);
this.hasMultiBlock = tile.getCachedHeat() != 0;
this.hasMultiBlock = blockEntity.getCachedHeat() != 0;
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawBigHeatBar(this, 31, 71, tile.getCachedHeat(), 3230, layer);
builder.drawBigHeatBar(this, 31, 71, blockEntity.getCachedHeat(), 3230, layer);
if (hasMultiBlock) {
addHologramButton(4, 4, 212, layer).clickHandler(this::onClick);
} else {
@ -92,7 +92,7 @@ public class GuiBlastFurnace extends GuiBase {
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer);
}
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
public void onClick(GuiButtonExtended button, Double x, Double y){
@ -143,11 +143,11 @@ public class GuiBlastFurnace extends GuiBase {
final MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
ClientProxy.multiblockRenderEvent.parent = blockEntity.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
tile.getPos().getX() - Direction.byId(tile.getFacingInt()).getOffsetX() * 2,
tile.getPos().getY() - 1,
tile.getPos().getZ() - Direction.byId(tile.getFacingInt()).getOffsetZ() * 2);
blockEntity.getPos().getX() - Direction.byId(blockEntity.getFacingInt()).getOffsetX() * 2,
blockEntity.getPos().getY() - 1,
blockEntity.getPos().getZ() - Direction.byId(blockEntity.getFacingInt()).getOffsetZ() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.TileIndustrialCentrifuge;
import techreborn.blockentity.IndustrialCentrifugeBlockEntity;
public class GuiCentrifuge extends GuiBase {
TileIndustrialCentrifuge tile;
IndustrialCentrifugeBlockEntity blockEntity;
public GuiCentrifuge(int syncID, final PlayerEntity player, final TileIndustrialCentrifuge tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiCentrifuge(int syncID, final PlayerEntity player, final IndustrialCentrifugeBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -61,7 +61,7 @@ public class GuiCentrifuge extends GuiBase {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 61, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 61, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -26,15 +26,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import techreborn.tiles.TileChargeOMat;
import techreborn.blockentity.ChargeOMatBlockEntity;
public class GuiChargeBench extends GuiBase {
TileChargeOMat tile;
ChargeOMatBlockEntity blockEntity;
public GuiChargeBench(int syncID, final PlayerEntity player, final TileChargeOMat tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiChargeBench(int syncID, final PlayerEntity player, final ChargeOMatBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -55,6 +55,6 @@ public class GuiChargeBench extends GuiBase {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
builder.drawMultiEnergyBar(this, 81, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawMultiEnergyBar(this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileChemicalReactor;
import techreborn.blockentity.machine.tier1.ChemicalReactorBlockEntity;
public class GuiChemicalReactor extends GuiBase {
TileChemicalReactor tile;
ChemicalReactorBlockEntity blockEntity;
public GuiChemicalReactor(int syncID, final PlayerEntity player, final TileChemicalReactor tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiChemicalReactor(int syncID, final PlayerEntity player, final ChemicalReactorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -57,8 +57,8 @@ public class GuiChemicalReactor extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -32,19 +32,19 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.text.LiteralText;
import net.minecraft.util.Identifier;
import reborncore.client.gui.builder.widget.GuiButtonSimple;
import techreborn.tiles.machine.tier3.TileChunkLoader;
import techreborn.blockentity.machine.tier3.ChunkLoaderBlockEntity;
public class GuiChunkLoader extends AbstractContainerScreen {
private static final Identifier texture = new Identifier("techreborn",
"textures/gui/industrial_chunkloader.png");
TileChunkLoader chunkloader;
ChunkLoaderBlockEntity chunkloader;
private ButtonWidget plusOneButton;
private ButtonWidget plusTenButton;
private ButtonWidget minusOneButton;
private ButtonWidget minusTenButton;
public GuiChunkLoader(int syncID, final PlayerEntity player, final TileChunkLoader chunkLoader) {
public GuiChunkLoader(int syncID, final PlayerEntity player, final ChunkLoaderBlockEntity chunkLoader) {
super(chunkLoader.createContainer(syncID, player), player.inventory, new LiteralText("techreborn.chunkloader"));
this.containerWidth = 176;
this.containerHeight = 167;
@ -80,7 +80,7 @@ public class GuiChunkLoader extends AbstractContainerScreen {
@Override
protected void drawForeground(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translate("tile.techreborn:chunk_loader.name");
final String name = I18n.translate("blockEntity.techreborn:chunk_loader.name");
this.font.draw(name, this.containerWidth / 2 - this.font.getStringWidth(name) / 2, 6,
4210752);
this.font.draw(I18n.translate("container.inventory", new Object[0]), 8,

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileCompressor;
import techreborn.blockentity.machine.tier1.CompressorBlockEntity;
public class GuiCompressor extends GuiBase {
TileCompressor tile;
CompressorBlockEntity blockEntity;
public GuiCompressor(int syncID, final PlayerEntity player, final TileCompressor tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiCompressor(int syncID, final PlayerEntity player, final CompressorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -56,7 +56,7 @@ public class GuiCompressor extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
this.builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
this.builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
this.builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
this.builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -29,16 +29,16 @@ import net.fabricmc.api.Environment;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.generator.advanced.TileDieselGenerator;
import techreborn.blockentity.generator.advanced.DieselGeneratorBlockEntity;
@Environment(EnvType.CLIENT)
public class GuiDieselGenerator extends GuiBase {
TileDieselGenerator tile;
DieselGeneratorBlockEntity blockEntity;
public GuiDieselGenerator(int syncID, final PlayerEntity player, final TileDieselGenerator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiDieselGenerator(int syncID, final PlayerEntity player, final DieselGeneratorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -56,9 +56,9 @@ public class GuiDieselGenerator extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 130, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(this, 44, 25, mouseX, mouseY, tile.tank.getFluid(), tile.tank.getCapacity(), tile.tank.isEmpty(), layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluid(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
}

View file

@ -26,15 +26,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import techreborn.tiles.TileDigitalChest;
import techreborn.blockentity.DigitalChestBlockEntity;
public class GuiDigitalChest extends GuiBase {
TileDigitalChest tile;
DigitalChestBlockEntity blockEntity;
public GuiDigitalChest(int syncID, final PlayerEntity player, final TileDigitalChest tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiDigitalChest(int syncID, final PlayerEntity player, final DigitalChestBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -51,14 +51,14 @@ public class GuiDigitalChest extends GuiBase {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
if (!tile.storedItem.isEmpty() && tile.inventory.getInvStack(1) != null) {
if (!blockEntity.storedItem.isEmpty() && blockEntity.inventory.getInvStack(1) != null) {
builder.drawBigBlueBar(this, 31, 43,
tile.storedItem.getCount() + tile.inventory.getInvStack(1).getCount(),
tile.maxCapacity, mouseX - left, mouseY - top, "Stored", layer);
blockEntity.storedItem.getCount() + blockEntity.inventory.getInvStack(1).getCount(),
blockEntity.maxCapacity, mouseX - left, mouseY - top, "Stored", layer);
}
if (tile.storedItem.isEmpty() && tile.inventory.getInvStack(1) != null) {
builder.drawBigBlueBar(this, 31, 43, tile.inventory.getInvStack(1).getCount(),
tile.maxCapacity, mouseX - left, mouseY - top, "Stored", layer);
if (blockEntity.storedItem.isEmpty() && blockEntity.inventory.getInvStack(1) != null) {
builder.drawBigBlueBar(this, 31, 43, blockEntity.inventory.getInvStack(1).getCount(),
blockEntity.maxCapacity, mouseX - left, mouseY - top, "Stored", layer);
}
}
}

View file

@ -37,15 +37,15 @@ import reborncore.client.multiblock.Multiblock;
import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.client.multiblock.MultiblockSet;
import techreborn.init.TRContent;
import techreborn.tiles.machine.multiblock.TileDistillationTower;
import techreborn.blockentity.machine.multiblock.DistillationTowerBlockEntity;
public class GuiDistillationTower extends GuiBase {
public TileDistillationTower tile;
public DistillationTowerBlockEntity blockEntity;
public GuiDistillationTower(int syncID, final PlayerEntity player, final TileDistillationTower tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiDistillationTower(int syncID, final PlayerEntity player, final DistillationTowerBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -76,8 +76,8 @@ public class GuiDistillationTower extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 55, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
if (tile.getMutliBlock()) {
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 55, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
if (blockEntity.getMutliBlock()) {
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer);
} else {
@ -85,7 +85,7 @@ public class GuiDistillationTower extends GuiBase {
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer);
}
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
@ -138,11 +138,11 @@ public class GuiDistillationTower extends GuiBase {
final MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
ClientProxy.multiblockRenderEvent.parent = blockEntity.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
tile.getPos().getX() - Direction.byId(tile.getFacingInt()).getOffsetX() * 2,
tile.getPos().getY() - 1,
tile.getPos().getZ() - Direction.byId(tile.getFacingInt()).getOffsetZ() * 2);
blockEntity.getPos().getX() - Direction.byId(blockEntity.getFacingInt()).getOffsetX() * 2,
blockEntity.getPos().getY() - 1,
blockEntity.getPos().getZ() - Direction.byId(blockEntity.getFacingInt()).getOffsetZ() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileElectricFurnace;
import techreborn.blockentity.machine.tier1.ElectricFurnaceBlockEntity;
public class GuiElectricFurnace extends GuiBase {
TileElectricFurnace tile;
ElectricFurnaceBlockEntity blockEntity;
public GuiElectricFurnace(int syncID, final PlayerEntity player, final TileElectricFurnace tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiElectricFurnace(int syncID, final PlayerEntity player, final ElectricFurnaceBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -56,7 +56,7 @@ public class GuiElectricFurnace extends GuiBase {
super.drawForeground(mouseX, mouseY);
Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.gaugeProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawProgressBar(this, blockEntity.gaugeProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileExtractor;
import techreborn.blockentity.machine.tier1.ExtractorBlockEntity;
public class GuiExtractor extends GuiBase {
TileExtractor tile;
ExtractorBlockEntity blockEntity;
public GuiExtractor(int syncID, final PlayerEntity player, final TileExtractor tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiExtractor(int syncID, final PlayerEntity player, final ExtractorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -56,7 +56,7 @@ public class GuiExtractor extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -36,7 +36,7 @@ import reborncore.client.multiblock.Multiblock;
import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.client.multiblock.MultiblockSet;
import techreborn.init.TRContent;
import techreborn.tiles.machine.multiblock.TileFluidReplicator;
import techreborn.blockentity.machine.multiblock.FluidReplicatorBlockEntity;
/**
* @author drcrazy
@ -44,11 +44,11 @@ import techreborn.tiles.machine.multiblock.TileFluidReplicator;
*/
public class GuiFluidReplicator extends GuiBase {
TileFluidReplicator tile;
FluidReplicatorBlockEntity blockEntity;
public GuiFluidReplicator(int syncID, final PlayerEntity player, final TileFluidReplicator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiFluidReplicator(int syncID, final PlayerEntity player, final FluidReplicatorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
public void addComponent(final int x, final int y, final int z, final BlockState blockState, final Multiblock multiblock) {
@ -76,7 +76,7 @@ public class GuiFluidReplicator extends GuiBase {
drawSlot(124, 55, layer);
// JEI button
builder.drawJEIButton(this, 158, 5, layer);
if (tile.getMultiBlock()) {
if (blockEntity.getMultiBlock()) {
builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer);
}
}
@ -86,16 +86,16 @@ public class GuiFluidReplicator extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawTank(this, 99, 25, mouseX, mouseY, tile.tank.getFluid(), tile.tank.getCapacity(), tile.tank.isEmpty(), layer);
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
if (tile.getMultiBlock()) {
builder.drawTank(this, 99, 25, mouseX, mouseY, blockEntity.tank.getFluid(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
if (blockEntity.getMultiBlock()) {
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
} else {
builder.drawMultiblockMissingBar(this, layer);
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer);
}
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
// GuiScreen
@ -118,12 +118,12 @@ public class GuiFluidReplicator extends GuiBase {
final MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
ClientProxy.multiblockRenderEvent.parent = blockEntity.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
this.tile.getPos().getX()
- Direction.byId(this.tile.getFacingInt()).getOffsetX() * 2,
this.tile.getPos().getY() - 1, this.tile.getPos().getZ()
- Direction.byId(this.tile.getFacingInt()).getOffsetZ() * 2);
this.blockEntity.getPos().getX()
- Direction.byId(this.blockEntity.getFacingInt()).getOffsetX() * 2,
this.blockEntity.getPos().getY() - 1, this.blockEntity.getPos().getZ()
- Direction.byId(this.blockEntity.getFacingInt()).getOffsetZ() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);

View file

@ -42,18 +42,18 @@ import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.util.Torus;
import techreborn.init.TRContent;
import techreborn.packets.ServerboundPackets;
import techreborn.tiles.fusionReactor.TileFusionControlComputer;
import techreborn.blockentity.fusionReactor.FusionControlComputerBlockEntity;
import java.awt.*;
import java.util.List;
import java.util.Optional;
public class GuiFusionReactor extends GuiBase {
TileFusionControlComputer tile;
FusionControlComputerBlockEntity blockEntity;
public GuiFusionReactor(int syncID, final PlayerEntity player, final TileFusionControlComputer tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiFusionReactor(int syncID, final PlayerEntity player, final FusionControlComputerBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -66,7 +66,7 @@ public class GuiFusionReactor extends GuiBase {
drawOutputSlot(80, 47, layer);
builder.drawJEIButton(this, 158, 5, layer);
if (tile.getCoilStatus() > 0) {
if (blockEntity.getCoilStatus() > 0) {
builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer);
}
@ -77,13 +77,13 @@ public class GuiFusionReactor extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
if (tile.getCoilStatus() > 0) {
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
if (blockEntity.getCoilStatus() > 0) {
addHologramButton(6, 4, 212, layer).clickHandler(this::hologramToggle);
drawCentredString(tile.getStateString(), 20, Color.BLUE.darker().getRGB(), layer);
if(tile.state == 2){
drawCentredString( PowerSystem.getLocaliszedPowerFormatted((int) tile.getPowerChange()) + "/t", 30, Color.GREEN.darker().getRGB(), layer);
drawCentredString(blockEntity.getStateString(), 20, Color.BLUE.darker().getRGB(), layer);
if(blockEntity.state == 2){
drawCentredString( PowerSystem.getLocaliszedPowerFormatted((int) blockEntity.getPowerChange()) + "/t", 30, Color.GREEN.darker().getRGB(), layer);
}
} else {
builder.drawMultiblockMissingBar(this, layer);
@ -101,15 +101,15 @@ public class GuiFusionReactor extends GuiBase {
}
}
builder.drawUpDownButtons(this, 121, 79, layer);
drawString("Size: " + tile.size, 83, 81, 0xFFFFFF, layer);
drawString("" + tile.getPowerMultiplier() + "x", 10, 81, 0xFFFFFF, layer);
drawString("Size: " + blockEntity.size, 83, 81, 0xFFFFFF, layer);
drawString("" + blockEntity.getPowerMultiplier() + "x", 10, 81, 0xFFFFFF, layer);
buttons.add(new GuiButtonUpDown(121, 79, this, GuiBase.Layer.FOREGROUND, (ButtonWidget buttonWidget) -> sendSizeChange(5)));
buttons.add(new GuiButtonUpDown(121 + 12, 79, this, GuiBase.Layer.FOREGROUND, (ButtonWidget buttonWidget) -> sendSizeChange(1)));
buttons.add(new GuiButtonUpDown(121 + 24, 79, this, GuiBase.Layer.FOREGROUND, (ButtonWidget buttonWidget) -> sendSizeChange(-5)));
buttons.add(new GuiButtonUpDown(121 + 36, 79, this, GuiBase.Layer.FOREGROUND, (ButtonWidget buttonWidget) -> sendSizeChange(-1)));
builder.drawMultiEnergyBar(this, 9, 19, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) this.blockEntity.getEnergy(), (int) this.blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
public void hologramToggle(GuiButtonExtended button, double x, double y){
@ -123,7 +123,7 @@ public class GuiFusionReactor extends GuiBase {
}
private void sendSizeChange(int sizeDelta){
NetworkManager.sendToServer(ServerboundPackets.createPacketFusionControlSize(sizeDelta, tile.getPos()));
NetworkManager.sendToServer(ServerboundPackets.createPacketFusionControlSize(sizeDelta, blockEntity.getPos()));
//Reset the multiblock as it will be wrong now.
if(ClientProxy.multiblockRenderEvent.currentMultiblock != null){
updateMultiBlockRender();
@ -134,14 +134,14 @@ public class GuiFusionReactor extends GuiBase {
final Multiblock multiblock = new Multiblock();
BlockState coil = TRContent.Machine.FUSION_COIL.block.getDefaultState();
List<BlockPos> coils = Torus.generate(new BlockPos(0, 0, 0), tile.size);
List<BlockPos> coils = Torus.generate(new BlockPos(0, 0, 0), blockEntity.size);
coils.forEach(pos -> addComponent(pos.getX(), pos.getY(), pos.getZ(), coil, multiblock));
final MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
MultiblockRenderEvent.anchor = new BlockPos(tile.getPos().getX(), tile.getPos().getY() - 1,
tile.getPos().getZ());
ClientProxy.multiblockRenderEvent.parent = blockEntity.getPos();
MultiblockRenderEvent.anchor = new BlockPos(blockEntity.getPos().getX(), blockEntity.getPos().getY() - 1,
blockEntity.getPos().getZ());
}
public void addComponent(final int x, final int y, final int z, final BlockState blockState, final Multiblock multiblock) {
@ -149,10 +149,10 @@ public class GuiFusionReactor extends GuiBase {
}
public Optional<Pair<Integer, Integer>> getCoilStackCount(){
if(!Torus.TORUS_SIZE_MAP.containsKey(tile.size)){
if(!Torus.TORUS_SIZE_MAP.containsKey(blockEntity.size)){
return Optional.empty();
}
int count = Torus.TORUS_SIZE_MAP.get(tile.size);
int count = Torus.TORUS_SIZE_MAP.get(blockEntity.size);
return Optional.of(Pair.of(count / 64, count % 64));
}
}

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.generator.advanced.TileGasTurbine;
import techreborn.blockentity.generator.advanced.GasTurbineBlockEntity;
public class GuiGasTurbine extends GuiBase {
TileGasTurbine tile;
GasTurbineBlockEntity blockEntity;
public GuiGasTurbine(int syncID, final PlayerEntity player, final TileGasTurbine tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiGasTurbine(int syncID, final PlayerEntity player, final GasTurbineBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -53,9 +53,9 @@ public class GuiGasTurbine extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 130, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(this, 44, 25, mouseX, mouseY, tile.tank.getFluid(), tile.tank.getCapacity(), tile.tank.isEmpty(), layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluid(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
}
}

View file

@ -26,15 +26,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import techreborn.tiles.generator.basic.TileSolidFuelGenerator;
import techreborn.blockentity.generator.basic.SolidFuelGeneratorBlockEntity;
public class GuiGenerator extends GuiBase {
TileSolidFuelGenerator tile;
SolidFuelGeneratorBlockEntity blockEntity;
public GuiGenerator(int syncID, final PlayerEntity player, final TileSolidFuelGenerator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiGenerator(int syncID, final PlayerEntity player, final SolidFuelGeneratorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -54,7 +54,7 @@ public class GuiGenerator extends GuiBase {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
builder.drawBurnBar(this, tile.getScaledBurnTime(100), 100, 81, 38, mouseX, mouseY, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawBurnBar(this, blockEntity.getScaledBurnTime(100), 100, 81, 38, mouseX, mouseY, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileGrinder;
import techreborn.blockentity.machine.tier1.GrinderBlockEntity;
public class GuiGrinder extends GuiBase {
TileGrinder tile;
GrinderBlockEntity blockEntity;
public GuiGrinder(int syncID, final PlayerEntity player, final TileGrinder tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiGrinder(int syncID, final PlayerEntity player, final GrinderBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -56,7 +56,7 @@ public class GuiGrinder extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -28,15 +28,15 @@ import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.tiles.storage.idsu.TileInterdimensionalSU;
import techreborn.blockentity.storage.idsu.InterdimensionalSUBlockEntity;
public class GuiIDSU extends GuiBase {
TileInterdimensionalSU idsu;
InterdimensionalSUBlockEntity idsu;
public GuiIDSU(int syncID, PlayerEntity player, TileInterdimensionalSU tileIDSU) {
super(player, tileIDSU, tileIDSU.createContainer(syncID, player));
idsu = tileIDSU;
public GuiIDSU(int syncID, PlayerEntity player, InterdimensionalSUBlockEntity blockEntityIDSU) {
super(player, blockEntityIDSU, blockEntityIDSU.createContainer(syncID, player));
idsu = blockEntityIDSU;
}
@Override

View file

@ -36,15 +36,15 @@ import reborncore.client.multiblock.Multiblock;
import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.client.multiblock.MultiblockSet;
import techreborn.init.TRContent;
import techreborn.tiles.machine.multiblock.TileImplosionCompressor;
import techreborn.blockentity.machine.multiblock.ImplosionCompressorBlockEntity;
public class GuiImplosionCompressor extends GuiBase {
TileImplosionCompressor tile;
ImplosionCompressorBlockEntity blockEntity;
public GuiImplosionCompressor(int syncID, final PlayerEntity player, final TileImplosionCompressor tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiImplosionCompressor(int syncID, final PlayerEntity player, final ImplosionCompressorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -67,7 +67,7 @@ public class GuiImplosionCompressor extends GuiBase {
drawSlot(92, 36, layer);
drawSlot(110, 36, layer);
if (tile.getMutliBlock()) {
if (blockEntity.getMutliBlock()) {
builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer);
}
@ -79,15 +79,15 @@ public class GuiImplosionCompressor extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
if (tile.getMutliBlock()) {
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
if (blockEntity.getMutliBlock()) {
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
} else {
builder.drawMultiblockMissingBar(this, layer);
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer);
}
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
@ -109,8 +109,8 @@ public class GuiImplosionCompressor extends GuiBase {
final MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
MultiblockRenderEvent.anchor = new BlockPos(tile.getPos().getX(), tile.getPos().getY(), tile.getPos().getZ());
ClientProxy.multiblockRenderEvent.parent = blockEntity.getPos();
MultiblockRenderEvent.anchor = new BlockPos(blockEntity.getPos().getX(), blockEntity.getPos().getY(), blockEntity.getPos().getZ());
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileIndustrialElectrolyzer;
import techreborn.blockentity.machine.tier1.IndustrialElectrolyzerBlockEntity;
public class GuiIndustrialElectrolyzer extends GuiBase {
TileIndustrialElectrolyzer tile;
IndustrialElectrolyzerBlockEntity blockEntity;
public GuiIndustrialElectrolyzer(int syncID, final PlayerEntity player, final TileIndustrialElectrolyzer tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiIndustrialElectrolyzer(int syncID, final PlayerEntity player, final IndustrialElectrolyzerBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -58,8 +58,8 @@ public class GuiIndustrialElectrolyzer extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 84, 52, mouseX, mouseY, GuiBuilder.ProgressDirection.UP, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 84, 52, mouseX, mouseY, GuiBuilder.ProgressDirection.UP, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}

View file

@ -37,15 +37,15 @@ import reborncore.client.multiblock.Multiblock;
import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.client.multiblock.MultiblockSet;
import techreborn.init.TRContent;
import techreborn.tiles.machine.multiblock.TileIndustrialGrinder;
import techreborn.blockentity.machine.multiblock.IndustrialGrinderBlockEntity;
public class GuiIndustrialGrinder extends GuiBase {
TileIndustrialGrinder tile;
IndustrialGrinderBlockEntity blockEntity;
public GuiIndustrialGrinder(int syncID, final PlayerEntity player, final TileIndustrialGrinder tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiIndustrialGrinder(int syncID, final PlayerEntity player, final IndustrialGrinderBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -74,7 +74,7 @@ public class GuiIndustrialGrinder extends GuiBase {
drawSlot(126, 72, layer);
builder.drawJEIButton(this, 158, 5, layer);
if (tile.getMultiBlock()) {
if (blockEntity.getMultiBlock()) {
builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer);
}
}
@ -84,16 +84,16 @@ public class GuiIndustrialGrinder extends GuiBase {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawTank(this, 53, 25, mouseX, mouseY, tile.tank.getFluid(), tile.tank.getCapacity(), tile.tank.isEmpty(), layer);
if (tile.getMultiBlock()) {
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawTank(this, 53, 25, mouseX, mouseY, blockEntity.tank.getFluid(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
if (blockEntity.getMultiBlock()) {
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
} else {
builder.drawMultiblockMissingBar(this, layer);
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer);
}
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
public void onClick(GuiButtonExtended button, double mouseX, double mouseY){
@ -138,12 +138,12 @@ public class GuiIndustrialGrinder extends GuiBase {
final MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
ClientProxy.multiblockRenderEvent.parent = blockEntity.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
this.tile.getPos().getX()
- Direction.byId(this.tile.getFacingInt()).getOffsetX() * 2,
this.tile.getPos().getY() - 1, this.tile.getPos().getZ()
- Direction.byId(this.tile.getFacingInt()).getOffsetZ() * 2);
this.blockEntity.getPos().getX()
- Direction.byId(this.blockEntity.getFacingInt()).getOffsetX() * 2,
this.blockEntity.getPos().getY() - 1, this.blockEntity.getPos().getZ()
- Direction.byId(this.blockEntity.getFacingInt()).getOffsetZ() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);

View file

@ -37,15 +37,15 @@ import reborncore.client.multiblock.Multiblock;
import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.client.multiblock.MultiblockSet;
import techreborn.init.TRContent;
import techreborn.tiles.machine.multiblock.TileIndustrialSawmill;
import techreborn.blockentity.machine.multiblock.IndustrialSawmillBlockEntity;
public class GuiIndustrialSawmill extends GuiBase {
TileIndustrialSawmill tile;
IndustrialSawmillBlockEntity blockEntity;
public GuiIndustrialSawmill(int syncID, final PlayerEntity player, final TileIndustrialSawmill tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiIndustrialSawmill(int syncID, final PlayerEntity player, final IndustrialSawmillBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -73,7 +73,7 @@ public class GuiIndustrialSawmill extends GuiBase {
drawSlot(126, 61, layer);
builder.drawJEIButton(this, 158, 5, layer);
if (tile.getMutliBlock()) {
if (blockEntity.getMutliBlock()) {
builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer);
}
}
@ -83,16 +83,16 @@ public class GuiIndustrialSawmill extends GuiBase {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawTank(this, 53, 25, mouseX, mouseY, tile.tank.getFluid(), tile.tank.getCapacity(), tile.tank.isEmpty(), layer);
if (tile.getMutliBlock()) {
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawTank(this, 53, 25, mouseX, mouseY, blockEntity.tank.getFluid(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
if (blockEntity.getMutliBlock()) {
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
} else {
builder.drawMultiblockMissingBar(this, layer);
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer);
}
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
public void onClick(GuiButtonExtended button, Double mouseX, Double mouseY){
@ -137,12 +137,12 @@ public class GuiIndustrialSawmill extends GuiBase {
final MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
ClientProxy.multiblockRenderEvent.parent = blockEntity.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
this.tile.getPos().getX()
- Direction.byId(this.tile.getFacingInt()).getOffsetY() * 2,
this.tile.getPos().getY() - 1, this.tile.getPos().getZ()
- Direction.byId(this.tile.getFacingInt()).getOffsetY() * 2);
this.blockEntity.getPos().getX()
- Direction.byId(this.blockEntity.getFacingInt()).getOffsetY() * 2,
this.blockEntity.getPos().getY() - 1, this.blockEntity.getPos().getZ()
- Direction.byId(this.blockEntity.getFacingInt()).getOffsetY() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);

View file

@ -31,16 +31,16 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
import reborncore.client.gui.builder.GuiBase;
import techreborn.init.TRContent;
import techreborn.tiles.machine.iron.TileIronFurnace;
import techreborn.blockentity.machine.iron.IronFurnaceBlockEntity;
public class GuiIronFurnace extends GuiBase {
public static final Identifier texture = new Identifier("minecraft",
"textures/gui/container/furnace.png");
TileIronFurnace furnace;
IronFurnaceBlockEntity furnace;
public GuiIronFurnace(int syncID, final PlayerEntity player, final TileIronFurnace furnace) {
public GuiIronFurnace(int syncID, final PlayerEntity player, final IronFurnaceBlockEntity furnace) {
super(player, furnace, furnace.createContainer(syncID, player));
this.containerWidth = 176;
this.containerHeight = 167;
@ -72,7 +72,7 @@ public class GuiIronFurnace extends GuiBase {
@Override
protected void drawForeground(int mouseX, int mouseY) {
final String name = I18n.translate("tile.techreborn.iron_furnace.name");
final String name = I18n.translate("blockEntity.techreborn.iron_furnace.name");
font.draw(name, containerWidth / 2 - font.getStringWidth(name) / 2, 6, 4210752);
font.draw(I18n.translate("container.inventory", new Object[0]), 8, containerHeight - 96 + 2, 4210752);

View file

@ -28,15 +28,15 @@ import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.tiles.storage.lesu.TileLapotronicSU;
import techreborn.blockentity.storage.lesu.LapotronicSUBlockEntity;
public class GuiLESU extends GuiBase {
TileLapotronicSU tile;
LapotronicSUBlockEntity blockEntity;
public GuiLESU(int syncID, final PlayerEntity player, final TileLapotronicSU tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiLESU(int syncID, final PlayerEntity player, final LapotronicSUBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -56,11 +56,11 @@ public class GuiLESU extends GuiBase {
GlStateManager.pushMatrix();
GlStateManager.scaled(0.6, 0.6, 1);
drawCentredString(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) tile.getEnergy()) + "/"
+ PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) tile.getMaxPower()) + " "
drawCentredString(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy()) + "/"
+ PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getMaxPower()) + " "
+ PowerSystem.getDisplayPower().abbreviation, 35, 0, 58, layer);
GlStateManager.popMatrix();
builder.drawMultiEnergyBar(this, 81, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawMultiEnergyBar(this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -28,13 +28,13 @@ import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.tiles.storage.TileMediumVoltageSU;
import techreborn.blockentity.storage.MediumVoltageSUBlockEntity;
public class GuiMFE extends GuiBase {
TileMediumVoltageSU mfe;
MediumVoltageSUBlockEntity mfe;
public GuiMFE(int syncID, final PlayerEntity player, final TileMediumVoltageSU mfe) {
public GuiMFE(int syncID, final PlayerEntity player, final MediumVoltageSUBlockEntity mfe) {
super(player, mfe, mfe.createContainer(syncID, player));
this.mfe = mfe;
}

View file

@ -28,13 +28,13 @@ import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.tiles.storage.TileHighVoltageSU;
import techreborn.blockentity.storage.HighVoltageSUBlockEntity;
public class GuiMFSU extends GuiBase {
TileHighVoltageSU mfsu;
HighVoltageSUBlockEntity mfsu;
public GuiMFSU(int syncID, final PlayerEntity player, final TileHighVoltageSU mfsu) {
public GuiMFSU(int syncID, final PlayerEntity player, final HighVoltageSUBlockEntity mfsu) {
super(player, mfsu, mfsu.createContainer(syncID, player));
this.mfsu = mfsu;
}

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier3.TileMatterFabricator;
import techreborn.blockentity.machine.tier3.MatterFabricatorBlockEntity;
public class GuiMatterFabricator extends GuiBase {
TileMatterFabricator tile;
MatterFabricatorBlockEntity blockEntity;
public GuiMatterFabricator(int syncID, final PlayerEntity player, final TileMatterFabricator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiMatterFabricator(int syncID, final PlayerEntity player, final MatterFabricatorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -60,7 +60,7 @@ public class GuiMatterFabricator extends GuiBase {
super.drawForeground(mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 83, 41, mouseX, mouseY, GuiBuilder.ProgressDirection.DOWN, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 83, 41, mouseX, mouseY, GuiBuilder.ProgressDirection.DOWN, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -29,7 +29,7 @@ import net.fabricmc.api.Environment;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.generator.TilePlasmaGenerator;
import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
/**
* @author drcrazy
@ -40,14 +40,14 @@ public class GuiPlasmaGenerator extends GuiBase {
/**
* @param player
* @param tile
* @param blockEntity
* @param container
*/
TilePlasmaGenerator tile;
PlasmaGeneratorBlockEntity blockEntity;
public GuiPlasmaGenerator(int syncID, final PlayerEntity player, final TilePlasmaGenerator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiPlasmaGenerator(int syncID, final PlayerEntity player, final PlasmaGeneratorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -65,9 +65,9 @@ public class GuiPlasmaGenerator extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 130, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(this, 44, 25, mouseX, mouseY, tile.tank.getFluid(), tile.tank.getCapacity(), tile.tank.isEmpty(), layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluid(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
}

View file

@ -26,13 +26,13 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import techreborn.tiles.machine.tier3.TileQuantumChest;
import techreborn.blockentity.machine.tier3.QuantumChestBlockEntity;
public class GuiQuantumChest extends GuiBase {
TileQuantumChest quantumChest;
QuantumChestBlockEntity quantumChest;
public GuiQuantumChest(int syncID, final PlayerEntity player, final TileQuantumChest quantumChest) {
public GuiQuantumChest(int syncID, final PlayerEntity player, final QuantumChestBlockEntity quantumChest) {
super(player, quantumChest, quantumChest.createContainer(syncID, player));
this.quantumChest = quantumChest;
}

View file

@ -27,13 +27,13 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.fluid.FluidStack;
import techreborn.tiles.machine.tier3.TileQuantumTank;
import techreborn.blockentity.machine.tier3.QuantumTankBlockEntity;
public class GuiQuantumTank extends GuiBase {
TileQuantumTank quantumTank;
QuantumTankBlockEntity quantumTank;
public GuiQuantumTank(int syncID, final PlayerEntity player, final TileQuantumTank quantumTank) {
public GuiQuantumTank(int syncID, final PlayerEntity player, final QuantumTankBlockEntity quantumTank) {
super(player, quantumTank, quantumTank.createContainer(syncID, player));
this.quantumTank = quantumTank;
}

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileRecycler;
import techreborn.blockentity.machine.tier1.RecyclerBlockEntity;
public class GuiRecycler extends GuiBase {
TileRecycler tile;
RecyclerBlockEntity blockEntity;
public GuiRecycler(int syncID, final PlayerEntity player, final TileRecycler tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiRecycler(int syncID, final PlayerEntity player, final RecyclerBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -54,7 +54,7 @@ public class GuiRecycler extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.gaugeProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawProgressBar(this, blockEntity.gaugeProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -29,15 +29,15 @@ import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import reborncore.common.network.NetworkManager;
import techreborn.packets.ServerboundPackets;
import techreborn.tiles.machine.tier1.TileRollingMachine;
import techreborn.blockentity.machine.tier1.RollingMachineBlockEntity;
public class GuiRollingMachine extends GuiBase {
TileRollingMachine rollingMachine;
RollingMachineBlockEntity rollingMachine;
public GuiRollingMachine(int syncID, final PlayerEntity player, final TileRollingMachine tileRollingmachine) {
super(player, tileRollingmachine, tileRollingmachine.createContainer(syncID, player));
this.rollingMachine = tileRollingmachine;
public GuiRollingMachine(int syncID, final PlayerEntity player, final RollingMachineBlockEntity blockEntityRollingmachine) {
super(player, blockEntityRollingmachine, blockEntityRollingmachine.createContainer(syncID, player));
this.rollingMachine = blockEntityRollingmachine;
}
@Override

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.machine.tier1.TileScrapboxinator;
import techreborn.blockentity.machine.tier1.ScrapboxinatorBlockEntity;
public class GuiScrapboxinator extends GuiBase {
TileScrapboxinator tile;
ScrapboxinatorBlockEntity blockEntity;
public GuiScrapboxinator(int syncID, final PlayerEntity player, final TileScrapboxinator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiScrapboxinator(int syncID, final PlayerEntity player, final ScrapboxinatorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -58,7 +58,7 @@ public class GuiScrapboxinator extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.generator.advanced.TileSemiFluidGenerator;
import techreborn.blockentity.generator.advanced.SemiFluidGeneratorBlockEntity;
public class GuiSemifluidGenerator extends GuiBase {
TileSemiFluidGenerator tile;
SemiFluidGeneratorBlockEntity blockEntity;
public GuiSemifluidGenerator(int syncID, final PlayerEntity player, final TileSemiFluidGenerator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiSemifluidGenerator(int syncID, final PlayerEntity player, final SemiFluidGeneratorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -53,9 +53,9 @@ public class GuiSemifluidGenerator extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 130, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(this, 44, 25, mouseX, mouseY, tile.tank.getFluid(), tile.tank.getCapacity(), tile.tank.isEmpty(), layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluid(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
}
}

View file

@ -27,15 +27,15 @@ package techreborn.client.gui;
import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.tiles.generator.advanced.TileThermalGenerator;
import techreborn.blockentity.generator.advanced.ThermalGeneratorBlockEntity;
public class GuiThermalGenerator extends GuiBase {
TileThermalGenerator tile;
ThermalGeneratorBlockEntity blockEntity;
public GuiThermalGenerator(int syncID, final PlayerEntity player, final TileThermalGenerator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiThermalGenerator(int syncID, final PlayerEntity player, final ThermalGeneratorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -53,9 +53,9 @@ public class GuiThermalGenerator extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 130, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(this, 44, 25, mouseX, mouseY, tile.tank.getFluid(), tile.tank.getCapacity(), tile.tank.isEmpty(), layer);
builder.drawProgressBar(this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluid(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
}
}

View file

@ -35,15 +35,15 @@ import reborncore.client.multiblock.Multiblock;
import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.client.multiblock.MultiblockSet;
import techreborn.init.TRContent;
import techreborn.tiles.machine.multiblock.TileVacuumFreezer;
import techreborn.blockentity.machine.multiblock.VacuumFreezerBlockEntity;
public class GuiVacuumFreezer extends GuiBase {
TileVacuumFreezer tile;
VacuumFreezerBlockEntity blockEntity;
public GuiVacuumFreezer(int syncID, final PlayerEntity player, final TileVacuumFreezer tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
public GuiVacuumFreezer(int syncID, final PlayerEntity player, final VacuumFreezerBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createContainer(syncID, player));
this.blockEntity = blockEntity;
}
@Override
@ -66,7 +66,7 @@ public class GuiVacuumFreezer extends GuiBase {
drawOutputSlot(101, 45, layer);
builder.drawJEIButton(this, 158, 5, layer);
if (tile.getMultiBlock()) {
if (blockEntity.getMultiBlock()) {
builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer);
}
}
@ -76,15 +76,15 @@ public class GuiVacuumFreezer extends GuiBase {
super.drawForeground(mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
if (tile.getMultiBlock()) {
builder.drawProgressBar(this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
if (blockEntity.getMultiBlock()) {
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
} else {
builder.drawMultiblockMissingBar(this, layer);
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer);
}
builder.drawMultiEnergyBar(this, 9, 19, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawMultiEnergyBar(this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
public void onClick(GuiButtonExtended button, Double mouseX, Double mouseY){
@ -127,8 +127,8 @@ public class GuiVacuumFreezer extends GuiBase {
final MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
MultiblockRenderEvent.anchor = tile.getPos().down();
ClientProxy.multiblockRenderEvent.parent = blockEntity.getPos();
MultiblockRenderEvent.anchor = blockEntity.getPos().down();
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);