diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-09-22 12:20:12 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-09-22 12:20:12 +0800 |
| commit | 72e44a1432f831bdbd42f1c8a574bf22e8b4a481 (patch) | |
| tree | 42ce881152e2dab8f4378612c45226ea9b0a773a /RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java | |
| parent | b76420e3bd81886593587c295284b33e57b29cdf (diff) | |
| download | RoughlyEnoughItems-72e44a1432f831bdbd42f1c8a574bf22e8b4a481.tar.gz RoughlyEnoughItems-72e44a1432f831bdbd42f1c8a574bf22e8b4a481.tar.bz2 RoughlyEnoughItems-72e44a1432f831bdbd42f1c8a574bf22e8b4a481.zip | |
Fix #409 and more
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java')
| -rw-r--r-- | RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java index 517597f8e..cdafd0ba2 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java @@ -36,8 +36,6 @@ import org.jetbrains.annotations.NotNull; import java.util.List; import java.util.function.Supplier; -import static net.minecraft.world.InteractionResult.PASS; - @Environment(EnvType.CLIENT) public interface DisplayHelper { @@ -167,15 +165,18 @@ public interface DisplayHelper { * @see BaseBoundsHandler#registerExclusionZones(Class, Supplier) for easier api */ default InteractionResult canItemSlotWidgetFit(int left, int top, T screen, Rectangle fullBounds) { - InteractionResult fit = isInZone(left, top); - if (fit == InteractionResult.FAIL) - return InteractionResult.FAIL; - InteractionResult fit2 = isInZone(left + 18, top + 18); - if (fit2 == InteractionResult.FAIL) - return InteractionResult.FAIL; - if (fit == InteractionResult.SUCCESS && fit2 == InteractionResult.SUCCESS) - return InteractionResult.SUCCESS; - return PASS; + InteractionResult fit; + fit = isInZone(left, top); + if (fit != InteractionResult.PASS) + return fit; + fit = isInZone(left + 18, top); + if (fit != InteractionResult.PASS) + return fit; + fit = isInZone(left, top + 18); + if (fit != InteractionResult.PASS) + return fit; + fit = isInZone(left + 18, top + 18); + return fit; } @Override |
