mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@93b2246 Fix EntityCombustEvent cancellation issues (#8529) PaperMC/Paper@4a9c9b3 Build updates
76 lines
3.8 KiB
Diff
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 b4b527e496b117b6bf0e8fb6b77aeaf421ac5f41..49f655e9335a13110c2fbb11af02fc81e71e1dbe 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -4079,6 +4079,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 (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 99248a9e2769a573839b199150da312d33344f95..709aaa9dc834d91219ce1087d8f89ef5bf3d915c 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
|
@@ -80,6 +80,12 @@ public class Squid extends WaterAnimal {
|
|
public void initAttributes() {
|
|
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);
|
|
+ }
|
|
// Purpur end
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/world/phys/AABB.java b/src/main/java/net/minecraft/world/phys/AABB.java
|
|
index 68cc6f2a78a06293a29317fda72ab3ee79b3533a..cfb2e46b34b2982d6724f18214557fc80cf4adfa 100644
|
|
--- a/src/main/java/net/minecraft/world/phys/AABB.java
|
|
+++ b/src/main/java/net/minecraft/world/phys/AABB.java
|
|
@@ -367,4 +367,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 08eca6afc59d1011e2e3ba184c5d8d5e2f31f094..022d8c904ce5df6c0b1906c99770aa17344bd351 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -1459,6 +1459,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);
|
|
@@ -1469,6 +1470,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;
|