Files
Purpur/patches/server/0084-Stop-squids-floating-on-top-of-water.patch
granny 236b06a2a3 Updated Upstream (Paper & Pufferfish)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@5e73c55 [ci skip] Add more identifying patch comments
PaperMC/Paper@3e20d3a [ci skip] Add more identifying patch comments
PaperMC/Paper@f61ebdc Fix issue with kick event causes being passed improperly
PaperMC/Paper@106c67a [ci skip] Add more identifying patch comments
PaperMC/Paper@cc693ce [ci skip] Add more identifying patch comments, merge related patches
PaperMC/Paper@eeb6afc [ci skip] Add more identifying patch comments, merge related patches
PaperMC/Paper@1c956ab [ci skip] Add more identifying patch comments, merge related patches
PaperMC/Paper@42e88a8 [ci skip] Add more identifying patch comments
PaperMC/Paper@8e41ef4 Add visual blockdata api for primed tnt (#10146)
PaperMC/Paper@68c3297 [ci skip] Add more identifying patch comments
PaperMC/Paper@4a98986 Add back Reduce allocation of Vec3D by entity tracker patch (#10179)
PaperMC/Paper@b48d737 Async world data IO saving (#10171)
PaperMC/Paper@8d94596 [ci skip] Add more identifying patch comments
PaperMC/Paper@f7dd304 [ci skip] Add more identifying patch comments
PaperMC/Paper@98e6d20 [ci skip] Add more identifying patch comments
PaperMC/Paper@e9e0bc1 [ci skip] Add more identifying patch comments
PaperMC/Paper@d9df6bc [ci skip] Add more patch identifying comments, cleanup
PaperMC/Paper@27cabc1 [ci skip] Add more patch identifying comments

Pufferfish Changes:
pufferfish-gg/Pufferfish@8e208d3 Fix Async World Saving attribution
2024-01-21 20:50:22 -08:00

76 lines
3.9 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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 96e79ca690a3951dd24601673703f914465c48a3..46dfa64da35505ca8be525d0eca0e2840840f776 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4451,6 +4451,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.yRotO = this.getYRot();
}
+ // Purpur start
+ public AABB getAxisForFluidCheck() {
+ return this.getBoundingBox().deflate(0.001D);
+ }
+ // Purpur end
+
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
if (false && this.touchingUnloadedChunk()) { // Pufferfish - cost of a lookup here is the same cost as below, so skip
return false;
diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java
index 913b66be2111da862e706d4978825c64cfe8b00b..f68c18b6645981126329b58379946308bbb8ccf8 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
@@ -75,6 +75,12 @@ public class Squid extends WaterAnimal {
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.squidMaxHealth);
}
+ @Override
+ public net.minecraft.world.phys.AABB getAxisForFluidCheck() {
+ // Stops squids from floating just over the water
+ return super.getAxisForFluidCheck().offsetY(level().purpurConfig.squidOffsetWaterCheck);
+ }
+
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new Squid.SquidRandomMovementGoal(this));
diff --git a/src/main/java/net/minecraft/world/phys/AABB.java b/src/main/java/net/minecraft/world/phys/AABB.java
index 67d595f75e0c3bffdb27b85b25ccd1f0bf1427d5..4d0c524af87d05dbd4a923ad6c40e1f26149e921 100644
--- a/src/main/java/net/minecraft/world/phys/AABB.java
+++ b/src/main/java/net/minecraft/world/phys/AABB.java
@@ -374,4 +374,10 @@ public class AABB {
public static AABB ofSize(Vec3 center, double dx, double dy, double dz) {
return new AABB(center.x - dx / 2.0D, center.y - dy / 2.0D, center.z - dz / 2.0D, center.x + dx / 2.0D, center.y + dy / 2.0D, center.z + dz / 2.0D);
}
+
+ // Purpur - tuinity added method
+ public final AABB offsetY(double dy) {
+ return new AABB(this.minX, this.minY + dy, this.minZ, this.maxX, this.maxY + dy, this.maxZ);
+ }
+ // Purpur
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 4218ebd3aa75c7290f1f8bb6ebd357ae3faf53f1..cb1d95f6f786df7a8825016b70c3c6b718f60358 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1478,6 +1478,7 @@ public class PurpurWorldConfig {
public boolean squidControllable = true;
public double squidMaxHealth = 10.0D;
public boolean squidImmuneToEAR = true;
+ public double squidOffsetWaterCheck = 0.0D;
private void squidSettings() {
squidRidable = getBoolean("mobs.squid.ridable", squidRidable);
squidControllable = getBoolean("mobs.squid.controllable", squidControllable);
@@ -1488,6 +1489,7 @@ public class PurpurWorldConfig {
}
squidMaxHealth = getDouble("mobs.squid.attributes.max_health", squidMaxHealth);
squidImmuneToEAR = getBoolean("mobs.squid.immune-to-EAR", squidImmuneToEAR);
+ squidOffsetWaterCheck = getDouble("mobs.squid.water-offset-check", squidOffsetWaterCheck);
}
public boolean spiderRidable = false;