diff --git a/gradle.properties b/gradle.properties index f977e72..944228c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -54,7 +54,7 @@ mod_name=Weather2 # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=All Rights Reserved # The mod version. See https://semver.org/ -mod_version=1.20.1-2.8.2 +mod_version=1.20.1-2.8.3 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/weather2/util/WeatherUtilBlock.java b/src/main/java/weather2/util/WeatherUtilBlock.java index ffc3189..65a6de6 100644 --- a/src/main/java/weather2/util/WeatherUtilBlock.java +++ b/src/main/java/weather2/util/WeatherUtilBlock.java @@ -444,7 +444,7 @@ public static BlockState setBlockWithLayerState(Block block, int height) { } public static BlockPos getPrecipitationHeightSafe(Level world, BlockPos pos) { - return getPrecipitationHeightSafe(world, pos, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES); + return getPrecipitationHeightSafe(world, pos, Heightmap.Types.MOTION_BLOCKING); } /** diff --git a/src/main/java/weather2/util/WeatherUtilEntity.java b/src/main/java/weather2/util/WeatherUtilEntity.java index c6fb1ed..6f84b12 100644 --- a/src/main/java/weather2/util/WeatherUtilEntity.java +++ b/src/main/java/weather2/util/WeatherUtilEntity.java @@ -205,7 +205,10 @@ public static boolean isPosOutside(Level parWorld, Vec3 parPos) { public static boolean isPosOutside(Level parWorld, Vec3 parPos, boolean cheapCheck, boolean eachSideClearCheck) { - if (WeatherUtilBlock.getPrecipitationHeightSafe(parWorld, new BlockPos(Mth.floor(parPos.x), 0, Mth.floor(parPos.z))).getY() < parPos.y+1) return true; + int height = WeatherUtilBlock.getPrecipitationHeightSafe(parWorld, new BlockPos(Mth.floor(parPos.x), 0, Mth.floor(parPos.z))).getY(); + if (height < parPos.y+1) { + return true; + } if (cheapCheck) return false; int rangeCheck = 5; @@ -263,7 +266,11 @@ public static boolean isPosOutside(Level parWorld, Vec3 parPos, boolean cheapChe public static boolean checkVecOutside(Level parWorld, Vec3 parPos, Vec3 parCheckPos) { BlockHitResult blockhitresult = parWorld.clip(new ClipContext(parPos, parCheckPos, ClipContext.Block.VISUAL, ClipContext.Fluid.NONE, null)); if (blockhitresult.getType() == HitResult.Type.MISS) { - if (WeatherUtilBlock.getPrecipitationHeightSafe(parWorld, new BlockPos(Mth.floor(parCheckPos.x), 0, Mth.floor(parCheckPos.z))).getY() < parCheckPos.y) return true; + int height = WeatherUtilBlock.getPrecipitationHeightSafe(parWorld, new BlockPos(Mth.floor(parCheckPos.x), 0, Mth.floor(parCheckPos.z))).getY(); + System.out.println("height: " + height + " vs " + parCheckPos.y); + if (height < parCheckPos.y) { + return true; + } } return false; }