mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-19 14:59:32 +00:00
Fix optimized-sun-burn npe (#478)
This commit is contained in:
@@ -36,7 +36,7 @@ index 7dc1aaaf590edcd1e7c6c6734c4baeecbfec93a7..3a2bf5f3db1130cae4c7d8dd43b5553d
|
|||||||
public void absMoveTo(double x, double y, double z, float yRot, float xRot) {
|
public void absMoveTo(double x, double y, double z, float yRot, float xRot) {
|
||||||
this.absMoveTo(x, y, z);
|
this.absMoveTo(x, y, z);
|
||||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||||
index 6a9a4ac52602d68f679672e16391304b8e6d8252..12c2b73ff94fb29a6d22917553a67b1cf03b5a68 100644
|
index 6a9a4ac52602d68f679672e16391304b8e6d8252..f4012def2ec11fe511d8a383e324a58f775cc1f2 100644
|
||||||
--- a/net/minecraft/world/entity/Mob.java
|
--- a/net/minecraft/world/entity/Mob.java
|
||||||
+++ b/net/minecraft/world/entity/Mob.java
|
+++ b/net/minecraft/world/entity/Mob.java
|
||||||
@@ -1629,20 +1629,40 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
@@ -1629,20 +1629,40 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||||
@@ -69,7 +69,7 @@ index 6a9a4ac52602d68f679672e16391304b8e6d8252..12c2b73ff94fb29a6d22917553a67b1c
|
|||||||
+ }
|
+ }
|
||||||
+ } else {
|
+ } else {
|
||||||
+ int positionHashCode = this.position().hashCode();
|
+ int positionHashCode = this.position().hashCode();
|
||||||
+ if (this.cached_position_hashcode != positionHashCode) {
|
+ if (this.cached_eye_blockpos == null || this.cached_position_hashcode != positionHashCode) {
|
||||||
+ this.cached_eye_blockpos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
+ this.cached_eye_blockpos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
||||||
+ this.cached_position_hashcode = positionHashCode;
|
+ this.cached_position_hashcode = positionHashCode;
|
||||||
+ }
|
+ }
|
||||||
|
|||||||
Reference in New Issue
Block a user