mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 05:55:44 +01:00
Cleanup 'nerfed spawner mobs can float' patch
This commit is contained in:
parent
f099ddc99e
commit
748d86a540
@ -1,4 +1,4 @@
|
||||
From ef49a98a7b98228c041a0dd310ebb8711b9071c5 Mon Sep 17 00:00:00 2001
|
||||
From 5c9c966394d5865e24c8c531e3fc940d83c9669b Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Mon, 29 Feb 2016 21:02:09 -0600
|
||||
Subject: [PATCH] Paper config files
|
||||
@ -6,7 +6,7 @@ Subject: [PATCH] Paper config files
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
new file mode 100644
|
||||
index 0000000..3d0a005
|
||||
index 000000000..3d0a00512
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -0,0 +1,164 @@
|
||||
@ -176,7 +176,7 @@ index 0000000..3d0a005
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
new file mode 100644
|
||||
index 0000000..dae60dc
|
||||
index 000000000..dae60dcce
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +1,72 @@
|
||||
@ -253,7 +253,7 @@ index 0000000..dae60dc
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 954e0f3..f01bd35 100644
|
||||
index 7336aed80..c6a834580 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -183,6 +183,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@ -268,7 +268,7 @@ index 954e0f3..f01bd35 100644
|
||||
DedicatedServer.LOGGER.info("Generating keypair");
|
||||
this.a(MinecraftEncryption.b());
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index a912719..8bd0250 100644
|
||||
index a32abf0fa..dcd6fc13f 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -125,6 +125,8 @@ public abstract class World implements IBlockAccess {
|
||||
@ -289,7 +289,7 @@ index a912719..8bd0250 100644
|
||||
this.world = new CraftWorld((WorldServer) this, gen, env);
|
||||
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index bb066fa..14543f3 100644
|
||||
index 50799950f..f4b0871ed 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -696,6 +696,7 @@ public final class CraftServer implements Server {
|
||||
@ -316,7 +316,7 @@ index bb066fa..14543f3 100644
|
||||
overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index f7637a9..11bc824 100644
|
||||
index 21170f377..30b6f3477 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -126,6 +126,14 @@ public class Main {
|
||||
@ -335,5 +335,5 @@ index f7637a9..11bc824 100644
|
||||
};
|
||||
|
||||
--
|
||||
2.10.2
|
||||
2.11.0.windows.1
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
From 6234b90aa3d52cd7c4fb7d32e32a6513bb871040 Mon Sep 17 00:00:00 2001
|
||||
From 06d29ae2bf47d827389f95b1654faf11c89f2bea Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Tue, 1 Mar 2016 13:24:16 -0600
|
||||
Subject: [PATCH] Allow nerfed mobs to jump
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 7b2b95d..021c01b 100644
|
||||
index 7b2b95dfa..021c01b2b 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -100,4 +100,9 @@ public class PaperWorldConfig {
|
||||
@ -18,44 +18,65 @@ index 7b2b95d..021c01b 100644
|
||||
+ nerfedMobsShouldJump = getBoolean("spawner-nerfed-mobs-should-jump", false);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ControllerJump.java b/src/main/java/net/minecraft/server/ControllerJump.java
|
||||
index 4f2fa59ac..8af52a61f 100644
|
||||
--- a/src/main/java/net/minecraft/server/ControllerJump.java
|
||||
+++ b/src/main/java/net/minecraft/server/ControllerJump.java
|
||||
@@ -13,6 +13,7 @@ public class ControllerJump {
|
||||
this.a = true;
|
||||
}
|
||||
|
||||
+ public void jumpIfSet() { this.b(); } // Paper - OBFHELPER
|
||||
public void b() {
|
||||
this.b.l(this.a);
|
||||
this.a = false;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index 0dabbaa..50b29c0 100644
|
||||
index 7430fe4ce..59654bcc9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -44,6 +44,8 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@@ -44,6 +44,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
private boolean bD;
|
||||
private Entity leashHolder;
|
||||
private NBTTagCompound bF;
|
||||
+ private NBTTagCompound bG;
|
||||
+ public PathfinderGoalFloat goalFloat; // Paper
|
||||
|
||||
public EntityInsentient(World world) {
|
||||
super(world);
|
||||
@@ -643,6 +645,12 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@@ -643,6 +644,12 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
// Spigot Start
|
||||
if ( this.fromMobSpawner )
|
||||
{
|
||||
+ // Paper start - Allow nerfed mobs to jump and float
|
||||
+ if (goalFloat != null) {
|
||||
+ if (goalFloat.a()) goalFloat.e();
|
||||
+ this.g.b();
|
||||
+ if (goalFloat.validConditions()) goalFloat.update();
|
||||
+ this.getControllerJump().jumpIfSet();
|
||||
+ }
|
||||
+ // Paper end
|
||||
return;
|
||||
}
|
||||
// Spigot End
|
||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
||||
index e3b4058..c16ad2c 100644
|
||||
index e3b405856..2d27aa63a 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
||||
@@ -6,6 +6,7 @@ public class PathfinderGoalFloat extends PathfinderGoal {
|
||||
@@ -6,14 +6,17 @@ public class PathfinderGoalFloat extends PathfinderGoal {
|
||||
|
||||
public PathfinderGoalFloat(EntityInsentient entityinsentient) {
|
||||
this.a = entityinsentient;
|
||||
+ if (entityinsentient.getWorld().paperConfig.nerfedMobsShouldJump) entityinsentient.goalFloat = this; // Paper
|
||||
+ if (entityinsentient.fromMobSpawner && entityinsentient.getWorld().paperConfig.nerfedMobsShouldJump) entityinsentient.goalFloat = this; // Paper
|
||||
this.a(4);
|
||||
((Navigation) entityinsentient.getNavigation()).c(true);
|
||||
}
|
||||
--
|
||||
2.9.3
|
||||
|
||||
+ public boolean validConditions() { return this.a(); } // Paper - OBFHELPER
|
||||
public boolean a() {
|
||||
return this.a.isInWater() || this.a.ao();
|
||||
}
|
||||
|
||||
+ public void update() { this.e(); } // Paper - OBFHELPER
|
||||
public void e() {
|
||||
if (this.a.getRandom().nextFloat() < 0.8F) {
|
||||
this.a.getControllerJump().a();
|
||||
--
|
||||
2.11.0.windows.1
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
From 9f15156e130d9728cb00e3e9960e6a5282b1e334 Mon Sep 17 00:00:00 2001
|
||||
From 03cedbb54a622527c73c7f42b215dd03a20ba637 Mon Sep 17 00:00:00 2001
|
||||
From: Suddenly <suddenly@suddenly.coffee>
|
||||
Date: Tue, 1 Mar 2016 13:51:54 -0600
|
||||
Subject: [PATCH] Add configurable despawn distances for living entities
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 021c01b..92f38a4 100644
|
||||
index 021c01b2b..92f38a450 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -105,4 +105,20 @@ public class PaperWorldConfig {
|
||||
@ -30,10 +30,10 @@ index 021c01b..92f38a4 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index 50b29c0..3f7eae1 100644
|
||||
index 59654bcc9..21f5df3c0 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -623,13 +623,13 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@@ -622,13 +622,13 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
double d2 = entityhuman.locZ - this.locZ;
|
||||
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
|
||||
@ -51,5 +51,5 @@ index 50b29c0..3f7eae1 100644
|
||||
}
|
||||
}
|
||||
--
|
||||
2.9.3
|
||||
2.11.0.windows.1
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
From c36382de32e928b4d76ce823104cfea9573abf90 Mon Sep 17 00:00:00 2001
|
||||
From 54e7e38b4d1b941300a7bb13bd7e66504ad09cc1 Mon Sep 17 00:00:00 2001
|
||||
From: Jedediah Smith <jedediah@silencegreys.com>
|
||||
Date: Tue, 1 Mar 2016 14:47:52 -0600
|
||||
Subject: [PATCH] Player affects spawning API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
index 82146de..f1823af 100644
|
||||
index 82146dedb..f1823af4d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
@@ -63,6 +63,7 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
@ -17,10 +17,10 @@ index 82146de..f1823af 100644
|
||||
// CraftBukkit start
|
||||
public boolean fauxSleeping;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index d3cf840..b6ecd02 100644
|
||||
index 21f5df3c0..a7283d36d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -617,7 +617,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@@ -616,7 +616,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
} else {
|
||||
EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
|
||||
|
||||
@ -30,7 +30,7 @@ index d3cf840..b6ecd02 100644
|
||||
double d1 = entityhuman.locY - this.locY;
|
||||
double d2 = entityhuman.locZ - this.locZ;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java
|
||||
index 5af51cc..7531c9b 100644
|
||||
index 5af51cc0a..7531c9ba9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntitySilverfish.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntitySilverfish.java
|
||||
@@ -99,8 +99,7 @@ public class EntitySilverfish extends EntityMonster {
|
||||
@ -44,7 +44,7 @@ index 5af51cc..7531c9b 100644
|
||||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
index 17bf3e4..a05fad5 100644
|
||||
index 17bf3e410..a05fad54f 100644
|
||||
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
@@ -52,7 +52,7 @@ public final class SpawnerCreature {
|
||||
@ -57,7 +57,7 @@ index 17bf3e4..a05fad5 100644
|
||||
|
||||
j = MathHelper.floor(entityhuman.locZ / 16.0D);
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index c5c4fad..64120c7 100644
|
||||
index c5c4fad6f..64120c76c 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -2722,7 +2722,7 @@ public abstract class World implements IBlockAccess {
|
||||
@ -70,7 +70,7 @@ index c5c4fad..64120c7 100644
|
||||
|
||||
if (d3 < 0.0D || d4 < d3 * d3) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 877a0c8..5e9834c 100644
|
||||
index 877a0c88d..5e9834c67 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1457,6 +1457,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@ -91,5 +91,5 @@ index 877a0c8..5e9834c 100644
|
||||
private final Player.Spigot spigot = new Player.Spigot()
|
||||
{
|
||||
--
|
||||
2.9.3
|
||||
2.11.0.windows.1
|
||||
|
||||
|
@ -53,6 +53,7 @@ import ChunkProviderHell
|
||||
import CommandAbstract
|
||||
import CommandScoreboard
|
||||
import CommandWhitelist
|
||||
import ControllerJump
|
||||
import DataBits
|
||||
import DataConverterMaterialId
|
||||
import DataInspectorBlockEntity
|
||||
|
Loading…
Reference in New Issue
Block a user