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: PaperMC/Paper@9f1fa0b Fix item gravity on inactive items, remove dumb active skipping PaperMC/Paper@1a1d0cf Use target pitch in teleport (generally the same thing) PaperMC/Paper@8ba3073 fix "is_freezing" damage type tag PaperMC/Paper@1523212 don't resend effects when PlayerItemConsumeEvent is cancelled PaperMC/Paper@1330880 Add Friction API to minecarts PaperMC/Paper@580a610 Allow using old ender pearl behavior & apply ender pearl exploit patch (#11524) PaperMC/Paper@40a960d Rebuild patches PaperMC/Paper@dfedf79 Correctly cancel consumption of consumable PaperMC/Paper@147b796 get previous redstone level from the right state for experimental wires PaperMC/Paper@ad9c58e Only expose velocity relative tp flags to API (#11532) PaperMC/Paper@f273e6e Set updatingMinecraft to false PaperMC/Paper@c5c1250 [ci skip] Remove leftover todo file (#11540) PaperMC/Paper@7ee4835 Correctly clear explosion density cache(#11541) PaperMC/Paper@52a0590 Updated Upstream (Bukkit/CraftBukkit) (#11543) PaperMC/Paper@5c0930d Fix fix recipe iterator patch PaperMC/Paper@1de0130 re-add a dispense fix patch PaperMC/Paper@16d7d73 bunch more general fixes PaperMC/Paper@a5d7426 Correctly support RecipeChoice.empty (#11550) PaperMC/Paper@85c870e Correct update cursor (#11554) PaperMC/Paper@d19be64 Fix NPE with spark when CraftServer is not init yet (#11558) PaperMC/Paper@92131ad Decrease dead entity teleport warning (#11559)
94 lines
5.0 KiB
Diff
94 lines
5.0 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 27aee968718af1ae78e2076ddc890114b2c9bb94..0f5be53c6f6a66c61dc3f2bebeb18ca61d06c10d 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/GlowSquid.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/GlowSquid.java
|
|
@@ -43,6 +43,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 7891d015d2f8dadcff8f457145574ea8ba48fe8d..4d2992a16865fa60dd38d0ff6dc341f9c5f6bd00 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
|
@@ -84,6 +84,15 @@ public class Squid extends AgeableWaterCreature {
|
|
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));
|
|
@@ -162,6 +171,7 @@ public class Squid extends AgeableWaterCreature {
|
|
}
|
|
|
|
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;
|
|
@@ -374,7 +384,7 @@ public class Squid extends AgeableWaterCreature {
|
|
int i = this.squid.getNoActionTime();
|
|
if (i > 100) {
|
|
this.squid.movementVector = Vec3.ZERO;
|
|
- } 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 * 2);
|
|
this.squid.movementVector = new Vec3(
|
|
(double)(Mth.cos(f) * 0.2F), (double)(-0.1F + this.squid.getRandom().nextFloat() * 0.2F), (double)(Mth.sin(f) * 0.2F)
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 3c185f89b6f90720620f1fa93e13da60a944613e..32ceab27543b01a0340796255b6f48bc2834de9d 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -933,11 +933,13 @@ public class PurpurWorldConfig {
|
|
public boolean glowSquidControllable = true;
|
|
public double glowSquidMaxHealth = 10.0D;
|
|
public double glowSquidScale = 1.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);
|
|
glowSquidScale = Mth.clamp(getDouble("mobs.glow_squid.attributes.scale", glowSquidScale), 0.0625D, 16.0D);
|
|
+ glowSquidsCanFly = getBoolean("mobs.glow_squid.can-fly", glowSquidsCanFly);
|
|
}
|
|
|
|
public boolean goatRidable = false;
|
|
@@ -1624,6 +1626,7 @@ public class PurpurWorldConfig {
|
|
public double squidScale = 1.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);
|
|
@@ -1636,6 +1639,7 @@ public class PurpurWorldConfig {
|
|
squidScale = Mth.clamp(getDouble("mobs.squid.attributes.scale", squidScale), 0.0625D, 16.0D);
|
|
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;
|