Files
Purpur/patches/server/0115-Stop-squids-floating-on-top-of-water.patch
BillyGalbreath b8fb7ff5b5 Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
821ce25d9 Significantly improve performance of the end generation
2b2e4fd65 Add Wandering Trader spawn rate config options
7263cbca7 [CI-SKIP] [Auto] Rebuild Patches
1c63aff6d Villager resetOffers API
8d8d74a5f Patch 2 references an invalid variable
e6d7bdca1 [CI-SKIP] fixed sed -i for bsd sed (#4782)
7ae47d4eb [CI-SKIP] Remove Waving banner fix (#4786)
2020-11-19 21:31:10 -06:00

60 lines
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Thu, 13 Aug 2020 04:00:26 -0500
Subject: [PATCH] Stop squids floating on top of water
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 1ae6dd961..b433bf6e6 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -3435,8 +3435,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.lastYaw = this.yaw;
}
+ // Purpur start
+ public AxisAlignedBB getAxisForFluidCheck() {
+ return this.getBoundingBox().shrink(0.001D);
+ }
public boolean a(Tag<FluidType> tag, double d0) {
- AxisAlignedBB axisalignedbb = this.getBoundingBox().shrink(0.001D);
+ AxisAlignedBB axisalignedbb = getAxisForFluidCheck();
+ // Purpur end
int i = MathHelper.floor(axisalignedbb.minX);
int j = MathHelper.f(axisalignedbb.maxX);
int k = MathHelper.floor(axisalignedbb.minY);
diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java
index b21605a62..148e4b158 100644
--- a/src/main/java/net/minecraft/server/EntitySquid.java
+++ b/src/main/java/net/minecraft/server/EntitySquid.java
@@ -25,6 +25,14 @@ public class EntitySquid extends EntityWaterAnimal {
this.bu = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F;
}
+ // Purpur start
+ @Override
+ public AxisAlignedBB getAxisForFluidCheck() {
+ // Stops squids from floating just over the water
+ return this.getBoundingBox().shrink(0.001D).offsetY(world.purpurConfig.squidOffsetWaterCheck);
+ }
+ // Purpur end
+
@Override
protected void initPathfinder() {
this.goalSelector.a(0, new EntitySquid.PathfinderGoalSquid(this));
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 806ef0bb4..6ee0a3179 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -486,8 +486,10 @@ public class PurpurWorldConfig {
}
public boolean squidImmuneToEAR = true;
+ public double squidOffsetWaterCheck = 0.0D;
private void squidSettings() {
squidImmuneToEAR = getBoolean("mobs.squid.immune-to-EAR", squidImmuneToEAR);
+ squidOffsetWaterCheck = getDouble("mobs.squid.water-offset-check", squidOffsetWaterCheck);
}
public int villagerBrainTicks = 1;