diff --git a/README.md b/README.md index 50254f38..7bbe508b 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,7 @@ See the patches list below. [MineTick-0017] Fix Insane Nether Portal Lag [Migot-0009] Prevent Creature Spawning in Unloaded Chunks +[Migot-0036] Check for lava only once per tick [Sugarcane-0022] Add YAML comments diff --git a/WindSpigot-Server/src/main/java/net/minecraft/server/Entity.java b/WindSpigot-Server/src/main/java/net/minecraft/server/Entity.java index d84fa7bc..2c5909f0 100644 --- a/WindSpigot-Server/src/main/java/net/minecraft/server/Entity.java +++ b/WindSpigot-Server/src/main/java/net/minecraft/server/Entity.java @@ -188,6 +188,11 @@ public void inactiveTick() { } // Spigot end + // Migot start + private boolean isInLava; + private int lastLavaCheck = Integer.MIN_VALUE; + // Migot end + public int getId() { return this.id; } @@ -1146,9 +1151,15 @@ public boolean a(Material material) { } public boolean ab() { - return this.world.a( - this.getBoundingBox().grow(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), - Material.LAVA); + // Migot start - Check for lava only once per tick + // return this.world.a(this.getBoundingBox().grow(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.LAVA); + int currentTick = MinecraftServer.currentTick; + if (this.lastLavaCheck != currentTick) { + this.lastLavaCheck = currentTick; + this.isInLava = this.world.a(this.getBoundingBox().grow(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.LAVA); + } + return this.isInLava; + // Migot end } public void a(float f, float f1, float f2) {