mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 7232d8f2a EntityLoadCrossbowEvent#shouldConsumeItem 4740bd6c8 Mark PlayerInventory#getItem as nullable bd9ace578 Add a config option to limit the number of entities of each type to load/save in a chunk (#4792) 6bafeb5a9 Move logic from last patch into correct place 9668118fd disable entity ticking flag after watchdog obliteration
57 lines
2.6 KiB
Diff
57 lines
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Sun, 4 Oct 2020 12:00:42 -0500
|
|
Subject: [PATCH] Flying squids! Oh my!
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java
|
|
index 70b952f10a2af547f58069977ee135469d02f84d..cee226501690e1c00983a01ac82bc7384f233c3c 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySquid.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySquid.java
|
|
@@ -51,6 +51,11 @@ public class EntitySquid extends EntityWaterAnimal {
|
|
vector.setX(cos * x - sine * z);
|
|
vector.setZ(sine * x + cos * z);
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public boolean isInWater() {
|
|
+ return this.inWater || world.purpurConfig.squidsCanFly;
|
|
+ }
|
|
// Purpur end
|
|
|
|
@Override
|
|
@@ -116,6 +121,7 @@ public class EntitySquid extends EntityWaterAnimal {
|
|
}
|
|
|
|
if (this.aH()) {
|
|
+ if (world.purpurConfig.squidsCanFly) setNoGravity(!inWater); // Purpur
|
|
if (this.bp < 3.1415927F) {
|
|
float f = this.bp / 3.1415927F;
|
|
|
|
@@ -323,7 +329,7 @@ public class EntitySquid extends EntityWaterAnimal {
|
|
|
|
if (i > 100) {
|
|
this.b.a(0.0F, 0.0F, 0.0F);
|
|
- } else if (this.b.getRandom().nextInt(50) == 0 || !this.b.inWater || !this.b.eK()) {
|
|
+ } else if (this.b.getRandom().nextInt(50) == 0 || !this.b.isInWater() || !this.b.eK()) { // Purpur
|
|
float f = this.b.getRandom().nextFloat() * 6.2831855F;
|
|
float f1 = MathHelper.cos(f) * 0.2F;
|
|
float f2 = -0.1F + this.b.getRandom().nextFloat() * 0.2F;
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 9f26c73dc6685ede1681a6b2ede8c35ccb2580f4..de6b4d078c1b41300bf570d7b6fb0b02e979049c 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -861,10 +861,12 @@ public class PurpurWorldConfig {
|
|
public boolean squidRidable = false;
|
|
public boolean squidImmuneToEAR = true;
|
|
public double squidOffsetWaterCheck = 0.0D;
|
|
+ public boolean squidsCanFly = false;
|
|
private void squidSettings() {
|
|
squidRidable = getBoolean("mobs.squid.ridable", squidRidable);
|
|
squidImmuneToEAR = getBoolean("mobs.squid.immune-to-EAR", squidImmuneToEAR);
|
|
squidOffsetWaterCheck = getDouble("mobs.squid.water-offset-check", squidOffsetWaterCheck);
|
|
+ squidsCanFly = getBoolean("mobs.squid.can-fly", squidsCanFly);
|
|
}
|
|
|
|
public boolean spiderRidable = false;
|