Refactor and import cleanup (Excluding network PR changed files)

This commit is contained in:
Justin Vitale 2020-07-09 23:04:42 +10:00
parent a36a0e6f4a
commit c4ef977f16
165 changed files with 1572 additions and 1625 deletions

View file

@ -47,7 +47,7 @@ public class GuiAESU extends GuiBase<BuiltScreenHandler> {
super(player, aesu, aesu.createScreenHandler(syncID, player));
this.blockEntity = aesu;
}
@Override
public void init() {
super.init();
@ -73,7 +73,7 @@ public class GuiAESU extends GuiBase<BuiltScreenHandler> {
super.drawForeground(matrixStack, mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
if(!hideGuiElements()){
if (!hideGuiElements()) {
RenderSystem.pushMatrix();
RenderSystem.scaled(0.6, 0.6, 1);
Text text = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy()))
@ -85,11 +85,11 @@ public class GuiAESU extends GuiBase<BuiltScreenHandler> {
drawCentredText(matrixStack, text, 35, 0, 58, layer);
RenderSystem.popMatrix();
}
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
public void onClick(int amount){
public void onClick(int amount) {
NetworkManager.sendToServer(ServerboundPackets.createPacketAesu(amount, Screen.hasShiftDown(), Screen.hasControlDown(), blockEntity));
}
}

View file

@ -51,7 +51,7 @@ public class GuiAssemblingMachine extends GuiBase<BuiltScreenHandler> {
// Input slots
drawSlot(matrixStack, 55, 35, layer);
drawSlot(matrixStack, 55, 55, layer);
drawOutputSlot(matrixStack, 101, 45, layer);
builder.drawJEIButton(matrixStack, this, 158, 5, layer);

View file

@ -64,7 +64,7 @@ public class GuiAutoCrafting extends GuiBase<BuiltScreenHandler> {
renderItemStack(recipe.getOutput(), 95, 42);
}
final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntityAutoCraftingTable.getProgress(), blockEntityAutoCraftingTable.getMaxProgress(), 120, 44, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 26, (int) blockEntityAutoCraftingTable.getEnergy(), (int) blockEntityAutoCraftingTable.getMaxPower(), mouseX, mouseY, 0, layer);
}

View file

@ -57,7 +57,7 @@ public class GuiBatbox extends GuiBase<BuiltScreenHandler> {
super.drawForeground(matrixStack, mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
if(!hideGuiElements()){
if (!hideGuiElements()) {
RenderSystem.pushMatrix();
RenderSystem.scaled(0.6, 0.6, 5);
Text text = new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) blockEntity.getEnergy()))

View file

@ -46,7 +46,7 @@ public class GuiChunkLoader extends GuiBase<BuiltScreenHandler> {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
this.blockEntity = blockEntity;
}
public void init() {
super.init();
addButton(new GuiButtonUpDown(x + 64, y + 40, this, b -> onClick(5), UpDownButtonType.FASTFORWARD));
@ -56,7 +56,7 @@ public class GuiChunkLoader extends GuiBase<BuiltScreenHandler> {
addButton(new GuiButtonSimple(x + 10, y + 70, 155, 20, new LiteralText("Toggle Loaded Chunks"), b -> ClientChunkManager.toggleLoadedChunks(blockEntity.getPos())));
}
@Override
protected void drawBackground(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) {
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
@ -69,7 +69,7 @@ public class GuiChunkLoader extends GuiBase<BuiltScreenHandler> {
drawCentredText(matrixStack, text, 25, 4210752, layer);
}
public void onClick(int amount){
public void onClick(int amount) {
NetworkManager.sendToServer(ServerboundPackets.createPacketChunkloader(amount, blockEntity, ClientChunkManager.hasChunksForLoader(blockEntity.getPos())));
}
}
}

View file

@ -42,7 +42,7 @@ public class GuiDieselGenerator extends GuiBase<BuiltScreenHandler> {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
this.blockEntity = blockEntity;
}
@Override
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
super.drawBackground(matrixStack, f, mouseX, mouseY);
@ -51,17 +51,17 @@ public class GuiDieselGenerator extends GuiBase<BuiltScreenHandler> {
drawSlot(matrixStack, 25, 55, layer);
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
}
@Override
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
super.drawForeground(matrixStack, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
}
}

View file

@ -41,7 +41,7 @@ public class GuiDistillationTower extends GuiBase<BuiltScreenHandler> {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
this.blockEntity = blockEntity;
}
@Override
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
super.drawBackground(matrixStack, f, mouseX, mouseY);
@ -58,7 +58,7 @@ public class GuiDistillationTower extends GuiBase<BuiltScreenHandler> {
// JEI Button
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
}
@Override
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
super.drawForeground(matrixStack, mouseX, mouseY);
@ -77,7 +77,7 @@ public class GuiDistillationTower extends GuiBase<BuiltScreenHandler> {
}
public void onClick(GuiButtonExtended button, Double x, Double y){
public void onClick(GuiButtonExtended button, Double x, Double y) {
blockEntity.renderMultiblock ^= !hideGuiElements();
}
}

View file

@ -39,7 +39,7 @@ public class GuiGasTurbine extends GuiBase<BuiltScreenHandler> {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
this.blockEntity = blockEntity;
}
@Override
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
super.drawBackground(matrixStack, f, mouseX, mouseY);
@ -48,16 +48,16 @@ public class GuiGasTurbine extends GuiBase<BuiltScreenHandler> {
drawSlot(matrixStack, 25, 55, layer);
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
}
@Override
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
super.drawForeground(matrixStack, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
}
}

View file

@ -32,14 +32,14 @@ import reborncore.client.screen.builder.BuiltScreenHandler;
import techreborn.blockentity.machine.tier1.IndustrialElectrolyzerBlockEntity;
public class GuiIndustrialElectrolyzer extends GuiBase<BuiltScreenHandler> {
IndustrialElectrolyzerBlockEntity blockEntity;
public GuiIndustrialElectrolyzer(int syncID, final PlayerEntity player, final IndustrialElectrolyzerBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
this.blockEntity = blockEntity;
}
@Override
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
super.drawBackground(matrixStack, f, mouseX, mouseY);
@ -54,7 +54,7 @@ public class GuiIndustrialElectrolyzer extends GuiBase<BuiltScreenHandler> {
drawOutputSlotBar(matrixStack, 50, 23, 4, layer);
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
}
@Override
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
super.drawForeground(matrixStack, mouseX, mouseY);
@ -63,6 +63,6 @@ public class GuiIndustrialElectrolyzer extends GuiBase<BuiltScreenHandler> {
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 84, 52, mouseX, mouseY, GuiBuilder.ProgressDirection.UP, layer);
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -49,14 +49,14 @@ public class GuiIronFurnace extends GuiBase<BuiltScreenHandler> {
IronFurnaceBlockEntity blockEntity;
public GuiIronFurnace(int syncID, PlayerEntity player, IronFurnaceBlockEntity furnace) {
super(player, furnace, furnace.createScreenHandler(syncID, player));
super(player, furnace, furnace.createScreenHandler(syncID, player));
this.blockEntity = furnace;
}
public void onClick(){
public void onClick() {
NetworkManager.sendToServer(ServerboundPackets.createPacketExperience(blockEntity));
}
}
@Override
public void init() {
super.init();
@ -87,7 +87,7 @@ public class GuiIronFurnace extends GuiBase<BuiltScreenHandler> {
furnaceExp -= PlayerUtils.getLevelExperience(player.experienceLevel);
++levels;
}
message = message + "+" + String.valueOf(levels) + "L";
message = message + "+" + levels + "L";
}
}
@ -95,17 +95,17 @@ public class GuiIronFurnace extends GuiBase<BuiltScreenHandler> {
list.add(new LiteralText(message));
renderTooltip(matrixStack, list, mouseX, mouseY);
GlStateManager.disableLighting();
GlStateManager.color4f(1, 1, 1, 1);
GlStateManager.color4f(1, 1, 1, 1);
}
@Override
public void renderBg(MatrixStack matrixStack, MinecraftClient mc, int mouseX, int mouseY) {
mc.getItemRenderer().renderInGuiWithOverrides(new ItemStack(Items.EXPERIENCE_BOTTLE), x, y);
}
});
});
}
@Override
protected void drawBackground(MatrixStack matrixStack, float lastFrameDuration, int mouseX, int mouseY) {
super.drawBackground(matrixStack, lastFrameDuration, mouseX, mouseY);
@ -118,7 +118,7 @@ public class GuiIronFurnace extends GuiBase<BuiltScreenHandler> {
drawOutputSlot(matrixStack, 116, 35, layer);
}
@Override
protected void drawForeground(MatrixStack matrixStack, int mouseX, int mouseY) {
super.drawForeground(matrixStack, mouseX, mouseY);

View file

@ -57,15 +57,15 @@ public class GuiMFE extends GuiBase<BuiltScreenHandler> {
super.drawForeground(matrixStack, mouseX, mouseY);
final Layer layer = Layer.FOREGROUND;
if(!hideGuiElements()){
if (!hideGuiElements()) {
RenderSystem.pushMatrix();
RenderSystem.scaled(0.6, 0.6, 1);
drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfe.getEnergy()))
.append("/")
.append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfe.getMaxPower()))
.append(" ")
.append(PowerSystem.getDisplayPower().abbreviation)
drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfe.getEnergy()))
.append("/")
.append(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) mfe.getMaxPower()))
.append(" ")
.append(PowerSystem.getDisplayPower().abbreviation)
, 35, 0, 58, layer);
RenderSystem.popMatrix();

View file

@ -59,9 +59,9 @@ public class GuiManual extends Screen {
@Override
public void init() {
int y = (height / 2) - guiHeight / 2;
y+= 40;
y += 40;
addButton(new GuiButtonExtended((width / 2 - 30), y + 10, 60, 20, new TranslatableText("techreborn.manual.wikibtn"), var1 -> client.openScreen(new ConfirmChatLinkScreen(t -> {
if(t){
if (t) {
Util.getOperatingSystem().open("http://wiki.techreborn.ovh");
this.client.openScreen(this);
} else {
@ -69,14 +69,14 @@ public class GuiManual extends Screen {
}
}, "http://wiki.techreborn.ovh", false))));
addButton(new GuiButtonExtended((width / 2 - 30), y + 60, 60, 20, new TranslatableText("techreborn.manual.discordbtn"), var1 -> client.openScreen(new ConfirmChatLinkScreen(t -> {
if(t){
if (t) {
Util.getOperatingSystem().open("https://discord.gg/teamreborn");
this.client.openScreen(this);
}else {
} else {
this.client.openScreen(this);
}
}, "https://discord.gg/teamreborn", false))));
if(TechRebornConfig.allowManualRefund){
if (TechRebornConfig.allowManualRefund) {
addButton(new GuiButtonExtended((width / 2 - 30), y + 110, 60, 20, new TranslatableText("techreborn.manual.refundbtn"), var1 -> {
NetworkManager.sendToServer(ServerboundPackets.createRefundPacket());
this.client.openScreen(null);

View file

@ -46,7 +46,7 @@ public class GuiMatterFabricator extends GuiBase<BuiltScreenHandler> {
final Layer layer = Layer.BACKGROUND;
drawSlot(matrixStack, 8, 72, layer);
drawSlot(matrixStack, 30, 20, layer);
drawSlot(matrixStack, 50, 20, layer);
drawSlot(matrixStack, 70, 20, layer);

View file

@ -35,7 +35,6 @@ import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
/**
* @author drcrazy
*
*/
@Environment(EnvType.CLIENT)
public class GuiPlasmaGenerator extends GuiBase<BuiltScreenHandler> {
@ -51,7 +50,7 @@ public class GuiPlasmaGenerator extends GuiBase<BuiltScreenHandler> {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
this.blockEntity = blockEntity;
}
@Override
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
super.drawBackground(matrixStack, f, mouseX, mouseY);
@ -60,17 +59,17 @@ public class GuiPlasmaGenerator extends GuiBase<BuiltScreenHandler> {
drawSlot(matrixStack, 25, 55, layer);
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
}
@Override
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
super.drawForeground(matrixStack, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
}
}

View file

@ -38,7 +38,7 @@ public class GuiRollingMachine extends GuiBase<BuiltScreenHandler> {
RollingMachineBlockEntity rollingMachine;
public GuiRollingMachine(int syncID, final PlayerEntity player, final RollingMachineBlockEntity blockEntityRollingmachine) {
super(player, blockEntityRollingmachine, blockEntityRollingmachine.createScreenHandler(syncID, player));
super(player, blockEntityRollingmachine, blockEntityRollingmachine.createScreenHandler(syncID, player));
this.rollingMachine = blockEntityRollingmachine;
}
@ -62,7 +62,7 @@ public class GuiRollingMachine extends GuiBase<BuiltScreenHandler> {
drawOutputSlot(matrixStack, 124, gridYPos + 18, layer);
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
builder.drawLockButton(matrixStack, this, 130, 4, mouseX, mouseY, layer,rollingMachine.locked);
builder.drawLockButton(matrixStack, this, 130, 4, mouseX, mouseY, layer, rollingMachine.locked);
}
@Override
@ -76,7 +76,7 @@ public class GuiRollingMachine extends GuiBase<BuiltScreenHandler> {
@Override
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
if(isPointInRect(130, 4, 20, 12, mouseX, mouseY)){
if (isPointInRect(130, 4, 20, 12, mouseX, mouseY)) {
NetworkManager.sendToServer(ServerboundPackets.createPacketRollingMachineLock(rollingMachine, !rollingMachine.locked));
return true;
}

View file

@ -39,7 +39,7 @@ public class GuiSemifluidGenerator extends GuiBase<BuiltScreenHandler> {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
this.blockEntity = blockEntity;
}
@Override
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
super.drawBackground(matrixStack, f, mouseX, mouseY);
@ -48,16 +48,16 @@ public class GuiSemifluidGenerator extends GuiBase<BuiltScreenHandler> {
drawSlot(matrixStack, 25, 55, layer);
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
}
@Override
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
super.drawForeground(matrixStack, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
}
}

View file

@ -48,16 +48,16 @@ public class GuiThermalGenerator extends GuiBase<BuiltScreenHandler> {
drawSlot(matrixStack, 25, 55, layer);
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
}
@Override
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
super.drawForeground(matrixStack, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxPower(), mouseX, mouseY, 0, layer);
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getCapacity(), blockEntity.tank.isEmpty(), layer);
}
}