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

Paper Changes:
PaperMC/Paper@cc491a3 Finish updating chunk system patch
PaperMC/Paper@619d7c9 Add in some patches
PaperMC/Paper@902691b Apply last patch
PaperMC/Paper@efb4197 Fix final compilation issues
PaperMC/Paper@57a5924 Fix boot errors
PaperMC/Paper@c1def9d Updated Upstream (CraftBukkit/Spigot)
PaperMC/Paper@a0a2e72 fix sculk npe
PaperMC/Paper@318a08c add missing block entity type to CraftBlockStates
PaperMC/Paper@aed9ef0 Update adventure
PaperMC/Paper@9d42879 Fix breaking pots throwing exception
PaperMC/Paper@59060aa fix some failing tests
PaperMC/Paper@e325e37 add missing call to EntityInsideBlockEvent
PaperMC/Paper@8ce5219 Fix inconsistent chunk sending with vanilla
PaperMC/Paper@04509f0 Fix crash relating to "Already sent chunk"
PaperMC/Paper@c9eb393 Updated Upstream (Bukkit)
PaperMC/Paper@21f2d15 Avoid duplicate poi entries from the first section (#9235)
PaperMC/Paper@3621d76 Fix collision between AABB and a dot (#8733)
PaperMC/Paper@ccb194b Move block farther away for Player#setRotation (#8514)
PaperMC/Paper@03c3587 fix not editable sign after openSign
PaperMC/Paper@6d74ad1 Finish tests & bad calls
PaperMC/Paper@e829a9d Fix javadoc
PaperMC/Paper@82c6479 Add back Anti-Xray patch (#9283)
PaperMC/Paper@0d969f0 comment out update logic from build.gradle.kts
PaperMC/Paper@ea9fdc3 Ignore inline definitions of trim material & pattern
PaperMC/Paper@9ada4bd Prevent the rcon thread from attempting connections after shutdown
PaperMC/Paper@c9e125f Fix setListenerRange for calibrated sculk sensors
PaperMC/Paper@9ebf75d fix some more 1.20 tracking issues
PaperMC/Paper@f9fc44f add side to PlayerSignCommandPreprocessEvent
PaperMC/Paper@4e3febb fix missing trigger entity for xp orb from breeding
PaperMC/Paper@4b5f847 Minimise EntityFertilizeEggEvent and add sniffer (#9280)
2023-06-09 05:22:52 -07:00

76 lines
3.8 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 26cb7466872b6e5b503cbaec933a7de18c928422..1a96037e195b7689db52a0991e644f500b8a9663 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4325,6 +4325,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
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 (this.touchingUnloadedChunk()) {
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 42ca9df0735b4f928fbbf1e695d1756f77be52fc..de0a015cc944c36358fc34a3142ecbf9d2a332b5 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
@@ -77,6 +77,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 ffc76354ead6937daf366c3d87bcb51d3e4c47f5..5b98d42b5d6bc07265fbb017e51a6281c148436a 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 9b398a73d093f83e437867119bbd77229080cfc3..99ce124edf3cb3e747785675c17bd831bf68fc74 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1482,6 +1482,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);
@@ -1492,6 +1493,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;