mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: 1daafe455 Updated Upstream (Bukkit/CraftBukkit) 98828b006 Merge pull request #4132 from Proximyst/progress/1.16.2 b23f27f8d Fix incorrect return for WorldServer#addAllEntitiesSafely (#3) 5085fa30c Fix MC-187716 Use configured height c44add5a0 Initialise a new chunk section if none was found yet updated 74a4d5f8b Remove armour stand double add to world 6d25cc4ec Don't mark null chunk sections for block updates
60 lines
2.6 KiB
Diff
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 26cefeb23c..26a08b9520 100644
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
|
@@ -3394,8 +3394,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 03d707ed09..028a7fe2cd 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 6329b1c507..421781136c 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -476,8 +476,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;
|