mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Add back multithreaded entity tracker
This commit is contained in:
56
patches/server/0116-Flying-squids-Oh-my.patch
Normal file
56
patches/server/0116-Flying-squids-Oh-my.patch
Normal file
@@ -0,0 +1,56 @@
|
||||
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/world/entity/animal/EntitySquid.java b/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java
|
||||
index 10e228a36b213a87e17f26a633adfca18a006e94..07b1db0e1fff1beffe464a3984716d5d84ea1873 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java
|
||||
@@ -80,6 +80,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
|
||||
@@ -145,6 +150,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;
|
||||
|
||||
@@ -352,7 +358,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 abe5bc17ff209edbbcb3bb366669887b8d3c75f3..53a9208cd22b5057caef0dff5edc100297686422 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -891,10 +891,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;
|
||||
Reference in New Issue
Block a user