mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
progress
This commit is contained in:
59
patches/server/0111-Flying-squids-Oh-my.patch
Normal file
59
patches/server/0111-Flying-squids-Oh-my.patch
Normal file
@@ -0,0 +1,59 @@
|
||||
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/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
index 2affff346a7fe81480e86cb61996039df0569853..be9b800d81b4d5faed7a3fb95d605bfd9e9afde6 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,11 @@ public class Squid extends WaterAnimal {
|
||||
// Stops squids from floating just over the water
|
||||
return this.getBoundingBox().deflate(0.001D).offsetY(level.purpurConfig.squidOffsetWaterCheck);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isInWater() {
|
||||
+ return this.wasTouchingWater || level.purpurConfig.squidsCanFly;
|
||||
+ }
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
@@ -159,6 +164,7 @@ public class Squid extends WaterAnimal {
|
||||
}
|
||||
|
||||
if (this.isInWaterOrBubble()) {
|
||||
+ if (level.purpurConfig.squidsCanFly) setNoGravity(!wasTouchingWater); // Purpur
|
||||
if (this.tentacleMovement < 3.1415927F) {
|
||||
float f = this.tentacleMovement / 3.1415927F;
|
||||
|
||||
@@ -320,7 +326,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 ab5d9375d20c38e0eb73a030524d59f78b58e3e5..78391c281e649fbf4b8c13544536755edc09dd68 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1354,6 +1354,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) {
|
||||
@@ -1364,6 +1365,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