TR ui work
This commit is contained in:
parent
4e0ea809c6
commit
027be66230
53 changed files with 659 additions and 661 deletions
|
@ -194,7 +194,7 @@ dependencies {
|
|||
|
||||
include project(":RebornCore")
|
||||
|
||||
optionalClientDependency("me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}", true)
|
||||
optionalClientDependency("me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}", false)
|
||||
|
||||
// Use groovy for datagen/gametest, if you are copying this you prob dont want it.
|
||||
gametestImplementation 'org.apache.groovy:groovy:4.0.10'
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.ClientNetworkManager;
|
||||
|
@ -55,35 +55,35 @@ public class GuiAESU extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
this.drawSlot(matrixStack, 62, 45, layer);
|
||||
this.drawSlot(matrixStack, 98, 45, layer);
|
||||
this.drawArmourSlots(matrixStack, 8, 18, layer);
|
||||
this.builder.drawEnergyOutput(matrixStack, this, 155, 61, this.blockEntity.getCurrentOutput(), layer);
|
||||
this.drawSlot(drawContext, 62, 45, layer);
|
||||
this.drawSlot(drawContext, 98, 45, layer);
|
||||
this.drawArmourSlots(drawContext, 8, 18, layer);
|
||||
this.builder.drawEnergyOutput(drawContext, this, 155, 61, this.blockEntity.getCurrentOutput(), layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
if (!hideGuiElements()) {
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
drawContext.push();
|
||||
drawContext.scale(0.6f, 0.6f, 1.0f);
|
||||
Text text = Text.literal(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getMaxStoredPower()))
|
||||
.append(" ")
|
||||
.append(PowerSystem.getDisplayPower().abbreviation);
|
||||
|
||||
drawCentredText(matrixStack, text, 35, 0, 58, layer);
|
||||
matrixStack.pop();
|
||||
drawCentredText(drawContext, text, 35, 0, 58, layer);
|
||||
drawContext.pop();
|
||||
}
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(int amount) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,25 +41,25 @@ public class GuiAlloyFurnace extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, float lastFrameDuration, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, lastFrameDuration, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, float lastFrameDuration, int mouseX, int mouseY) {
|
||||
super.drawBackground(drawContext, lastFrameDuration, mouseX, mouseY);
|
||||
GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
// Input slots
|
||||
drawSlot(matrixStack, 47, 17, layer);
|
||||
drawSlot(matrixStack, 65, 17, layer);
|
||||
drawSlot(drawContext, 47, 17, layer);
|
||||
drawSlot(drawContext, 65, 17, layer);
|
||||
// Fuel slot
|
||||
drawSlot(matrixStack, 56, 53, layer);
|
||||
drawSlot(drawContext, 56, 53, layer);
|
||||
|
||||
drawOutputSlot(matrixStack, 116, 35, layer);
|
||||
drawOutputSlot(drawContext, 116, 35, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, int mouseX, int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, int mouseX, int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 85, 36, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawBurnBar(matrixStack, this, blockEntity.getBurnTimeRemainingScaled(100), 100, 56, 36, mouseX, mouseY, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 85, 36, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawBurnBar(drawContext, this, blockEntity.getBurnTimeRemainingScaled(100), 100, 56, 36, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -42,26 +42,26 @@ public class GuiAlloySmelter extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 34, 47, layer);
|
||||
drawSlot(matrixStack, 126, 47, layer);
|
||||
drawOutputSlot(matrixStack, 80, 47, layer);
|
||||
drawSlot(drawContext, 34, 47, layer);
|
||||
drawSlot(drawContext, 126, 47, layer);
|
||||
drawOutputSlot(drawContext, 80, 47, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,28 +41,28 @@ public class GuiAssemblingMachine extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float partialTicks, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float partialTicks, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, partialTicks, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
// Input slots
|
||||
drawSlot(matrixStack, 55, 35, layer);
|
||||
drawSlot(matrixStack, 55, 55, layer);
|
||||
drawSlot(drawContext, 55, 35, layer);
|
||||
drawSlot(drawContext, 55, 55, layer);
|
||||
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
drawOutputSlot(drawContext, 101, 45, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.recipe.CraftingRecipe;
|
||||
|
@ -51,38 +51,38 @@ public class GuiAutoCrafting extends GuiBase<BuiltScreenHandler> {
|
|||
this.blockEntityAutoCraftingTable = blockEntity;
|
||||
}
|
||||
|
||||
public void renderItemStack(MatrixStack matrixStack, ItemStack stack, int x, int y) {
|
||||
MinecraftClient.getInstance().getItemRenderer().renderInGuiWithOverrides(matrixStack, stack, x, y);
|
||||
public void renderItemStack(DrawContext drawContext, ItemStack stack, int x, int y) {
|
||||
drawContext.drawItem(stack, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, int mouseX, int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, int mouseX, int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
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.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntityAutoCraftingTable.getProgress(), blockEntityAutoCraftingTable.getMaxProgress(), 120, 44, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 26, (int) blockEntityAutoCraftingTable.getEnergy(), (int) blockEntityAutoCraftingTable.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, int mouseX, int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
drawSlot(matrixStack, 28 + (i * 18), 25 + (j * 18), layer);
|
||||
drawSlot(drawContext, 28 + (i * 18), 25 + (j * 18), layer);
|
||||
}
|
||||
}
|
||||
drawOutputSlot(matrixStack, 95, 42, layer);
|
||||
drawOutputSlot(matrixStack, 145, 42, layer);
|
||||
drawOutputSlot(matrixStack, 145, 70, layer);
|
||||
drawOutputSlot(drawContext, 95, 42, layer);
|
||||
drawOutputSlot(drawContext, 145, 42, layer);
|
||||
drawOutputSlot(drawContext, 145, 70, layer);
|
||||
|
||||
CraftingRecipe recipe = blockEntityAutoCraftingTable.getCurrentRecipe();
|
||||
if (recipe != null) {
|
||||
renderItemStack(matrixStack, recipe.getOutput(getMachine().getWorld().getRegistryManager()), 95 + getGuiLeft(), 42 + getGuiTop());
|
||||
renderItemStack(drawContext, recipe.getOutput(getMachine().getWorld().getRegistryManager()), 95 + getGuiLeft(), 42 + getGuiTop());
|
||||
}
|
||||
|
||||
builder.drawLockButton(matrixStack, this, 145, 4, mouseX, mouseY, layer, blockEntityAutoCraftingTable.locked);
|
||||
builder.drawLockButton(drawContext, this, 145, 4, mouseX, mouseY, layer, blockEntityAutoCraftingTable.locked);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
|
@ -42,30 +42,30 @@ public class GuiBatbox extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 62, 45, layer);
|
||||
drawSlot(matrixStack, 98, 45, layer);
|
||||
drawSlot(drawContext, 62, 45, layer);
|
||||
drawSlot(drawContext, 98, 45, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
if (!hideGuiElements()) {
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
drawContext.push();
|
||||
drawContext.scale(0.6f, 0.6f, 1.0f);
|
||||
Text text = Text.literal(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPower(blockEntity.getMaxStoredPower()));
|
||||
|
||||
drawCentredText(matrixStack, text, 35, 0, 58, layer);
|
||||
matrixStack.pop();
|
||||
drawCentredText(drawContext, text, 35, 0, 58, layer);
|
||||
drawContext.pop();
|
||||
}
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
|
@ -49,41 +49,41 @@ public class GuiBlastFurnace extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
this.hasMultiBlock = this.blockEntity.getCachedHeat() != 0;
|
||||
|
||||
final GuiBase.Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 50, 27, layer);
|
||||
drawSlot(matrixStack, 50, 47, layer);
|
||||
drawOutputSlotBar(matrixStack, 92, 36, 2, layer);
|
||||
drawSlot(drawContext, 50, 27, layer);
|
||||
drawSlot(drawContext, 50, 47, layer);
|
||||
drawOutputSlotBar(drawContext, 92, 36, 2, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
if (hasMultiBlock) {
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 6, 4, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
this.hasMultiBlock = blockEntity.getCachedHeat() != 0;
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
|
||||
builder.drawBigHeatBar(matrixStack, this, 31, 71, blockEntity.getCachedHeat(), 3230, layer);
|
||||
builder.drawBigHeatBar(drawContext, this, 31, 71, blockEntity.getCachedHeat(), 3230, layer);
|
||||
if (hasMultiBlock) {
|
||||
addHologramButton(4, 4, 212, layer).clickHandler(this::onClick);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
builder.drawMultiblockMissingBar(drawContext, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(GuiButtonExtended button, Double x, Double y) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
|
@ -41,28 +41,28 @@ public class GuiBlockBreaker extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
BlockBreakerProcessor processor = blockEntity.getProcessor();
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawCentredText(matrixStack, blockEntity.getProcessor().getStatusEnum().getText(), 25, processor.getStatusEnum().getColor(), layer);
|
||||
drawCentredText(drawContext, blockEntity.getProcessor().getStatusEnum().getText(), 25, processor.getStatusEnum().getColor(), layer);
|
||||
|
||||
drawCentredText(matrixStack, processor.getStatusEnum().getProgressText(processor.getProgress()), 40, processor.getStatusEnum().getColor(), layer);
|
||||
drawCentredText(drawContext, processor.getStatusEnum().getProgressText(processor.getProgress()), 40, processor.getStatusEnum().getColor(), layer);
|
||||
|
||||
drawOutputSlot(matrixStack, 80, 60, layer);
|
||||
drawOutputSlot(drawContext, 80, 60, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
|
@ -41,28 +41,28 @@ public class GuiBlockPlacer extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
BlockPlacerProcessor processor = blockEntity.getProcessor();
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawCentredText(matrixStack, blockEntity.getProcessor().getStatusEnum().getText(), 25, processor.getStatusEnum().getColor(), layer);
|
||||
drawCentredText(drawContext, blockEntity.getProcessor().getStatusEnum().getText(), 25, processor.getStatusEnum().getColor(), layer);
|
||||
|
||||
drawCentredText(matrixStack, processor.getStatusEnum().getProgressText(processor.getProgress()), 40, processor.getStatusEnum().getColor(), layer);
|
||||
drawCentredText(drawContext, processor.getStatusEnum().getProgressText(processor.getProgress()), 40, processor.getStatusEnum().getColor(), layer);
|
||||
|
||||
drawSlot(matrixStack, 80, 60, layer);
|
||||
drawSlot(drawContext, 80, 60, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,29 +41,29 @@ public class GuiCentrifuge extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 40, 34, layer);
|
||||
drawSlot(matrixStack, 40, 54, layer);
|
||||
drawSlot(drawContext, 40, 34, layer);
|
||||
drawSlot(drawContext, 40, 54, layer);
|
||||
|
||||
drawSlot(matrixStack, 82, 44, layer);
|
||||
drawSlot(matrixStack, 101, 25, layer);
|
||||
drawSlot(matrixStack, 120, 44, layer);
|
||||
drawSlot(matrixStack, 101, 63, layer);
|
||||
drawSlot(drawContext, 82, 44, layer);
|
||||
drawSlot(drawContext, 101, 25, layer);
|
||||
drawSlot(drawContext, 120, 44, layer);
|
||||
drawSlot(drawContext, 101, 63, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 61, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 61, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
|
@ -40,23 +40,23 @@ public class GuiChargeBench extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 62, 25, layer);
|
||||
drawSlot(matrixStack, 98, 25, layer);
|
||||
drawSlot(matrixStack, 62, 45, layer);
|
||||
drawSlot(matrixStack, 98, 45, layer);
|
||||
drawSlot(matrixStack, 62, 65, layer);
|
||||
drawSlot(matrixStack, 98, 65, layer);
|
||||
drawSlot(drawContext, 62, 25, layer);
|
||||
drawSlot(drawContext, 98, 25, layer);
|
||||
drawSlot(drawContext, 62, 45, layer);
|
||||
drawSlot(drawContext, 98, 45, layer);
|
||||
drawSlot(drawContext, 62, 65, layer);
|
||||
drawSlot(drawContext, 98, 65, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,26 +41,26 @@ public class GuiChemicalReactor extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 34, 47, layer);
|
||||
drawSlot(matrixStack, 126, 47, layer);
|
||||
drawOutputSlot(matrixStack, 80, 47, layer);
|
||||
drawSlot(drawContext, 34, 47, layer);
|
||||
drawSlot(drawContext, 126, 47, layer);
|
||||
drawOutputSlot(drawContext, 80, 47, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.ClientChunkManager;
|
||||
|
@ -60,15 +60,15 @@ public class GuiChunkLoader extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(drawContext, partialTicks, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
if (hideGuiElements()) return;
|
||||
|
||||
Text text = Text.literal("Radius: ")
|
||||
.append(String.valueOf(blockEntity.getRadius()));
|
||||
drawCentredText(matrixStack, text, 25, 4210752, layer);
|
||||
drawCentredText(drawContext, text, 25, 4210752, layer);
|
||||
}
|
||||
|
||||
public void onClick(int amount) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,24 +41,24 @@ public class GuiCompressor extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
drawSlot(drawContext, 55, 45, layer);
|
||||
drawOutputSlot(drawContext, 101, 45, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
this.builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
this.builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
this.builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
this.builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,23 +41,23 @@ public class GuiDieselGenerator extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
drawSlot(matrixStack, 25, 35, layer);
|
||||
drawSlot(matrixStack, 25, 55, layer);
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
drawSlot(drawContext, 25, 35, layer);
|
||||
drawSlot(drawContext, 25, 55, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, 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.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(drawContext, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
|
@ -42,35 +42,35 @@ public class GuiDistillationTower extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = Layer.BACKGROUND;
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
// Input slots
|
||||
drawSlot(matrixStack, 35, 27, layer);
|
||||
drawSlot(matrixStack, 35, 47, layer);
|
||||
drawSlot(drawContext, 35, 27, layer);
|
||||
drawSlot(drawContext, 35, 47, layer);
|
||||
// Four output slots
|
||||
drawOutputSlotBar(matrixStack, 78, 36, 4, layer);
|
||||
drawOutputSlotBar(drawContext, 78, 36, 4, layer);
|
||||
// JEI Button
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 55, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 6, 4, mouseX, mouseY, layer);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
builder.drawMultiblockMissingBar(drawContext, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(GuiButtonExtended button, Double x, Double y) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,24 +41,24 @@ public class GuiElectricFurnace extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(drawContext, partialTicks, mouseX, mouseY);
|
||||
Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
drawSlot(drawContext, 55, 45, layer);
|
||||
drawOutputSlot(drawContext, 101, 45, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, int mouseX, int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, int mouseX, int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
|
@ -40,11 +40,11 @@ public class GuiElevator extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,24 +41,24 @@ public class GuiExtractor extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
drawSlot(drawContext, 55, 45, layer);
|
||||
drawOutputSlot(drawContext, 101, 45, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
|
@ -40,28 +40,28 @@ public class GuiFishingStation extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
int gridYPos = 22;
|
||||
drawSlot(matrixStack, 30, gridYPos, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos, layer);
|
||||
drawSlot(matrixStack, 30, gridYPos + 18, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos + 18, layer);
|
||||
drawSlot(matrixStack, 30, gridYPos + 36, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos + 36, layer);
|
||||
drawSlot(drawContext, 30, gridYPos, layer);
|
||||
drawSlot(drawContext, 48, gridYPos, layer);
|
||||
drawSlot(drawContext, 30, gridYPos + 18, layer);
|
||||
drawSlot(drawContext, 48, gridYPos + 18, layer);
|
||||
drawSlot(drawContext, 30, gridYPos + 36, layer);
|
||||
drawSlot(drawContext, 48, gridYPos + 36, layer);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
|
@ -45,39 +45,39 @@ public class GuiFluidReplicator extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
// Input slot
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
drawSlot(drawContext, 55, 45, layer);
|
||||
// Liquid input slot
|
||||
drawSlot(matrixStack, 124, 35, layer);
|
||||
drawSlot(drawContext, 124, 35, layer);
|
||||
// Liquid output slot
|
||||
drawSlot(matrixStack, 124, 55, layer);
|
||||
drawSlot(drawContext, 124, 55, layer);
|
||||
// JEI button
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 6, 4, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawTank(matrixStack, this, 99, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawTank(drawContext, this, 99, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
builder.drawMultiblockMissingBar(drawContext, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
// GuiScreen
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
@ -63,59 +63,59 @@ public class GuiFusionReactor extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float partialTicks, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float partialTicks, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, partialTicks, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 34, 47, layer);
|
||||
drawSlot(matrixStack, 126, 47, layer);
|
||||
drawOutputSlot(matrixStack, 80, 47, layer);
|
||||
drawSlot(drawContext, 34, 47, layer);
|
||||
drawSlot(drawContext, 126, 47, layer);
|
||||
drawOutputSlot(drawContext, 80, 47, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 6, 4, mouseX, mouseY, layer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
addHologramButton(6, 4, 212, layer).clickHandler(this::hologramToggle);
|
||||
drawCentredText(matrixStack, blockEntity.getStateText(), 20, Color.BLUE.darker().getColor(), layer);
|
||||
drawCentredText(drawContext, blockEntity.getStateText(), 20, Color.BLUE.darker().getColor(), layer);
|
||||
if (blockEntity.state == 2) {
|
||||
drawCentredText(matrixStack, Text.literal(PowerSystem.getLocalizedPower(blockEntity.getPowerChange())).append("/t"), 30, Color.GREEN.darker().getColor(), layer);
|
||||
drawCentredText(drawContext, Text.literal(PowerSystem.getLocalizedPower(blockEntity.getPowerChange())).append("/t"), 30, Color.GREEN.darker().getColor(), layer);
|
||||
}
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
builder.drawMultiblockMissingBar(drawContext, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::hologramToggle);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 76, 56, mouseX, mouseY, layer);
|
||||
|
||||
Optional<Pair<Integer, Integer>> stackSize = getCoilStackCount();
|
||||
if (stackSize.isPresent()) {
|
||||
if (stackSize.get().getLeft() > 0) {
|
||||
|
||||
drawCentredText(matrixStack,
|
||||
drawCentredText(drawContext,
|
||||
Text.literal("Required Coils: ")
|
||||
.append(String.valueOf(stackSize.get().getLeft()))
|
||||
.append("x64 +")
|
||||
.append(String.valueOf(stackSize.get().getRight()))
|
||||
, 25, 0xFFFFFF, layer);
|
||||
} else {
|
||||
drawCentredText(matrixStack, Text.literal("Required Coils: ").append(String.valueOf(stackSize.get().getRight())), 25, 0xFFFFFF, layer);
|
||||
drawCentredText(drawContext, Text.literal("Required Coils: ").append(String.valueOf(stackSize.get().getRight())), 25, 0xFFFFFF, layer);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
drawTextWithShadow(matrixStack, this.textRenderer, Text.literal("Size: ").append(String.valueOf(blockEntity.size)), 83, 81, 0xFFFFFF);
|
||||
drawTextWithShadow(matrixStack, this.textRenderer, Text.literal(String.valueOf(blockEntity.getPowerMultiplier())).append("x"), 10, 81, 0xFFFFFF);
|
||||
drawTextWithShadow(drawContext, this.textRenderer, Text.literal("Size: ").append(String.valueOf(blockEntity.size)), 83, 81, 0xFFFFFF);
|
||||
drawTextWithShadow(drawContext, this.textRenderer, Text.literal(String.valueOf(blockEntity.getPowerMultiplier())).append("x"), 10, 81, 0xFFFFFF);
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, this.blockEntity.getEnergy(), this.blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, this.blockEntity.getEnergy(), this.blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void hologramToggle(GuiButtonExtended button, double x, double y) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,23 +41,23 @@ public class GuiGasTurbine extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
drawSlot(matrixStack, 25, 35, layer);
|
||||
drawSlot(matrixStack, 25, 55, layer);
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
drawSlot(drawContext, 25, 35, layer);
|
||||
drawSlot(drawContext, 25, 55, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, 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.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(drawContext, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
|
@ -40,23 +40,23 @@ public class GuiGenerator extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 80, 54, layer);
|
||||
drawSlot(drawContext, 80, 54, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawBurnBar(matrixStack, this, blockEntity.getScaledBurnTime(100), 100, 81, 38, mouseX, mouseY, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawBurnBar(drawContext, this, blockEntity.getScaledBurnTime(100), 100, 81, 38, mouseX, mouseY, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ package techreborn.client.gui;
|
|||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
@ -49,44 +49,44 @@ public class GuiGreenhouseController extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
int gridYPos = 22;
|
||||
drawSlot(matrixStack, 30, gridYPos, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos, layer);
|
||||
drawSlot(matrixStack, 30, gridYPos + 18, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos + 18, layer);
|
||||
drawSlot(matrixStack, 30, gridYPos + 36, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos + 36, layer);
|
||||
drawSlot(drawContext, 30, gridYPos, layer);
|
||||
drawSlot(drawContext, 48, gridYPos, layer);
|
||||
drawSlot(drawContext, 30, gridYPos + 18, layer);
|
||||
drawSlot(drawContext, 48, gridYPos + 18, layer);
|
||||
drawSlot(drawContext, 30, gridYPos + 36, layer);
|
||||
drawSlot(drawContext, 48, gridYPos + 36, layer);
|
||||
|
||||
if (!blockEntity.isMultiblockValid()) {
|
||||
RenderSystem.setShaderTexture(0, new Identifier("techreborn", "textures/item/part/digital_display.png"));
|
||||
drawTexture(matrixStack, x + 68, y + 22, 0, 0, 16, 16, 16, 16);
|
||||
drawTexture(drawContext, x + 68, y + 22, 0, 0, 16, 16, 16, 16);
|
||||
if (isPointInRect(68, 22, 16, 16, mouseX, mouseY)) {
|
||||
List<Text> list = Arrays.stream(I18n.translate("techreborn.tooltip.greenhouse.upgrade_available")
|
||||
.split("\\r?\\n"))
|
||||
.map(Text::literal)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
matrixStack.push();
|
||||
renderTooltip(matrixStack, list, mouseX, mouseY);
|
||||
matrixStack.pop();
|
||||
drawContext.push();
|
||||
renderTooltip(drawContext, list, mouseX, mouseY);
|
||||
drawContext.pop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
addHologramButton(90, 24, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 90, 24, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 90, 24, mouseX, mouseY, layer);
|
||||
|
||||
if (!blockEntity.isMultiblockValid()) {
|
||||
if (isPointInRect(68, 22, 16, 16, mouseX, mouseY)) {
|
||||
|
@ -95,13 +95,13 @@ public class GuiGreenhouseController extends GuiBase<BuiltScreenHandler> {
|
|||
.map(Text::literal)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
matrixStack.push();
|
||||
renderTooltip(matrixStack, list, mouseX - getGuiLeft(), mouseY - getGuiTop());
|
||||
matrixStack.pop();
|
||||
drawContext.push();
|
||||
renderTooltip(drawContext, list, mouseX - getGuiLeft(), mouseY - getGuiTop());
|
||||
drawContext.pop();
|
||||
}
|
||||
}
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(GuiButtonExtended button, Double x, Double y) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -40,24 +40,24 @@ public class GuiGrinder extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
drawSlot(drawContext, 55, 45, layer);
|
||||
drawOutputSlot(drawContext, 101, 45, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
|
@ -42,22 +42,22 @@ public class GuiIDSU extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 62, 45, layer);
|
||||
drawSlot(matrixStack, 98, 45, layer);
|
||||
drawArmourSlots(matrixStack, 8, 18, layer);
|
||||
drawSlot(drawContext, 62, 45, layer);
|
||||
drawSlot(drawContext, 98, 45, layer);
|
||||
drawArmourSlots(drawContext, 8, 18, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
drawContext.push();
|
||||
drawContext.scale(0.6f, 0.6f, 1.0f);
|
||||
|
||||
Text text = Text.literal(PowerSystem.getLocalizedPowerNoSuffix(idsu.getEnergy()))
|
||||
.append("/")
|
||||
|
@ -65,10 +65,10 @@ public class GuiIDSU extends GuiBase<BuiltScreenHandler> {
|
|||
.append(" ")
|
||||
.append(PowerSystem.getDisplayPower().abbreviation);
|
||||
|
||||
drawCentredText(matrixStack, text, 35, 0, 58, layer);
|
||||
matrixStack.pop();
|
||||
drawCentredText(drawContext, text, 35, 0, 58, layer);
|
||||
drawContext.pop();
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) idsu.getEnergy(), (int) idsu.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 81, 28, (int) idsu.getEnergy(), (int) idsu.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
|
@ -42,38 +42,38 @@ public class GuiImplosionCompressor extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 50, 27, layer);
|
||||
drawSlot(matrixStack, 50, 47, layer);
|
||||
drawSlot(matrixStack, 92, 36, layer);
|
||||
drawSlot(matrixStack, 110, 36, layer);
|
||||
drawSlot(drawContext, 50, 27, layer);
|
||||
drawSlot(drawContext, 50, 47, layer);
|
||||
drawSlot(drawContext, 92, 36, layer);
|
||||
drawSlot(drawContext, 110, 36, layer);
|
||||
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 6, 4, mouseX, mouseY, layer);
|
||||
}
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
builder.drawMultiblockMissingBar(drawContext, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(GuiButtonExtended button, Double mouseX, Double mouseY) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,27 +41,27 @@ public class GuiIndustrialElectrolyzer extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
//Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
//Input slots
|
||||
drawSlot(matrixStack, 47, 72, layer);
|
||||
drawSlot(matrixStack, 81, 72, layer);
|
||||
drawSlot(drawContext, 47, 72, layer);
|
||||
drawSlot(drawContext, 81, 72, layer);
|
||||
//Output slots
|
||||
drawOutputSlotBar(matrixStack, 50, 23, 4, layer);
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
drawOutputSlotBar(drawContext, 50, 23, 4, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
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.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 84, 52, mouseX, mouseY, GuiBuilder.ProgressDirection.UP, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
|
@ -42,45 +42,45 @@ public class GuiIndustrialGrinder extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
// Liquid input slot
|
||||
drawSlot(matrixStack, 34, 35, layer);
|
||||
drawSlot(drawContext, 34, 35, layer);
|
||||
// Liquid output slot
|
||||
drawSlot(matrixStack, 34, 55, layer);
|
||||
drawSlot(drawContext, 34, 55, layer);
|
||||
// Solid material input slot
|
||||
drawSlot(matrixStack, 84, 43, layer);
|
||||
drawSlot(drawContext, 84, 43, layer);
|
||||
// Output slots
|
||||
drawSlot(matrixStack, 126, 18, layer);
|
||||
drawSlot(matrixStack, 126, 36, layer);
|
||||
drawSlot(matrixStack, 126, 54, layer);
|
||||
drawSlot(matrixStack, 126, 72, layer);
|
||||
drawSlot(drawContext, 126, 18, layer);
|
||||
drawSlot(drawContext, 126, 36, layer);
|
||||
drawSlot(drawContext, 126, 54, layer);
|
||||
drawSlot(drawContext, 126, 72, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 6, 4, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawTank(matrixStack, this, 53, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawTank(drawContext, this, 53, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
builder.drawMultiblockMissingBar(drawContext, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(GuiButtonExtended button, double mouseX, double mouseY) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
|
@ -42,44 +42,44 @@ public class GuiIndustrialSawmill extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float partialTicks, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float partialTicks, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, partialTicks, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
// Liquid input slot
|
||||
drawSlot(matrixStack, 34, 35, layer);
|
||||
drawSlot(drawContext, 34, 35, layer);
|
||||
// Liquid output slot
|
||||
drawSlot(matrixStack, 34, 55, layer);
|
||||
drawSlot(drawContext, 34, 55, layer);
|
||||
// Solid material input slot
|
||||
drawSlot(matrixStack, 84, 43, layer);
|
||||
drawSlot(drawContext, 84, 43, layer);
|
||||
// Output slots
|
||||
drawSlot(matrixStack, 126, 25, layer);
|
||||
drawSlot(matrixStack, 126, 43, layer);
|
||||
drawSlot(matrixStack, 126, 61, layer);
|
||||
drawSlot(drawContext, 126, 25, layer);
|
||||
drawSlot(drawContext, 126, 43, layer);
|
||||
drawSlot(drawContext, 126, 61, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 6, 4, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawTank(matrixStack, this, 53, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawTank(drawContext, this, 53, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
builder.drawMultiblockMissingBar(drawContext, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(GuiButtonExtended button, Double mouseX, Double mouseY) {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.widget.TexturedButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
@ -100,24 +100,24 @@ public class GuiIronFurnace extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, float lastFrameDuration, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, lastFrameDuration, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, float lastFrameDuration, int mouseX, int mouseY) {
|
||||
super.drawBackground(drawContext, lastFrameDuration, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
// Input slot
|
||||
drawSlot(matrixStack, 56, 17, layer);
|
||||
drawSlot(drawContext, 56, 17, layer);
|
||||
// Fuel slot
|
||||
drawSlot(matrixStack, 56, 53, layer);
|
||||
drawSlot(drawContext, 56, 53, layer);
|
||||
|
||||
drawOutputSlot(matrixStack, 116, 35, layer);
|
||||
drawOutputSlot(drawContext, 116, 35, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, int mouseX, int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, int mouseX, int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 85, 36, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawBurnBar(matrixStack, this, blockEntity.getBurnTimeRemainingScaled(100), 100, 56, 36, mouseX, mouseY, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 85, 36, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawBurnBar(drawContext, this, blockEntity.getBurnTimeRemainingScaled(100), 100, 56, 36, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
|
@ -42,30 +42,30 @@ public class GuiLESU extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 62, 45, layer);
|
||||
drawSlot(matrixStack, 98, 45, layer);
|
||||
drawArmourSlots(matrixStack, 8, 18, layer);
|
||||
drawSlot(drawContext, 62, 45, layer);
|
||||
drawSlot(drawContext, 98, 45, layer);
|
||||
drawArmourSlots(drawContext, 8, 18, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
drawCentredText(matrixStack, Text.literal(PowerSystem.getLocalizedPowerNoSuffix( blockEntity.getEnergy()))
|
||||
drawContext.push();
|
||||
drawContext.scale(0.6f, 0.6f, 1.0f);
|
||||
drawCentredText(drawContext, Text.literal(PowerSystem.getLocalizedPowerNoSuffix( blockEntity.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getMaxStoredPower()))
|
||||
.append(" ")
|
||||
.append(PowerSystem.getDisplayPower().abbreviation),
|
||||
35, 0, 58, layer);
|
||||
matrixStack.pop();
|
||||
drawContext.pop();
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.ClientNetworkManager;
|
||||
|
@ -58,22 +58,22 @@ public class GuiLaunchpad extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(drawContext, partialTicks, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
if (hideGuiElements()) return;
|
||||
|
||||
Text text = Text.literal("Launch Speed: ").append(Text.translatable(blockEntity.selectedTranslationKey()));
|
||||
drawCentredText(matrixStack, text, 25, 4210752, layer);
|
||||
drawCentredText(drawContext, text, 25, 4210752, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
|
@ -42,32 +42,32 @@ public class GuiMFE extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 62, 45, layer);
|
||||
drawSlot(matrixStack, 98, 45, layer);
|
||||
drawArmourSlots(matrixStack, 8, 18, layer);
|
||||
drawSlot(drawContext, 62, 45, layer);
|
||||
drawSlot(drawContext, 98, 45, layer);
|
||||
drawArmourSlots(drawContext, 8, 18, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
if (!hideGuiElements()) {
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
drawContext.push();
|
||||
drawContext.scale(0.6f, 0.6f, 1.0f);
|
||||
|
||||
drawCentredText(matrixStack, Text.literal(PowerSystem.getLocalizedPowerNoSuffix(mfe.getEnergy()))
|
||||
drawCentredText(drawContext, Text.literal(PowerSystem.getLocalizedPowerNoSuffix(mfe.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPower(mfe.getMaxStoredPower()))
|
||||
, 35, 0, 58, layer);
|
||||
|
||||
matrixStack.pop();
|
||||
drawContext.pop();
|
||||
}
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) mfe.getEnergy(), (int) mfe.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 81, 28, (int) mfe.getEnergy(), (int) mfe.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
|
@ -42,25 +42,25 @@ public class GuiMFSU extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 62, 45, layer);
|
||||
drawSlot(matrixStack, 98, 45, layer);
|
||||
drawArmourSlots(matrixStack, 8, 18, layer);
|
||||
drawSlot(drawContext, 62, 45, layer);
|
||||
drawSlot(drawContext, 98, 45, layer);
|
||||
drawArmourSlots(drawContext, 8, 18, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
drawCentredText(matrixStack, Text.literal(PowerSystem.getLocalizedPowerNoSuffix(mfsu.getEnergy()) + "/" + PowerSystem.getLocalizedPower(mfsu.getMaxStoredPower())), 35, 0, 58, layer);
|
||||
matrixStack.pop();
|
||||
drawContext.push();
|
||||
drawContext.scale(0.6f, 0.6f, 1.0f);
|
||||
drawCentredText(drawContext, Text.literal(PowerSystem.getLocalizedPowerNoSuffix(mfsu.getEnergy()) + "/" + PowerSystem.getLocalizedPower(mfsu.getMaxStoredPower())), 35, 0, 58, layer);
|
||||
drawContext.pop();
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) mfsu.getEnergy(), (int) mfsu.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 81, 28, (int) mfsu.getEnergy(), (int) mfsu.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ package techreborn.client.gui;
|
|||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.gui.screen.ConfirmLinkScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Util;
|
||||
|
@ -77,20 +77,18 @@ public class GuiManual extends Screen {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
|
||||
renderBackground(matrixStack);
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.setShaderTexture(0, MANUAL_TEXTURE);
|
||||
public void render(DrawContext drawContext, int mouseX, int mouseY, float partialTicks) {
|
||||
renderBackground(drawContext);
|
||||
int centerX = (width / 2) - guiWidth / 2;
|
||||
int centerY = (height / 2) - guiHeight / 2;
|
||||
drawTexture(matrixStack, centerX, centerY, 0, 0, guiWidth, guiHeight);
|
||||
drawContext.drawTexture(MANUAL_TEXTURE, centerX, centerY, 0, 0, guiWidth, guiHeight);
|
||||
|
||||
textRenderer.draw(matrixStack, text1, (float) ((width / 2) - textRenderer.getWidth(text1) / 2), centerY + 40, 4210752);
|
||||
textRenderer.draw(matrixStack, text2, (float) ((width / 2) - textRenderer.getWidth(text2) / 2), centerY + 90, 4210752);
|
||||
drawContext.drawText(textRenderer, text1, (float) ((width / 2) - textRenderer.getWidth(text1) / 2), centerY + 40, 4210752);
|
||||
drawContext.drawText(textRenderer, text2, (float) ((width / 2) - textRenderer.getWidth(text2) / 2), centerY + 90, 4210752);
|
||||
if (TechRebornConfig.allowManualRefund) {
|
||||
textRenderer.draw(matrixStack, text3, (float) ((width / 2) - textRenderer.getWidth(text3) / 2), centerY + 140, 4210752);
|
||||
drawContext.drawText(textRenderer, text3, (float) ((width / 2) - textRenderer.getWidth(text3) / 2), centerY + 140, 4210752);
|
||||
}
|
||||
|
||||
super.render(matrixStack, mouseX, mouseY, partialTicks);
|
||||
super.render(drawContext, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,28 +41,28 @@ public class GuiMatterFabricator extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 30, 20, layer);
|
||||
drawSlot(matrixStack, 50, 20, layer);
|
||||
drawSlot(matrixStack, 70, 20, layer);
|
||||
drawSlot(matrixStack, 90, 20, layer);
|
||||
drawSlot(matrixStack, 110, 20, layer);
|
||||
drawSlot(matrixStack, 130, 20, layer);
|
||||
drawOutputSlotBar(matrixStack, 39, 65, 5, layer);
|
||||
drawSlot(drawContext, 30, 20, layer);
|
||||
drawSlot(drawContext, 50, 20, layer);
|
||||
drawSlot(drawContext, 70, 20, layer);
|
||||
drawSlot(drawContext, 90, 20, layer);
|
||||
drawSlot(drawContext, 110, 20, layer);
|
||||
drawSlot(drawContext, 130, 20, layer);
|
||||
drawOutputSlotBar(drawContext, 39, 65, 5, layer);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 83, 41, mouseX, mouseY, GuiBuilder.ProgressDirection.DOWN, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 83, 41, mouseX, mouseY, GuiBuilder.ProgressDirection.DOWN, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -44,23 +44,23 @@ public class GuiPlasmaGenerator extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
drawSlot(matrixStack, 25, 35, layer);
|
||||
drawSlot(matrixStack, 25, 55, layer);
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
drawSlot(drawContext, 25, 35, layer);
|
||||
drawSlot(drawContext, 25, 55, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, 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.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(drawContext, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.ClientNetworkManager;
|
||||
|
@ -58,22 +58,22 @@ public class GuiPlayerDetector extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(drawContext, partialTicks, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
if (hideGuiElements()) return;
|
||||
|
||||
Text text = Text.literal("Radius: ").append(String.valueOf(blockEntity.getCurrentRadius()));
|
||||
drawCentredText(matrixStack, text, 25, 4210752, layer);
|
||||
drawCentredText(drawContext, text, 25, 4210752, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.ClientNetworkManager;
|
||||
|
@ -67,34 +67,34 @@ public class GuiPump extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float partialTicks, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float partialTicks, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, partialTicks, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
if (hideGuiElements()) return;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer); // Battery slot
|
||||
drawSlot(drawContext, 8, 72, layer); // Battery slot
|
||||
|
||||
drawText(matrixStack,
|
||||
drawText(drawContext,
|
||||
Text.translatable("gui.techreborn.pump.depth", Integer.toString(PumpBlockEntity.MIN_DEPTH), Integer.toString(PumpBlockEntity.MAX_DEPTH))
|
||||
.append(Integer.toString(blockEntity.getDepth())),
|
||||
80, 20, 0x404040, layer);
|
||||
drawText(matrixStack,
|
||||
drawText(drawContext,
|
||||
Text.translatable("gui.techreborn.pump.range", Integer.toString(PumpBlockEntity.MIN_RANGE), Integer.toString(PumpBlockEntity.MAX_RANGE))
|
||||
.append(Integer.toString(blockEntity.getRange())),
|
||||
80, 45, 0x404040, layer);
|
||||
|
||||
if (blockEntity.getExhausted()) {
|
||||
drawText(matrixStack, Text.translatable("gui.techreborn.pump.exhausted"), 80, 75, 0x800000, layer);
|
||||
drawText(drawContext, Text.translatable("gui.techreborn.pump.exhausted"), 80, 75, 0x800000, layer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawTank(matrixStack, this, 33, 25, mouseX, mouseY, blockEntity.getTank().getFluidInstance(), blockEntity.getTank().getFluidValueCapacity(), blockEntity.getTank().isEmpty(), layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(drawContext, this, 33, 25, mouseX, mouseY, blockEntity.getTank().getFluidInstance(), blockEntity.getTank().getFluidValueCapacity(), blockEntity.getTank().isEmpty(), layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,24 +41,24 @@ public class GuiRecycler extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
// Input
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
drawSlot(drawContext, 55, 45, layer);
|
||||
// Output
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
drawOutputSlot(drawContext, 101, 45, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.ClientNetworkManager;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
|
@ -43,35 +43,35 @@ public class GuiRollingMachine extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
int gridYPos = 22;
|
||||
drawSlot(matrixStack, 30, gridYPos, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos, layer);
|
||||
drawSlot(matrixStack, 66, gridYPos, layer);
|
||||
drawSlot(matrixStack, 30, gridYPos + 18, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos + 18, layer);
|
||||
drawSlot(matrixStack, 66, gridYPos + 18, layer);
|
||||
drawSlot(matrixStack, 30, gridYPos + 36, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos + 36, layer);
|
||||
drawSlot(matrixStack, 66, gridYPos + 36, layer);
|
||||
drawSlot(drawContext, 30, gridYPos, layer);
|
||||
drawSlot(drawContext, 48, gridYPos, layer);
|
||||
drawSlot(drawContext, 66, gridYPos, layer);
|
||||
drawSlot(drawContext, 30, gridYPos + 18, layer);
|
||||
drawSlot(drawContext, 48, gridYPos + 18, layer);
|
||||
drawSlot(drawContext, 66, gridYPos + 18, layer);
|
||||
drawSlot(drawContext, 30, gridYPos + 36, layer);
|
||||
drawSlot(drawContext, 48, gridYPos + 36, layer);
|
||||
drawSlot(drawContext, 66, gridYPos + 36, layer);
|
||||
|
||||
drawSlot(matrixStack, 8, 70, layer);
|
||||
drawOutputSlot(matrixStack, 124, gridYPos + 18, layer);
|
||||
drawSlot(drawContext, 8, 70, layer);
|
||||
drawOutputSlot(drawContext, 124, gridYPos + 18, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawLockButton(matrixStack, this, 130, 4, mouseX, mouseY, layer, rollingMachine.locked);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
builder.drawLockButton(drawContext, this, 130, 4, mouseX, mouseY, layer, rollingMachine.locked);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, rollingMachine.getProgressScaled(100), 100, 92, 43, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 17, (int) rollingMachine.getEnergy(), (int) rollingMachine.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, rollingMachine.getProgressScaled(100), 100, 92, 43, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 17, (int) rollingMachine.getEnergy(), (int) rollingMachine.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,26 +41,26 @@ public class GuiScrapboxinator extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(drawContext, partialTicks, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
// Scrapboxes input slot
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
drawSlot(drawContext, 55, 45, layer);
|
||||
// Output slot
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
drawOutputSlot(drawContext, 101, 45, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,23 +41,23 @@ public class GuiSemifluidGenerator extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
drawSlot(matrixStack, 25, 35, layer);
|
||||
drawSlot(matrixStack, 25, 55, layer);
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
drawSlot(drawContext, 25, 35, layer);
|
||||
drawSlot(drawContext, 25, 55, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, 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.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(drawContext, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
|
@ -41,17 +41,17 @@ public class GuiSolar extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, int mouseX, int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, int mouseX, int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 156, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 156, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
|
||||
if (!blockEntity.isGenerating()) {
|
||||
builder.drawText(matrixStack, this, Text.translatable("techreborn.message.panel_blocked"), 10, 20, 12066591);
|
||||
builder.drawText(drawContext, this, Text.translatable("techreborn.message.panel_blocked"), 10, 20, 12066591);
|
||||
}
|
||||
|
||||
builder.drawText(matrixStack, this, Text.literal("Generating: " + blockEntity.getGenerationRate() + " E/t"), 10, 30, 0);
|
||||
builder.drawText(drawContext, this, Text.literal("Generating: " + blockEntity.getGenerationRate() + " E/t"), 10, 30, 0);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -42,26 +42,26 @@ public class GuiSolidCanningMachine extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 34, 47, layer);
|
||||
drawSlot(matrixStack, 126, 47, layer);
|
||||
drawOutputSlot(matrixStack, 80, 47, layer);
|
||||
drawSlot(drawContext, 34, 47, layer);
|
||||
drawSlot(drawContext, 126, 47, layer);
|
||||
drawOutputSlot(drawContext, 80, 47, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.ClientNetworkManager;
|
||||
|
@ -43,42 +43,42 @@ public class GuiStorageUnit extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
// Draw slots
|
||||
drawSlot(matrixStack, 100, 53, layer);
|
||||
drawSlot(matrixStack, 140, 53, layer);
|
||||
drawSlot(drawContext, 100, 53, layer);
|
||||
drawSlot(drawContext, 140, 53, layer);
|
||||
|
||||
builder.drawLockButton(matrixStack, this, 150, 4, mouseX, mouseY, layer, storageEntity.isLocked());
|
||||
builder.drawLockButton(drawContext, this, 150, 4, mouseX, mouseY, layer, storageEntity.isLocked());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
|
||||
// Draw in/out labels
|
||||
builder.drawText(matrixStack, this, Text.translatable("gui.techreborn.unit.in"), 100, 43, 4210752);
|
||||
builder.drawText(matrixStack, this, Text.translatable("gui.techreborn.unit.out"), 140, 43, 4210752);
|
||||
builder.drawText(drawContext, this, Text.translatable("gui.techreborn.unit.in"), 100, 43, 4210752);
|
||||
builder.drawText(drawContext, this, Text.translatable("gui.techreborn.unit.out"), 140, 43, 4210752);
|
||||
|
||||
|
||||
int storedAmount = storageEntity.storedAmount;
|
||||
|
||||
if (storedAmount == 0 && !storageEntity.isLocked()) {
|
||||
textRenderer.draw(matrixStack, Text.translatable("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
|
||||
textRenderer.draw(drawContext, Text.translatable("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
|
||||
} else {
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.storage.store"), 10, 20, 4210752);
|
||||
textRenderer.draw(matrixStack, storageEntity.getDisplayedStack().getName(), 10, 30, 4210752);
|
||||
textRenderer.draw(drawContext, Text.translatable("gui.techreborn.storage.store"), 10, 20, 4210752);
|
||||
textRenderer.draw(drawContext, storageEntity.getDisplayedStack().getName(), 10, 30, 4210752);
|
||||
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.storage.amount"), 10, 50, 4210752);
|
||||
textRenderer.draw(matrixStack, String.valueOf(storedAmount), 10, 60, 4210752);
|
||||
textRenderer.draw(drawContext, Text.translatable("gui.techreborn.storage.amount"), 10, 50, 4210752);
|
||||
textRenderer.draw(drawContext, String.valueOf(storedAmount), 10, 60, 4210752);
|
||||
|
||||
String percentFilled = String.valueOf((int) ((double) storedAmount / (double) storageEntity.getMaxCapacity() * 100));
|
||||
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752);
|
||||
textRenderer.draw(drawContext, Text.translatable("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752);
|
||||
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
|
||||
textRenderer.draw(drawContext, Text.translatable("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
|
@ -43,47 +43,47 @@ public class GuiTankUnit extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
// Draw slots
|
||||
drawSlot(matrixStack, 100, 53, layer);
|
||||
drawSlot(matrixStack, 140, 53, layer);
|
||||
drawSlot(drawContext, 100, 53, layer);
|
||||
drawSlot(drawContext, 140, 53, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
|
||||
// Draw input/out
|
||||
builder.drawText(matrixStack, this, Text.translatable("gui.techreborn.unit.in"), 100, 43, 4210752);
|
||||
builder.drawText(matrixStack, this, Text.translatable("gui.techreborn.unit.out"), 140, 43, 4210752);
|
||||
builder.drawText(drawContext, this, Text.translatable("gui.techreborn.unit.in"), 100, 43, 4210752);
|
||||
builder.drawText(drawContext, this, Text.translatable("gui.techreborn.unit.out"), 140, 43, 4210752);
|
||||
|
||||
|
||||
FluidInstance fluid = tankEntity.getTank().getFluidInstance();
|
||||
|
||||
if (fluid.isEmpty()) {
|
||||
textRenderer.draw(matrixStack, Text.translatable("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
|
||||
textRenderer.draw(drawContext, Text.translatable("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
|
||||
} else {
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.tank.type"), 10, 20, 4210752);
|
||||
textRenderer.draw(matrixStack, FluidUtils.getFluidName(fluid).replace("_", " "), 10, 30, 4210752);
|
||||
textRenderer.draw(drawContext, Text.translatable("gui.techreborn.tank.type"), 10, 20, 4210752);
|
||||
textRenderer.draw(drawContext, FluidUtils.getFluidName(fluid).replace("_", " "), 10, 30, 4210752);
|
||||
|
||||
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.tank.amount"), 10, 50, 4210752);
|
||||
textRenderer.draw(matrixStack, fluid.getAmount().toString(), 10, 60, 4210752);
|
||||
textRenderer.draw(drawContext, Text.translatable("gui.techreborn.tank.amount"), 10, 50, 4210752);
|
||||
textRenderer.draw(drawContext, fluid.getAmount().toString(), 10, 60, 4210752);
|
||||
|
||||
String percentFilled = String.valueOf((int) ((double) fluid.getAmount().getRawValue() / (double) tankEntity.getTank().getFluidValueCapacity().getRawValue() * 100));
|
||||
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752);
|
||||
textRenderer.draw(drawContext, Text.translatable("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752);
|
||||
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
|
||||
textRenderer.draw(drawContext, Text.translatable("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
|
||||
super.render(matrixStack, mouseX, mouseY, partialTicks);
|
||||
drawMouseoverTooltip(matrixStack, mouseX, mouseY);
|
||||
public void render(DrawContext drawContext, int mouseX, int mouseY, float partialTicks) {
|
||||
super.render(drawContext, mouseX, mouseY, partialTicks);
|
||||
drawMouseoverTooltip(drawContext, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,23 +41,23 @@ public class GuiThermalGenerator extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
drawSlot(matrixStack, 25, 35, layer);
|
||||
drawSlot(matrixStack, 25, 55, layer);
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
drawSlot(drawContext, 25, 35, layer);
|
||||
drawSlot(drawContext, 25, 55, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, 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.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(drawContext, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
|
@ -42,38 +42,38 @@ public class GuiVacuumFreezer extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
// Input slots
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
drawSlot(drawContext, 55, 45, layer);
|
||||
// Output slot
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
drawOutputSlot(drawContext, 101, 45, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 6, 4, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
builder.drawMultiblockMissingBar(drawContext, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
builder.drawHologramButton(drawContext, this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(GuiButtonExtended button, Double mouseX, Double mouseY) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -41,28 +41,28 @@ public class GuiWireMill extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float partialTicks, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
protected void drawBackground(DrawContext drawContext, final float partialTicks, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(drawContext, partialTicks, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
drawSlot(drawContext, 8, 72, layer);
|
||||
|
||||
// Input slots
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
drawSlot(matrixStack, 101, 45, layer);
|
||||
drawSlot(drawContext, 55, 45, layer);
|
||||
drawSlot(drawContext, 101, 45, layer);
|
||||
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
drawOutputSlot(drawContext, 101, 45, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawJEIButton(drawContext, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(drawContext, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawProgressBar(drawContext, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(drawContext, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue