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:7a59345eb7Hide feature seeds in Timings79e52a51bdDon't log if debug logging isn't enabled. (#6603)89c648bcd7Fix log message formatting when classes not owned by plugins use sysout (#6604)3069eaee04Fix tick rates map being stored with upper case values instead of lower case (#6587) Airplane Changes:1888adc228Reduce fluid lookups for entities
92 lines
4.3 KiB
Diff
92 lines
4.3 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/world/entity/GlowSquid.java b/src/main/java/net/minecraft/world/entity/GlowSquid.java
|
|
index 87d01bebbb179eec53323e9e23db011a791660ed..02b79aa6f4c472a9450549b1730f026d6d93b87b 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/GlowSquid.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/GlowSquid.java
|
|
@@ -34,6 +34,11 @@ public class GlowSquid extends Squid {
|
|
public void initAttributes() {
|
|
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;
|
|
+ }
|
|
// Purpur end
|
|
|
|
@Override
|
|
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 8b3dfce6c890a44f9bc485bec016c922375fadfb..3c3a5d7ac95916e066c4ec78c0d3849cd0a9f3e0 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
|
@@ -85,6 +85,15 @@ public class Squid extends WaterAnimal {
|
|
// Stops squids from floating just over the water
|
|
return super.getAxisForFluidCheck().offsetY(level.purpurConfig.squidOffsetWaterCheck);
|
|
}
|
|
+
|
|
+ public boolean canFly() {
|
|
+ return this.level.purpurConfig.squidsCanFly;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean isInWater() {
|
|
+ return this.wasTouchingWater || canFly();
|
|
+ }
|
|
// Purpur end
|
|
|
|
@Override
|
|
@@ -159,6 +168,7 @@ public class Squid extends WaterAnimal {
|
|
}
|
|
|
|
if (this.isInWaterOrBubble()) {
|
|
+ if (canFly()) setNoGravity(!wasTouchingWater); // Purpur
|
|
if (this.tentacleMovement < 3.1415927F) {
|
|
float f = this.tentacleMovement / 3.1415927F;
|
|
|
|
@@ -320,7 +330,7 @@ public class Squid extends WaterAnimal {
|
|
|
|
if (i > 100) {
|
|
this.squid.setMovementVector(0.0F, 0.0F, 0.0F);
|
|
- } else if (this.squid.getRandom().nextInt(50) == 0 || !this.squid.wasTouchingWater || !this.squid.hasMovementVector()) {
|
|
+ } else if (this.squid.getRandom().nextInt(50) == 0 || !this.squid.isInWater() || !this.squid.hasMovementVector()) { // Purpur
|
|
float f = this.squid.getRandom().nextFloat() * 6.2831855F;
|
|
float f1 = Mth.cos(f) * 0.2F;
|
|
float f2 = -0.1F + this.squid.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 a3f5f60167502d596f5587782fa2f3f69f423a18..27b8310766566e17a46b880f6d2636bf62ae9cab 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -826,9 +826,11 @@ public class PurpurWorldConfig {
|
|
|
|
public boolean glowSquidRidable = false;
|
|
public double glowSquidMaxHealth = 10.0D;
|
|
+ public boolean glowSquidsCanFly = false;
|
|
private void glowSquidSettings() {
|
|
glowSquidRidable = getBoolean("mobs.glow_squid.ridable", glowSquidRidable);
|
|
glowSquidMaxHealth = getDouble("mobs.glow_squid.attributes.max_health", glowSquidMaxHealth);
|
|
+ glowSquidsCanFly = getBoolean("mobs.glow_squid.can-fly", glowSquidsCanFly);
|
|
}
|
|
|
|
public boolean goatRidable = false;
|
|
@@ -1384,6 +1386,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);
|
|
if (PurpurConfig.version < 10) {
|
|
@@ -1394,6 +1397,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;
|