From f3efa570a4224fec085b36dbac4c461deb9e874d Mon Sep 17 00:00:00 2001 From: Mrbysco Date: Mon, 4 Mar 2024 21:54:00 +0100 Subject: [PATCH 1/4] Update TexturedButton.java --- .../mod/inventory/gui/TexturedButton.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java index e3dde93ba..25562a478 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java @@ -45,20 +45,17 @@ public class TexturedButton extends Button { } @Override - public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { - if (this.visible) { - RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - this.isHovered = mouseX >= this.getX() && mouseY >= this.getY() && mouseX < this.getX() + this.width && mouseY < this.getY() + this.height; - int k = this.isHovered + public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { + RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); + int k = this.isHovered ? 1 : 0; - GlStateManager._enableBlend(); - GlStateManager._blendFuncSeparate(770, 771, 1, 0); - GlStateManager._blendFunc(770, 771); - guiGraphics.blit(this.resLoc, this.getX(), this.getY(), this.texturePosX, this.texturePosY - this.height + k * this.height, this.width, this.height); - // this.mouseDragged(minecraft, x, y); - } + GlStateManager._enableBlend(); + GlStateManager._blendFuncSeparate(770, 771, 1, 0); + GlStateManager._blendFunc(770, 771); + guiGraphics.blit(this.resLoc, this.getX(), this.getY(), this.texturePosX, this.texturePosY - this.height + k * this.height, this.width, this.height); + // this.mouseDragged(minecraft, x, y); } public void drawHover(GuiGraphics guiGraphics, int x, int y) { From 06bb77b7dd6427387b7b24e8d6b32f948e986a1f Mon Sep 17 00:00:00 2001 From: Mrbysco Date: Mon, 4 Mar 2024 21:57:36 +0100 Subject: [PATCH 2/4] Update BlockGreenhouseGlass.java --- .../actuallyadditions/mod/blocks/BlockGreenhouseGlass.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java index 4cdab6849..c13868aee 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java @@ -60,7 +60,7 @@ public class BlockGreenhouseGlass extends BlockBase { BlockState growState = i == 0 ? trip.getMiddle() : world.getBlockState(trip.getLeft()); - if (growState.getBlock() == trip.getRight() && trip.getRight().isValidBonemealTarget(world, trip.getLeft(), growState, false)) { + if (growState.getBlock() == trip.getRight() && trip.getRight().isValidBonemealTarget(world, trip.getLeft(), growState)) { trip.getRight().performBonemeal(world, rand, trip.getLeft(), growState); once = true; } From 056ec5c1e09573e24190963affda1fcc5e295176 Mon Sep 17 00:00:00 2001 From: Mrbysco Date: Mon, 4 Mar 2024 21:58:59 +0100 Subject: [PATCH 3/4] Fix canola press container --- .../actuallyadditions/mod/inventory/ContainerCanolaPress.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java index d63ddb9bd..c5446a77b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java @@ -20,6 +20,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeHolder; import java.util.Objects; import java.util.Optional; @@ -64,7 +65,7 @@ public class ContainerCanolaPress extends AbstractContainerMenu { //Other Slots in Inventory excluded if (slot >= inventoryStart) { //Shift from Inventory - Optional recipeOptional = TileEntityCanolaPress.getRecipeForInput(newStack); + Optional> recipeOptional = TileEntityCanolaPress.getRecipeForInput(newStack); if (recipeOptional.isPresent()) { if (!this.moveItemStackTo(newStack, 0, 1, false)) { return ItemStack.EMPTY; From 5ac94e8fe4cdccce75aed2125da515152d8c2854 Mon Sep 17 00:00:00 2001 From: Mrbysco Date: Mon, 4 Mar 2024 21:59:11 +0100 Subject: [PATCH 4/4] Fix WorldData getter --- .../java/de/ellpeck/actuallyadditions/mod/data/WorldData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java b/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java index f23e42f36..8543c97fd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java @@ -38,7 +38,7 @@ public class WorldData extends SavedData { } public static WorldData get(Level level) { - return ((ServerLevel) level).getDataStorage().computeIfAbsent(WorldData::load, WorldData::new, SAVE_NAME); + return ((ServerLevel) level).getDataStorage().computeIfAbsent(new Factory<>(WorldData::new, WorldData::load), SAVE_NAME); } //TODO what in the world is this?