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:
Justin Vitale 2020-01-03 08:24:46 +11:00 committed by drcrazy
parent 2fc9557516
commit 9328c47bed
207 changed files with 1830 additions and 928 deletions

View file

@ -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> {

View file

@ -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> {

View file

@ -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> {

View file

@ -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> {

View file

@ -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;

View file

@ -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> {

View file

@ -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> {

View file

@ -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> {

View file

@ -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> {

View file

@ -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);
}
}
}

View file

@ -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);
}
}
}

View file

@ -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