Tiered tank and storage blocks, GUI improvements, refactoring, cell nerf and misc organisation (#1932)
Tanks, storage blocks and variouse stuff. Thanks to Dimmerworld!!
This commit is contained in:
parent
2fc9557516
commit
9328c47bed
207 changed files with 1830 additions and 928 deletions
|
@ -49,7 +49,6 @@ public enum EGui implements IMachineGuiHandler {
|
|||
CHUNK_LOADER,
|
||||
COMPRESSOR,
|
||||
DIESEL_GENERATOR,
|
||||
DIGITAL_CHEST,
|
||||
DISTILLATION_TOWER,
|
||||
ELECTRIC_FURNACE,
|
||||
EXTRACTOR,
|
||||
|
@ -68,8 +67,8 @@ public enum EGui implements IMachineGuiHandler {
|
|||
MATTER_FABRICATOR,
|
||||
MEDIUM_VOLTAGE_SU,
|
||||
PLASMA_GENERATOR,
|
||||
QUANTUM_CHEST,
|
||||
QUANTUM_TANK,
|
||||
STORAGE_UNIT,
|
||||
TANK_UNIT,
|
||||
RECYCLER,
|
||||
ROLLING_MACHINE,
|
||||
SAWMILL,
|
||||
|
|
|
@ -34,12 +34,12 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.RebornCore;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import techreborn.blockentity.ChargeOMatBlockEntity;
|
||||
import techreborn.blockentity.DigitalChestBlockEntity;
|
||||
import techreborn.blockentity.IndustrialCentrifugeBlockEntity;
|
||||
import techreborn.blockentity.machine.misc.ChargeOMatBlockEntity;
|
||||
import techreborn.blockentity.machine.tier3.IndustrialCentrifugeBlockEntity;
|
||||
import techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity;
|
||||
import techreborn.blockentity.data.DataDrivenBEProvider;
|
||||
import techreborn.blockentity.data.DataDrivenGui;
|
||||
import techreborn.blockentity.fusionReactor.FusionControlComputerBlockEntity;
|
||||
import techreborn.blockentity.machine.multiblock.FusionControlComputerBlockEntity;
|
||||
import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
|
||||
import techreborn.blockentity.generator.SolarPanelBlockEntity;
|
||||
import techreborn.blockentity.generator.advanced.DieselGeneratorBlockEntity;
|
||||
|
@ -53,14 +53,13 @@ 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;
|
||||
import techreborn.blockentity.storage.energy.AdjustableSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.HighVoltageSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.LowVoltageSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.MediumVoltageSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.idsu.InterdimensionalSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.lesu.LapotronicSUBlockEntity;
|
||||
import techreborn.blockentity.storage.item.StorageUnitBaseBlockEntity;
|
||||
import techreborn.client.gui.*;
|
||||
|
||||
public class GuiHandler {
|
||||
|
@ -108,8 +107,6 @@ public class GuiHandler {
|
|||
return new GuiCompressor(syncID, player, (CompressorBlockEntity) blockEntity);
|
||||
case DIESEL_GENERATOR:
|
||||
return new GuiDieselGenerator(syncID, player, (DieselGeneratorBlockEntity) blockEntity);
|
||||
case DIGITAL_CHEST:
|
||||
return new GuiDigitalChest(syncID, player, (DigitalChestBlockEntity) blockEntity);
|
||||
case ELECTRIC_FURNACE:
|
||||
return new GuiElectricFurnace(syncID, player, (ElectricFurnaceBlockEntity) blockEntity);
|
||||
case EXTRACTOR:
|
||||
|
@ -138,10 +135,10 @@ public class GuiHandler {
|
|||
return new GuiMFE(syncID, player, (MediumVoltageSUBlockEntity) blockEntity);
|
||||
case HIGH_VOLTAGE_SU:
|
||||
return new GuiMFSU(syncID, player, (HighVoltageSUBlockEntity) blockEntity);
|
||||
case QUANTUM_CHEST:
|
||||
return new GuiQuantumChest(syncID, player, (QuantumChestBlockEntity) blockEntity);
|
||||
case QUANTUM_TANK:
|
||||
return new GuiQuantumTank(syncID, player, (QuantumTankBlockEntity) blockEntity);
|
||||
case STORAGE_UNIT:
|
||||
return new GuiStorageUnit(syncID, player, (StorageUnitBaseBlockEntity) blockEntity);
|
||||
case TANK_UNIT:
|
||||
return new GuiTankUnit(syncID, player, (TankUnitBaseBlockEntity) blockEntity);
|
||||
case RECYCLER:
|
||||
return new GuiRecycler(syncID, player, (RecyclerBlockEntity) blockEntity);
|
||||
case ROLLING_MACHINE:
|
||||
|
|
|
@ -33,7 +33,7 @@ import reborncore.client.gui.builder.widget.GuiButtonUpDown;
|
|||
import reborncore.client.gui.builder.widget.GuiButtonUpDown.UpDownButtonType;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.blockentity.storage.AdjustableSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.AdjustableSUBlockEntity;
|
||||
import techreborn.packets.ServerboundPackets;
|
||||
|
||||
public class GuiAESU extends GuiBase<BuiltContainer> {
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.blockentity.storage.LowVoltageSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.LowVoltageSUBlockEntity;
|
||||
|
||||
public class GuiBatbox extends GuiBase<BuiltContainer> {
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import techreborn.blockentity.IndustrialCentrifugeBlockEntity;
|
||||
import techreborn.blockentity.machine.tier3.IndustrialCentrifugeBlockEntity;
|
||||
|
||||
public class GuiCentrifuge extends GuiBase<BuiltContainer> {
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ package techreborn.client.gui;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import techreborn.blockentity.ChargeOMatBlockEntity;
|
||||
import techreborn.blockentity.machine.misc.ChargeOMatBlockEntity;
|
||||
|
||||
public class GuiChargeBench extends GuiBase<BuiltContainer> {
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ import reborncore.common.network.NetworkManager;
|
|||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.util.Color;
|
||||
import reborncore.common.util.Torus;
|
||||
import techreborn.blockentity.fusionReactor.FusionControlComputerBlockEntity;
|
||||
import techreborn.blockentity.machine.multiblock.FusionControlComputerBlockEntity;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.packets.ServerboundPackets;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.blockentity.storage.idsu.InterdimensionalSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.idsu.InterdimensionalSUBlockEntity;
|
||||
|
||||
public class GuiIDSU extends GuiBase<BuiltContainer> {
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.blockentity.storage.lesu.LapotronicSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.lesu.LapotronicSUBlockEntity;
|
||||
|
||||
public class GuiLESU extends GuiBase<BuiltContainer> {
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.blockentity.storage.MediumVoltageSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.MediumVoltageSUBlockEntity;
|
||||
|
||||
public class GuiMFE extends GuiBase<BuiltContainer> {
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.blockentity.storage.HighVoltageSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.HighVoltageSUBlockEntity;
|
||||
|
||||
public class GuiMFSU extends GuiBase<BuiltContainer> {
|
||||
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import techreborn.blockentity.machine.tier3.QuantumChestBlockEntity;
|
||||
|
||||
public class GuiQuantumChest extends GuiBase<BuiltContainer> {
|
||||
|
||||
QuantumChestBlockEntity quantumChest;
|
||||
|
||||
public GuiQuantumChest(int syncID, final PlayerEntity player, final QuantumChestBlockEntity quantumChest) {
|
||||
super(player, quantumChest, quantumChest.createContainer(syncID, player));
|
||||
this.quantumChest = quantumChest;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(80, 24, layer);
|
||||
drawSlot(80, 64, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(final int mouseX, final int mouseY) {
|
||||
super.drawForeground(mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
if (!this.quantumChest.storedItem.isEmpty() && !this.quantumChest.inventory.getInvStack(1).isEmpty()) {
|
||||
this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.storedItem.getCount() + this.quantumChest.inventory.getInvStack(1).getCount(), this.quantumChest.maxCapacity, mouseX - this.x, mouseY - this.y, "Stored", layer);
|
||||
}
|
||||
if (this.quantumChest.storedItem.isEmpty() && !this.quantumChest.inventory.getInvStack(1).isEmpty()) {
|
||||
this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.inventory.getInvStack(1).getCount(), this.quantumChest.maxCapacity, mouseX - this.x, mouseY - this.y, "Stored", layer);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -27,15 +27,16 @@ package techreborn.client.gui;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import techreborn.blockentity.DigitalChestBlockEntity;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.blockentity.storage.item.StorageUnitBaseBlockEntity;
|
||||
|
||||
public class GuiDigitalChest extends GuiBase<BuiltContainer> {
|
||||
public class GuiStorageUnit extends GuiBase<BuiltContainer> {
|
||||
|
||||
DigitalChestBlockEntity blockEntity;
|
||||
StorageUnitBaseBlockEntity storageEntity;
|
||||
|
||||
public GuiDigitalChest(int syncID, final PlayerEntity player, final DigitalChestBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createContainer(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
public GuiStorageUnit(int syncID, final PlayerEntity player, final StorageUnitBaseBlockEntity storageEntity) {
|
||||
super(player, storageEntity, storageEntity.createContainer(syncID, player));
|
||||
this.storageEntity = storageEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -43,23 +44,32 @@ public class GuiDigitalChest extends GuiBase<BuiltContainer> {
|
|||
super.drawBackground(f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(80, 24, layer);
|
||||
drawSlot(80, 64, layer);
|
||||
drawString(StringUtils.t("gui.techreborn.unit.in"), 100, 43, 4210752, layer);
|
||||
drawSlot(100, 53, layer);
|
||||
|
||||
drawString(StringUtils.t("gui.techreborn.unit.out"), 140, 43, 4210752, layer);
|
||||
drawSlot(140, 53, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(final int mouseX, final int mouseY) {
|
||||
super.drawForeground(mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
if (!blockEntity.storedItem.isEmpty() && blockEntity.inventory.getInvStack(1) != null) {
|
||||
builder.drawBigBlueBar(this, 31, 43,
|
||||
blockEntity.storedItem.getCount() + blockEntity.inventory.getInvStack(1).getCount(),
|
||||
blockEntity.maxCapacity, mouseX - x, mouseY - y, "Stored", layer);
|
||||
}
|
||||
if (blockEntity.storedItem.isEmpty() && blockEntity.inventory.getInvStack(1) != null) {
|
||||
builder.drawBigBlueBar(this, 31, 43, blockEntity.inventory.getInvStack(1).getCount(),
|
||||
blockEntity.maxCapacity, mouseX - x, mouseY - y, "Stored", layer);
|
||||
if (storageEntity.isEmpty()) {
|
||||
font.draw(StringUtils.t("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
|
||||
} else {
|
||||
font.draw(StringUtils.t("gui.techreborn.storage.store"), 10, 20, 4210752);
|
||||
font.draw(storageEntity.getStoredStack().getName().asString(), 10, 30, 4210752);
|
||||
|
||||
|
||||
font.draw(StringUtils.t("gui.techreborn.storage.amount"), 10, 50, 4210752);
|
||||
font.draw(String.valueOf(storageEntity.getCurrentCapacity()), 10, 60, 4210752);
|
||||
|
||||
String percentFilled = String.valueOf((int) ((double) storageEntity.getCurrentCapacity() / (double) storageEntity.getMaxCapacity() * 100));
|
||||
|
||||
font.draw(StringUtils.t("gui.techreborn.unit.used") + percentFilled + "%", 10, 70, 4210752);
|
||||
|
||||
font.draw(StringUtils.t("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,15 +29,16 @@ import reborncore.client.containerBuilder.builder.BuiltContainer;
|
|||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.fluid.FluidUtil;
|
||||
import reborncore.common.fluid.container.FluidInstance;
|
||||
import techreborn.blockentity.machine.tier3.QuantumTankBlockEntity;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity;
|
||||
|
||||
public class GuiQuantumTank extends GuiBase<BuiltContainer> {
|
||||
public class GuiTankUnit extends GuiBase<BuiltContainer> {
|
||||
|
||||
QuantumTankBlockEntity quantumTank;
|
||||
TankUnitBaseBlockEntity tankEntity;
|
||||
|
||||
public GuiQuantumTank(int syncID, final PlayerEntity player, final QuantumTankBlockEntity quantumTank) {
|
||||
super(player, quantumTank, quantumTank.createContainer(syncID, player));
|
||||
this.quantumTank = quantumTank;
|
||||
public GuiTankUnit(int syncID, final PlayerEntity player, final TankUnitBaseBlockEntity tankEntity) {
|
||||
super(player, tankEntity, tankEntity.createContainer(syncID, player));
|
||||
this.tankEntity = tankEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,24 +46,35 @@ public class GuiQuantumTank extends GuiBase<BuiltContainer> {
|
|||
super.drawBackground(f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(80, 17, layer);
|
||||
drawSlot(80, 53, layer);
|
||||
drawString(StringUtils.t("gui.techreborn.unit.in"), 100, 43, 4210752, layer);
|
||||
drawSlot(100, 53, layer);
|
||||
|
||||
drawString(StringUtils.t("gui.techreborn.unit.out"), 140, 43, 4210752, layer);
|
||||
drawSlot(140, 53, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(final int mouseX, final int mouseY) {
|
||||
super.drawForeground(mouseX, mouseY);
|
||||
|
||||
FluidInstance fluid = quantumTank.tank.getFluidInstance();
|
||||
if(fluid != null){
|
||||
font.draw( "Fluid Type:", 10, 20, 4210752);
|
||||
font.draw(FluidUtil.getFluidName(fluid) + "", 10, 30, 4210752);
|
||||
FluidInstance fluid = tankEntity.getTank().getFluidInstance();
|
||||
|
||||
font.draw("Fluid Amount:", 10, 50, 4210752);
|
||||
font.draw(quantumTank.tank.getFluidAmount().toString() , 10, 60, 4210752);
|
||||
if (fluid.isEmpty()) {
|
||||
font.draw(StringUtils.t("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
|
||||
} else {
|
||||
font.draw(StringUtils.t("gui.techreborn.tank.type"), 10, 20, 4210752);
|
||||
font.draw(FluidUtil.getFluidName(fluid).replace("_", " "), 10, 30, 4210752);
|
||||
|
||||
|
||||
font.draw(StringUtils.t("gui.techreborn.tank.amount"), 10, 50, 4210752);
|
||||
font.draw(fluid.getAmount().toString(), 10, 60, 4210752);
|
||||
|
||||
String percentFilled = String.valueOf((int) ((double) fluid.getAmount().getRawValue() / (double) tankEntity.getTank().getCapacity().getRawValue() * 100));
|
||||
|
||||
font.draw(StringUtils.t("gui.techreborn.unit.used") + percentFilled + "%", 10, 70, 4210752);
|
||||
|
||||
font.draw(StringUtils.t("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
Loading…
Add table
Add a link
Reference in a new issue