From a36a4e2018665258bc9ffa4d1be564b90d225602 Mon Sep 17 00:00:00 2001 From: Jake Potrebic <jake.m.potrebic@gmail.com> Date: Fri, 31 Dec 2021 19:05:42 -0800 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit/Spigot) --- build-data/paper.at | 5 -- ...Collidable-methods-to-various-places.patch | 2 +- .../Attributes-API-for-item-defaults.patch | 6 ++- patches/api/Here-s-Johnny.patch | 42 --------------- patches/api/Make-EnderDragon-extend-Mob.patch | 19 ------- patches/api/Missing-Entity-Behavior-API.patch | 4 ++ patches/api/SkeletonHorse-Additions.patch | 23 +++++---- ...p-for-default-config-comment-parsing.patch | 51 +++++++++++++++++++ patches/api/Timings-v2.patch | 4 +- ...a-bunch-of-missing-forceDrop-toggles.patch | 14 ----- patches/server/Add-ignore-discounts-API.patch | 4 +- patches/server/Adventure.patch | 2 +- .../Attributes-API-for-item-defaults.patch | 23 ++------- ...onfigurable-door-breaking-difficulty.patch | 2 +- .../server/Entity-Activation-Range-2.0.patch | 12 +++-- patches/server/Here-s-Johnny.patch | 25 --------- .../Make-EnderDragon-implement-Mob.patch | 33 ------------ patches/server/SkeletonHorse-Additions.patch | 16 ++---- patches/server/Timings-v2.patch | 2 +- work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 22 files changed, 100 insertions(+), 195 deletions(-) delete mode 100644 patches/api/Here-s-Johnny.patch delete mode 100644 patches/api/Make-EnderDragon-extend-Mob.patch create mode 100644 patches/api/System-prop-for-default-config-comment-parsing.patch delete mode 100644 patches/server/Here-s-Johnny.patch delete mode 100644 patches/server/Make-EnderDragon-implement-Mob.patch diff --git a/build-data/paper.at b/build-data/paper.at index 3e2f39ada6..fdecc391fd 100644 --- a/build-data/paper.at +++ b/build-data/paper.at @@ -54,9 +54,6 @@ public net.minecraft.world.entity.player.Player removeEntitiesOnShoulder()V # LivingEntity setkiller public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime -# SkeletonHorse Additions -public net.minecraft.world.entity.animal.horse.SkeletonHorse trapTime - # Fix client rendering skulls public net.minecraft.world.item.ItemStack tag @@ -189,8 +186,6 @@ public net.minecraft.server.level.ServerLevel players # Chunk priority urgency system public net.minecraft.server.level.ChunkMap$ChunkDistanceManager -# Here's Johnny -public net.minecraft.world.entity.monster.Vindicator isJohnny # Chunk debug command public net.minecraft.server.level.Ticket createdTick diff --git a/patches/api/Add-isCollidable-methods-to-various-places.patch b/patches/api/Add-isCollidable-methods-to-various-places.patch index ce821d3df4..084ef23bd0 100644 --- a/patches/api/Add-isCollidable-methods-to-various-places.patch +++ b/patches/api/Add-isCollidable-methods-to-various-places.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata - public com.google.common.collect.Multimap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) { + public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) { return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot); } + diff --git a/patches/api/Attributes-API-for-item-defaults.patch b/patches/api/Attributes-API-for-item-defaults.patch index 344bb6e7cd..ac9b8f689b 100644 --- a/patches/api/Attributes-API-for-item-defaults.patch +++ b/patches/api/Attributes-API-for-item-defaults.patch @@ -20,9 +20,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @param equipmentSlot the slot to get the attributes for + * @throws IllegalArgumentException if {@link #isItem()} is false + * @return an immutable multimap of attributes ++ * @deprecated use {@link #getDefaultAttributeModifiers(EquipmentSlot)} + */ + @NotNull -+ public com.google.common.collect.Multimap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) { ++ @Deprecated ++ public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) { + return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot); + } // Paper end @@ -46,7 +48,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @return an immutable multimap of attributes + */ + @org.jetbrains.annotations.NotNull -+ public com.google.common.collect.Multimap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> getItemAttributes(@org.jetbrains.annotations.NotNull Material material, @org.jetbrains.annotations.NotNull org.bukkit.inventory.EquipmentSlot equipmentSlot); ++ public Multimap<Attribute, AttributeModifier> getItemAttributes(@org.jetbrains.annotations.NotNull Material material, @org.jetbrains.annotations.NotNull EquipmentSlot equipmentSlot); + /** * Returns the server's protocol version. diff --git a/patches/api/Here-s-Johnny.patch b/patches/api/Here-s-Johnny.patch deleted file mode 100644 index 0d35bffd3e..0000000000 --- a/patches/api/Here-s-Johnny.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: BillyGalbreath <Blake.Galbreath@GMail.com> -Date: Fri, 12 Oct 2018 01:37:16 -0500 -Subject: [PATCH] Here's Johnny! - - -diff --git a/src/main/java/org/bukkit/entity/Vindicator.java b/src/main/java/org/bukkit/entity/Vindicator.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/entity/Vindicator.java -+++ b/src/main/java/org/bukkit/entity/Vindicator.java -@@ -0,0 +0,0 @@ package org.bukkit.entity; - /** - * Represents a Vindicator. - */ --public interface Vindicator extends Illager { } -+public interface Vindicator extends Illager { -+ // Paper start -+ /** -+ * Check if this Vindicator is set to Johnny mode. -+ * <p> -+ * When in Johnny mode the Vindicator will be hostile to any kind of mob, except -+ * for evokers, ghasts, illusioners and other vindicators. It will even be hostile -+ * to vexes. All mobs, except for endermites, phantoms, guardians, slimes and -+ * magma cubes, will try to attack the vindicator in return. -+ * -+ * @return True if in Johnny mode -+ */ -+ boolean isJohnny(); -+ -+ /** -+ * Set this Vindicator's Johnny mode. -+ * <p> -+ * When in Johnny mode the Vindicator will be hostile to any kind of mob, except -+ * for evokers, ghasts, illusioners and other vindicators. It will even be hostile -+ * to vexes. All mobs, except for endermites, phantoms, guardians, slimes and -+ * magma cubes, will try to attack the vindicator in return. -+ * -+ * @param johnny True to enable Johnny mode -+ */ -+ void setJohnny(boolean johnny); -+ // Paper end -+} diff --git a/patches/api/Make-EnderDragon-extend-Mob.patch b/patches/api/Make-EnderDragon-extend-Mob.patch deleted file mode 100644 index dcc2a9bd0d..0000000000 --- a/patches/api/Make-EnderDragon-extend-Mob.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar <aikar@aikar.co> -Date: Fri, 10 Aug 2018 22:08:34 -0400 -Subject: [PATCH] Make EnderDragon extend Mob - - -diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/entity/EnderDragon.java -+++ b/src/main/java/org/bukkit/entity/EnderDragon.java -@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; - /** - * Represents an Ender Dragon - */ --public interface EnderDragon extends ComplexLivingEntity, Boss { -+public interface EnderDragon extends ComplexLivingEntity, Boss, org.bukkit.entity.Mob { // Paper - add Mob - - /** - * Represents a phase or action that an Ender Dragon can perform. diff --git a/patches/api/Missing-Entity-Behavior-API.patch b/patches/api/Missing-Entity-Behavior-API.patch index e03e5feca3..97cf6e63e7 100644 --- a/patches/api/Missing-Entity-Behavior-API.patch +++ b/patches/api/Missing-Entity-Behavior-API.patch @@ -18,7 +18,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * Gets if a horse is in their eating grass animation. + * + * @return eating grass animation is active ++ * @deprecated use {@link #isEatingHaystack()} + */ ++ @Deprecated + public boolean isEatingGrass(); + + /** @@ -27,7 +29,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * <p>When true, the horse will lower its neck.</p> + * + * @param eating eating grass animation is active ++ * @deprecated use {@link #setEatingHaystack(boolean)} + */ ++ @Deprecated + public void setEatingGrass(boolean eating); + + /** diff --git a/patches/api/SkeletonHorse-Additions.patch b/patches/api/SkeletonHorse-Additions.patch index 7ea4e67bb6..3836f5ad5e 100644 --- a/patches/api/SkeletonHorse-Additions.patch +++ b/patches/api/SkeletonHorse-Additions.patch @@ -76,17 +76,22 @@ diff --git a/src/main/java/org/bukkit/entity/SkeletonHorse.java b/src/main/java/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/SkeletonHorse.java +++ b/src/main/java/org/bukkit/entity/SkeletonHorse.java -@@ -0,0 +0,0 @@ package org.bukkit.entity; - /** - * Represents a SkeletonHorse - variant of {@link AbstractHorse}. - */ --public interface SkeletonHorse extends AbstractHorse { } -+public interface SkeletonHorse extends AbstractHorse { -+ // Paper start -+ int getTrapTime(); +@@ -0,0 +0,0 @@ public interface SkeletonHorse extends AbstractHorse { + * @param trapTime new trap time + */ + void setTrapTime(int trapTime); + ++ // Paper start ++ /** ++ * @deprecated use {@link #isTrapped()} ++ */ ++ @Deprecated + boolean isTrap(); + ++ /** ++ * @deprecated use {@link #setTrapped(boolean)} ++ */ ++ @Deprecated + void setTrap(boolean trap); + // Paper end -+} + } diff --git a/patches/api/System-prop-for-default-config-comment-parsing.patch b/patches/api/System-prop-for-default-config-comment-parsing.patch new file mode 100644 index 0000000000..72fd49e82e --- /dev/null +++ b/patches/api/System-prop-for-default-config-comment-parsing.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <jake.m.potrebic@gmail.com> +Date: Thu, 30 Dec 2021 16:35:56 -0800 +Subject: [PATCH] System prop for default config comment parsing + +Allows for certain legacy plugins to continue to work without changing +by setting `Paper.parseYamlCommentsByDefault` to false + +diff --git a/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java b/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java ++++ b/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; + public class FileConfigurationOptions extends MemoryConfigurationOptions { + private List<String> header = Collections.emptyList(); + private List<String> footer = Collections.emptyList(); +- private boolean parseComments = true; ++ // Paper start - add system prop for comment parsing ++ private static final boolean PAPER_PARSE_COMMENTS_BY_DEFAULT = Boolean.parseBoolean(System.getProperty("Paper.parseYamlCommentsByDefault", "true")); ++ private boolean parseComments = PAPER_PARSE_COMMENTS_BY_DEFAULT; ++ // Paper end + + protected FileConfigurationOptions(@NotNull MemoryConfiguration configuration) { + super(configuration); +diff --git a/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java b/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java ++++ b/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java +@@ -0,0 +0,0 @@ import org.yaml.snakeyaml.representer.Representer; + public class YamlRepresenter extends Representer { + + public YamlRepresenter() { ++ this.multiRepresenters.put(org.bukkit.configuration.ConfigurationSection.class, new RepresentConfigurationSection()); // Paper - restore old yaml config section representer + this.multiRepresenters.put(ConfigurationSerializable.class, new RepresentConfigurationSerializable()); + // SPIGOT-6234: We could just switch YamlConstructor to extend Constructor rather than SafeConstructor, however there is a very small risk of issues with plugins treating config as untrusted input + // So instead we will just allow future plugins to have their enums extend ConfigurationSerializable + this.multiRepresenters.remove(Enum.class); + } ++ // Paper start - restore old yaml config section representer ++ private class RepresentConfigurationSection extends RepresentMap { ++ ++ @NotNull ++ @Override ++ public Node representData(@NotNull Object data) { ++ return super.representData(((org.bukkit.configuration.ConfigurationSection) data).getValues(false)); ++ } ++ } ++ // Paper end + + private class RepresentConfigurationSerializable extends RepresentMap { + diff --git a/patches/api/Timings-v2.patch b/patches/api/Timings-v2.patch index 2d82538ecc..2c95d3a74b 100644 --- a/patches/api/Timings-v2.patch +++ b/patches/api/Timings-v2.patch @@ -2837,9 +2837,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 Material fromLegacy(Material material); @@ -0,0 +0,0 @@ public interface UnsafeValues { - * @return true if a file matching this key was found and deleted - */ boolean removeAdvancement(NamespacedKey key); + + Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(Material material, EquipmentSlot slot); + + // Paper start + /** diff --git a/patches/server/Add-a-bunch-of-missing-forceDrop-toggles.patch b/patches/server/Add-a-bunch-of-missing-forceDrop-toggles.patch index bea9f8f9b8..5fbe74c67b 100644 --- a/patches/server/Add-a-bunch-of-missing-forceDrop-toggles.patch +++ b/patches/server/Add-a-bunch-of-missing-forceDrop-toggles.patch @@ -4,20 +4,6 @@ Date: Tue, 20 Jul 2021 21:25:35 -0700 Subject: [PATCH] Add a bunch of missing forceDrop toggles -diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/Mob.java -+++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { - } - - if (this.tickCount > 100) { -+ this.forceDrops = true; // Paper - this.spawnAtLocation((ItemLike) Items.LEAD); -+ this.forceDrops = false; // Paper - this.leashInfoTag = null; - } - } diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java b/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java diff --git a/patches/server/Add-ignore-discounts-API.patch b/patches/server/Add-ignore-discounts-API.patch index 98c226aff1..b85bf560c9 100644 --- a/patches/server/Add-ignore-discounts-API.patch +++ b/patches/server/Add-ignore-discounts-API.patch @@ -14,8 +14,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 MerchantOffer merchantrecipe = (MerchantOffer) iterator.next(); + if (merchantrecipe.ignoreDiscounts) continue; // Paper - // CraftBukkit start - int bonus = -Mth.floor((float) i * merchantrecipe.getPriceMultiplier()); + merchantrecipe.addToSpecialPriceDiff(-Mth.floor((float) i * merchantrecipe.getPriceMultiplier())); + } @@ -0,0 +0,0 @@ public class Villager extends AbstractVillager implements ReputationEventHandler while (iterator1.hasNext()) { diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index a3cb2808f5..7aef1b2181 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -1303,7 +1303,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import io.papermc.paper.adventure.PaperAdventure; // Paper import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicInteger; - import net.minecraft.world.inventory.AbstractContainerMenu; + import net.minecraft.world.entity.animal.Bucketable; @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser return this.server.isSingleplayerOwner(this.player.getGameProfile()); } diff --git a/patches/server/Attributes-API-for-item-defaults.patch b/patches/server/Attributes-API-for-item-defaults.patch index 7f7c7f4107..1b220757cf 100644 --- a/patches/server/Attributes-API-for-item-defaults.patch +++ b/patches/server/Attributes-API-for-item-defaults.patch @@ -4,21 +4,6 @@ Date: Sat, 8 May 2021 15:01:54 -0700 Subject: [PATCH] Attributes API for item defaults -diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java -+++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java -@@ -0,0 +0,0 @@ public class CraftAttributeInstance implements AttributeInstance { - public static AttributeModifier convert(net.minecraft.world.entity.ai.attributes.AttributeModifier nms) { - return new AttributeModifier(nms.getId(), nms.getName(), nms.getAmount(), AttributeModifier.Operation.values()[nms.getOperation().ordinal()]); - } -+ -+ // Paper start - construct using slot -+ public static AttributeModifier convert(net.minecraft.world.entity.ai.attributes.AttributeModifier nms, org.bukkit.inventory.EquipmentSlot slot) { -+ return new AttributeModifier(nms.getId(), nms.getName(), nms.getAmount(), AttributeModifier.Operation.values()[nms.getOperation().ordinal()], slot); -+ } -+ // Paper end - } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -28,14 +13,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + @Override -+ public com.google.common.collect.Multimap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> getItemAttributes(org.bukkit.Material material, org.bukkit.inventory.EquipmentSlot equipmentSlot) { ++ public Multimap<Attribute, AttributeModifier> getItemAttributes(Material material, EquipmentSlot equipmentSlot) { + Item item = CraftMagicNumbers.getItem(material); + if (item == null) { + throw new IllegalArgumentException(material + " is not an item and therefore does not have attributes"); + } -+ com.google.common.collect.ImmutableMultimap.Builder<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> attributeMapBuilder = com.google.common.collect.ImmutableMultimap.builder(); -+ item.getDefaultAttributeModifiers(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(equipmentSlot)).forEach((attributeBase, attributeModifier) -> { -+ attributeMapBuilder.put(org.bukkit.Registry.ATTRIBUTE.get(CraftNamespacedKey.fromMinecraft(net.minecraft.core.Registry.ATTRIBUTE.getKey(attributeBase))), org.bukkit.craftbukkit.attribute.CraftAttributeInstance.convert(attributeModifier, equipmentSlot)); ++ ImmutableMultimap.Builder<Attribute, AttributeModifier> attributeMapBuilder = ImmutableMultimap.builder(); ++ item.getDefaultAttributeModifiers(CraftEquipmentSlot.getNMS(equipmentSlot)).forEach((attributeBase, attributeModifier) -> { ++ attributeMapBuilder.put(CraftAttributeMap.fromMinecraft(net.minecraft.core.Registry.ATTRIBUTE.getKey(attributeBase).toString()), CraftAttributeInstance.convert(attributeModifier, equipmentSlot)); + }); + return attributeMapBuilder.build(); + } diff --git a/patches/server/Configurable-door-breaking-difficulty.patch b/patches/server/Configurable-door-breaking-difficulty.patch index 3d3e507f70..7f839bfaa1 100644 --- a/patches/server/Configurable-door-breaking-difficulty.patch +++ b/patches/server/Configurable-door-breaking-difficulty.patch @@ -39,8 +39,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java +++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java @@ -0,0 +0,0 @@ public class Vindicator extends AbstractIllager { + private static class VindicatorBreakDoorGoal extends BreakDoorGoal { - static class VindicatorBreakDoorGoal extends BreakDoorGoal { public VindicatorBreakDoorGoal(Mob mob) { - super(mob, 6, Vindicator.DOOR_BREAKING_PREDICATE); + super(mob, 6, com.google.common.base.Predicates.in(mob.level.paperConfig.vindicatorBreakDoors)); // Paper diff --git a/patches/server/Entity-Activation-Range-2.0.patch b/patches/server/Entity-Activation-Range-2.0.patch index e2f38eb3b7..dfa024f1d9 100644 --- a/patches/server/Entity-Activation-Range-2.0.patch +++ b/patches/server/Entity-Activation-Range-2.0.patch @@ -346,6 +346,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import net.minecraft.server.MinecraftServer; +import net.minecraft.server.level.ServerChunkCache; import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.ExperienceOrb; +import net.minecraft.world.entity.FlyingMob; import net.minecraft.world.entity.LightningBolt; import net.minecraft.world.entity.LivingEntity; @@ -566,8 +567,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 { - return true; + return 20; // Paper - } -- if ( entity instanceof Villager && ( (Villager) entity ).canBreed() ) ++ } + // Paper start + if (entity instanceof Bee) { + Bee bee = (Bee)entity; @@ -595,7 +595,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return config.villagersWorkImmunityFor; + } + } -+ } + } +- if ( entity instanceof Villager && ( (Villager) entity ).canBreed() ) + if ( entity instanceof Llama && ( (Llama) entity ).inCaravan() ) { - return true; @@ -630,6 +631,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + // Paper end } + // SPIGOT-6644: Otherwise the target refresh tick will be missed + if (entity instanceof ExperienceOrb) { +- return true; ++ return 20; // Paper + } - return false; + return -1; // Paper } diff --git a/patches/server/Here-s-Johnny.patch b/patches/server/Here-s-Johnny.patch deleted file mode 100644 index 5e3ddcbacc..0000000000 --- a/patches/server/Here-s-Johnny.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: BillyGalbreath <Blake.Galbreath@GMail.com> -Date: Fri, 12 Oct 2018 01:37:22 -0500 -Subject: [PATCH] Here's Johnny! - - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java -@@ -0,0 +0,0 @@ public class CraftVindicator extends CraftIllager implements Vindicator { - public EntityType getType() { - return EntityType.VINDICATOR; - } -+ -+ // Paper start -+ public boolean isJohnny() { -+ return getHandle().isJohnny; -+ } -+ -+ public void setJohnny(boolean johnny) { -+ getHandle().isJohnny = johnny; -+ } -+ // Paper end - } diff --git a/patches/server/Make-EnderDragon-implement-Mob.patch b/patches/server/Make-EnderDragon-implement-Mob.patch deleted file mode 100644 index f22973c810..0000000000 --- a/patches/server/Make-EnderDragon-implement-Mob.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar <aikar@aikar.co> -Date: Fri, 10 Aug 2018 22:11:49 -0400 -Subject: [PATCH] Make EnderDragon implement Mob - - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java -@@ -0,0 +0,0 @@ - package org.bukkit.craftbukkit.entity; - --import net.minecraft.world.entity.LivingEntity; -+import net.minecraft.world.entity.Mob; - import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.ComplexLivingEntity; - --public abstract class CraftComplexLivingEntity extends CraftLivingEntity implements ComplexLivingEntity { -- public CraftComplexLivingEntity(CraftServer server, LivingEntity entity) { -+public abstract class CraftComplexLivingEntity extends CraftMob implements ComplexLivingEntity { // Paper -+ public CraftComplexLivingEntity(CraftServer server, Mob entity) { // Paper - super(server, entity); - } - - @Override -- public LivingEntity getHandle() { -- return (LivingEntity) entity; -+ public Mob getHandle() { // Paper -+ return (Mob) entity; // Paper - } - - @Override diff --git a/patches/server/SkeletonHorse-Additions.patch b/patches/server/SkeletonHorse-Additions.patch index e05550f616..d7c37900ef 100644 --- a/patches/server/SkeletonHorse-Additions.patch +++ b/patches/server/SkeletonHorse-Additions.patch @@ -69,21 +69,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java @@ -0,0 +0,0 @@ public class CraftSkeletonHorse extends CraftAbstractHorse implements SkeletonHo - public Variant getVariant() { - return Variant.SKELETON_HORSE; + public void setTrapTime(int trapTime) { + this.getHandle().trapTime = trapTime; } + -+ // Paper start -+ @Override -+ public net.minecraft.world.entity.animal.horse.SkeletonHorse getHandle() { -+ return (net.minecraft.world.entity.animal.horse.SkeletonHorse) super.getHandle(); -+ } -+ -+ @Override -+ public int getTrapTime() { -+ return getHandle().trapTime; -+ } -+ ++ // Paper start - replaced by above methods + @Override + public boolean isTrap() { + return getHandle().isTrap(); diff --git a/patches/server/Timings-v2.patch b/patches/server/Timings-v2.patch index 686d1d3eeb..369c8e2ba4 100644 --- a/patches/server/Timings-v2.patch +++ b/patches/server/Timings-v2.patch @@ -2131,7 +2131,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static byte toLegacyData(BlockState data) { return CraftLegacy.toLegacyData(data); @@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues { - return clazz; + return defaultAttributes.build(); } + // Paper start diff --git a/work/Bukkit b/work/Bukkit index 031731e60e..7b1856bfe9 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 031731e60ece4b3fe0468a0df94b89d339b4169d +Subproject commit 7b1856bfe9bbf0ae0e1e9fee6759bd956f958e22 diff --git a/work/CraftBukkit b/work/CraftBukkit index 2a2caa7e25..c93fcba47a 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 2a2caa7e25cfcf66c368b0098f320ac93d416d6a +Subproject commit c93fcba47ab0e9c319a5c06e83e3f4b675fbe17c diff --git a/work/Spigot b/work/Spigot index 8965a50244..78a14d9d9c 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 8965a5024427f83a4e82ce3e3d4773fd78d22d76 +Subproject commit 78a14d9d9cc79fd5692226f74cad274c5052f4cd