From b8fed8aaf27fbab9dab355d42404fd921aba9330 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Mon, 6 May 2019 22:37:10 -0500 Subject: [PATCH] Update to 1.14 --- .gitmodules | 2 +- Paper | 2 +- current-paper | 2 +- patches/api/0001-Rebrand.patch | 19 +- ...ose-Animals-isBreedingItem-ItemStack.patch | 6 +- ...lement-LivingEntity-safeFallDistance.patch | 6 +- patches/api/0006-Integrate-ridables.patch | 6 +- patches/server/0001-Rebrand.patch | 22 +- ...cows-to-mooshroom-when-fed-mushrooms.patch | 20 +- .../server/0003-PlayerFeedAnimalEvent.patch | 16 +- ...ose-Animals-isBreedingItem-ItemStack.patch | 6 +- ...cow-rotation-when-shearing-mooshroom.patch | 30 +- ...pumpkin-on-off-by-player-interaction.patch | 30 +- ...lement-LivingEntity-safeFallDistance.patch | 36 +- patches/server/0008-Integrate-ridables.patch | 1192 +++++++++-------- scripts/upstream.sh | 2 +- 16 files changed, 726 insertions(+), 671 deletions(-) diff --git a/.gitmodules b/.gitmodules index 9cfc2efcd..1ed0680b7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "Paper"] path = Paper url = https://github.com/PaperMC/Paper.git - branch = master + branch = ver/1.14-pre5 diff --git a/Paper b/Paper index fb25dc17c..bc024aec6 160000 --- a/Paper +++ b/Paper @@ -1 +1 @@ -Subproject commit fb25dc17c62acce335346d5e96899257ae7230c7 +Subproject commit bc024aec6e648ce3ca45d3fc487c0f408b6040e1 diff --git a/current-paper b/current-paper index 7988f6f9a..b010029ac 100644 --- a/current-paper +++ b/current-paper @@ -1 +1 @@ -1.13.2--68781abc035f77c64c2ef6961375df70ae357e83 +1.14--4168b329732ffe495224049fa0e0b8fec6acbb40 diff --git a/patches/api/0001-Rebrand.patch b/patches/api/0001-Rebrand.patch index 1a3614983..2095dff70 100644 --- a/patches/api/0001-Rebrand.patch +++ b/patches/api/0001-Rebrand.patch @@ -1,18 +1,18 @@ -From 54a9be260f9d24b37ddf635cd8b7cfee6ab99bf5 Mon Sep 17 00:00:00 2001 +From 7b6ccc334157135036716bd93907cbb34f28cd82 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Sat, 4 May 2019 00:57:16 -0500 Subject: [PATCH] Rebrand --- - pom.xml | 8 +++---- + pom.xml | 9 ++++---- .../command/defaults/VersionCommand.java | 21 +++++++++++-------- - 2 files changed, 16 insertions(+), 13 deletions(-) + 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml -index 13cdc25f..1e24fd1e 100644 +index 81aefdf7..d73f48ae 100644 --- a/pom.xml +++ b/pom.xml -@@ -4,17 +4,17 @@ +@@ -4,18 +4,17 @@ 4.0.0 @@ -23,9 +23,10 @@ index 13cdc25f..1e24fd1e 100644 dev-SNAPSHOT +- com.destroystokyo.paper - paper-api + purpur-api - 1.13.2-R0.1-SNAPSHOT + 1.14-R0.1-SNAPSHOT jar Paper-API @@ -35,10 +36,10 @@ index 13cdc25f..1e24fd1e 100644 diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java -index ee07fe5e..0c4e8604 100644 +index a36ab04c..42c88ae1 100644 --- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java -@@ -214,8 +214,8 @@ public class VersionCommand extends BukkitCommand { +@@ -211,8 +211,8 @@ public class VersionCommand extends BukkitCommand { private void obtainVersion() { String version = Bukkit.getVersion(); if (version == null) version = "Custom"; @@ -49,7 +50,7 @@ index ee07fe5e..0c4e8604 100644 int distance = getDistance(null, parts[0]); switch (distance) { case -1: -@@ -266,13 +266,16 @@ public class VersionCommand extends BukkitCommand { +@@ -263,13 +263,16 @@ public class VersionCommand extends BukkitCommand { // Paper start private static int getDistance(@NotNull String repo, @NotNull String verInfo) { diff --git a/patches/api/0004-Expose-Animals-isBreedingItem-ItemStack.patch b/patches/api/0004-Expose-Animals-isBreedingItem-ItemStack.patch index 45818ae5c..abc6ef897 100644 --- a/patches/api/0004-Expose-Animals-isBreedingItem-ItemStack.patch +++ b/patches/api/0004-Expose-Animals-isBreedingItem-ItemStack.patch @@ -1,4 +1,4 @@ -From 2c54818037c32884b46e0263e6fba858f997ac61 Mon Sep 17 00:00:00 2001 +From 0598f218844ed5949808033cb1502ae3f2eab089 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Fri, 3 May 2019 23:45:26 -0500 Subject: [PATCH] Expose Animals#isBreedingItem(ItemStack) @@ -8,10 +8,10 @@ Subject: [PATCH] Expose Animals#isBreedingItem(ItemStack) 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/bukkit/entity/Animals.java b/src/main/java/org/bukkit/entity/Animals.java -index 3d4f8c3d..1f0cd380 100644 +index 1047481e..939f131f 100644 --- a/src/main/java/org/bukkit/entity/Animals.java +++ b/src/main/java/org/bukkit/entity/Animals.java -@@ -51,4 +51,14 @@ public interface Animals extends Ageable { +@@ -50,4 +50,14 @@ public interface Animals extends Ageable { * @param ticks the love mode ticks. Must be positive */ void setLoveModeTicks(int ticks); diff --git a/patches/api/0005-Implement-LivingEntity-safeFallDistance.patch b/patches/api/0005-Implement-LivingEntity-safeFallDistance.patch index 34436a96b..b5cf8e206 100644 --- a/patches/api/0005-Implement-LivingEntity-safeFallDistance.patch +++ b/patches/api/0005-Implement-LivingEntity-safeFallDistance.patch @@ -1,4 +1,4 @@ -From 5b9dd7186e204dd62aa6430c2dc97f639a8d0cb8 Mon Sep 17 00:00:00 2001 +From c9c5d4932bf02be755c90c32d537803076bb30f5 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Sun, 5 May 2019 12:58:19 -0500 Subject: [PATCH] Implement LivingEntity safeFallDistance @@ -8,10 +8,10 @@ Subject: [PATCH] Implement LivingEntity safeFallDistance 1 file changed, 16 insertions(+) diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 956d6886..a3baaecb 100644 +index fe87caf1..d737937e 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java -@@ -649,4 +649,20 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource +@@ -655,4 +655,20 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource */ boolean isHandRaised(); // Paper end diff --git a/patches/api/0006-Integrate-ridables.patch b/patches/api/0006-Integrate-ridables.patch index 926330ef0..be3c811f3 100644 --- a/patches/api/0006-Integrate-ridables.patch +++ b/patches/api/0006-Integrate-ridables.patch @@ -1,4 +1,4 @@ -From e8f6e9aeba7fe0b9bca877c2df79fea8c3ca9472 Mon Sep 17 00:00:00 2001 +From dc4ce39da212c22db5f734553ebd96371012b628 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Fri, 3 May 2019 06:08:35 -0500 Subject: [PATCH] Integrate ridables @@ -8,10 +8,10 @@ Subject: [PATCH] Integrate ridables 1 file changed, 14 insertions(+) diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index a3baaecb..097e82a0 100644 +index d737937e..cf9dde56 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java -@@ -664,5 +664,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource +@@ -670,5 +670,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource * @param safeFallDistance Safe fall distance */ void setSafeFallDistance(float safeFallDistance); diff --git a/patches/server/0001-Rebrand.patch b/patches/server/0001-Rebrand.patch index 23c591f65..10201d41e 100644 --- a/patches/server/0001-Rebrand.patch +++ b/patches/server/0001-Rebrand.patch @@ -1,4 +1,4 @@ -From 42e69a8ea10cb6eff36dd87d4381021b248f5baf Mon Sep 17 00:00:00 2001 +From a9c61ea092067c2508ba72f175fbde0e29602260 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Sat, 4 May 2019 01:02:11 -0500 Subject: [PATCH] Rebrand @@ -12,7 +12,7 @@ Subject: [PATCH] Rebrand 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml -index 9cbd4880f..caae26eb4 100644 +index 8c18a0c09..dcbf59fbe 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,11 @@ @@ -22,7 +22,7 @@ index 9cbd4880f..caae26eb4 100644 - paper + purpur jar - 1.13.2-R0.1-SNAPSHOT + 1.14-R0.1-SNAPSHOT - Paper - https://papermc.io + Purpur @@ -51,7 +51,7 @@ index 9cbd4880f..caae26eb4 100644 ${project.version} compile -@@ -136,7 +136,7 @@ +@@ -143,7 +143,7 @@ @@ -60,7 +60,7 @@ index 9cbd4880f..caae26eb4 100644 clean install -@@ -144,7 +144,7 @@ +@@ -151,7 +151,7 @@ gitdescribe-maven-plugin 1.3 @@ -70,7 +70,7 @@ index 9cbd4880f..caae26eb4 100644 diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java -index 688b4715e..e4522e68f 100644 +index cd6e25923..bb227bc0f 100644 --- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java @@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole { @@ -83,10 +83,10 @@ index 688b4715e..e4522e68f 100644 ); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8db5c6a35..16c2e1dac 100644 +index 33c7a295e..f6e27f2fb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1348,7 +1348,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -1405,7 +1405,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant Date: Sat, 4 May 2019 01:10:30 -0500 Subject: [PATCH] cows to mooshroom when fed mushrooms @@ -9,22 +9,22 @@ Subject: [PATCH] cows to mooshroom when fed mushrooms 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 581c78e00..89a8bbe33 100644 +index 23f910187..7bdc0f4a5 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1082,6 +1082,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -995,6 +995,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return false; } + public void playSound(SoundEffect soundeffect, float volume, float pitch) { a(soundeffect, volume, pitch); } // Paper - OBFHELPER public void a(SoundEffect soundeffect, float f, float f1) { if (!this.isSilent()) { - this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, soundeffect, this.bV(), f, f1); + this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, soundeffect, this.getSoundCategory(), f, f1); diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java -index cc53e915d..efd2a0ee7 100644 +index d2c2e3cc3..0139688c7 100644 --- a/src/main/java/net/minecraft/server/EntityCow.java +++ b/src/main/java/net/minecraft/server/EntityCow.java -@@ -21,7 +21,7 @@ public class EntityCow extends EntityAnimal { +@@ -16,7 +16,7 @@ public class EntityCow extends EntityAnimal { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new PathfinderGoalPanic(this, 2.0D)); this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D)); @@ -33,16 +33,16 @@ index cc53e915d..efd2a0ee7 100644 this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D)); this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D)); this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); -@@ -59,6 +59,8 @@ public class EntityCow extends EntityAnimal { - return LootTables.S; +@@ -55,6 +55,8 @@ public class EntityCow extends EntityAnimal { + return 0.4F; } + private int mushroomsFed = 0; // Purpur + + @Override public boolean a(EntityHuman entityhuman, EnumHand enumhand) { ItemStack itemstack = entityhuman.b(enumhand); - -@@ -82,6 +84,47 @@ public class EntityCow extends EntityAnimal { +@@ -79,6 +81,47 @@ public class EntityCow extends EntityAnimal { // CraftBukkit end return true; diff --git a/patches/server/0003-PlayerFeedAnimalEvent.patch b/patches/server/0003-PlayerFeedAnimalEvent.patch index e9a71aacd..e6630aa01 100644 --- a/patches/server/0003-PlayerFeedAnimalEvent.patch +++ b/patches/server/0003-PlayerFeedAnimalEvent.patch @@ -1,4 +1,4 @@ -From efc21635e384f64394f2b9c50b73bd235f200f1c Mon Sep 17 00:00:00 2001 +From 50e421da6a6620d15e29fb476577b0ff445b0c65 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Fri, 3 May 2019 23:39:38 -0500 Subject: [PATCH] PlayerFeedAnimalEvent @@ -8,24 +8,24 @@ Subject: [PATCH] PlayerFeedAnimalEvent 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/EntityAnimal.java b/src/main/java/net/minecraft/server/EntityAnimal.java -index 31ca1f80..26c43ac6 100644 +index dbce8a866..8a4594654 100644 --- a/src/main/java/net/minecraft/server/EntityAnimal.java +++ b/src/main/java/net/minecraft/server/EntityAnimal.java -@@ -99,6 +99,7 @@ public abstract class EntityAnimal extends EntityAgeable implements IAnimal { +@@ -110,6 +110,7 @@ public abstract class EntityAnimal extends EntityAgeable { return 1 + this.world.random.nextInt(3); } -+ public boolean isBreedingItem(ItemStack itemstack) { return f(itemstack); } // Purpur - OBFHELPER - public boolean f(ItemStack itemstack) { ++ public boolean isBreedingItem(ItemStack itemstack) { return i(itemstack); } // Purpur - OBFHELPER + public boolean i(ItemStack itemstack) { return itemstack.getItem() == Items.WHEAT; } -@@ -106,7 +107,7 @@ public abstract class EntityAnimal extends EntityAgeable implements IAnimal { +@@ -118,7 +119,7 @@ public abstract class EntityAnimal extends EntityAgeable { public boolean a(EntityHuman entityhuman, EnumHand enumhand) { ItemStack itemstack = entityhuman.b(enumhand); -- if (this.f(itemstack)) { +- if (this.i(itemstack)) { + if (this.isBreedingItem(itemstack) && new net.pl3x.purpur.event.PlayerFeedAnimalEvent((org.bukkit.entity.Animals) getBukkitEntity(), (org.bukkit.entity.Player) entityhuman.getBukkitEntity(), itemstack.asBukkitCopy()).callEvent()) { // Purpur - if (this.getAge() == 0 && this.dD()) { + if (this.getAge() == 0 && this.ea()) { this.a(entityhuman, itemstack); this.f(entityhuman); -- diff --git a/patches/server/0004-Expose-Animals-isBreedingItem-ItemStack.patch b/patches/server/0004-Expose-Animals-isBreedingItem-ItemStack.patch index 89f42c455..0f6e2bb05 100644 --- a/patches/server/0004-Expose-Animals-isBreedingItem-ItemStack.patch +++ b/patches/server/0004-Expose-Animals-isBreedingItem-ItemStack.patch @@ -1,4 +1,4 @@ -From 39c6bbb0f6744af41f73aa9e1fce7b542d4795d7 Mon Sep 17 00:00:00 2001 +From 57f8d250f1af0e3b93e1168e2a5c5711c4f97d71 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Fri, 3 May 2019 23:45:45 -0500 Subject: [PATCH] Expose Animals#isBreedingItem(ItemStack) @@ -8,12 +8,12 @@ Subject: [PATCH] Expose Animals#isBreedingItem(ItemStack) 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java -index b06909c3e..63ddecb1a 100644 +index 599db583b..fa8ca2168 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java @@ -47,4 +47,11 @@ public class CraftAnimals extends CraftAgeable implements Animals { public int getLoveModeTicks() { - return getHandle().bC; // PAIL rename loveTicks + return getHandle().loveTicks; } + + // Purpur start diff --git a/patches/server/0005-Fix-cow-rotation-when-shearing-mooshroom.patch b/patches/server/0005-Fix-cow-rotation-when-shearing-mooshroom.patch index 2b04e832e..a413e10ae 100644 --- a/patches/server/0005-Fix-cow-rotation-when-shearing-mooshroom.patch +++ b/patches/server/0005-Fix-cow-rotation-when-shearing-mooshroom.patch @@ -1,4 +1,4 @@ -From a676b948f70d903d53d3483320b507b19e100740 Mon Sep 17 00:00:00 2001 +From e08952bd0dd95decb187f18b812d85e27d476e38 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Fri, 3 May 2019 23:53:16 -0500 Subject: [PATCH] Fix cow rotation when shearing mooshroom @@ -8,23 +8,23 @@ Subject: [PATCH] Fix cow rotation when shearing mooshroom 1 file changed, 6 insertions(+) diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java -index 638dbe978..4a74145bc 100644 +index 76712996f..d2de3589a 100644 --- a/src/main/java/net/minecraft/server/EntityMushroomCow.java +++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java -@@ -44,7 +44,13 @@ public class EntityMushroomCow extends EntityCow { +@@ -92,7 +92,13 @@ public class EntityMushroomCow extends EntityCow { - entitycow.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch); - entitycow.setHealth(this.getHealth()); -+ // Purpur start - correctly copy rotation -+ entitycow.u(this); - entitycow.aQ = this.aQ; -+ entitycow.aS = this.aS; -+ entitycow.lastYaw = this.lastYaw; -+ entitycow.lastPitch = this.lastPitch; -+ // Purpur end - if (this.hasCustomName()) { - entitycow.setCustomName(this.getCustomName()); - } + entitycow.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch); + entitycow.setHealth(this.getHealth()); ++ // Purpur start - correctly copy rotation ++ entitycow.u(this); + entitycow.aK = this.aK; ++ entitycow.aM = this.aM; ++ entitycow.lastYaw = this.lastYaw; ++ entitycow.lastPitch = this.lastPitch; ++ // Purpur end + if (this.hasCustomName()) { + entitycow.setCustomName(this.getCustomName()); + } -- 2.20.1 diff --git a/patches/server/0006-Snowman-set-pumpkin-on-off-by-player-interaction.patch b/patches/server/0006-Snowman-set-pumpkin-on-off-by-player-interaction.patch index 98c6effaa..7c2bd7ba1 100644 --- a/patches/server/0006-Snowman-set-pumpkin-on-off-by-player-interaction.patch +++ b/patches/server/0006-Snowman-set-pumpkin-on-off-by-player-interaction.patch @@ -1,26 +1,25 @@ -From e560363dbb4d096d26d2b6d6e184426d9e9193d5 Mon Sep 17 00:00:00 2001 +From 545452f08d19964e93df05345cbd7e405c583077 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Fri, 3 May 2019 23:58:44 -0500 Subject: [PATCH] Snowman set pumpkin on/off by player interaction --- - .../net/minecraft/server/EntitySnowman.java | 19 +++++++++++++++++-- - 1 file changed, 17 insertions(+), 2 deletions(-) + .../net/minecraft/server/EntitySnowman.java | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java -index b5c2fd92..7518d997 100644 +index 8677f0818..c13dfc6cc 100644 --- a/src/main/java/net/minecraft/server/EntitySnowman.java +++ b/src/main/java/net/minecraft/server/EntitySnowman.java -@@ -7,7 +7,7 @@ import org.bukkit.event.player.PlayerShearEntityEvent; - // CraftBukkit end +@@ -8,6 +8,7 @@ import org.bukkit.event.player.PlayerShearEntityEvent; public class EntitySnowman extends EntityGolem implements IRangedEntity { -- -+ private static final RecipeItemStack PUMPKIN = RecipeItemStack.a(Blocks.PUMPKIN.getItem(), Blocks.CARVED_PUMPKIN.getItem(), Blocks.JACK_O_LANTERN.getItem()); // Purpur - private static final DataWatcherObject a = DataWatcher.a(EntitySnowman.class, DataWatcherRegistry.a); - public EntitySnowman(World world) { -@@ -107,7 +107,7 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity { ++ private static final RecipeItemStack PUMPKIN = RecipeItemStack.a(Blocks.PUMPKIN.getItem(), Blocks.CARVED_PUMPKIN.getItem(), Blocks.JACK_O_LANTERN.getItem()); // Purpur + private static final DataWatcherObject b = DataWatcher.a(EntitySnowman.class, DataWatcherRegistry.a); + + public EntitySnowman(EntityTypes entitytypes, World world) { +@@ -112,7 +113,7 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity { protected boolean a(EntityHuman entityhuman, EnumHand enumhand) { ItemStack itemstack = entityhuman.b(enumhand); @@ -29,10 +28,10 @@ index b5c2fd92..7518d997 100644 // CraftBukkit start PlayerShearEntityEvent event = new PlayerShearEntityEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), this.getBukkitEntity()); this.world.getServer().getPluginManager().callEvent(event); -@@ -119,6 +119,21 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity { - - this.setHasPumpkin(false); - itemstack.damage(1, entityhuman); +@@ -126,6 +127,20 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity { + itemstack.damage(1, entityhuman, (entityhuman1) -> { + entityhuman1.d(enumhand); + }); + + // Purpur start + EntityItem pumpkin = new EntityItem(world, locX, locY, locZ, new ItemStack(Blocks.PUMPKIN.getItem())); @@ -47,7 +46,6 @@ index b5c2fd92..7518d997 100644 + } + return true; + } -+ // Purpur end } return super.a(entityhuman, enumhand); diff --git a/patches/server/0007-Implement-LivingEntity-safeFallDistance.patch b/patches/server/0007-Implement-LivingEntity-safeFallDistance.patch index 9e4f66c0a..c950d60ea 100644 --- a/patches/server/0007-Implement-LivingEntity-safeFallDistance.patch +++ b/patches/server/0007-Implement-LivingEntity-safeFallDistance.patch @@ -1,4 +1,4 @@ -From 9b22151ca279174b771b39bf13bea6f2422c9700 Mon Sep 17 00:00:00 2001 +From 9fb9afd68241fd01be4dfdf00f0211294b8471d6 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Sun, 5 May 2019 12:58:45 -0500 Subject: [PATCH] Implement LivingEntity safeFallDistance @@ -12,24 +12,24 @@ Subject: [PATCH] Implement LivingEntity safeFallDistance 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java -index dd827aea..053a880c 100644 +index d9e5eaad1..bcbade19e 100644 --- a/src/main/java/net/minecraft/server/EntityGiantZombie.java +++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java -@@ -7,6 +7,9 @@ public class EntityGiantZombie extends EntityMonster { - public EntityGiantZombie(World world) { - super(EntityTypes.GIANT, world); - this.setSize(this.width * 6.0F, this.length * 6.0F); +@@ -4,6 +4,9 @@ public class EntityGiantZombie extends EntityMonster { + + public EntityGiantZombie(EntityTypes entitytypes, World world) { + super(entitytypes, world); + // Purpur start + this.safeFallDistance = 10.0F; + // Purpur end } - public float getHeadHeight() { + @Override diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java -index 95327763..e211b95c 100644 +index 8ce2fca80..686bca4f2 100644 --- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java +++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java -@@ -181,7 +181,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven +@@ -179,7 +179,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven this.a(SoundEffects.ENTITY_HORSE_LAND, 0.4F, 1.0F); } @@ -39,7 +39,7 @@ index 95327763..e211b95c 100644 if (i > 0) { this.damageEntity(DamageSource.FALL, (float) i); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 4d5459d2..13a3bd02 100644 +index dacaa16e0..488ecbaa9 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -122,6 +122,7 @@ public abstract class EntityLiving extends Entity { @@ -50,8 +50,8 @@ index 4d5459d2..13a3bd02 100644 boolean forceDrops; ArrayList drops = new ArrayList(); public org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes; -@@ -1368,7 +1369,7 @@ public abstract class EntityLiving extends Entity { - super.c(f, f1); +@@ -1522,7 +1523,7 @@ public abstract class EntityLiving extends Entity { + super.b(f, f1); MobEffect mobeffect = this.getEffect(MobEffects.JUMP); float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1); - int i = MathHelper.f((f - 3.0F - f2) * f1); @@ -60,23 +60,23 @@ index 4d5459d2..13a3bd02 100644 if (i > 0) { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index 82a32c61..5e752b0c 100644 +index 6404b32b2..f8a8da637 100644 --- a/src/main/java/net/minecraft/server/EntityLlama.java +++ b/src/main/java/net/minecraft/server/EntityLlama.java -@@ -318,7 +318,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn - } +@@ -344,7 +344,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn - public void c(float f, float f1) { + @Override + public void b(float f, float f1) { - int i = MathHelper.f((f * 0.5F - 3.0F) * f1); + int i = MathHelper.f((f * 0.5F - this.safeFallDistance) * f1); // Purpur if (i > 0) { if (f >= 6.0F) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index d6a4bc64..89a49f03 100644 +index b85385ba4..640faccfd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -633,4 +633,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -686,4 +686,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return getHandle().isHandRaised(); } // Paper end diff --git a/patches/server/0008-Integrate-ridables.patch b/patches/server/0008-Integrate-ridables.patch index 5b7eb0877..ce8f27290 100644 --- a/patches/server/0008-Integrate-ridables.patch +++ b/patches/server/0008-Integrate-ridables.patch @@ -1,24 +1,24 @@ -From 06a7a4326ebb2250a3adac29b758fcf3bdd8da76 Mon Sep 17 00:00:00 2001 +From 2de5e5fb595c7060de3ebe191e00acc78449b8c2 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Tue, 30 Apr 2019 19:17:21 -0500 Subject: [PATCH] Integrate ridables --- - .../java/net/minecraft/server/BiomeBase.java | 26 ++- - .../net/minecraft/server/ControllerJump.java | 1 + + .../java/net/minecraft/server/BiomeBase.java | 1 + + .../java/net/minecraft/server/Biomes.java | 23 ++ .../server/ControllerLookDolphin.java | 4 +- - .../java/net/minecraft/server/Entity.java | 16 +- + .../java/net/minecraft/server/Entity.java | 15 +- .../net/minecraft/server/EntityChicken.java | 17 +- - .../java/net/minecraft/server/EntityCow.java | 14 ++ + .../java/net/minecraft/server/EntityCow.java | 20 +- .../net/minecraft/server/EntityCreeper.java | 14 ++ - .../net/minecraft/server/EntityDolphin.java | 28 ++- - .../net/minecraft/server/EntityDrowned.java | 38 +++- - .../minecraft/server/EntityEnderCrystal.java | 49 +++++ + .../net/minecraft/server/EntityDolphin.java | 27 ++- + .../net/minecraft/server/EntityDrowned.java | 7 +- + .../minecraft/server/EntityEnderCrystal.java | 49 ++++ .../net/minecraft/server/EntityEnderman.java | 15 ++ - .../net/minecraft/server/EntityEndermite.java | 15 ++ - .../java/net/minecraft/server/EntityFish.java | 28 ++- - .../minecraft/server/EntityGiantZombie.java | 36 +++- - .../net/minecraft/server/EntityGuardian.java | 36 +++- + .../net/minecraft/server/EntityEndermite.java | 17 +- + .../java/net/minecraft/server/EntityFish.java | 33 ++- + .../minecraft/server/EntityGiantZombie.java | 35 ++- + .../net/minecraft/server/EntityGuardian.java | 37 ++- .../net/minecraft/server/EntityHorse.java | 10 +- .../minecraft/server/EntityHorseAbstract.java | 4 +- .../server/EntityHorseChestedAbstract.java | 18 +- @@ -29,16 +29,18 @@ Subject: [PATCH] Integrate ridables .../net/minecraft/server/EntityHuman.java | 14 +- .../minecraft/server/EntityInsentient.java | 39 ++++ .../net/minecraft/server/EntityIronGolem.java | 15 ++ - .../net/minecraft/server/EntityLiving.java | 21 +- - .../net/minecraft/server/EntityLlama.java | 37 +++- + .../net/minecraft/server/EntityLiving.java | 28 ++- + .../net/minecraft/server/EntityLlama.java | 37 ++- .../minecraft/server/EntityMushroomCow.java | 14 ++ .../net/minecraft/server/EntityOcelot.java | 14 ++ - .../net/minecraft/server/EntityPhantom.java | 203 ++++++++++++++++-- - .../java/net/minecraft/server/EntityPig.java | 25 +++ + .../net/minecraft/server/EntityPhantom.java | 216 +++++++++++++++++- + .../java/net/minecraft/server/EntityPig.java | 25 ++ .../net/minecraft/server/EntityPolarBear.java | 15 ++ + .../net/minecraft/server/EntityRabbit.java | 2 +- .../net/minecraft/server/EntitySheep.java | 14 ++ .../minecraft/server/EntitySilverfish.java | 15 ++ .../server/EntitySkeletonAbstract.java | 15 ++ + .../net/minecraft/server/EntitySlime.java | 2 +- .../net/minecraft/server/EntitySnowman.java | 15 ++ .../net/minecraft/server/EntitySpider.java | 15 ++ .../net/minecraft/server/EntitySquid.java | 57 +++++ @@ -51,70 +53,59 @@ Subject: [PATCH] Integrate ridables .../controller/ControllerMoveWASDFlying.java | 58 +++++ .../controller/ControllerMoveWASDWater.java | 42 ++++ .../craftbukkit/entity/CraftLivingEntity.java | 10 + - 47 files changed, 1149 insertions(+), 55 deletions(-) + 49 files changed, 1137 insertions(+), 68 deletions(-) create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlying.java create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDWater.java diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java -index 3496d423..e59ee303 100644 +index 72eb669c5..f1500f7a0 100644 --- a/src/main/java/net/minecraft/server/BiomeBase.java +++ b/src/main/java/net/minecraft/server/BiomeBase.java -@@ -196,6 +196,7 @@ public abstract class BiomeBase { - return this.aR != null; +@@ -97,6 +97,7 @@ public abstract class BiomeBase { + return this.m != null; } + protected void addMobSpawn(EnumCreatureType creaturetype, BiomeBase.BiomeMeta biomemeta) { a(creaturetype, biomemeta); } // Purpur - OBFHELPER protected void a(EnumCreatureType enumcreaturetype, BiomeBase.BiomeMeta biomebase_biomemeta) { - ((List) this.aZ.get(enumcreaturetype)).add(biomebase_biomemeta); + ((List) this.u.get(enumcreaturetype)).add(biomebase_biomemeta); } -@@ -463,7 +464,30 @@ public abstract class BiomeBase { - a(166, "modified_wooded_badlands_plateau", new BiomeMesaPlateauMutated()); - a(167, "modified_badlands_plateau", new BiomeMesaPlateauClearMutated()); - Collections.addAll(BiomeBase.aG, new BiomeBase[] { Biomes.OCEAN, Biomes.PLAINS, Biomes.DESERT, Biomes.MOUNTAINS, Biomes.FOREST, Biomes.TAIGA, Biomes.SWAMP, Biomes.RIVER, Biomes.FROZEN_RIVER, Biomes.SNOWY_TUNDRA, Biomes.SNOWY_MOUNTAINS, Biomes.MUSHROOM_FIELDS, Biomes.MUSHROOM_FIELD_SHORE, Biomes.BEACH, Biomes.DESERT_HILLS, Biomes.WOODED_HILLS, Biomes.TAIGA_HILLS, Biomes.JUNGLE, Biomes.JUNGLE_HILLS, Biomes.JUNGLE_EDGE, Biomes.DEEP_OCEAN, Biomes.STONE_SHORE, Biomes.SNOWY_BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.DARK_FOREST, Biomes.SNOWY_TAIGA, Biomes.SNOWY_TAIGA_HILLS, Biomes.GIANT_TREE_TAIGA, Biomes.GIANT_TREE_TAIGA_HILLS, Biomes.WOODED_MOUNTAINS, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.BADLANDS, Biomes.WOODED_BADLANDS_PLATEAU, Biomes.BADLANDS_PLATEAU}); -- } +diff --git a/src/main/java/net/minecraft/server/Biomes.java b/src/main/java/net/minecraft/server/Biomes.java +index 317db4b12..69ba98b66 100644 +--- a/src/main/java/net/minecraft/server/Biomes.java ++++ b/src/main/java/net/minecraft/server/Biomes.java +@@ -92,5 +92,28 @@ public abstract class Biomes { + + static { + Collections.addAll(BiomeBase.b, new BiomeBase[] { Biomes.OCEAN, Biomes.PLAINS, Biomes.DESERT, Biomes.MOUNTAINS, Biomes.FOREST, Biomes.TAIGA, Biomes.SWAMP, Biomes.RIVER, Biomes.FROZEN_RIVER, Biomes.SNOWY_TUNDRA, Biomes.SNOWY_MOUNTAINS, Biomes.MUSHROOM_FIELDS, Biomes.MUSHROOM_FIELD_SHORE, Biomes.BEACH, Biomes.DESERT_HILLS, Biomes.WOODED_HILLS, Biomes.TAIGA_HILLS, Biomes.JUNGLE, Biomes.JUNGLE_HILLS, Biomes.JUNGLE_EDGE, Biomes.DEEP_OCEAN, Biomes.STONE_SHORE, Biomes.SNOWY_BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.DARK_FOREST, Biomes.SNOWY_TAIGA, Biomes.SNOWY_TAIGA_HILLS, Biomes.GIANT_TREE_TAIGA, Biomes.GIANT_TREE_TAIGA_HILLS, Biomes.WOODED_MOUNTAINS, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.BADLANDS, Biomes.WOODED_BADLANDS_PLATEAU, Biomes.BADLANDS_PLATEAU}); + + // Purpur start - add natural mob spawns (maybe find a better place for this?) -+ BiomeBase.addSpawn("plains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1); -+ BiomeBase.addSpawn("sunflower_plains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1); -+ BiomeBase.addSpawn("desert", EnumCreatureType.MONSTER, EntityTypes.GIANT, 2, 1, 1); -+ BiomeBase.addSpawn("desert_hills", EnumCreatureType.MONSTER, EntityTypes.GIANT, 2, 1, 1); -+ BiomeBase.addSpawn("desert_lakes", EnumCreatureType.MONSTER, EntityTypes.GIANT, 2, 1, 1); -+ BiomeBase.addSpawn("mountains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1); -+ BiomeBase.addSpawn("gravelly_mountains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1); -+ BiomeBase.addSpawn("modified_gravelly_mountains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1); -+ BiomeBase.addSpawn("savanna", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 2); -+ BiomeBase.addSpawn("savanna_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 2); -+ BiomeBase.addSpawn("shattered_savanna", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 2); -+ BiomeBase.addSpawn("shattered_savanna_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 2); -+ BiomeBase.addSpawn("badlands", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 2); -+ BiomeBase.addSpawn("badlands_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 2); -+ BiomeBase.addSpawn("eroded_badlands", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 2); -+ BiomeBase.addSpawn("modified_badlands_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 2, 1); ++ addSpawn("plains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1); ++ addSpawn("sunflower_plains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1); ++ addSpawn("desert", EnumCreatureType.MONSTER, EntityTypes.GIANT, 2, 1, 1); ++ addSpawn("desert_hills", EnumCreatureType.MONSTER, EntityTypes.GIANT, 2, 1, 1); ++ addSpawn("desert_lakes", EnumCreatureType.MONSTER, EntityTypes.GIANT, 2, 1, 1); ++ addSpawn("mountains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1); ++ addSpawn("gravelly_mountains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1); ++ addSpawn("modified_gravelly_mountains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1); ++ addSpawn("savanna", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 2); ++ addSpawn("savanna_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 2); ++ addSpawn("shattered_savanna", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 2); ++ addSpawn("shattered_savanna_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 2); ++ addSpawn("badlands", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 2); ++ addSpawn("badlands_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 2); ++ addSpawn("eroded_badlands", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 2); ++ addSpawn("modified_badlands_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 2, 1); + } + + private static void addSpawn(String biome, EnumCreatureType ct, EntityTypes et, int weight, int min_group, int max_group) { + IRegistry.BIOME.get(new MinecraftKey(biome)).addMobSpawn(ct, new BiomeBase.BiomeMeta(et, weight, min_group, max_group)); -+ } + } + // Purpur end - - private static void a(int i, String s, BiomeBase biomebase) { - IRegistry.BIOME.a(i, new MinecraftKey(s), biomebase); -diff --git a/src/main/java/net/minecraft/server/ControllerJump.java b/src/main/java/net/minecraft/server/ControllerJump.java -index 489beed2..041f0763 100644 ---- a/src/main/java/net/minecraft/server/ControllerJump.java -+++ b/src/main/java/net/minecraft/server/ControllerJump.java -@@ -9,6 +9,7 @@ public class ControllerJump { - this.b = entityinsentient; - } - -+ public void jump() { a(); } // Purpur - OBFHELPER - public void a() { - this.a = true; - } + } diff --git a/src/main/java/net/minecraft/server/ControllerLookDolphin.java b/src/main/java/net/minecraft/server/ControllerLookDolphin.java -index 8397aacb..92432ee6 100644 +index 454627f65..df3d6cf28 100644 --- a/src/main/java/net/minecraft/server/ControllerLookDolphin.java +++ b/src/main/java/net/minecraft/server/ControllerLookDolphin.java @@ -1,6 +1,6 @@ @@ -125,38 +116,38 @@ index 8397aacb..92432ee6 100644 private final int h; -@@ -9,7 +9,7 @@ public class ControllerLookDolphin extends ControllerLook { - this.h = i; +@@ -10,7 +10,7 @@ public class ControllerLookDolphin extends ControllerLook { } + @Override - public void a() { + public void tick() { // Purpur if (this.d) { this.d = false; - double d0 = this.e - this.a.locX; + this.a.aM = this.a(this.a.aM, this.h() + 20.0F, this.b); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 89a8bbe3..0abe7a99 100644 +index 7bdc0f4a5..af7a4f89b 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -96,6 +96,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -101,6 +101,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke private int id; - public boolean j; public boolean blocksEntitySpawning() { return j; } // Paper - OBFHELPER + public boolean i; public final boolean blocksEntitySpawning() { return this.i; } // Paper - OBFHELPER public final List passengers; + private EntityHuman rider; // Purpur - protected int k; + protected int j; private Entity vehicle; public boolean attachedToPlayer; -@@ -135,7 +136,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - public double N; - public double O; - public double P; -- public float Q; -+ public float Q; public float getStepHeight() { return Q; } public void setStepHeight(float stepHeight) { this.Q = stepHeight; } // Purpur - OBFHELPER +@@ -134,7 +135,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + public double H; + public double I; + public double J; +- public float K; ++ public float K; public float getStepHeight() { return K; } public void setStepHeight(float stepHeight) { this.K = stepHeight; } // Purpur - OBFHELPER public boolean noclip; - public float S; - protected Random random; -@@ -2115,6 +2116,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return this.k <= 0; + public float M; + protected final Random random; +@@ -2015,6 +2016,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + return this.world.getCubes(this, this.d(entitypose)); } + // Purpur start @@ -168,15 +159,15 @@ index 89a8bbe3..0abe7a99 100644 public void ejectPassengers() { for (int i = this.passengers.size() - 1; i >= 0; --i) { ((Entity) this.passengers.get(i)).stopRiding(); -@@ -2167,6 +2174,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2073,6 +2080,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke // Spigot end - if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bO() instanceof EntityHuman)) { + if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.getRidingPassenger() instanceof EntityHuman)) { this.passengers.add(0, entity); + this.rider = (EntityHuman) entity; // Purpur } else { this.passengers.add(entity); } -@@ -2205,6 +2213,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2111,6 +2119,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return false; } // Spigot end @@ -186,23 +177,15 @@ index 89a8bbe3..0abe7a99 100644 + } + // Purpur end this.passengers.remove(entity); - entity.k = 60; + entity.j = 60; } -@@ -2991,6 +3004,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return null; - } - -+ public List getPassengers() { return bP(); } // Purpur - OBFHELPER - public List bP() { - return (List) (this.passengers.isEmpty() ? Collections.emptyList() : Lists.newArrayList(this.passengers)); - } diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java -index 070a9e7b..cf3730b3 100644 +index a374c3051..4ab6b4fc4 100644 --- a/src/main/java/net/minecraft/server/EntityChicken.java +++ b/src/main/java/net/minecraft/server/EntityChicken.java -@@ -18,6 +18,11 @@ public class EntityChicken extends EntityAnimal { - this.setSize(0.4F, 0.7F); - this.bI = this.random.nextInt(6000) + 6000; +@@ -15,6 +15,11 @@ public class EntityChicken extends EntityAnimal { + super(entitytypes, world); + this.eggLayTime = this.random.nextInt(6000) + 6000; this.a(PathType.WATER, 0.0F); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); @@ -211,17 +194,17 @@ index 070a9e7b..cf3730b3 100644 + // Purpur end } - protected void n() { -@@ -62,7 +67,7 @@ public class EntityChicken extends EntityAnimal { + @Override +@@ -65,7 +70,7 @@ public class EntityChicken extends EntityAnimal { } - this.bC += this.bH * 2.0F; -- if (!this.world.isClientSide && !this.isBaby() && !this.isChickenJockey() && --this.bI <= 0) { -+ if (!this.isBaby() && !this.isChickenJockey() && --this.bI <= 0 && getRider() == null) { // Purpur + this.bz += this.bE * 2.0F; +- if (!this.world.isClientSide && this.isAlive() && !this.isBaby() && !this.isChickenJockey() && --this.eggLayTime <= 0) { ++ if (this.isAlive() && !this.isBaby() && !this.isChickenJockey() && --this.eggLayTime <= 0 && getRider() == null) { // Purpur this.a(SoundEffects.ENTITY_CHICKEN_EGG, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); this.forceDrops = true; // CraftBukkit this.a((IMaterial) Items.EGG); -@@ -72,6 +77,16 @@ public class EntityChicken extends EntityAnimal { +@@ -75,6 +80,16 @@ public class EntityChicken extends EntityAnimal { } @@ -235,17 +218,17 @@ index 070a9e7b..cf3730b3 100644 + } + // Purpur end + - public void c(float f, float f1) {} + @Override + public void b(float f, float f1) {} - protected SoundEffect D() { diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java -index efd2a0ee..231ade5c 100644 +index 0139688c7..4e70a2fc8 100644 --- a/src/main/java/net/minecraft/server/EntityCow.java +++ b/src/main/java/net/minecraft/server/EntityCow.java -@@ -11,6 +11,11 @@ public class EntityCow extends EntityAnimal { - protected EntityCow(EntityTypes entitytypes, World world) { +@@ -9,6 +9,11 @@ public class EntityCow extends EntityAnimal { + + public EntityCow(EntityTypes entitytypes, World world) { super(entitytypes, world); - this.setSize(0.9F, 1.4F); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -253,10 +236,10 @@ index efd2a0ee..231ade5c 100644 + // Purpur end } - public EntityCow(World world) { -@@ -62,6 +67,15 @@ public class EntityCow extends EntityAnimal { - private int mushroomsFed = 0; // Purpur + @Override +@@ -59,6 +64,15 @@ public class EntityCow extends EntityAnimal { + @Override public boolean a(EntityHuman entityhuman, EnumHand enumhand) { + // Purpur start - processInteract + if (processInteract(entityhuman, enumhand)) { @@ -270,14 +253,34 @@ index efd2a0ee..231ade5c 100644 ItemStack itemstack = entityhuman.b(enumhand); if (itemstack.getItem() == Items.BUCKET && !entityhuman.abilities.canInstantlyBuild && !this.isBaby()) { +@@ -99,8 +113,8 @@ public class EntityCow extends EntityAnimal { + mooshroom.setHealth(this.getHealth()); + mooshroom.setAge(getAge()); + mooshroom.u(this); +- mooshroom.aQ = this.aQ; +- mooshroom.aS = this.aS; ++ mooshroom.aK = this.aK; ++ mooshroom.aM = this.aM; + mooshroom.lastYaw = this.lastYaw; + mooshroom.lastPitch = this.lastPitch; + if (this.hasCustomName()) { +@@ -116,7 +130,7 @@ public class EntityCow extends EntityAnimal { + itemstack.subtract(1); + } + for (int i = 0; i < 15; ++i) { +- ((WorldServer) world).sendParticles(world.players, null, Particles.z, ++ ((WorldServer) world).sendParticles(((WorldServer) world).players, null, Particles.HAPPY_VILLAGER, + locX + random.nextFloat(), locY + (random.nextFloat() * 2), locZ + random.nextFloat(), 1, + random.nextGaussian() * 0.05D, random.nextGaussian() * 0.05D, random.nextGaussian() * 0.05D, 0, true); + } diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index 945a75dd..588bba0a 100644 +index 0c2c3c730..e0bfe0345 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java -@@ -22,6 +22,11 @@ public class EntityCreeper extends EntityMonster { - public EntityCreeper(World world) { - super(EntityTypes.CREEPER, world); - this.setSize(0.6F, 1.7F); +@@ -20,6 +20,11 @@ public class EntityCreeper extends EntityMonster { + + public EntityCreeper(EntityTypes entitytypes, World world) { + super(entitytypes, world); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -285,10 +288,10 @@ index 945a75dd..588bba0a 100644 + // Purpur end } - protected void n() { -@@ -175,6 +180,15 @@ public class EntityCreeper extends EntityMonster { - // CraftBukkit end + @Override +@@ -184,6 +189,15 @@ public class EntityCreeper extends EntityMonster { + @Override protected boolean a(EntityHuman entityhuman, EnumHand enumhand) { + // Purpur start - processInteract + if (processInteract(entityhuman, enumhand)) { @@ -303,20 +306,20 @@ index 945a75dd..588bba0a 100644 if (itemstack.getItem() == Items.FLINT_AND_STEEL) { diff --git a/src/main/java/net/minecraft/server/EntityDolphin.java b/src/main/java/net/minecraft/server/EntityDolphin.java -index 8bf15a68..5ef1796b 100644 +index 56394ccdc..07fe13619 100644 --- a/src/main/java/net/minecraft/server/EntityDolphin.java +++ b/src/main/java/net/minecraft/server/EntityDolphin.java -@@ -18,6 +18,7 @@ public class EntityDolphin extends EntityWaterAnimal { - this.setSize(0.9F, 0.6F); +@@ -20,6 +20,7 @@ public class EntityDolphin extends EntityWaterAnimal { this.moveController = new EntityDolphin.a(this); this.lookController = new ControllerLookDolphin(this, 10); + this.setCanPickupLoot(true); + this.canBeRiddenInWater = true; // Purpur - this.p(true); } -@@ -199,6 +200,15 @@ public class EntityDolphin extends EntityWaterAnimal { - } + @Nullable +@@ -224,6 +225,15 @@ public class EntityDolphin extends EntityWaterAnimal { + @Override protected boolean a(EntityHuman entityhuman, EnumHand enumhand) { + // Purpur start - processInteract + if (processInteract(entityhuman, enumhand)) { @@ -330,7 +333,7 @@ index 8bf15a68..5ef1796b 100644 ItemStack itemstack = entityhuman.b(enumhand); if (!itemstack.isEmpty() && itemstack.getItem().a(TagsItem.FISHES)) { -@@ -487,7 +497,7 @@ public class EntityDolphin extends EntityWaterAnimal { +@@ -519,7 +529,7 @@ public class EntityDolphin extends EntityWaterAnimal { } } @@ -339,11 +342,10 @@ index 8bf15a68..5ef1796b 100644 private final EntityDolphin i; -@@ -496,7 +506,21 @@ public class EntityDolphin extends EntityWaterAnimal { +@@ -528,8 +538,21 @@ public class EntityDolphin extends EntityWaterAnimal { this.i = entitydolphin; } -- public void a() { + // Purpur start + @Override + public void tick(EntityHuman rider) { @@ -352,86 +354,64 @@ index 8bf15a68..5ef1796b 100644 + tick(); + } else { + super.tick(rider); -+ this.i.motY += 0.005D; ++ this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D)); + } + } + -+ @Override + @Override +- public void a() { + public void tick() { + // Purpur end if (this.i.isInWater()) { - this.i.motY += 0.005D; + this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D)); } diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java -index 0e2b5ee7..522f7d61 100644 +index 449fbee60..482c4ee48 100644 --- a/src/main/java/net/minecraft/server/EntityDrowned.java +++ b/src/main/java/net/minecraft/server/EntityDrowned.java -@@ -6,14 +6,47 @@ import javax.annotation.Nullable; +@@ -6,7 +6,7 @@ import javax.annotation.Nullable; public class EntityDrowned extends EntityZombie implements IRangedEntity { -- private boolean bC; -+ private boolean bC; public boolean isSwimmingUp() { return this.bC; } // Purpur - OBFHELPER - protected final NavigationGuardian a; - protected final Navigation b; +- private boolean bz; ++ private boolean bz; public boolean isSwimmingUp() { return this.bz; } // Purpur - OBFHELPER + protected final NavigationGuardian b; + protected final Navigation c; - public EntityDrowned(World world) { - super(EntityTypes.DROWNED, world); - this.Q = 1.0F; -- this.moveController = new EntityDrowned.e(this); -+ // Purpur start -+ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this) { -+ @Override -+ public void tick() { -+ EntityDrowned drowned = EntityDrowned.this; -+ EntityLiving target = drowned.getGoalTarget(); -+ if (drowned.isSwimmingUpOrTargetIsInWater() && drowned.isInWater()) { -+ if (target != null && target.locY > drowned.locY || drowned.isSwimmingUp()) { -+ drowned.motY += 0.002D; -+ } -+ if (h != Operation.MOVE_TO || drowned.getNavigation().p()) { -+ drowned.setSpeed(0.0F); -+ return; -+ } -+ double x = b - drowned.locX; -+ double y = c - drowned.locY; -+ double z = d - drowned.locZ; -+ y /= (double) MathHelper.sqrt(x * x + y * y + z * z); -+ drowned.yaw = a(drowned.yaw, (float) (MathHelper.c(z, x) * 57.2957763671875D) - 90.0F, 90.0F); -+ drowned.setRenderYawOffset(drowned.yaw); -+ float speed = (float) (e * drowned.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue()); -+ drowned.setSpeed(drowned.getSpeed() + (speed - drowned.getSpeed()) * 0.125F); -+ drowned.motY += (double) drowned.getSpeed() * y * 0.1D; -+ drowned.motX += (double) drowned.getSpeed() * x * 0.005D; -+ drowned.motZ += (double) drowned.getSpeed() * z * 0.005D; -+ } else { -+ if (!drowned.onGround) { -+ drowned.motY -= 0.008D; -+ } -+ super.tick(); -+ } -+ } -+ }; -+ // Purpur end - this.a(PathType.WATER, 0.0F); - this.a = new NavigationGuardian(this, world); - this.b = new Navigation(this, world); -@@ -123,6 +156,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { +@@ -134,6 +134,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { return !this.isSwimming(); } -+ public boolean isSwimmingUpOrTargetIsInWater() { return dI(); } // Purpur - OBFHELPER - private boolean dI() { - if (this.bC) { ++ public boolean isSwimmingUpOrTargetIsInWater() { return eg(); } // Purpur - OBFHELPER + private boolean eg() { + if (this.bz) { return true; +@@ -205,7 +206,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + this.bz = flag; + } + +- static class d extends ControllerMove { ++ static class d extends net.pl3x.purpur.controller.ControllerMoveWASD { + + private final EntityDrowned i; + +@@ -215,7 +216,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + } + + @Override +- public void a() { ++ public void tick() { + EntityLiving entityliving = this.i.getGoalTarget(); + + if (this.i.eg() && this.i.isInWater()) { diff --git a/src/main/java/net/minecraft/server/EntityEnderCrystal.java b/src/main/java/net/minecraft/server/EntityEnderCrystal.java -index 79bdb82b..020a0f2d 100644 +index 9491cb9de..871c65b88 100644 --- a/src/main/java/net/minecraft/server/EntityEnderCrystal.java +++ b/src/main/java/net/minecraft/server/EntityEnderCrystal.java @@ -13,6 +13,12 @@ public class EntityEnderCrystal extends Entity { - private static final DataWatcherObject> b = DataWatcher.a(EntityEnderCrystal.class, DataWatcherRegistry.m); - private static final DataWatcherObject c = DataWatcher.a(EntityEnderCrystal.class, DataWatcherRegistry.i); - public int a; + private static final DataWatcherObject> c = DataWatcher.a(EntityEnderCrystal.class, DataWatcherRegistry.m); + private static final DataWatcherObject d = DataWatcher.a(EntityEnderCrystal.class, DataWatcherRegistry.i); + public int b; + // Purpur start + private EntityPhantom targetPhantom; + private int phantomBeamTicks = 0; @@ -439,9 +419,9 @@ index 79bdb82b..020a0f2d 100644 + private int idleCooldown = 0; + // Purpur end - public EntityEnderCrystal(World world) { - super(EntityTypes.END_CRYSTAL, world); -@@ -52,7 +58,50 @@ public class EntityEnderCrystal extends Entity { + public EntityEnderCrystal(EntityTypes entitytypes, World world) { + super(entitytypes, world); +@@ -54,7 +60,50 @@ public class EntityEnderCrystal extends Entity { } } @@ -490,15 +470,15 @@ index 79bdb82b..020a0f2d 100644 } + // Purpur end + @Override protected void b(NBTTagCompound nbttagcompound) { - if (this.getBeamTarget() != null) { diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 94504044..7ac728ba 100644 +index f08f139e9..434ffc0f4 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -21,6 +21,11 @@ public class EntityEnderman extends EntityMonster { - this.setSize(0.6F, 2.9F); - this.Q = 1.0F; +@@ -24,6 +24,11 @@ public class EntityEnderman extends EntityMonster { + super(entitytypes, world); + this.K = 1.0F; this.a(PathType.WATER, -1.0F); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); @@ -507,9 +487,9 @@ index 94504044..7ac728ba 100644 + // Purpur end } - protected void n() { -@@ -243,6 +248,16 @@ public class EntityEnderman extends EntityMonster { - return LootTables.C; + @Override +@@ -256,6 +261,16 @@ public class EntityEnderman extends EntityMonster { + } + // Purpur start - processInteract @@ -523,16 +503,16 @@ index 94504044..7ac728ba 100644 + // Purpur end + public void setCarried(@Nullable IBlockData iblockdata) { - this.datawatcher.set(EntityEnderman.c, Optional.ofNullable(iblockdata)); + this.datawatcher.set(EntityEnderman.d, Optional.ofNullable(iblockdata)); } diff --git a/src/main/java/net/minecraft/server/EntityEndermite.java b/src/main/java/net/minecraft/server/EntityEndermite.java -index 9a22e202..8e8d4cbc 100644 +index 10b0f9653..09c9be025 100644 --- a/src/main/java/net/minecraft/server/EntityEndermite.java +++ b/src/main/java/net/minecraft/server/EntityEndermite.java -@@ -11,6 +11,11 @@ public class EntityEndermite extends EntityMonster { - super(EntityTypes.ENDERMITE, world); - this.b_ = 3; - this.setSize(0.4F, 0.3F); +@@ -9,6 +9,11 @@ public class EntityEndermite extends EntityMonster { + public EntityEndermite(EntityTypes entitytypes, World world) { + super(entitytypes, world); + this.f = 3; + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -540,8 +520,17 @@ index 9a22e202..8e8d4cbc 100644 + // Purpur end } - protected void n() { -@@ -128,4 +133,14 @@ public class EntityEndermite extends EntityMonster { + @Override +@@ -18,7 +23,7 @@ public class EntityEndermite extends EntityMonster { + this.goalSelector.a(3, new PathfinderGoalRandomStrollLand(this, 1.0D)); + this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); +- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a()); ++ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // Purpur - decompile error? + this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); + } + +@@ -138,4 +143,14 @@ public class EntityEndermite extends EntityMonster { public EnumMonsterType getMonsterType() { return EnumMonsterType.ARTHROPOD; } @@ -557,11 +546,11 @@ index 9a22e202..8e8d4cbc 100644 + // Purpur end } diff --git a/src/main/java/net/minecraft/server/EntityFish.java b/src/main/java/net/minecraft/server/EntityFish.java -index 5da2d72a..ecfcbe31 100644 +index a28fbdf1e..c014c6f6c 100644 --- a/src/main/java/net/minecraft/server/EntityFish.java +++ b/src/main/java/net/minecraft/server/EntityFish.java -@@ -7,6 +7,10 @@ public abstract class EntityFish extends EntityWaterAnimal implements IAnimal { - public EntityFish(EntityTypes entitytypes, World world) { +@@ -9,6 +9,10 @@ public abstract class EntityFish extends EntityWaterAnimal { + public EntityFish(EntityTypes entitytypes, World world) { super(entitytypes, world); this.moveController = new EntityFish.a(this); + // Purpur start @@ -570,19 +559,32 @@ index 5da2d72a..ecfcbe31 100644 + // Purpur end } - public float getHeadHeight() { -@@ -73,7 +77,7 @@ public abstract class EntityFish extends EntityWaterAnimal implements IAnimal { - - public void a(float f, float f1, float f2) { - if (this.cP() && this.isInWater()) { -- this.a(f, f1, f2, 0.01F); -+ this.a(f, f1, f2, getRider() == null ? 0.1F : getSpeed()); // Purpur - this.move(EnumMoveType.SELF, this.motX, this.motY, this.motZ); - this.motX *= 0.8999999761581421D; - this.motY *= 0.8999999761581421D; -@@ -101,6 +105,15 @@ public abstract class EntityFish extends EntityWaterAnimal implements IAnimal { + @Override +@@ -75,11 +79,7 @@ public abstract class EntityFish extends EntityWaterAnimal { + protected void initPathfinder() { + super.initPathfinder(); + this.goalSelector.a(0, new PathfinderGoalPanic(this, 1.25D)); +- PathfinderGoalSelector pathfindergoalselector = this.goalSelector; +- Predicate predicate = IEntitySelector.f; +- +- predicate.getClass(); +- pathfindergoalselector.a(2, new PathfinderGoalAvoidTarget<>(this, EntityHuman.class, 8.0F, 1.6D, 1.4D, predicate::test)); ++ this.goalSelector.a(2, new PathfinderGoalAvoidTarget<>(this, EntityHuman.class, 8.0F, 1.6D, 1.4D, IEntitySelector.f::test)); // Purpur - decompile error? + this.goalSelector.a(4, new EntityFish.b(this)); } +@@ -91,7 +91,7 @@ public abstract class EntityFish extends EntityWaterAnimal { + @Override + public void e(Vec3D vec3d) { + if (this.de() && this.isInWater()) { +- this.a(0.01F, vec3d); ++ this.a(getRider() == null ? 0.1F : getSpeed(), vec3d); // Purpur + this.move(EnumMoveType.SELF, this.getMot()); + this.setMot(this.getMot().a(0.9D)); + if (this.getGoalTarget() == null) { +@@ -117,6 +117,15 @@ public abstract class EntityFish extends EntityWaterAnimal { + + @Override protected boolean a(EntityHuman entityhuman, EnumHand enumhand) { + // Purpur start - processInteract + if (processInteract(entityhuman, enumhand)) { @@ -596,7 +598,7 @@ index 5da2d72a..ecfcbe31 100644 ItemStack itemstack = entityhuman.b(enumhand); if (itemstack.getItem() == Items.WATER_BUCKET && this.isAlive()) { -@@ -145,7 +158,7 @@ public abstract class EntityFish extends EntityWaterAnimal implements IAnimal { +@@ -162,7 +171,7 @@ public abstract class EntityFish extends EntityWaterAnimal { return SoundEffects.ENTITY_FISH_SWIM; } @@ -605,31 +607,31 @@ index 5da2d72a..ecfcbe31 100644 private final EntityFish i; -@@ -154,7 +167,16 @@ public abstract class EntityFish extends EntityWaterAnimal implements IAnimal { +@@ -171,8 +180,16 @@ public abstract class EntityFish extends EntityWaterAnimal { this.i = entityfish; } -- public void a() { + // Purpur start + @Override + public void tick(EntityHuman rider) { + super.tick(rider); -+ this.i.motY += 0.005D; ++ this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D)); + } + -+ @Override + @Override +- public void a() { + public void tick() { + // Purpur end if (this.i.a(TagsFluid.WATER)) { - this.i.motY += 0.005D; + this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D)); } diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java -index 053a880c..0786af8b 100644 +index bcbade19e..3cfbc5c49 100644 --- a/src/main/java/net/minecraft/server/EntityGiantZombie.java +++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java -@@ -8,7 +8,11 @@ public class EntityGiantZombie extends EntityMonster { - super(EntityTypes.GIANT, world); - this.setSize(this.width * 6.0F, this.length * 6.0F); +@@ -5,7 +5,11 @@ public class EntityGiantZombie extends EntityMonster { + public EntityGiantZombie(EntityTypes entitytypes, World world) { + super(entitytypes, world); // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -639,20 +641,20 @@ index 053a880c..0786af8b 100644 // Purpur end } -@@ -23,8 +27,38 @@ public class EntityGiantZombie extends EntityMonster { +@@ -22,8 +26,37 @@ public class EntityGiantZombie extends EntityMonster { this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(50.0D); } + // Purpur start -+ @Override -+ protected void n() { // initPathfinder + @Override ++ protected void initPathfinder() { + this.goalSelector.a(0, new PathfinderGoalFloat(this)); + this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); + this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D)); + this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 16.0F)); + this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); + this.goalSelector.a(5, new PathfinderGoalMoveTowardsRestriction(this, 1.0D)); -+ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, true, EntityHuman.class)); ++ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this).a(EntityPigZombie.class)); + this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillager.class, false)); + this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true)); @@ -660,7 +662,7 @@ index 053a880c..0786af8b 100644 + } + + @Override -+ public float cG() { // jump height ++ public float cW() { // jump height + return 1.0F; + } + @@ -674,19 +676,20 @@ index 053a880c..0786af8b 100644 + // Purpur end + public float a(BlockPosition blockposition, IWorldReader iworldreader) { -- return iworldreader.A(blockposition) - 0.5F; +- return iworldreader.w(blockposition) - 0.5F; + return super.a(blockposition, iworldreader); // Purpur - fix light requirements for natural spawns } - - @Nullable + } diff --git a/src/main/java/net/minecraft/server/EntityGuardian.java b/src/main/java/net/minecraft/server/EntityGuardian.java -index 072236ec..e04cb7c0 100644 +index 335416d96..6c41730eb 100644 --- a/src/main/java/net/minecraft/server/EntityGuardian.java +++ b/src/main/java/net/minecraft/server/EntityGuardian.java -@@ -22,6 +22,15 @@ public class EntityGuardian extends EntityMonster { - this.b_ = 10; - this.setSize(0.85F, 0.85F); +@@ -22,8 +22,15 @@ public class EntityGuardian extends EntityMonster { + super(entitytypes, world); + this.f = 10; this.moveController = new EntityGuardian.ControllerMoveGuardian(this); +- this.c = this.random.nextFloat(); +- this.d = this.c; + // Purpur start + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this) { + @Override @@ -696,27 +699,27 @@ index 072236ec..e04cb7c0 100644 + }; + this.canBeRiddenInWater = true; + // Purpur end - this.a = this.random.nextFloat(); - this.b = this.a; - } -@@ -75,6 +84,7 @@ public class EntityGuardian extends EntityMonster { - return (Boolean) this.datawatcher.get(EntityGuardian.bF); } -+ private void setMovingFlag(boolean movingFlag) { a(movingFlag); } // Purpur - OBFHELPER - private void a(boolean flag) { - this.datawatcher.set(EntityGuardian.bF, flag); + @Override +@@ -77,6 +84,7 @@ public class EntityGuardian extends EntityMonster { + return (Boolean) this.datawatcher.get(EntityGuardian.b); } -@@ -282,7 +292,7 @@ public class EntityGuardian extends EntityMonster { - public void a(float f, float f1, float f2) { - if (this.cP() && this.isInWater()) { -- this.a(f, f1, f2, 0.1F); -+ this.a(f, f1, f2, getRider() == null ? 0.1F : getSpeed()); // Purpur - this.move(EnumMoveType.SELF, this.motX, this.motY, this.motZ); - this.motX *= 0.8999999761581421D; - this.motY *= 0.8999999761581421D; -@@ -296,7 +306,17 @@ public class EntityGuardian extends EntityMonster { ++ private void setMovingFlag(boolean movingFlag) { r(movingFlag); } // Purpur - OBFHELPER + private void r(boolean flag) { + this.datawatcher.set(EntityGuardian.b, flag); + } +@@ -302,7 +310,7 @@ public class EntityGuardian extends EntityMonster { + @Override + public void e(Vec3D vec3d) { + if (this.de() && this.isInWater()) { +- this.a(0.1F, vec3d); ++ this.a(getRider() == null ? 0.1F : getSpeed(), vec3d); // Purpur + this.move(EnumMoveType.SELF, this.getMot()); + this.setMot(this.getMot().a(0.9D)); + if (!this.dY() && this.getGoalTarget() == null) { +@@ -314,7 +322,17 @@ public class EntityGuardian extends EntityMonster { } @@ -735,30 +738,29 @@ index 072236ec..e04cb7c0 100644 private final EntityGuardian i; -@@ -305,7 +325,17 @@ public class EntityGuardian extends EntityMonster { - this.i = entityguardian; +@@ -324,7 +342,16 @@ public class EntityGuardian extends EntityMonster { } + @Override - public void a() { + // Purpur start -+ @Override + public void tick(EntityHuman rider) { + super.tick(rider); -+ this.i.motY += 0.005D; ++ this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D)); + this.i.setMovingFlag(this.i.getForward() > 0.0F); // control tail speed + } + + @Override + public void tick() { + // Purpur end - if (this.h == ControllerMove.Operation.MOVE_TO && !this.i.getNavigation().p()) { - double d0 = this.b - this.i.locX; - double d1 = this.c - this.i.locY; + if (this.h == ControllerMove.Operation.MOVE_TO && !this.i.getNavigation().n()) { + Vec3D vec3d = new Vec3D(this.b - this.i.locX, this.c - this.i.locY, this.d - this.i.locZ); + double d0 = vec3d.f(); diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java -index 1b9425f3..ff7f1a61 100644 +index 401f00561..0e6759303 100644 --- a/src/main/java/net/minecraft/server/EntityHorse.java +++ b/src/main/java/net/minecraft/server/EntityHorse.java -@@ -191,12 +191,14 @@ public class EntityHorse extends EntityHorseAbstract { +@@ -201,12 +201,14 @@ public class EntityHorse extends EntityHorseAbstract { } } @@ -778,43 +780,43 @@ index 1b9425f3..ff7f1a61 100644 } diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java -index e211b95c..31e29b2e 100644 +index 686bca4f2..0250a5653 100644 --- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java +++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java -@@ -80,7 +80,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven +@@ -81,7 +81,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven } public boolean isTamed() { -- return this.p(2); -+ return this.p(2) || isBaby(); // Purpur +- return this.r(2); ++ return this.r(2) || isBaby(); // Purpur } @Nullable -@@ -300,6 +300,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven +@@ -280,6 +280,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven return true; } -+ public boolean isSaddled() { return dV(); } // Purpur - OBFHELPER - public boolean dV() { - return this.p(4); ++ public boolean isSaddled() { return eq(); } // Purpur - OBFHELPER + public boolean eq() { + return this.r(4); } -@@ -611,6 +612,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven +@@ -600,6 +601,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven } -+ public void makeMad() { dZ(); } // Purpur - OBFHELPER - public void dZ() { - this.dH(); - SoundEffect soundeffect = this.dB(); ++ public void makeMad() { eu(); } // Purpur - OBFHELPER + public void eu() { + this.eB(); + SoundEffect soundeffect = this.getSoundAngry(); diff --git a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java -index 6eddc2a8..7fa0c8fc 100644 +index e61d8f07d..371f2dcb9 100644 --- a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java +++ b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java -@@ -146,8 +146,12 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract { +@@ -152,8 +152,12 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract { return true; } -- this.dZ(); +- this.eu(); - return true; + // Purpur start - don't make babies mad + if (!this.isBaby()) { @@ -825,7 +827,7 @@ index 6eddc2a8..7fa0c8fc 100644 } if (!this.isCarryingChest() && itemstack.getItem() == Blocks.CHEST.getItem()) { -@@ -172,12 +176,14 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract { +@@ -178,12 +182,14 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract { } } @@ -845,48 +847,48 @@ index 6eddc2a8..7fa0c8fc 100644 } diff --git a/src/main/java/net/minecraft/server/EntityHorseDonkey.java b/src/main/java/net/minecraft/server/EntityHorseDonkey.java -index 65c40e72..cd0828cc 100644 +index 46338f0f8..3083269a5 100644 --- a/src/main/java/net/minecraft/server/EntityHorseDonkey.java +++ b/src/main/java/net/minecraft/server/EntityHorseDonkey.java -@@ -6,6 +6,9 @@ public class EntityHorseDonkey extends EntityHorseChestedAbstract { +@@ -4,6 +4,9 @@ public class EntityHorseDonkey extends EntityHorseChestedAbstract { - public EntityHorseDonkey(World world) { - super(EntityTypes.DONKEY, world); + public EntityHorseDonkey(EntityTypes entitytypes, World world) { + super(entitytypes, world); + // Purpur start + this.canBeRiddenInWater = true; + // Purpur end } - @Nullable + @Override diff --git a/src/main/java/net/minecraft/server/EntityHorseMule.java b/src/main/java/net/minecraft/server/EntityHorseMule.java -index d17c3e81..874ea280 100644 +index ef930d194..119ca47d0 100644 --- a/src/main/java/net/minecraft/server/EntityHorseMule.java +++ b/src/main/java/net/minecraft/server/EntityHorseMule.java -@@ -6,6 +6,9 @@ public class EntityHorseMule extends EntityHorseChestedAbstract { +@@ -4,6 +4,9 @@ public class EntityHorseMule extends EntityHorseChestedAbstract { - public EntityHorseMule(World world) { - super(EntityTypes.MULE, world); + public EntityHorseMule(EntityTypes entitytypes, World world) { + super(entitytypes, world); + // Purpur start + this.canBeRiddenInWater = true; + // Purpur end } - @Nullable + @Override diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -index 0a092acd..05c963c3 100644 +index b96726456..2193f218a 100644 --- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java +++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java @@ -10,6 +10,9 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { - public EntityHorseSkeleton(World world) { - super(EntityTypes.SKELETON_HORSE, world); + public EntityHorseSkeleton(EntityTypes entitytypes, World world) { + super(entitytypes, world); + // Purpur start + this.canBeRiddenInWater = true; + // Purpur end } - protected void initAttributes() { -@@ -142,18 +145,20 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { + @Override +@@ -154,18 +157,20 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { if (itemstack.getItem() instanceof ItemMonsterEgg) { return super.a(entityhuman, enumhand); @@ -901,22 +903,22 @@ index 0a092acd..05c963c3 100644 + // return super.a(entityhuman, enumhand); + // Purpur end + } else if (entityhuman.isSneaking() && !this.isBaby()) { // Purpur - don't open inventory on babies - this.c(entityhuman); + this.e(entityhuman); return true; } else if (this.isVehicle()) { return super.a(entityhuman, enumhand); } else { if (!itemstack.isEmpty()) { -- if (itemstack.getItem() == Items.SADDLE && !this.dV()) { +- if (itemstack.getItem() == Items.SADDLE && !this.eq()) { + if (!this.isBaby() && itemstack.getItem() == Items.SADDLE && !this.isSaddled()) { // Purpur - don't open inventory on babies - this.c(entityhuman); + this.e(entityhuman); return true; } diff --git a/src/main/java/net/minecraft/server/EntityHorseZombie.java b/src/main/java/net/minecraft/server/EntityHorseZombie.java -index a1873f55..9dac0c25 100644 +index 1160929e1..e25511ef1 100644 --- a/src/main/java/net/minecraft/server/EntityHorseZombie.java +++ b/src/main/java/net/minecraft/server/EntityHorseZombie.java -@@ -49,18 +49,20 @@ public class EntityHorseZombie extends EntityHorseAbstract { +@@ -51,18 +51,20 @@ public class EntityHorseZombie extends EntityHorseAbstract { if (itemstack.getItem() instanceof ItemMonsterEgg) { return super.a(entityhuman, enumhand); @@ -931,22 +933,22 @@ index a1873f55..9dac0c25 100644 + // return super.a(entityhuman, enumhand); + // Purpur end + } else if (entityhuman.isSneaking() && !this.isBaby()) { // Purpur - don't open inventory on babies - this.c(entityhuman); + this.e(entityhuman); return true; } else if (this.isVehicle()) { return super.a(entityhuman, enumhand); } else { if (!itemstack.isEmpty()) { -- if (!this.dV() && itemstack.getItem() == Items.SADDLE) { +- if (!this.eq() && itemstack.getItem() == Items.SADDLE) { + if (!this.isBaby() && itemstack.getItem() == Items.SADDLE && !this.isSaddled()) { // Purpur - don't open inventory on babies - this.c(entityhuman); + this.e(entityhuman); return true; } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index fdbe9a2a..3fbfa6d7 100644 +index e811a2917..f25c394e3 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -372,8 +372,20 @@ public abstract class EntityHuman extends EntityLiving { +@@ -347,9 +347,21 @@ public abstract class EntityHuman extends EntityLiving { this.activeContainer = this.defaultContainer; } @@ -962,27 +964,28 @@ index fdbe9a2a..3fbfa6d7 100644 + } + // Purpur end + - public void aH() { + @Override + public void passengerTick() { - if (!this.world.isClientSide && this.isSneaking() && this.isPassenger()) { + if (this.isSneaking() && this.isPassenger() && !this.mounting) { // Purpur this.stopRiding(); this.setSneaking(false); } else { diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index d1ec201d..ae9d0585 100644 +index a0c089477..db5284f48 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -515,6 +515,7 @@ public abstract class EntityInsentient extends EntityLiving { - this.bh = f; +@@ -492,6 +492,7 @@ public abstract class EntityInsentient extends EntityLiving { + this.bb = f; } + public void setSpeed(float speed) { o(speed); } // Purpur - OBFHELPER + @Override public void o(float f) { super.o(f); - this.r(f); -@@ -1310,4 +1311,42 @@ public abstract class EntityInsentient extends EntityLiving { - } - +@@ -1359,4 +1360,42 @@ public abstract class EntityInsentient extends EntityLiving { + public boolean a(Item item) { + return this.getItemInMainHand().getItem() == item || this.getItemInOffHand().getItem() == item; } + + // Purpur start @@ -1024,13 +1027,13 @@ index d1ec201d..ae9d0585 100644 + // Purpur end } diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java -index ae269270..8140fa12 100644 +index 7aebc90af..97a5dcfd0 100644 --- a/src/main/java/net/minecraft/server/EntityIronGolem.java +++ b/src/main/java/net/minecraft/server/EntityIronGolem.java -@@ -14,6 +14,11 @@ public class EntityIronGolem extends EntityGolem { - public EntityIronGolem(World world) { - super(EntityTypes.IRON_GOLEM, world); - this.setSize(1.4F, 2.7F); +@@ -9,6 +9,11 @@ public class EntityIronGolem extends EntityGolem { + public EntityIronGolem(EntityTypes entitytypes, World world) { + super(entitytypes, world); + this.K = 1.0F; + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -1038,10 +1041,10 @@ index ae269270..8140fa12 100644 + // Purpur end } - protected void n() { -@@ -190,4 +195,14 @@ public class EntityIronGolem extends EntityGolem { - - return iblockdata1.q() && SpawnerCreature.a(iblockdata2, iblockdata2.s()) && SpawnerCreature.a(iblockdata, FluidTypes.EMPTY.i()) && iworldreader.getCubes(this, this.getBoundingBox()) && iworldreader.a_(this, this.getBoundingBox()); + @Override +@@ -175,4 +180,14 @@ public class EntityIronGolem extends EntityGolem { + return SpawnerCreature.a((IBlockAccess) iworldreader, blockposition2, iblockdata1, iblockdata1.p()) && SpawnerCreature.a((IBlockAccess) iworldreader, blockposition, iworldreader.getType(blockposition), FluidTypes.EMPTY.i()) && iworldreader.i(this); + } } + + // Purpur start - processInteract @@ -1055,24 +1058,24 @@ index ae269270..8140fa12 100644 + // Purpur end } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 13a3bd02..3058c6ce 100644 +index 488ecbaa9..4a1fefbb4 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -90,9 +90,9 @@ public abstract class EntityLiving extends Entity { - protected int be; protected int getKillCount() { return this.be; } // Paper - OBFHELPER +@@ -88,9 +88,9 @@ public abstract class EntityLiving extends Entity { + protected int aY; protected int getKillCount() { return this.aY; } // Paper - OBFHELPER public float lastDamage; - protected boolean bg; -- public float bh; -- public float bi; -- public float bj; -+ public float bh; public float getStrafe() { return bh; } public void setStrafe(float strafe) { bh = strafe; } // Purpur - OBFHELPER -+ public float bi; public float getVertical() { return bi; } public void setVertical(float vertical) { bi = vertical; } // Purpur - OBFHELPER -+ public float bj; public float getForward() { return bj; } public void setForward(float forward) { bj = forward; } // Purpur - OBFHELPER - public float bk; - protected int bl; - protected double bm; -@@ -347,8 +347,16 @@ public abstract class EntityLiving extends Entity { - return false; + protected boolean jumping; +- public float bb; +- public float bc; +- public float bd; ++ public float bb; public float getStrafe() { return bb; } public void setStrafe(float strafe) { bb = strafe; } // Purpur - OBFHELPER ++ public float bc; public float getVertical() { return bc; } public void setVertical(float vertical) { bc = vertical; } // Purpur - OBFHELPER ++ public float bd; public float getForward() { return bd; } public void setForward(float forward) { bd = forward; } // Purpur - OBFHELPER + public float be; + protected int bf; + protected double bg; +@@ -369,10 +369,19 @@ public abstract class EntityLiving extends Entity { + return this.isBaby() ? 0.5F : 1.0F; } + // Purpur start @@ -1082,58 +1085,67 @@ index 13a3bd02..3058c6ce 100644 + this.canBeRiddenInWater = canBeRiddenInWater; + } + -+ public boolean canBeRiddenInWater() { return aY(); } - public boolean aY() { ++ public boolean canBeRiddenInWater() { return be(); } + @Override + public boolean be() { - return false; + return canBeRiddenInWater; } ++ // Purpur end - protected void cb() { -@@ -1839,6 +1847,7 @@ public abstract class EntityLiving extends Entity { + protected void cn() { + ++this.deathTicks; +@@ -2027,7 +2036,7 @@ public abstract class EntityLiving extends Entity { return 0.42F; } -+ public void jump() { cH(); } // Purpur - OBFHELPER - protected void cH() { - this.motY = (double) this.cG(); +- protected void jump() { ++ public void jump() { // Purpur - protected -> public + float f; + if (this.hasEffect(MobEffects.JUMP)) { -@@ -2083,10 +2092,12 @@ public abstract class EntityLiving extends Entity { - this.aK += this.aJ; +@@ -2256,10 +2265,12 @@ public abstract class EntityLiving extends Entity { + return this.onGround ? this.da() * (0.21600002F / (f * f * f)) : this.aO; } -+ public float getSpeed() { return cK(); } // Purpur - OBFHELPER - public float cK() { - return this.bI; ++ public float getSpeed() { return da(); } // Purpur - OBFHELPER + public float da() { + return this.bD; } + public void setSpeed(float speed) { o(speed); } // Purpur - OBFHELPER public void o(float f) { - this.bI = f; + this.bD = f; } -@@ -2500,6 +2511,7 @@ public abstract class EntityLiving extends Entity { +@@ -2683,6 +2694,12 @@ public abstract class EntityLiving extends Entity { this.fallDistance = 0.0F; } -+ public void setJumping(boolean jumping) { o(jumping); } public boolean isJumping() { return bg; } // Purpur - OBFHELPER - public void o(boolean flag) { - this.bg = flag; ++ // Purpur start ++ public boolean isJumping() { ++ return jumping; ++ } ++ // Purpur end ++ + public void setJumping(boolean flag) { + this.jumping = flag; } -@@ -2547,6 +2559,7 @@ public abstract class EntityLiving extends Entity { - this.aS = f; +@@ -2735,6 +2752,7 @@ public abstract class EntityLiving extends Entity { + this.aM = f; } -+ public void setRenderYawOffset(float renderYawOffset) { k(renderYawOffset); } // Purpur - OBFHELPER - public void k(float f) { - this.aQ = f; - } ++ public void setRenderYawOffset(float renderYawOffset) { l(renderYawOffset); } // Purpur - OBFHELPER + @Override + public void l(float f) { + this.aK = f; diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index 5e752b0c..8a54a6f2 100644 +index f8a8da637..6870fb875 100644 --- a/src/main/java/net/minecraft/server/EntityLlama.java +++ b/src/main/java/net/minecraft/server/EntityLlama.java -@@ -18,6 +18,29 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn - public EntityLlama(World world) { - super(EntityTypes.LLAMA, world); - this.setSize(0.9F, 1.87F); +@@ -16,6 +16,29 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + + public EntityLlama(EntityTypes entitytypes, World world) { + super(entitytypes, world); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this) { + @Override @@ -1160,7 +1172,7 @@ index 5e752b0c..8a54a6f2 100644 } public void setStrength(int i) { -@@ -346,6 +369,18 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn +@@ -371,6 +394,18 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn } } @@ -1176,26 +1188,26 @@ index 5e752b0c..8a54a6f2 100644 + } + // Purpur end + - public void ek() { - if (this.bQ != null) { - this.bQ.bR = null; -@@ -360,7 +395,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + public void eG() { + if (this.bN != null) { + this.bN.bO = null; +@@ -385,7 +420,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn } - public boolean el() { -- return this.bR != null; -+ return getRider() != null || this.bR != null; // Purpur + public boolean eH() { +- return this.bO != null; ++ return getRider() != null || this.bO != null; // Purpur } - public boolean inCaravan() { return this.em(); } // Paper - OBFHELPER + public boolean eI() { diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java -index 4a74145b..a7277d84 100644 +index d2de3589a..5c113e35c 100644 --- a/src/main/java/net/minecraft/server/EntityMushroomCow.java +++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java -@@ -14,9 +14,23 @@ public class EntityMushroomCow extends EntityCow { - super(EntityTypes.MOOSHROOM, world); - this.setSize(0.9F, 1.4F); - this.bF = Blocks.MYCELIUM; +@@ -18,6 +18,11 @@ public class EntityMushroomCow extends EntityCow { + public EntityMushroomCow(EntityTypes entitytypes, World world) { + super(entitytypes, world); + this.bC = Blocks.MYCELIUM; + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -1203,6 +1215,10 @@ index 4a74145b..a7277d84 100644 + // Purpur end } + @Override +@@ -40,6 +45,15 @@ public class EntityMushroomCow extends EntityCow { + + @Override public boolean a(EntityHuman entityhuman, EnumHand enumhand) { + // Purpur start - processInteract + if (processInteract(entityhuman, enumhand)) { @@ -1217,13 +1233,13 @@ index 4a74145b..a7277d84 100644 if (itemstack.getItem() == Items.BOWL && this.getAge() >= 0 && !entityhuman.abilities.canInstantlyBuild) { diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java -index 13c84bda..bee1532a 100644 +index 1713bead2..21fa1579b 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java -@@ -15,6 +15,11 @@ public class EntityOcelot extends EntityTameableAnimal { - public EntityOcelot(World world) { - super(EntityTypes.OCELOT, world); - this.setSize(0.6F, 0.7F); +@@ -14,6 +14,11 @@ public class EntityOcelot extends EntityAnimal { + public EntityOcelot(EntityTypes entitytypes, World world) { + super(entitytypes, world); + this.dV(); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -1231,61 +1247,60 @@ index 13c84bda..bee1532a 100644 + // Purpur end } - protected void n() { -@@ -122,6 +127,15 @@ public class EntityOcelot extends EntityTameableAnimal { - } + private boolean isTrusting() { +@@ -127,6 +132,15 @@ public class EntityOcelot extends EntityAnimal { + @Override public boolean a(EntityHuman entityhuman, EnumHand enumhand) { + // Purpur start - processInteract + if (processInteract(entityhuman, enumhand)) { + return true; // vanilla action handled + } -+ return (!isTamed() && isOwner(entityhuman)) || tryRide(entityhuman, enumhand); ++ return tryRide(entityhuman, enumhand); + } + + public boolean processInteract(EntityHuman entityhuman, EnumHand enumhand) { + // Purpur end ItemStack itemstack = entityhuman.b(enumhand); - if (this.isTamed()) { + if ((this.bD == null || this.bD.h()) && !this.isTrusting() && this.i(itemstack) && entityhuman.h((Entity) this) < 9.0D) { diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java -index f576264a..8a5aed24 100644 +index e5d032d02..7201b3a39 100644 --- a/src/main/java/net/minecraft/server/EntityPhantom.java +++ b/src/main/java/net/minecraft/server/EntityPhantom.java -@@ -1,5 +1,7 @@ +@@ -1,5 +1,6 @@ package net.minecraft.server; -+import net.pl3x.purpur.controller.ControllerLookWASD; -+ ++import java.util.Comparator; + import java.util.EnumSet; import java.util.Iterator; import java.util.List; - import javax.annotation.Nullable; -@@ -7,9 +9,10 @@ import javax.annotation.Nullable; +@@ -8,9 +9,10 @@ import javax.annotation.Nullable; public class EntityPhantom extends EntityFlying implements IMonster { - private static final DataWatcherObject a = DataWatcher.a(EntityPhantom.class, DataWatcherRegistry.b); -- private Vec3D b; -- private BlockPosition c; -- private EntityPhantom.AttackPhase bC; -+ private Vec3D b; public Vec3D getOrbitOffset() { return this.b; } public void setOrbitOffset(Vec3D offset) { this.b = offset; } // Purpur - OBFHELPER -+ private BlockPosition c; public BlockPosition getOrbitPosition() { return this.c; } public void setOrbitPosition(BlockPosition position) { this.c = position; } // Purpur - OBFHELPER -+ private EntityPhantom.AttackPhase bC; public AttackPhase getPhase() { return this.bC; } public void setPhase(AttackPhase phase) { this.bC = phase; } // Purpur - OBFHELPER + private static final DataWatcherObject b = DataWatcher.a(EntityPhantom.class, DataWatcherRegistry.b); +- private Vec3D c; +- private BlockPosition d; +- private EntityPhantom.AttackPhase bz; ++ private Vec3D c; public Vec3D getOrbitOffset() { return this.c; } public void setOrbitOffset(Vec3D offset) { this.c = offset; } // Purpur - OBFHELPER ++ private BlockPosition d; public BlockPosition getOrbitPosition() { return this.d; } public void setOrbitPosition(BlockPosition position) { this.d = position; } // Purpur - OBFHELPER ++ private EntityPhantom.AttackPhase bz; public AttackPhase getPhase() { return this.bz; } public void setPhase(AttackPhase phase) { this.bz = phase; } // Purpur - OBFHELPER + private BlockPosition totemPosition; public BlockPosition getTotemPosition() { return this.totemPosition; } public void setTotemPosition(BlockPosition position) { this.totemPosition = position; } // Purpur - public EntityPhantom(World world) { - super(EntityTypes.PHANTOM, world); -@@ -20,6 +23,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { - this.setSize(0.9F, 0.5F); + public EntityPhantom(EntityTypes entitytypes, World world) { + super(entitytypes, world); +@@ -20,6 +22,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + this.f = 5; this.moveController = new EntityPhantom.g(this); this.lookController = new EntityPhantom.f(this); + this.canBeRiddenInWater = false; // Purpur } - protected EntityAIBodyControl o() { -@@ -27,8 +31,10 @@ public class EntityPhantom extends EntityFlying implements IMonster { - } + @Override +@@ -29,8 +32,10 @@ public class EntityPhantom extends EntityFlying implements IMonster { - protected void n() { + @Override + protected void initPathfinder() { + this.goalSelector.a(0, new FindTotemGoal(this)); // Purpur this.goalSelector.a(1, new EntityPhantom.c()); this.goalSelector.a(2, new EntityPhantom.i()); @@ -1293,31 +1308,32 @@ index f576264a..8a5aed24 100644 this.goalSelector.a(3, new EntityPhantom.e()); this.targetSelector.a(1, new EntityPhantom.b()); } -@@ -103,7 +109,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { - } +@@ -102,7 +107,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + @Override public void movementTick() { -- if (this.dq()) { -+ if (getRider() == null && this.dq()) { // Purpur - do not set fire if being ridden +- if (this.isAlive() && this.dS()) { ++ if (this.isAlive() && getRider() == null && this.dS()) { // Purpur - do not set fire if being ridden this.setOnFire(8); } -@@ -114,6 +120,25 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -114,6 +119,26 @@ public class EntityPhantom extends EntityFlying implements IMonster { super.mobTick(); } + // Purpur start + @Override -+ protected void a(boolean wasRecentlyHit, int lootingModifier, DamageSource damagesource) { // dropLoot ++ protected LootTableInfo.Builder a(boolean wasRecentlyHit, DamageSource damagesource) { // dropLoot + boolean dropped = false; + if (killer == null && damagesource.getEntity() instanceof EntityEnderCrystal) { + if (random.nextInt(5) < 1) { // 1 out of 5 chance (20%) -+ dropped = a_(new ItemStack(Items.PHANTOM_MEMBRANE)) != null; ++ dropped = a(new ItemStack(Items.PHANTOM_MEMBRANE)) != null; + } + } + if (!dropped) { -+ super.a(wasRecentlyHit, lootingModifier, damagesource); // dropLoot ++ return super.a(wasRecentlyHit, damagesource); // dropLoot + } ++ return new LootTableInfo.Builder((WorldServer) world); + } + + public boolean isCirclingTotem() { @@ -1325,10 +1341,10 @@ index f576264a..8a5aed24 100644 + } + // Purpur end + - public GroupDataEntity prepare(DifficultyDamageScaler difficultydamagescaler, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) { - this.c = (new BlockPosition(this)).up(5); - this.setSize(0); -@@ -188,6 +213,138 @@ public class EntityPhantom extends EntityFlying implements IMonster { + @Override + public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) { + this.d = (new BlockPosition(this)).up(5); +@@ -202,6 +227,150 @@ public class EntityPhantom extends EntityFlying implements IMonster { } // Paper end @@ -1344,11 +1360,11 @@ index f576264a..8a5aed24 100644 + class FindTotemGoal extends PathfinderGoal { + private final EntityPhantom phantom; + private EntityEnderCrystal totem; -+ private PathfinderGoalNearestAttackableTarget.DistanceComparator comparator; ++ private Comparator comparator; + + FindTotemGoal(EntityPhantom phantom) { + this.phantom = phantom; -+ comparator = new PathfinderGoalNearestAttackableTarget.DistanceComparator(phantom); ++ comparator = Comparator.comparingDouble(phantom::h); + } + + @Override @@ -1398,6 +1414,18 @@ index f576264a..8a5aed24 100644 + AttributeInstance range = phantom.getAttributeInstance(GenericAttributes.FOLLOW_RANGE); + return range == null ? 16.0D : range.getValue(); + } ++ ++ class DistanceComparator implements Comparator { ++ private final Entity entity; ++ ++ public DistanceComparator(Entity entity) { ++ this.entity = entity; ++ } ++ ++ public int compare(Entity entity1, Entity entity2) { ++ return Double.compare(entity.h(entity1), entity.h(entity2)); ++ } ++ } + } + + class OrbitTotemGoal extends PathfinderGoal { @@ -1409,7 +1437,7 @@ index f576264a..8a5aed24 100644 + + OrbitTotemGoal(EntityPhantom phantom) { + this.phantom = phantom; -+ a(1); ++ this.a(EnumSet.of(PathfinderGoal.Type.MOVE)); + } + + @Override @@ -1441,14 +1469,14 @@ index f576264a..8a5aed24 100644 + this.c = phantom.random.nextFloat() * 2.0F * 3.1415927F; + updateOffset(); + } -+ if (phantom.b.c(phantom.locX, phantom.locY, phantom.locZ) < 4.0D) { ++ if (phantom.c.c(phantom.locX, phantom.locY, phantom.locZ) < 4.0D) { + updateOffset(); + } -+ if (phantom.b.y < phantom.locY && !phantom.world.isEmpty((new BlockPosition(phantom)).down(1))) { ++ if (phantom.c.y < phantom.locY && !phantom.world.isEmpty((new BlockPosition(phantom)).down(1))) { + this.verticalChange = Math.max(1.0F, this.verticalChange); + updateOffset(); + } -+ if (phantom.b.y > phantom.locY && !phantom.world.isEmpty((new BlockPosition(phantom)).up(1))) { ++ if (phantom.c.y > phantom.locY && !phantom.world.isEmpty((new BlockPosition(phantom)).up(1))) { + this.verticalChange = Math.min(-1.0F, this.verticalChange); + updateOffset(); + } @@ -1466,55 +1494,57 @@ index f576264a..8a5aed24 100644 + class b extends PathfinderGoal { - private int b; -@@ -237,7 +394,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { - private c() {} - + private final PathfinderTargetCondition b; +@@ -259,7 +428,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { public boolean a() { -- return PathfinderGoalTarget.a(EntityPhantom.this, EntityPhantom.this.getGoalTarget(), false, false); -+ return !isCirclingTotem() && PathfinderGoalTarget.a(EntityPhantom.this, EntityPhantom.this.getGoalTarget(), false, false); // Purpur - } - - public void c() { -@@ -279,13 +436,13 @@ public class EntityPhantom extends EntityFlying implements IMonster { - } - - public boolean a() { -- return EntityPhantom.this.getGoalTarget() != null && EntityPhantom.this.bC == EntityPhantom.AttackPhase.SWOOP; -+ return !isCirclingTotem() && EntityPhantom.this.getGoalTarget() != null && EntityPhantom.this.bC == EntityPhantom.AttackPhase.SWOOP; // Purpur - } - - public boolean b() { EntityLiving entityliving = EntityPhantom.this.getGoalTarget(); -- return entityliving == null ? false : (!entityliving.isAlive() ? false : (entityliving instanceof EntityHuman && (((EntityHuman) entityliving).isSpectator() || ((EntityHuman) entityliving).u()) ? false : this.a())); -+ return !isCirclingTotem() && entityliving == null ? false : (!entityliving.isAlive() ? false : (entityliving instanceof EntityHuman && (((EntityHuman) entityliving).isSpectator() || ((EntityHuman) entityliving).u()) ? false : this.a())); // Purpur +- return entityliving != null ? EntityPhantom.this.a(EntityPhantom.this.getGoalTarget(), PathfinderTargetCondition.a) : false; ++ return !isCirclingTotem() && entityliving != null && EntityPhantom.this.a(EntityPhantom.this.getGoalTarget(), PathfinderTargetCondition.a); // Purpur } - public void c() {} -@@ -322,7 +479,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { - } + @Override +@@ -305,11 +474,16 @@ public class EntityPhantom extends EntityFlying implements IMonster { + @Override public boolean a() { -- return EntityPhantom.this.getGoalTarget() == null || EntityPhantom.this.bC == EntityPhantom.AttackPhase.CIRCLE; -+ return !isCirclingTotem() && (EntityPhantom.this.getGoalTarget() == null || EntityPhantom.this.bC == EntityPhantom.AttackPhase.CIRCLE); // Purpur +- return EntityPhantom.this.getGoalTarget() != null && EntityPhantom.this.bz == EntityPhantom.AttackPhase.SWOOP; ++ return !isCirclingTotem() && EntityPhantom.this.getGoalTarget() != null && EntityPhantom.this.bz == EntityPhantom.AttackPhase.SWOOP; // Purpur } - public void c() { -@@ -387,13 +544,23 @@ public class EntityPhantom extends EntityFlying implements IMonster { + @Override + public boolean b() { ++ // Purpur start ++ if (isCirclingTotem()) { ++ return false; ++ } ++ // Purpur end + EntityLiving entityliving = EntityPhantom.this.getGoalTarget(); + + if (entityliving == null) { +@@ -379,7 +553,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + + @Override + public boolean a() { +- return EntityPhantom.this.getGoalTarget() == null || EntityPhantom.this.bz == EntityPhantom.AttackPhase.CIRCLE; ++ return !isCirclingTotem() && EntityPhantom.this.getGoalTarget() == null || EntityPhantom.this.bz == EntityPhantom.AttackPhase.CIRCLE; // Purpur + } + + @Override +@@ -446,14 +620,23 @@ public class EntityPhantom extends EntityFlying implements IMonster { } } - class f extends ControllerLook { -+ class f extends ControllerLookWASD { // Purpur ++ class f extends net.pl3x.purpur.controller.ControllerLookWASD { // Purpur public f(EntityInsentient entityinsentient) { super(entityinsentient); } + @Override - public void a() {} + // Purpur start -+ @Override + public void tick(EntityHuman rider) { + setYawPitch(rider.yaw, -rider.pitch * 0.75F); + } @@ -1527,7 +1557,7 @@ index f576264a..8a5aed24 100644 } class d extends EntityAIBodyControl { -@@ -408,7 +575,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -469,7 +652,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { } } @@ -1536,13 +1566,13 @@ index f576264a..8a5aed24 100644 private float j = 0.1F; -@@ -416,7 +583,19 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -477,8 +660,19 @@ public class EntityPhantom extends EntityFlying implements IMonster { super(entityinsentient); } -- public void a() { + // Purpur start -+ @Override + @Override +- public void a() { + public void tick(EntityHuman rider) { + if (!EntityPhantom.this.onGround) { + // phantom is always in motion when flying @@ -1558,13 +1588,13 @@ index f576264a..8a5aed24 100644 EntityPhantom.this.yaw += 180.0F; this.j = 0.1F; diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index d1689dc3..50efffcf 100644 +index 616075569..f44bbfcb3 100644 --- a/src/main/java/net/minecraft/server/EntityPig.java +++ b/src/main/java/net/minecraft/server/EntityPig.java -@@ -19,6 +19,11 @@ public class EntityPig extends EntityAnimal { - public EntityPig(World world) { - super(EntityTypes.PIG, world); - this.setSize(0.9F, 0.9F); +@@ -18,6 +18,11 @@ public class EntityPig extends EntityAnimal { + + public EntityPig(EntityTypes entitytypes, World world) { + super(entitytypes, world); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -1572,10 +1602,10 @@ index d1689dc3..50efffcf 100644 + // Purpur end } - protected void n() { -@@ -99,6 +104,15 @@ public class EntityPig extends EntityAnimal { - } + @Override +@@ -111,6 +116,15 @@ public class EntityPig extends EntityAnimal { + @Override public boolean a(EntityHuman entityhuman, EnumHand enumhand) { + // Purpur start - processInteract + if (processInteract(entityhuman, enumhand)) { @@ -1589,7 +1619,7 @@ index d1689dc3..50efffcf 100644 if (!super.a(entityhuman, enumhand)) { ItemStack itemstack = entityhuman.b(enumhand); -@@ -114,6 +128,17 @@ public class EntityPig extends EntityAnimal { +@@ -126,6 +140,17 @@ public class EntityPig extends EntityAnimal { } else if (itemstack.getItem() == Items.SADDLE) { itemstack.a(entityhuman, (EntityLiving) this, enumhand); return true; @@ -1608,13 +1638,13 @@ index d1689dc3..50efffcf 100644 return false; } diff --git a/src/main/java/net/minecraft/server/EntityPolarBear.java b/src/main/java/net/minecraft/server/EntityPolarBear.java -index dbb534c9..77de1a7d 100644 +index 182a3195e..94f561a9d 100644 --- a/src/main/java/net/minecraft/server/EntityPolarBear.java +++ b/src/main/java/net/minecraft/server/EntityPolarBear.java -@@ -15,6 +15,11 @@ public class EntityPolarBear extends EntityAnimal { - public EntityPolarBear(World world) { - super(EntityTypes.POLAR_BEAR, world); - this.setSize(1.3F, 1.4F); +@@ -14,6 +14,11 @@ public class EntityPolarBear extends EntityAnimal { + + public EntityPolarBear(EntityTypes entitytypes, World world) { + super(entitytypes, world); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -1622,8 +1652,8 @@ index dbb534c9..77de1a7d 100644 + // Purpur end } - public EntityAgeable createChild(EntityAgeable entityageable) { -@@ -130,6 +135,16 @@ public class EntityPolarBear extends EntityAnimal { + @Override +@@ -154,6 +159,16 @@ public class EntityPolarBear extends EntityAnimal { return 0.98F; } @@ -1637,17 +1667,30 @@ index dbb534c9..77de1a7d 100644 + } + // Purpur end + - public GroupDataEntity prepare(DifficultyDamageScaler difficultydamagescaler, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) { + @Override + public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) { if (groupdataentity instanceof EntityPolarBear.b) { - if (((EntityPolarBear.b) groupdataentity).a) { +diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java +index f6fa87158..bd0679e74 100644 +--- a/src/main/java/net/minecraft/server/EntityRabbit.java ++++ b/src/main/java/net/minecraft/server/EntityRabbit.java +@@ -59,7 +59,7 @@ public class EntityRabbit extends EntityAnimal { + } + + @Override +- protected void jump() { ++ public void jump() { // Purpur - protected -> public + super.jump(); + double d0 = this.moveController.c(); + diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java -index c35d1eef..78ce8211 100644 +index f0cd951ac..311cdb58b 100644 --- a/src/main/java/net/minecraft/server/EntitySheep.java +++ b/src/main/java/net/minecraft/server/EntitySheep.java -@@ -67,6 +67,11 @@ public class EntitySheep extends EntityAnimal { - public EntitySheep(World world) { - super(EntityTypes.SHEEP, world); - this.setSize(0.9F, 1.3F); +@@ -55,6 +55,11 @@ public class EntitySheep extends EntityAnimal { + + public EntitySheep(EntityTypes entitytypes, World world) { + super(entitytypes, world); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -1655,10 +1698,10 @@ index c35d1eef..78ce8211 100644 + // Purpur end } - protected void n() { -@@ -150,6 +155,15 @@ public class EntitySheep extends EntityAnimal { - } + @Override +@@ -144,6 +149,15 @@ public class EntitySheep extends EntityAnimal { + @Override public boolean a(EntityHuman entityhuman, EnumHand enumhand) { + // Purpur start - processInteract + if (processInteract(entityhuman, enumhand)) { @@ -1673,13 +1716,13 @@ index c35d1eef..78ce8211 100644 if (itemstack.getItem() == Items.SHEARS && !this.isSheared() && !this.isBaby()) { diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java -index ba40e03f..8f30ad66 100644 +index d823c6b6d..4bc91b19f 100644 --- a/src/main/java/net/minecraft/server/EntitySilverfish.java +++ b/src/main/java/net/minecraft/server/EntitySilverfish.java @@ -10,6 +10,11 @@ public class EntitySilverfish extends EntityMonster { - public EntitySilverfish(World world) { - super(EntityTypes.SILVERFISH, world); - this.setSize(0.4F, 0.3F); + + public EntitySilverfish(EntityTypes entitytypes, World world) { + super(entitytypes, world); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -1687,8 +1730,8 @@ index ba40e03f..8f30ad66 100644 + // Purpur end } - protected void n() { -@@ -106,6 +111,16 @@ public class EntitySilverfish extends EntityMonster { + @Override +@@ -117,6 +122,16 @@ public class EntitySilverfish extends EntityMonster { return EnumMonsterType.ARTHROPOD; } @@ -1706,13 +1749,13 @@ index ba40e03f..8f30ad66 100644 private EnumDirection h; diff --git a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java -index 6e2ee04c..f62dfecf 100644 +index 85157e80d..94dca9e48 100644 --- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java +++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java @@ -24,6 +24,11 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR + protected EntitySkeletonAbstract(EntityTypes entitytypes, World world) { super(entitytypes, world); - this.setSize(0.6F, 1.99F); - this.dz(); + this.dV(); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -1720,10 +1763,10 @@ index 6e2ee04c..f62dfecf 100644 + // Purpur end } - protected void n() { -@@ -197,4 +202,14 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR - public void s(boolean flag) { - this.datawatcher.set(EntitySkeletonAbstract.a, flag); + @Override +@@ -199,4 +204,14 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR + public double aN() { + return -0.6D; } + + // Purpur start - processInteract @@ -1736,14 +1779,27 @@ index 6e2ee04c..f62dfecf 100644 + } + // Purpur end } +diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java +index d720d0fae..e4f7797ed 100644 +--- a/src/main/java/net/minecraft/server/EntitySlime.java ++++ b/src/main/java/net/minecraft/server/EntitySlime.java +@@ -316,7 +316,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { + } + + @Override +- protected void jump() { ++ public void jump() { // Purpur - protected -> public + Vec3D vec3d = this.getMot(); + + this.setMot(vec3d.x, 0.41999998688697815D, vec3d.z); diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java -index 277ef077..0a7c8872 100644 +index c13dfc6cc..930b4673e 100644 --- a/src/main/java/net/minecraft/server/EntitySnowman.java +++ b/src/main/java/net/minecraft/server/EntitySnowman.java @@ -13,6 +13,11 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity { - public EntitySnowman(World world) { - super(EntityTypes.SNOW_GOLEM, world); - this.setSize(0.7F, 1.9F); + + public EntitySnowman(EntityTypes entitytypes, World world) { + super(entitytypes, world); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -1751,8 +1807,8 @@ index 277ef077..0a7c8872 100644 + // Purpur end } - protected void n() { -@@ -66,6 +71,7 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity { + @Override +@@ -74,6 +79,7 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity { return; } @@ -1760,9 +1816,9 @@ index 277ef077..0a7c8872 100644 IBlockData iblockdata = Blocks.SNOW.getBlockData(); for (int l = 0; l < 4; ++l) { -@@ -105,6 +111,15 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity { - } +@@ -111,6 +117,15 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity { + @Override protected boolean a(EntityHuman entityhuman, EnumHand enumhand) { + // Purpur start - processInteract + if (processInteract(entityhuman, enumhand)) { @@ -1777,13 +1833,13 @@ index 277ef077..0a7c8872 100644 if (this.hasPumpkin()) { if (itemstack.getItem() == Items.SHEARS) { // Purpur diff --git a/src/main/java/net/minecraft/server/EntitySpider.java b/src/main/java/net/minecraft/server/EntitySpider.java -index 9ef1c9ba..8ac330dc 100644 +index b560a8969..41374df4f 100644 --- a/src/main/java/net/minecraft/server/EntitySpider.java +++ b/src/main/java/net/minecraft/server/EntitySpider.java -@@ -10,6 +10,11 @@ public class EntitySpider extends EntityMonster { - protected EntitySpider(EntityTypes entitytypes, World world) { +@@ -9,6 +9,11 @@ public class EntitySpider extends EntityMonster { + + public EntitySpider(EntityTypes entitytypes, World world) { super(entitytypes, world); - this.setSize(1.4F, 0.9F); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -1791,9 +1847,9 @@ index 9ef1c9ba..8ac330dc 100644 + // Purpur end } - public EntitySpider(World world) { -@@ -106,6 +111,16 @@ public class EntitySpider extends EntityMonster { - this.datawatcher.set(EntitySpider.a, b0); + @Override +@@ -115,6 +120,16 @@ public class EntitySpider extends EntityMonster { + this.datawatcher.set(EntitySpider.b, b0); } + // Purpur start - processInteract @@ -1807,30 +1863,30 @@ index 9ef1c9ba..8ac330dc 100644 + // Purpur end + @Nullable - public GroupDataEntity prepare(DifficultyDamageScaler difficultydamagescaler, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) { - Object object = super.prepare(difficultydamagescaler, groupdataentity, nbttagcompound); + @Override + public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) { diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java -index ab79317a..b783c073 100644 +index 77c0ed42f..e82d4e643 100644 --- a/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java -@@ -24,6 +24,7 @@ public class EntitySquid extends EntityWaterAnimal { - this.setSize(0.8F, 0.8F); - //this.random.setSeed((long) (1 + this.getId())); // Paper - this.bI = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F; +@@ -21,6 +21,7 @@ public class EntitySquid extends EntityWaterAnimal { + super(entitytypes, world); + //this.random.setSeed((long) this.getId()); // Paper + this.bF = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F; + this.canBeRiddenInWater = true; // Purpur } - protected void n() { -@@ -173,6 +174,7 @@ public class EntitySquid extends EntityWaterAnimal { - // Paper end + @Override +@@ -174,6 +175,7 @@ public class EntitySquid extends EntityWaterAnimal { + return this.locY > this.world.spigotConfig.squidSpawnRangeMin && this.locY < maxHeight; // Spigot // Paper } -+ public void setMovementVector(float x, float y, float z) { c(x, y, z); } // Purpur - OBFHELPER - public void c(float f, float f1, float f2) { - this.bK = f; - this.bL = f1; -@@ -183,6 +185,16 @@ public class EntitySquid extends EntityWaterAnimal { - return this.bK != 0.0F || this.bL != 0.0F || this.bM != 0.0F; ++ public void setMovementVector(float x, float y, float z) { a(x, y, z); } // Purpur - OBFHELPER + public void a(float f, float f1, float f2) { + this.bH = f; + this.bI = f1; +@@ -184,6 +186,16 @@ public class EntitySquid extends EntityWaterAnimal { + return this.bH != 0.0F || this.bI != 0.0F || this.bJ != 0.0F; } + // Purpur start - processInteract @@ -1846,9 +1902,9 @@ index ab79317a..b783c073 100644 class a extends PathfinderGoal { private int b; -@@ -252,6 +264,39 @@ public class EntitySquid extends EntityWaterAnimal { - } +@@ -258,6 +270,39 @@ public class EntitySquid extends EntityWaterAnimal { + @Override public void e() { + // Purpur start + EntityHuman rider = this.b.getRider(); @@ -1883,10 +1939,10 @@ index ab79317a..b783c073 100644 + } + // Purpur end + - int i = this.b.cj(); + int i = this.b.cv(); if (i > 100) { -@@ -266,5 +311,17 @@ public class EntitySquid extends EntityWaterAnimal { +@@ -272,5 +317,17 @@ public class EntitySquid extends EntityWaterAnimal { } } @@ -1905,11 +1961,11 @@ index ab79317a..b783c073 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityTameableAnimal.java b/src/main/java/net/minecraft/server/EntityTameableAnimal.java -index 5262ede2..d3d4c5df 100644 +index 70bf06b94..2f41d8ade 100644 --- a/src/main/java/net/minecraft/server/EntityTameableAnimal.java +++ b/src/main/java/net/minecraft/server/EntityTameableAnimal.java -@@ -123,6 +123,12 @@ public abstract class EntityTameableAnimal extends EntityAnimal implements Entit - this.datawatcher.set(EntityTameableAnimal.bD, Optional.ofNullable(uuid)); +@@ -127,6 +127,12 @@ public abstract class EntityTameableAnimal extends EntityAnimal { + this.datawatcher.set(EntityTameableAnimal.bA, Optional.ofNullable(uuid)); } + // Purpur start @@ -1918,15 +1974,15 @@ index 5262ede2..d3d4c5df 100644 + } + // Purpur end + - public void c(EntityHuman entityhuman) { + public void tame(EntityHuman entityhuman) { this.setTamed(true); this.setOwnerUUID(entityhuman.getUniqueID()); diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 24ca3511..2356b879 100644 +index 483c97692..181e92980 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java -@@ -253,6 +253,12 @@ public class EntityTypes { - return this.aS; +@@ -255,6 +255,12 @@ public class EntityTypes { + return this.ba; } + // Purpur start @@ -1935,16 +1991,16 @@ index 24ca3511..2356b879 100644 + } + // Purpur end + - public String d() { - if (this.aW == null) { - this.aW = SystemUtils.a("entity", IRegistry.ENTITY_TYPE.getKey(this)); + public String e() { + if (this.be == null) { + this.be = SystemUtils.a("entity", IRegistry.ENTITY_TYPE.getKey(this)); diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java -index 46d8e0a1..1edba183 100644 +index 4167ce8f8..0222399b4 100644 --- a/src/main/java/net/minecraft/server/EntityWolf.java +++ b/src/main/java/net/minecraft/server/EntityWolf.java -@@ -24,6 +24,11 @@ public class EntityWolf extends EntityTameableAnimal { - super(EntityTypes.WOLF, world); - this.setSize(0.6F, 0.85F); +@@ -29,6 +29,11 @@ public class EntityWolf extends EntityTameableAnimal { + public EntityWolf(EntityTypes entitytypes, World world) { + super(entitytypes, world); this.setTamed(false); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); @@ -1953,10 +2009,10 @@ index 46d8e0a1..1edba183 100644 + // Purpur end } - protected void n() { -@@ -245,6 +250,15 @@ public class EntityWolf extends EntityTameableAnimal { - } + @Override +@@ -275,6 +280,15 @@ public class EntityWolf extends EntityTameableAnimal { + @Override public boolean a(EntityHuman entityhuman, EnumHand enumhand) { + // Purpur start - processInteract + if (processInteract(entityhuman, enumhand)) { @@ -1971,13 +2027,13 @@ index 46d8e0a1..1edba183 100644 Item item = itemstack.getItem(); diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index bf2bed00..8d8ef643 100644 +index b06235d46..cff6fb1fb 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -37,6 +37,11 @@ public class EntityZombie extends EntityMonster { - this.bG = new PathfinderGoalBreakDoor(this); - this.bK = -1.0F; - this.setSize(0.6F, 1.95F); +@@ -36,6 +36,11 @@ public class EntityZombie extends EntityMonster { + public EntityZombie(EntityTypes entitytypes, World world) { + super(entitytypes, world); + this.bD = new PathfinderGoalBreakDoor(this, EntityZombie.bC); + // Purpur start + this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); + this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); @@ -1986,8 +2042,8 @@ index bf2bed00..8d8ef643 100644 } public EntityZombie(World world) { -@@ -454,6 +459,16 @@ public class EntityZombie extends EntityMonster { - return itemstack.getItem() == Items.EGG && this.isBaby() && this.isPassenger() ? false : super.d(itemstack); +@@ -460,6 +465,16 @@ public class EntityZombie extends EntityMonster { + return itemstack.getItem() == Items.EGG && this.isBaby() && this.isPassenger() ? false : super.g(itemstack); } + // Purpur start - processInteract @@ -2001,11 +2057,11 @@ index bf2bed00..8d8ef643 100644 + // Purpur end + @Nullable - public GroupDataEntity prepare(DifficultyDamageScaler difficultydamagescaler, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) { - Object object = super.prepare(difficultydamagescaler, groupdataentity, nbttagcompound); + @Override + public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) { diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java b/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java new file mode 100644 -index 00000000..851ab80e +index 000000000..851ab80e4 --- /dev/null +++ b/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java @@ -0,0 +1,46 @@ @@ -2057,7 +2113,7 @@ index 00000000..851ab80e +} diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java new file mode 100644 -index 00000000..4f7dec9b +index 000000000..4f7dec9bc --- /dev/null +++ b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java @@ -0,0 +1,77 @@ @@ -2140,7 +2196,7 @@ index 00000000..4f7dec9b +} diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlying.java b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlying.java new file mode 100644 -index 00000000..197b4951 +index 000000000..1a5a0c04c --- /dev/null +++ b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlying.java @@ -0,0 +1,58 @@ @@ -2181,7 +2237,7 @@ index 00000000..197b4951 + + if (entity.locY >= maxY || --tooHighCooldown > 0) { + tooHighCooldown = 60; -+ entity.motY = -0.05F; ++ entity.setMot(entity.getMot().add(0.0D, -0.05D, 0.0D)); + vertical = 0.0F; + } + @@ -2204,7 +2260,7 @@ index 00000000..197b4951 +} diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDWater.java b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDWater.java new file mode 100644 -index 00000000..74ff4825 +index 000000000..74ff48259 --- /dev/null +++ b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDWater.java @@ -0,0 +1,42 @@ @@ -2251,10 +2307,10 @@ index 00000000..74ff4825 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 89a49f03..03593e70 100644 +index 640faccfd..2390baa75 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -644,5 +644,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -697,5 +697,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public void setSafeFallDistance(float safeFallDistance) { getHandle().safeFallDistance = safeFallDistance; } diff --git a/scripts/upstream.sh b/scripts/upstream.sh index 25ec4c8d4..0d6882125 100755 --- a/scripts/upstream.sh +++ b/scripts/upstream.sh @@ -11,7 +11,7 @@ done if [[ "$1" == up* ]]; then ( cd "$basedir/Paper/" - git fetch && git reset --hard origin/master + git fetch && git reset --hard origin/ver/1.14-pre5 cd ../ git add Paper )