diff --git a/RebornCore/src/main/java/reborncore/api/events/ItemCraftCallback.java b/RebornCore/src/main/java/reborncore/api/events/ItemCraftCallback.java index f2b675e73..1e2736edc 100644 --- a/RebornCore/src/main/java/reborncore/api/events/ItemCraftCallback.java +++ b/RebornCore/src/main/java/reborncore/api/events/ItemCraftCallback.java @@ -27,7 +27,7 @@ package reborncore.api.events; import net.fabricmc.fabric.api.event.Event; import net.fabricmc.fabric.api.event.EventFactory; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.inventory.CraftingInventory; +import net.minecraft.inventory.RecipeInputInventory; import net.minecraft.item.ItemStack; @@ -39,6 +39,6 @@ public interface ItemCraftCallback { } }); - void onCraft(ItemStack stack, CraftingInventory craftingInventory, PlayerEntity playerEntity); + void onCraft(ItemStack stack, RecipeInputInventory craftingInventory, PlayerEntity playerEntity); } diff --git a/RebornCore/src/main/java/reborncore/mixin/common/MixinCraftingResultSlot.java b/RebornCore/src/main/java/reborncore/mixin/common/MixinCraftingResultSlot.java index 0b958e09d..3c4f69b93 100644 --- a/RebornCore/src/main/java/reborncore/mixin/common/MixinCraftingResultSlot.java +++ b/RebornCore/src/main/java/reborncore/mixin/common/MixinCraftingResultSlot.java @@ -25,7 +25,7 @@ package reborncore.mixin.common; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.inventory.CraftingInventory; +import net.minecraft.inventory.RecipeInputInventory; import net.minecraft.item.ItemStack; import net.minecraft.screen.slot.CraftingResultSlot; import org.spongepowered.asm.mixin.Final; @@ -41,7 +41,7 @@ public abstract class MixinCraftingResultSlot { @Shadow @Final - private CraftingInventory input; + private RecipeInputInventory input; @Shadow @Final diff --git a/RebornCore/src/main/resources/fabric.mod.json b/RebornCore/src/main/resources/fabric.mod.json index f3df289ef..c45bdbf15 100644 --- a/RebornCore/src/main/resources/fabric.mod.json +++ b/RebornCore/src/main/resources/fabric.mod.json @@ -32,7 +32,7 @@ "fabric-api": ">=0.75.3", "team_reborn_energy": ">=3.0.0", "fabric-biome-api-v1": ">=3.0.0", - "minecraft": ">=1.19.4- <1.19.5-" + "minecraft": ">=1.20- <1.20.1-" }, "authors": [ "Team Reborn", diff --git a/src/client/java/techreborn/client/compat/rei/ReiPlugin.java b/src/client/java/techreborn/client/compat/rei/ReiPlugin.java index 03469d392..91f01763a 100644 --- a/src/client/java/techreborn/client/compat/rei/ReiPlugin.java +++ b/src/client/java/techreborn/client/compat/rei/ReiPlugin.java @@ -50,6 +50,7 @@ import me.shedaniel.rei.api.common.util.EntryStacks; import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandler; import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandlerRegistry; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.texture.Sprite; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.fluid.Fluid; @@ -95,6 +96,11 @@ import java.util.stream.Stream; public class ReiPlugin implements REIClientPlugin { public static final Map, ItemConvertible> iconMap = new HashMap<>(); + @Deprecated(forRemoval = true) + public static DrawContext drawContext() { + throw new IllegalStateException("TODO 1.20 port!"); + } + public ReiPlugin() { iconMap.put(ModRecipes.ALLOY_SMELTER, Machine.ALLOY_SMELTER); iconMap.put(ModRecipes.ASSEMBLING_MACHINE, Machine.ASSEMBLY_MACHINE); @@ -270,19 +276,18 @@ public class ReiPlugin implements REIClientPlugin { } public static Widget createProgressBar(int x, int y, double animationDuration, GuiBuilder.ProgressDirection direction) { - return Widgets.createDrawableWidget((helper, matrices, mouseX, mouseY, delta) -> { - RenderSystem.setShaderTexture(0, GuiBuilder.defaultTextureSheet); - helper.drawTexture(matrices, x, y, direction.x, direction.y, direction.width, direction.height); + return Widgets.createDrawableWidget((drawContext, matrices, mouseX, mouseY, delta) -> { + drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x, y, direction.x, direction.y, direction.width, direction.height); int j = (int) ((System.currentTimeMillis() / animationDuration) % 1.0 * 16.0); if (j < 0) { j = 0; } switch (direction) { - case RIGHT -> helper.drawTexture(matrices, x, y, direction.xActive, direction.yActive, j, 10); - case LEFT -> helper.drawTexture(matrices, x + 16 - j, y, direction.xActive + 16 - j, direction.yActive, j, 10); - case UP -> helper.drawTexture(matrices, x, y + 16 - j, direction.xActive, direction.yActive + 16 - j, 10, j); - case DOWN -> helper.drawTexture(matrices, x, y, direction.xActive, direction.yActive, 10, j); + case RIGHT -> drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x, y, direction.xActive, direction.yActive, j, 10); + case LEFT -> drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x + 16 - j, y, direction.xActive + 16 - j, direction.yActive, j, 10); + case UP -> drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x, y + 16 - j, direction.xActive, direction.yActive + 16 - j, 10, j); + case DOWN -> drawContext.drawTexture(GuiBuilder.defaultTextureSheet, x, y, direction.xActive, direction.yActive, 10, j); } }); } @@ -315,15 +320,14 @@ public class ReiPlugin implements REIClientPlugin { int innerHeight = height - 2; PowerSystem.EnergySystem displayPower = PowerSystem.getDisplayPower(); - RenderSystem.setShaderTexture(0, GuiBuilder.defaultTextureSheet); - drawTexture(matrices, bounds.x - 1, bounds.y - 1, displayPower.xBar - 15, displayPower.yBar - 1, width, height); + drawContext().drawTexture(GuiBuilder.defaultTextureSheet, bounds.x - 1, bounds.y - 1, displayPower.xBar - 15, displayPower.yBar - 1, width, height); int innerDisplayHeight; if (animation.animationType != EntryAnimationType.NONE) { innerDisplayHeight = MathHelper.ceil((System.currentTimeMillis() / (animation.duration / (float) innerHeight) % innerHeight)); if (animation.animationType == EntryAnimationType.DOWNWARDS) innerDisplayHeight = innerHeight - innerDisplayHeight; } else innerDisplayHeight = innerHeight; - drawTexture(matrices, bounds.x, bounds.y + innerHeight - innerDisplayHeight, displayPower.xBar, innerHeight + displayPower.yBar - innerDisplayHeight, width - 2, innerDisplayHeight); + drawContext().drawTexture(GuiBuilder.defaultTextureSheet, bounds.x, bounds.y + innerHeight - innerDisplayHeight, displayPower.xBar, innerHeight + displayPower.yBar - innerDisplayHeight, width - 2, innerDisplayHeight); } @Override @@ -347,9 +351,8 @@ public class ReiPlugin implements REIClientPlugin { int width = bounds.width; int height = bounds.height; - RenderSystem.setShaderTexture(0, GuiBuilder.defaultTextureSheet); - drawTexture(matrices, bounds.x - 4, bounds.y - 4, 194, 26, width + 8, height + 8); - drawTexture(matrices, bounds.x - 1, bounds.y - 1, 194, 82, width + 2, height + 2); + drawContext().drawTexture(GuiBuilder.defaultTextureSheet, bounds.x - 4, bounds.y - 4, 194, 26, width + 8, height + 8); + drawContext().drawTexture(GuiBuilder.defaultTextureSheet, bounds.x - 1, bounds.y - 1, 194, 82, width + 2, height + 2); int innerDisplayHeight; if (animation.animationType != EntryAnimationType.NONE) { innerDisplayHeight = MathHelper.ceil((System.currentTimeMillis() / (animation.duration / (float) height) % height)); @@ -382,7 +385,7 @@ public class ReiPlugin implements REIClientPlugin { while (offsetHeight != 0) { final int curHeight = Math.min(offsetHeight, iconHeight); - drawSprite(matrixStack, x, y - offsetHeight, 0, width, curHeight, sprite); + drawContext().drawSprite(x, y - offsetHeight, 0, width, curHeight, sprite); offsetHeight -= curHeight; iteration++; if (iteration > 50) { diff --git a/src/client/java/techreborn/client/gui/GuiAESU.java b/src/client/java/techreborn/client/gui/GuiAESU.java index d9ff26bde..497c43258 100644 --- a/src/client/java/techreborn/client/gui/GuiAESU.java +++ b/src/client/java/techreborn/client/gui/GuiAESU.java @@ -25,6 +25,7 @@ package techreborn.client.gui; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.Text; import reborncore.client.ClientNetworkManager; @@ -71,8 +72,9 @@ public class GuiAESU extends GuiBase { final Layer layer = Layer.FOREGROUND; if (!hideGuiElements()) { - drawContext.push(); - drawContext.scale(0.6f, 0.6f, 1.0f); + final MatrixStack matrices = drawContext.getMatrices(); + matrices.push(); + matrices.scale(0.6f, 0.6f, 1.0f); Text text = Text.literal(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getEnergy())) .append("/") .append(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getMaxStoredPower())) @@ -80,7 +82,7 @@ public class GuiAESU extends GuiBase { .append(PowerSystem.getDisplayPower().abbreviation); drawCentredText(drawContext, text, 35, 0, 58, layer); - drawContext.pop(); + matrices.pop(); } builder.drawMultiEnergyBar(drawContext, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer); diff --git a/src/client/java/techreborn/client/gui/GuiBatbox.java b/src/client/java/techreborn/client/gui/GuiBatbox.java index a30e877a7..9d5101c2e 100644 --- a/src/client/java/techreborn/client/gui/GuiBatbox.java +++ b/src/client/java/techreborn/client/gui/GuiBatbox.java @@ -25,6 +25,7 @@ package techreborn.client.gui; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.Text; import reborncore.client.gui.builder.GuiBase; @@ -56,14 +57,15 @@ public class GuiBatbox extends GuiBase { final Layer layer = Layer.FOREGROUND; if (!hideGuiElements()) { - drawContext.push(); - drawContext.scale(0.6f, 0.6f, 1.0f); + final MatrixStack matrices = drawContext.getMatrices(); + matrices.push(); + matrices.scale(0.6f, 0.6f, 1.0f); Text text = Text.literal(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getEnergy())) .append("/") .append(PowerSystem.getLocalizedPower(blockEntity.getMaxStoredPower())); drawCentredText(drawContext, text, 35, 0, 58, layer); - drawContext.pop(); + matrices.pop(); } builder.drawMultiEnergyBar(drawContext, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer); diff --git a/src/client/java/techreborn/client/gui/GuiFusionReactor.java b/src/client/java/techreborn/client/gui/GuiFusionReactor.java index c45ea6d45..76ec6409f 100644 --- a/src/client/java/techreborn/client/gui/GuiFusionReactor.java +++ b/src/client/java/techreborn/client/gui/GuiFusionReactor.java @@ -112,8 +112,8 @@ public class GuiFusionReactor extends GuiBase { } } - 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); + drawContext.drawText(this.textRenderer, Text.literal("Size: ").append(String.valueOf(blockEntity.size)), 83, 81, 0xFFFFFF, true); + drawContext.drawText(this.textRenderer, Text.literal(String.valueOf(blockEntity.getPowerMultiplier())).append("x"), 10, 81, 0xFFFFFF, true); builder.drawMultiEnergyBar(drawContext, this, 9, 19, this.blockEntity.getEnergy(), this.blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer); } diff --git a/src/client/java/techreborn/client/gui/GuiGreenhouseController.java b/src/client/java/techreborn/client/gui/GuiGreenhouseController.java index ecce23750..f498166d0 100644 --- a/src/client/java/techreborn/client/gui/GuiGreenhouseController.java +++ b/src/client/java/techreborn/client/gui/GuiGreenhouseController.java @@ -24,9 +24,8 @@ package techreborn.client.gui; -import com.mojang.blaze3d.systems.RenderSystem; -import net.minecraft.client.resource.language.I18n; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.resource.language.I18n; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.Text; import net.minecraft.util.Identifier; @@ -64,17 +63,14 @@ public class GuiGreenhouseController extends GuiBase { drawSlot(drawContext, 48, gridYPos + 36, layer); if (!blockEntity.isMultiblockValid()) { - RenderSystem.setShaderTexture(0, new Identifier("techreborn", "textures/item/part/digital_display.png")); - drawTexture(drawContext, x + 68, y + 22, 0, 0, 16, 16, 16, 16); + drawContext.drawTexture(new Identifier("techreborn", "textures/item/part/digital_display.png"), x + 68, y + 22, 0, 0, 16, 16, 16, 16); if (isPointInRect(68, 22, 16, 16, mouseX, mouseY)) { List list = Arrays.stream(I18n.translate("techreborn.tooltip.greenhouse.upgrade_available") .split("\\r?\\n")) .map(Text::literal) .collect(Collectors.toList()); - drawContext.push(); - renderTooltip(drawContext, list, mouseX, mouseY); - drawContext.pop(); + drawContext.drawTooltip(getTextRenderer(), list, mouseX, mouseY); } } @@ -95,9 +91,7 @@ public class GuiGreenhouseController extends GuiBase { .map(Text::literal) .collect(Collectors.toList()); - drawContext.push(); - renderTooltip(drawContext, list, mouseX - getGuiLeft(), mouseY - getGuiTop()); - drawContext.pop(); + drawContext.drawTooltip(getTextRenderer(), list, mouseX - getGuiLeft(), mouseY - getGuiTop()); } } diff --git a/src/client/java/techreborn/client/gui/GuiIDSU.java b/src/client/java/techreborn/client/gui/GuiIDSU.java index fbbbb7040..147e052bc 100644 --- a/src/client/java/techreborn/client/gui/GuiIDSU.java +++ b/src/client/java/techreborn/client/gui/GuiIDSU.java @@ -56,9 +56,6 @@ public class GuiIDSU extends GuiBase { super.drawForeground(drawContext, mouseX, mouseY); final Layer layer = Layer.FOREGROUND; - drawContext.push(); - drawContext.scale(0.6f, 0.6f, 1.0f); - Text text = Text.literal(PowerSystem.getLocalizedPowerNoSuffix(idsu.getEnergy())) .append("/") .append(PowerSystem.getLocalizedPowerNoSuffix(idsu.getMaxStoredPower())) @@ -66,7 +63,6 @@ public class GuiIDSU extends GuiBase { .append(PowerSystem.getDisplayPower().abbreviation); drawCentredText(drawContext, text, 35, 0, 58, layer); - drawContext.pop(); builder.drawMultiEnergyBar(drawContext, this, 81, 28, (int) idsu.getEnergy(), (int) idsu.getMaxStoredPower(), mouseX, mouseY, 0, layer); } diff --git a/src/client/java/techreborn/client/gui/GuiLESU.java b/src/client/java/techreborn/client/gui/GuiLESU.java index d6d7126a6..74b23f3ea 100644 --- a/src/client/java/techreborn/client/gui/GuiLESU.java +++ b/src/client/java/techreborn/client/gui/GuiLESU.java @@ -25,6 +25,7 @@ package techreborn.client.gui; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.Text; import reborncore.client.gui.builder.GuiBase; @@ -55,16 +56,16 @@ public class GuiLESU extends GuiBase { protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) { super.drawForeground(drawContext, mouseX, mouseY); final Layer layer = Layer.FOREGROUND; - - drawContext.push(); - drawContext.scale(0.6f, 0.6f, 1.0f); + final MatrixStack matrices = drawContext.getMatrices(); + matrices.push(); + matrices.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); - drawContext.pop(); + matrices.pop(); builder.drawMultiEnergyBar(drawContext, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer); } diff --git a/src/client/java/techreborn/client/gui/GuiMFE.java b/src/client/java/techreborn/client/gui/GuiMFE.java index b76297a4a..29b2ddfd7 100644 --- a/src/client/java/techreborn/client/gui/GuiMFE.java +++ b/src/client/java/techreborn/client/gui/GuiMFE.java @@ -25,6 +25,7 @@ package techreborn.client.gui; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.Text; import reborncore.client.gui.builder.GuiBase; @@ -57,15 +58,16 @@ public class GuiMFE extends GuiBase { final Layer layer = Layer.FOREGROUND; if (!hideGuiElements()) { - drawContext.push(); - drawContext.scale(0.6f, 0.6f, 1.0f); + MatrixStack matrices = drawContext.getMatrices(); + matrices.push(); + matrices.scale(0.6f, 0.6f, 1.0f); drawCentredText(drawContext, Text.literal(PowerSystem.getLocalizedPowerNoSuffix(mfe.getEnergy())) .append("/") .append(PowerSystem.getLocalizedPower(mfe.getMaxStoredPower())) , 35, 0, 58, layer); - drawContext.pop(); + matrices.pop(); } builder.drawMultiEnergyBar(drawContext, this, 81, 28, (int) mfe.getEnergy(), (int) mfe.getMaxStoredPower(), mouseX, mouseY, 0, layer); diff --git a/src/client/java/techreborn/client/gui/GuiMFSU.java b/src/client/java/techreborn/client/gui/GuiMFSU.java index 7bacf376e..8c6db9408 100644 --- a/src/client/java/techreborn/client/gui/GuiMFSU.java +++ b/src/client/java/techreborn/client/gui/GuiMFSU.java @@ -25,6 +25,7 @@ package techreborn.client.gui; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.Text; import reborncore.client.gui.builder.GuiBase; @@ -55,11 +56,11 @@ public class GuiMFSU extends GuiBase { protected void drawForeground(DrawContext drawContext, final int mouseX, final int mouseY) { super.drawForeground(drawContext, mouseX, mouseY); final Layer layer = Layer.FOREGROUND; - - drawContext.push(); - drawContext.scale(0.6f, 0.6f, 1.0f); + final MatrixStack matrices = drawContext.getMatrices(); + matrices.push(); + matrices.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(); + matrices.pop(); builder.drawMultiEnergyBar(drawContext, this, 81, 28, (int) mfsu.getEnergy(), (int) mfsu.getMaxStoredPower(), mouseX, mouseY, 0, layer); } diff --git a/src/client/java/techreborn/client/gui/GuiManual.java b/src/client/java/techreborn/client/gui/GuiManual.java index 96b506378..265f67b15 100644 --- a/src/client/java/techreborn/client/gui/GuiManual.java +++ b/src/client/java/techreborn/client/gui/GuiManual.java @@ -83,10 +83,10 @@ public class GuiManual extends Screen { int centerY = (height / 2) - guiHeight / 2; drawContext.drawTexture(MANUAL_TEXTURE, centerX, centerY, 0, 0, guiWidth, guiHeight); - 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); + drawContext.drawText(textRenderer, text1, (width / 2) - textRenderer.getWidth(text1) / 2, centerY + 40, 4210752, false); + drawContext.drawText(textRenderer, text2, (width / 2) - textRenderer.getWidth(text2) / 2, centerY + 90, 4210752, false); if (TechRebornConfig.allowManualRefund) { - drawContext.drawText(textRenderer, text3, (float) ((width / 2) - textRenderer.getWidth(text3) / 2), centerY + 140, 4210752); + drawContext.drawText(textRenderer, text3, (width / 2) - textRenderer.getWidth(text3) / 2, centerY + 140, 4210752, false); } super.render(drawContext, mouseX, mouseY, partialTicks); diff --git a/src/client/java/techreborn/client/gui/GuiStorageUnit.java b/src/client/java/techreborn/client/gui/GuiStorageUnit.java index 72e5149a9..245b7a7f5 100644 --- a/src/client/java/techreborn/client/gui/GuiStorageUnit.java +++ b/src/client/java/techreborn/client/gui/GuiStorageUnit.java @@ -66,19 +66,20 @@ public class GuiStorageUnit extends GuiBase { int storedAmount = storageEntity.storedAmount; if (storedAmount == 0 && !storageEntity.isLocked()) { - textRenderer.draw(drawContext, Text.translatable("techreborn.tooltip.unit.empty"), 10, 20, 4210752); - } else { - textRenderer.draw(drawContext, Text.translatable("gui.techreborn.storage.store"), 10, 20, 4210752); - textRenderer.draw(drawContext, storageEntity.getDisplayedStack().getName(), 10, 30, 4210752); - textRenderer.draw(drawContext, Text.translatable("gui.techreborn.storage.amount"), 10, 50, 4210752); - textRenderer.draw(drawContext, String.valueOf(storedAmount), 10, 60, 4210752); + drawContext.drawText(textRenderer, Text.translatable("techreborn.tooltip.unit.empty"), 10, 20, 4210752, false); + } else { + drawContext.drawText(textRenderer, Text.translatable("gui.techreborn.storage.store"), 10, 20, 4210752, false); + drawContext.drawText(textRenderer, storageEntity.getDisplayedStack().getName(), 10, 30, 4210752, false); + + drawContext.drawText(textRenderer, Text.translatable("gui.techreborn.storage.amount"), 10, 50, 4210752, false); + drawContext.drawText(textRenderer, String.valueOf(storedAmount), 10, 60, 4210752, false); String percentFilled = String.valueOf((int) ((double) storedAmount / (double) storageEntity.getMaxCapacity() * 100)); - textRenderer.draw(drawContext, Text.translatable("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752); + drawContext.drawText(textRenderer, Text.translatable("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752, false); - textRenderer.draw(drawContext, Text.translatable("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680); + drawContext.drawText(textRenderer, Text.translatable("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680, false); } } diff --git a/src/client/java/techreborn/client/gui/GuiTankUnit.java b/src/client/java/techreborn/client/gui/GuiTankUnit.java index 6058c4f8d..e4dd2af3c 100644 --- a/src/client/java/techreborn/client/gui/GuiTankUnit.java +++ b/src/client/java/techreborn/client/gui/GuiTankUnit.java @@ -64,20 +64,20 @@ public class GuiTankUnit extends GuiBase { FluidInstance fluid = tankEntity.getTank().getFluidInstance(); if (fluid.isEmpty()) { - textRenderer.draw(drawContext, Text.translatable("techreborn.tooltip.unit.empty"), 10, 20, 4210752); + drawContext.drawText(textRenderer, Text.translatable("techreborn.tooltip.unit.empty"), 10, 20, 4210752, false); } else { - textRenderer.draw(drawContext, Text.translatable("gui.techreborn.tank.type"), 10, 20, 4210752); - textRenderer.draw(drawContext, FluidUtils.getFluidName(fluid).replace("_", " "), 10, 30, 4210752); + drawContext.drawText(textRenderer, Text.translatable("gui.techreborn.tank.type"), 10, 20, 4210752, false); + drawContext.drawText(textRenderer, FluidUtils.getFluidName(fluid).replace("_", " "), 10, 30, 4210752, false); - textRenderer.draw(drawContext, Text.translatable("gui.techreborn.tank.amount"), 10, 50, 4210752); - textRenderer.draw(drawContext, fluid.getAmount().toString(), 10, 60, 4210752); + drawContext.drawText(textRenderer, Text.translatable("gui.techreborn.tank.amount"), 10, 50, 4210752, false); + drawContext.drawText(textRenderer, fluid.getAmount().toString(), 10, 60, 4210752, false); String percentFilled = String.valueOf((int) ((double) fluid.getAmount().getRawValue() / (double) tankEntity.getTank().getFluidValueCapacity().getRawValue() * 100)); - textRenderer.draw(drawContext, Text.translatable("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752); + drawContext.drawText(textRenderer, Text.translatable("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752, false); - textRenderer.draw(drawContext, Text.translatable("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680); + drawContext.drawText(textRenderer, Text.translatable("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680, false); } } diff --git a/src/datagen/groovy/techreborn/datagen/recipes/machine/extractor/ExtractorRecipesProvider.groovy b/src/datagen/groovy/techreborn/datagen/recipes/machine/extractor/ExtractorRecipesProvider.groovy index 5e89bb514..7950b9b2a 100644 --- a/src/datagen/groovy/techreborn/datagen/recipes/machine/extractor/ExtractorRecipesProvider.groovy +++ b/src/datagen/groovy/techreborn/datagen/recipes/machine/extractor/ExtractorRecipesProvider.groovy @@ -89,7 +89,6 @@ class ExtractorRecipesProvider extends TechRebornRecipesProvider { power 10 time 300 criterion getCriterionName(item), getCriterionConditions(item) - feature FeatureFlags.UPDATE_1_20 } } } @@ -138,7 +137,6 @@ class ExtractorRecipesProvider extends TechRebornRecipesProvider { power 10 time 300 criterion getCriterionName(Items.CHERRY_LEAVES), getCriterionConditions(Items.CHERRY_LEAVES) - feature FeatureFlags.UPDATE_1_20 } } diff --git a/src/datagen/groovy/techreborn/datagen/recipes/machine/industrial_sawmill/IndustrialSawmillRecipesProvider.groovy b/src/datagen/groovy/techreborn/datagen/recipes/machine/industrial_sawmill/IndustrialSawmillRecipesProvider.groovy index 59e15c443..6f0c534c9 100644 --- a/src/datagen/groovy/techreborn/datagen/recipes/machine/industrial_sawmill/IndustrialSawmillRecipesProvider.groovy +++ b/src/datagen/groovy/techreborn/datagen/recipes/machine/industrial_sawmill/IndustrialSawmillRecipesProvider.groovy @@ -69,7 +69,6 @@ class IndustrialSawmillRecipesProvider extends TechRebornRecipesProvider { power 40 time 200 fluidAmount 1000 // in millibuckets - feature FeatureFlags.UPDATE_1_20 } offerIndustrialSawmillRecipe { ingredients ItemTags.BAMBOO_BLOCKS @@ -77,7 +76,6 @@ class IndustrialSawmillRecipesProvider extends TechRebornRecipesProvider { power 40 time 100 fluidAmount 500 // in millibuckets - feature FeatureFlags.UPDATE_1_20 } [ (Items.ACACIA_STAIRS): Items.ACACIA_SLAB, @@ -114,7 +112,6 @@ class IndustrialSawmillRecipesProvider extends TechRebornRecipesProvider { fluidAmount 250 // in millibuckets source "stairs" criterion getCriterionName(stairs), getCriterionConditions(stairs) - feature FeatureFlags.UPDATE_1_20 } } [ @@ -152,7 +149,6 @@ class IndustrialSawmillRecipesProvider extends TechRebornRecipesProvider { fluidAmount 250 // in millibuckets source ((slab == Items.BAMBOO_MOSAIC_SLAB ? "mosaic_" : "") + "slab") criterion getCriterionName(slab), getCriterionConditions(slab) - feature FeatureFlags.UPDATE_1_20 } } [ diff --git a/src/main/java/techreborn/utils/PoweredCraftingHandler.java b/src/main/java/techreborn/utils/PoweredCraftingHandler.java index d726de450..2e8cb49cd 100644 --- a/src/main/java/techreborn/utils/PoweredCraftingHandler.java +++ b/src/main/java/techreborn/utils/PoweredCraftingHandler.java @@ -28,7 +28,7 @@ import com.google.common.collect.Maps; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.inventory.CraftingInventory; +import net.minecraft.inventory.RecipeInputInventory; import net.minecraft.item.ItemStack; import net.minecraft.registry.Registries; import reborncore.api.events.ItemCraftCallback; @@ -48,7 +48,7 @@ public final class PoweredCraftingHandler implements ItemCraftCallback { } @Override - public void onCraft(ItemStack stack, CraftingInventory craftingInventory, PlayerEntity playerEntity) { + public void onCraft(ItemStack stack, RecipeInputInventory craftingInventory, PlayerEntity playerEntity) { if (stack.getItem() instanceof RcEnergyItem energyItem) { long totalEnergy = IntStream.range(0, craftingInventory.size()) .mapToObj(craftingInventory::getStack) diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index f265c8876..b3d0bbebe 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -35,7 +35,7 @@ "reborncore": "*", "team_reborn_energy": ">=3.0.0", "fabric-biome-api-v1": ">=3.0.0", - "minecraft": ">=1.19.4- <1.19.5-" + "minecraft": ">=1.20- <1.20.1-" }, "accessWidener": "techreborn.accesswidener", "authors": [