From 2fbbb12c020d5bf28897486ac5d54e9f9de794ce Mon Sep 17 00:00:00 2001 From: brandon3055 Date: Fri, 23 Feb 2024 08:57:08 +1100 Subject: [PATCH] Fixed "Between" constraint and ModularSlot place item validation. --- .../lib/gui/modular/lib/geometry/ConstraintImpl.java | 4 ++-- .../lib/inventory/container/modular/ModularSlot.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/codechicken/lib/gui/modular/lib/geometry/ConstraintImpl.java b/src/main/java/codechicken/lib/gui/modular/lib/geometry/ConstraintImpl.java index 646abe93..207fb8ae 100644 --- a/src/main/java/codechicken/lib/gui/modular/lib/geometry/ConstraintImpl.java +++ b/src/main/java/codechicken/lib/gui/modular/lib/geometry/ConstraintImpl.java @@ -160,7 +160,7 @@ public Between(GeoRef start, GeoRef end, double pos) { @Override protected double getImpl() { - return start.get() + (end.get() - start.get()) * getPos(); + return start.get() + ((end.get() - start.get()) * getPos()); } public double getPos() { @@ -202,7 +202,7 @@ public BetweenDynamic(GeoRef start, GeoRef end, Supplier pos) { @Override protected double getImpl() { - return start.get() + (end.get() - start.get()) * getPos(); + return start.get() + ((end.get() - start.get()) * getPos()); } public double getPos() { diff --git a/src/main/java/codechicken/lib/inventory/container/modular/ModularSlot.java b/src/main/java/codechicken/lib/inventory/container/modular/ModularSlot.java index c652f2cd..75dcc995 100644 --- a/src/main/java/codechicken/lib/inventory/container/modular/ModularSlot.java +++ b/src/main/java/codechicken/lib/inventory/container/modular/ModularSlot.java @@ -106,7 +106,7 @@ public ModularSlot setEnabled(boolean enabled) { @Override public boolean mayPlace(ItemStack itemStack) { - return canPlace && validator.test(itemStack) && (!checkContainer || container.canPlaceItem(getContainerSlot(), itemStack)); + return canPlace && validator.test(itemStack) && (!checkContainer || getItemHandler().isItemValid(getContainerSlot(), itemStack)); } @Override