aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-04-26 01:24:22 +0200
committernea <nea@nea.moe>2023-04-26 01:24:22 +0200
commit7fac94e2763c0bbd7f8371f675c8e304bca2182e (patch)
tree48c4149e5eb79ac9fa40a00bc7e91fc67329f955
parentfc745da88b19064f3015f918b4f090f2c4666524 (diff)
downloadNotEnoughUpdates-feat/ruler.tar.gz
NotEnoughUpdates-feat/ruler.tar.bz2
NotEnoughUpdates-feat/ruler.zip
add build height limitfeat/ruler
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java
index 242fce4e..55dedadf 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java
@@ -1005,6 +1005,11 @@ public class CustomItemEffects {
event.target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK &&
NotEnoughUpdates.INSTANCE.config.itemOverlays.enableDirtWandOverlay) {
BlockPos hover = event.target.getBlockPos().offset(event.target.sideHit, 1);
+ if ("garden".equals(SBInfo.getInstance().getLocation()) &&
+ (hover.getX() > 239 || hover.getX() < -240 || hover.getZ() > 239 || hover.getZ() < -240 ||
+ hover.getY() <= 66 || hover.getY() > 76)) {
+ return;
+ }
IBlockState hoverState = Minecraft.getMinecraft().theWorld.getBlockState(event.target
.getBlockPos()
.offset(event.target.sideHit, 1));
@@ -1579,6 +1584,9 @@ public class CustomItemEffects {
(candidate.getY() + 0.5f - d1 - player.getEyeHeight()) *
(candidate.getY() + 0.5f - d1 - player.getEyeHeight()) +
(candidate.getZ() + 0.5f - d2) * (candidate.getZ() + 0.5f - d2));
+ if (candidate.getY() < 66 || candidate.getY() >= 76) {
+ continue;
+ }
candidatesOldSorted.computeIfAbsent(distSq, k -> new HashSet<>()).add(candidate);
candidatesOld.add(candidate);
@@ -1598,6 +1606,9 @@ public class CustomItemEffects {
if (plotX != plotXNew || plotZ != plotZNew) {
continue;
}
+ if (2 < plotXNew || plotXNew < -2 || 2 < plotZNew || plotZNew < -2) {
+ continue;
+ }
}
if (!sneaking) {
if (Minecraft.getMinecraft().theWorld.getBlockState(candidate.add(xOff, 1, zOff)).getBlock() == Blocks.air) {