mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Updated Upstream (Paper & Pufferfish)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@44ee1cd fix recipe packet limiter (#9841) PaperMC/Paper@e57af7d sync netty version with vanilla (#9842) Pufferfish Changes: pufferfish-gg/Pufferfish@0020a8b Port a patch from upstream pufferfish-gg/Pufferfish@979d3a2 Update upstream (last 1.20.1) pufferfish-gg/Pufferfish@06262c1 Initial 1.20.2 update
This commit is contained in:
92
patches/server/0094-Flying-squids-Oh-my.patch
Normal file
92
patches/server/0094-Flying-squids-Oh-my.patch
Normal file
@@ -0,0 +1,92 @@
|
||||
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/GlowSquid.java b/src/main/java/net/minecraft/world/entity/GlowSquid.java
|
||||
index dc99e7f0e6f173c1313c0d5e9ea5dd6bdbdac169..19f95ddb2fa9dd264947a8b0033dd7437ee66c7f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/GlowSquid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/GlowSquid.java
|
||||
@@ -41,6 +41,11 @@ public class GlowSquid extends Squid {
|
||||
this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.glowSquidMaxHealth);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean canFly() {
|
||||
+ return this.level().purpurConfig.glowSquidsCanFly;
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
protected ParticleOptions getInkParticle() {
|
||||
return ParticleTypes.GLOW_SQUID_INK;
|
||||
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 f68c18b6645981126329b58379946308bbb8ccf8..80bdc93cba675d6c1286618f14fc33e0344c601f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
@@ -81,6 +81,15 @@ public class Squid extends WaterAnimal {
|
||||
return super.getAxisForFluidCheck().offsetY(level().purpurConfig.squidOffsetWaterCheck);
|
||||
}
|
||||
|
||||
+ public boolean canFly() {
|
||||
+ return this.level().purpurConfig.squidsCanFly;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isInWater() {
|
||||
+ return this.wasTouchingWater || canFly();
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new Squid.SquidRandomMovementGoal(this));
|
||||
@@ -153,6 +162,7 @@ public class Squid extends WaterAnimal {
|
||||
}
|
||||
|
||||
if (this.isInWaterOrBubble()) {
|
||||
+ if (canFly()) setNoGravity(!wasTouchingWater); // Purpur
|
||||
if (this.tentacleMovement < (float)Math.PI) {
|
||||
float f = this.tentacleMovement / (float)Math.PI;
|
||||
this.tentacleAngle = Mth.sin(f * f * (float)Math.PI) * (float)Math.PI * 0.25F;
|
||||
@@ -366,7 +376,7 @@ public class Squid extends WaterAnimal {
|
||||
int i = this.squid.getNoActionTime();
|
||||
if (i > 100) {
|
||||
this.squid.setMovementVector(0.0F, 0.0F, 0.0F);
|
||||
- } else if (this.squid.getRandom().nextInt(reducedTickDelay(50)) == 0 || !this.squid.wasTouchingWater || !this.squid.hasMovementVector()) {
|
||||
+ } else if (this.squid.getRandom().nextInt(reducedTickDelay(50)) == 0 || !this.squid.isInWater() || !this.squid.hasMovementVector()) { // Purpur
|
||||
float f = this.squid.getRandom().nextFloat() * ((float)Math.PI * 2F);
|
||||
float g = Mth.cos(f) * 0.2F;
|
||||
float h = -0.1F + this.squid.getRandom().nextFloat() * 0.2F;
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 45fc13436aa43da593704d142202eb43e5cbe4b3..a85d4a9c2583f8233032b680c89b147a230bca41 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -902,10 +902,12 @@ public class PurpurWorldConfig {
|
||||
public boolean glowSquidRidable = false;
|
||||
public boolean glowSquidControllable = true;
|
||||
public double glowSquidMaxHealth = 10.0D;
|
||||
+ public boolean glowSquidsCanFly = false;
|
||||
private void glowSquidSettings() {
|
||||
glowSquidRidable = getBoolean("mobs.glow_squid.ridable", glowSquidRidable);
|
||||
glowSquidControllable = getBoolean("mobs.glow_squid.controllable", glowSquidControllable);
|
||||
glowSquidMaxHealth = getDouble("mobs.glow_squid.attributes.max_health", glowSquidMaxHealth);
|
||||
+ glowSquidsCanFly = getBoolean("mobs.glow_squid.can-fly", glowSquidsCanFly);
|
||||
}
|
||||
|
||||
public boolean goatRidable = false;
|
||||
@@ -1537,6 +1539,7 @@ public class PurpurWorldConfig {
|
||||
public double squidMaxHealth = 10.0D;
|
||||
public boolean squidImmuneToEAR = true;
|
||||
public double squidOffsetWaterCheck = 0.0D;
|
||||
+ public boolean squidsCanFly = false;
|
||||
private void squidSettings() {
|
||||
squidRidable = getBoolean("mobs.squid.ridable", squidRidable);
|
||||
squidControllable = getBoolean("mobs.squid.controllable", squidControllable);
|
||||
@@ -1548,6 +1551,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);
|
||||
+ squidsCanFly = getBoolean("mobs.squid.can-fly", squidsCanFly);
|
||||
}
|
||||
|
||||
public boolean spiderRidable = false;
|
||||
Reference in New Issue
Block a user