From 975444e5d2abf866001a746a7fce434a2e3df765 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sun, 13 Aug 2023 16:32:51 -0700 Subject: [PATCH] Updated Upstream (CraftBukkit/Spigot) (#9598) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes: b76ceb4f5 PR-1235: Move EntityType return to base Entity class e795d7490 SPIGOT-7458: Exception when Entity CommandSender executes Vanilla command 46c7fc3b1 SPIGOT-7452: Player#openSign cannot edit d91e5aa0b SPIGOT-7447: Rewrite --forceUpgrade to minimise diff and properly handle CraftBukkit world layout 921ae06d6 Revert "SPIGOT-7447: Fix --forceUpgrade" Spigot Changes: 94e187b5 Rebuild patches 3bce7935 SPIGOT-7091: Update bungeecord-chat --- patches/api/Adventure.patch | 16 +++++------ ...low-plugins-to-use-SLF4J-for-logging.patch | 10 +++---- patches/api/Build-system-changes.patch | 4 +-- patches/api/Convert-project-to-Gradle.patch | 9 ++++--- patches/server/Add-More-Creeper-API.patch | 4 +-- patches/server/Add-PhantomPreSpawnEvent.patch | 4 +-- patches/server/Add-Shearable-API.patch | 10 +++---- .../Add-event-for-player-editing-sign.patch | 8 +++--- patches/server/Add-more-Evoker-API.patch | 2 +- patches/server/Add-more-Witch-API.patch | 2 +- .../Add-openSign-method-to-HumanEntity.patch | 12 --------- patches/server/Adventure.patch | 2 +- patches/server/Bucketable-API.patch | 4 +-- patches/server/Dolphin-API.patch | 6 +++-- ...Folia-scheduler-and-owned-region-API.patch | 4 +-- ...-API-Replenishable-Lootables-Feature.patch | 4 +-- patches/server/Missing-Entity-API.patch | 27 ++++++++++--------- patches/server/More-Projectile-API.patch | 2 +- patches/server/RangedEntity-API.patch | 22 +++++++-------- patches/server/Slime-Pathfinder-Events.patch | 4 +-- ...apper-didnt-account-for-entity-sende.patch | 23 ---------------- work/CraftBukkit | 2 +- work/Spigot | 2 +- 23 files changed, 74 insertions(+), 109 deletions(-) delete mode 100644 patches/server/VanillaCommandWrapper-didnt-account-for-entity-sende.patch diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index d5880b6893..9745dcfcbf 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -11,9 +11,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -0,0 +0,0 @@ java { - withJavadocJar() - } + val annotationsVersion = "24.0.1" + val bungeeCordChatVersion = "1.20-R0.1" +val adventureVersion = "4.14.0" +val apiAndDocs: Configuration by configurations.creating { + attributes { @@ -26,15 +26,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +configurations.api { + extendsFrom(apiAndDocs) +} -+ - val annotationsVersion = "24.0.1" dependencies { // api dependencies are listed transitively to API consumers api("com.google.guava:guava:31.1-jre") api("com.google.code.gson:gson:2.10") -- api("net.md-5:bungeecord-chat:1.16-R0.4") -+ api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.9") // Paper +- api("net.md-5:bungeecord-chat:$bungeeCordChatVersion") ++ api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.14") // Paper api("org.yaml:snakeyaml:2.0") api("org.joml:joml:1.10.5") // Paper start @@ -56,15 +54,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 "https://guava.dev/releases/31.1-jre/api/docs/", "https://javadoc.io/doc/org.yaml/snakeyaml/2.0/", "https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations -- "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", +- "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", + // Paper start -+ //"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", // don't link to bungee chat ++ // "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", // don't link to bungee chat + "https://jd.advntr.dev/api/$adventureVersion/", + "https://jd.advntr.dev/text-minimessage/$adventureVersion/", + "https://jd.advntr.dev/text-serializer-gson/$adventureVersion/", + "https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/", + "https://jd.advntr.dev/text-serializer-plain/$adventureVersion/", -+ "https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/" ++ "https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/", + // Paper end ) options.tags("apiNote:a:API Note:") diff --git a/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch b/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch index af98be515b..1b51fdba9e 100644 --- a/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch +++ b/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch @@ -18,8 +18,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -0,0 +0,0 @@ java { - } - + val annotationsVersion = "24.0.1" + val bungeeCordChatVersion = "1.20-R0.1" val adventureVersion = "4.14.0" +val slf4jVersion = "1.8.0-beta4" +val log4jVersion = "2.17.1" @@ -36,13 +36,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 implementation("org.ow2.asm:asm:9.4") implementation("org.ow2.asm:asm-commons:9.4") @@ -0,0 +0,0 @@ tasks.withType { - "https://jd.advntr.dev/text-serializer-gson/$adventureVersion/", "https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/", "https://jd.advntr.dev/text-serializer-plain/$adventureVersion/", -- "https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/" -+ "https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/", + "https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/", + "https://javadoc.io/doc/org.slf4j/slf4j-api/$slf4jVersion/", -+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/" ++ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/", // Paper end ) options.tags("apiNote:a:API Note:") diff --git a/patches/api/Build-system-changes.patch b/patches/api/Build-system-changes.patch index 11478221cf..d8ee311541 100644 --- a/patches/api/Build-system-changes.patch +++ b/patches/api/Build-system-changes.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -0,0 +0,0 @@ dependencies { - api("net.md-5:bungeecord-chat:1.16-R0.4") + api("net.md-5:bungeecord-chat:$bungeeCordChatVersion") api("org.yaml:snakeyaml:2.0") api("org.joml:joml:1.10.5") + // Paper start @@ -43,7 +43,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 "https://javadoc.io/doc/org.yaml/snakeyaml/2.0/", - "https://javadoc.io/doc/org.jetbrains/annotations-java5/$annotationsVersion/", + "https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations - "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", + "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", ) options.tags("apiNote:a:API Note:") @@ -0,0 +0,0 @@ tasks.withType { diff --git a/patches/api/Convert-project-to-Gradle.patch b/patches/api/Convert-project-to-Gradle.patch index b05ecd4459..12e235f8ff 100644 --- a/patches/api/Convert-project-to-Gradle.patch +++ b/patches/api/Convert-project-to-Gradle.patch @@ -42,12 +42,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +} + +val annotationsVersion = "24.0.1" ++val bungeeCordChatVersion = "1.20-R0.1" + +dependencies { + // api dependencies are listed transitively to API consumers + api("com.google.guava:guava:31.1-jre") + api("com.google.code.gson:gson:2.10") -+ api("net.md-5:bungeecord-chat:1.16-R0.4") ++ api("net.md-5:bungeecord-chat:$bungeeCordChatVersion") + api("org.yaml:snakeyaml:2.0") + api("org.joml:joml:1.10.5") + @@ -101,7 +102,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + "https://guava.dev/releases/31.1-jre/api/docs/", + "https://javadoc.io/doc/org.yaml/snakeyaml/2.0/", + "https://javadoc.io/doc/org.jetbrains/annotations-java5/$annotationsVersion/", -+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", ++ "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", + ) + options.tags("apiNote:a:API Note:") + @@ -179,7 +180,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - net.md-5 - bungeecord-chat -- 1.16-R0.4 +- 1.20-R0.1 - jar - compile - @@ -320,7 +321,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - https://guava.dev/releases/31.1-jre/api/docs/ - https://javadoc.io/doc/org.yaml/snakeyaml/2.0/ - https://javadoc.io/doc/org.jetbrains/annotations-java5/24.0.1/ -- https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/ +- https://javadoc.io/doc/net.md-5/bungeecord-chat/1.20-R0.1/ - - - diff --git a/patches/server/Add-More-Creeper-API.patch b/patches/server/Add-More-Creeper-API.patch index 0e46a6a554..8221e72099 100644 --- a/patches/server/Add-More-Creeper-API.patch +++ b/patches/server/Add-More-Creeper-API.patch @@ -42,8 +42,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java @@ -0,0 +0,0 @@ public class CraftCreeper extends CraftMonster implements Creeper { - public EntityType getType() { - return EntityType.CREEPER; + public String toString() { + return "CraftCreeper"; } + + // Paper start diff --git a/patches/server/Add-PhantomPreSpawnEvent.patch b/patches/server/Add-PhantomPreSpawnEvent.patch index 89c9b8ab43..e434be0cd2 100644 --- a/patches/server/Add-PhantomPreSpawnEvent.patch +++ b/patches/server/Add-PhantomPreSpawnEvent.patch @@ -76,8 +76,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java @@ -0,0 +0,0 @@ public class CraftPhantom extends CraftFlying implements Phantom, CraftEnemy { - public EntityType getType() { - return EntityType.PHANTOM; + public String toString() { + return "CraftPhantom"; } + + // Paper start diff --git a/patches/server/Add-Shearable-API.patch b/patches/server/Add-Shearable-API.patch index 972d3be1e3..3c97763a1c 100644 --- a/patches/server/Add-Shearable-API.patch +++ b/patches/server/Add-Shearable-API.patch @@ -35,7 +35,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java b index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java -@@ -0,0 +0,0 @@ import org.bukkit.entity.EntityType; +@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.MushroomCow; import org.bukkit.entity.MushroomCow.Variant; @@ -48,8 +48,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java b/src/m index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java -@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; +@@ -0,0 +0,0 @@ import org.bukkit.DyeColor; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Sheep; -public class CraftSheep extends CraftAnimals implements Sheep { @@ -61,8 +61,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java -@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; +@@ -0,0 +0,0 @@ import net.minecraft.world.entity.animal.SnowGolem; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Snowman; -public class CraftSnowman extends CraftGolem implements Snowman, com.destroystokyo.paper.entity.CraftRangedEntity { // Paper diff --git a/patches/server/Add-event-for-player-editing-sign.patch b/patches/server/Add-event-for-player-editing-sign.patch index c10bd45780..10842ca8a8 100644 --- a/patches/server/Add-event-for-player-editing-sign.patch +++ b/patches/server/Add-event-for-player-editing-sign.patch @@ -75,8 +75,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java @@ -0,0 +0,0 @@ public class CraftSign extends CraftBlockEntityState< - - SignBlockEntity handle = ((CraftSign) sign).getTileEntity(); + Preconditions.checkArgument(sign.isPlaced(), "Sign must be placed"); + Preconditions.checkArgument(sign.getWorld() == player.getWorld(), "Sign must be in same world as Player"); + // Paper start + io.papermc.paper.event.player.PlayerOpenSignEvent event = new io.papermc.paper.event.player.PlayerOpenSignEvent((Player) player, sign, side, io.papermc.paper.event.player.PlayerOpenSignEvent.Cause.PLUGIN); @@ -88,5 +88,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + } // Paper - handle.setAllowedPlayerEditor(player.getUniqueId()); // Paper - ((CraftPlayer) player).getHandle().openTextEdit(handle, Side.FRONT == side); + SignBlockEntity handle = ((CraftSign) sign).getTileEntity(); + handle.setAllowedPlayerEditor(player.getUniqueId()); diff --git a/patches/server/Add-more-Evoker-API.patch b/patches/server/Add-more-Evoker-API.patch index 1126a736ec..d771b60f4a 100644 --- a/patches/server/Add-more-Evoker-API.patch +++ b/patches/server/Add-more-Evoker-API.patch @@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import net.minecraft.world.entity.animal.Sheep; import net.minecraft.world.entity.monster.SpellcasterIllager; import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; + import org.bukkit.entity.Evoker; @@ -0,0 +0,0 @@ public class CraftEvoker extends CraftSpellcaster implements Evoker { public void setCurrentSpell(Evoker.Spell spell) { this.getHandle().setIsCastingSpell(spell == null ? SpellcasterIllager.IllagerSpell.NONE : SpellcasterIllager.IllagerSpell.byId(spell.ordinal())); diff --git a/patches/server/Add-more-Witch-API.patch b/patches/server/Add-more-Witch-API.patch index 70c3e40a2e..458a63abe0 100644 --- a/patches/server/Add-more-Witch-API.patch +++ b/patches/server/Add-more-Witch-API.patch @@ -64,8 +64,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java @@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.entity; + import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; import org.bukkit.entity.Witch; +// Paper start +import com.destroystokyo.paper.entity.CraftRangedEntity; diff --git a/patches/server/Add-openSign-method-to-HumanEntity.patch b/patches/server/Add-openSign-method-to-HumanEntity.patch index 6b4b8bd0a7..49203f3802 100644 --- a/patches/server/Add-openSign-method-to-HumanEntity.patch +++ b/patches/server/Add-openSign-method-to-HumanEntity.patch @@ -4,18 +4,6 @@ Date: Sun, 1 Apr 2018 02:29:37 +0300 Subject: [PATCH] Add openSign method to HumanEntity -diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java -@@ -0,0 +0,0 @@ public class CraftSign extends CraftBlockEntityState< - return; - } - -+ handle.setAllowedPlayerEditor(player.getUniqueId()); // Paper - ((CraftPlayer) player).getHandle().openTextEdit(handle, Side.FRONT == side); - } - diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index 8d7603a2ec..5d97f9d7d6 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -3562,7 +3562,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { - protected Entity entity; + private final EntityType entityType; private EntityDamageEvent lastDamageEvent; private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftEntity.DATA_TYPE_REGISTRY); + protected net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers diff --git a/patches/server/Bucketable-API.patch b/patches/server/Bucketable-API.patch index 8ca19fc834..307d447144 100644 --- a/patches/server/Bucketable-API.patch +++ b/patches/server/Bucketable-API.patch @@ -45,9 +45,9 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java -@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftServer; +@@ -0,0 +0,0 @@ import com.google.common.base.Preconditions; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Axolotl; - import org.bukkit.entity.EntityType; -public class CraftAxolotl extends CraftAnimals implements Axolotl { +public class CraftAxolotl extends CraftAnimals implements Axolotl, io.papermc.paper.entity.PaperBucketable { // Paper - Bucketable API diff --git a/patches/server/Dolphin-API.patch b/patches/server/Dolphin-API.patch index 89d7135523..45ac939895 100644 --- a/patches/server/Dolphin-API.patch +++ b/patches/server/Dolphin-API.patch @@ -9,10 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftDolphin.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftDolphin.java @@ -0,0 +0,0 @@ public class CraftDolphin extends CraftWaterMob implements Dolphin { - public EntityType getType() { - return EntityType.DOLPHIN; + public String toString() { + return "CraftDolphin"; } + ++ // Paper start - Missing Dolphin API + @Override + public int getMoistness() { + return this.getHandle().getMoistnessLevel(); @@ -42,4 +43,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public void setTreasureLocation(org.bukkit.Location location) { + this.getHandle().setTreasurePos(io.papermc.paper.util.MCUtil.toBlockPosition(location)); + } ++ // Paper end - Missing Dolphin API } diff --git a/patches/server/Folia-scheduler-and-owned-region-API.patch b/patches/server/Folia-scheduler-and-owned-region-API.patch index 0102ef837e..7f10810e56 100644 --- a/patches/server/Folia-scheduler-and-owned-region-API.patch +++ b/patches/server/Folia-scheduler-and-owned-region-API.patch @@ -1335,5 +1335,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + @Override - public void playEffect(EntityEffect type) { - Preconditions.checkArgument(type != null, "type"); + public final EntityType getType() { + return this.entityType; diff --git a/patches/server/LootTable-API-Replenishable-Lootables-Feature.patch b/patches/server/LootTable-API-Replenishable-Lootables-Feature.patch index 17ef1643c0..8e74459dcf 100644 --- a/patches/server/LootTable-API-Replenishable-Lootables-Feature.patch +++ b/patches/server/LootTable-API-Replenishable-Lootables-Feature.patch @@ -753,7 +753,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java b/s index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java -@@ -0,0 +0,0 @@ import org.bukkit.entity.EntityType; +@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.inventory.Inventory; import org.bukkit.loot.LootTable; @@ -789,7 +789,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java -@@ -0,0 +0,0 @@ import org.bukkit.entity.EntityType; +@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.entity.minecart.HopperMinecart; import org.bukkit.inventory.Inventory; diff --git a/patches/server/Missing-Entity-API.patch b/patches/server/Missing-Entity-API.patch index aec47a03b5..992eec953e 100644 --- a/patches/server/Missing-Entity-API.patch +++ b/patches/server/Missing-Entity-API.patch @@ -563,9 +563,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java @@ -0,0 +0,0 @@ public class CraftChicken extends CraftAnimals implements Chicken { - public EntityType getType() { - return EntityType.CHICKEN; + public String toString() { + return "CraftChicken"; } ++ + // Paper start + @Override + public boolean isChickenJockey() { @@ -592,9 +593,9 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCod.java b/src/mai index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCod.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCod.java -@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftServer; +@@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.entity; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Cod; - import org.bukkit.entity.EntityType; -public class CraftCod extends CraftFish implements Cod { +public class CraftCod extends io.papermc.paper.entity.PaperSchoolableFish implements Cod { // Paper - School Fish API @@ -751,8 +752,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java @@ -0,0 +0,0 @@ public class CraftLlama extends CraftChestedHorse implements Llama, com.destroys - public EntityType getType() { - return EntityType.LLAMA; + public String toString() { + return "CraftLlama"; } + + // Paper start @@ -947,8 +948,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java @@ -0,0 +0,0 @@ public class CraftPolarBear extends CraftAnimals implements PolarBear { - public EntityType getType() { - return EntityType.POLAR_BEAR; + public String toString() { + return "CraftPolarBear"; } + + // Paper start @@ -1027,8 +1028,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSalmon.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSalmon.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSalmon.java -@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; +@@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.entity; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Salmon; -public class CraftSalmon extends CraftFish implements Salmon { @@ -1061,8 +1062,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java @@ -0,0 +0,0 @@ public class CraftTrident extends CraftArrow implements Trident { - public EntityType getType() { - return EntityType.TRIDENT; + public String toString() { + return "CraftTrident"; } + + // Paper start @@ -1092,7 +1093,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java -@@ -0,0 +0,0 @@ import org.bukkit.entity.EntityType; +@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.TropicalFish; import org.bukkit.entity.TropicalFish.Pattern; diff --git a/patches/server/More-Projectile-API.patch b/patches/server/More-Projectile-API.patch index d9a94c08b2..557db4a3b1 100644 --- a/patches/server/More-Projectile-API.patch +++ b/patches/server/More-Projectile-API.patch @@ -327,7 +327,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlamaSpit.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlamaSpit.java @@ -0,0 +0,0 @@ public class CraftLlamaSpit extends AbstractProjectile implements LlamaSpit { - return EntityType.LLAMA_SPIT; + return "CraftLlamaSpit"; } - @Override diff --git a/patches/server/RangedEntity-API.patch b/patches/server/RangedEntity-API.patch index 8ad8875b62..ae0f75e54c 100644 --- a/patches/server/RangedEntity-API.patch +++ b/patches/server/RangedEntity-API.patch @@ -60,9 +60,9 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java -@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftServer; +@@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.entity; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Drowned; - import org.bukkit.entity.EntityType; -public class CraftDrowned extends CraftZombie implements Drowned { +public class CraftDrowned extends CraftZombie implements Drowned, com.destroystokyo.paper.entity.CraftRangedEntity { // Paper @@ -73,8 +73,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftIllusioner.java b/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftIllusioner.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftIllusioner.java -@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; +@@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.entity; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Illusioner; -public class CraftIllusioner extends CraftSpellcaster implements Illusioner { @@ -99,7 +99,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java -@@ -0,0 +0,0 @@ import org.bukkit.entity.EntityType; +@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.entity.Piglin; import org.bukkit.inventory.Inventory; @@ -112,7 +112,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java b/sr index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java -@@ -0,0 +0,0 @@ import org.bukkit.entity.EntityType; +@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.entity.Pillager; import org.bukkit.inventory.Inventory; @@ -125,8 +125,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java -@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; +@@ -0,0 +0,0 @@ import net.minecraft.world.entity.animal.SnowGolem; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Snowman; -public class CraftSnowman extends CraftGolem implements Snowman { @@ -138,8 +138,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/m index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java -@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; +@@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.entity; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Witch; -public class CraftWitch extends CraftRaider implements Witch { @@ -151,7 +151,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java -@@ -0,0 +0,0 @@ import org.bukkit.entity.EntityType; +@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.boss.CraftBossBar; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Wither; diff --git a/patches/server/Slime-Pathfinder-Events.patch b/patches/server/Slime-Pathfinder-Events.patch index 81bf91d240..cd26f623f2 100644 --- a/patches/server/Slime-Pathfinder-Events.patch +++ b/patches/server/Slime-Pathfinder-Events.patch @@ -149,8 +149,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java @@ -0,0 +0,0 @@ public class CraftSlime extends CraftMob implements Slime, CraftEnemy { - public EntityType getType() { - return EntityType.SLIME; + public String toString() { + return "CraftSlime"; } + + // Paper start diff --git a/patches/server/VanillaCommandWrapper-didnt-account-for-entity-sende.patch b/patches/server/VanillaCommandWrapper-didnt-account-for-entity-sende.patch deleted file mode 100644 index 211eb7b865..0000000000 --- a/patches/server/VanillaCommandWrapper-didnt-account-for-entity-sende.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Fri, 10 Sep 2021 15:49:12 -0700 -Subject: [PATCH] VanillaCommandWrapper didnt account for entity senders - - -diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java -+++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java -@@ -0,0 +0,0 @@ public final class VanillaCommandWrapper extends BukkitCommand { - } - - public static CommandSourceStack getListener(CommandSender sender) { -- if (sender instanceof Player) { -- return ((CraftPlayer) sender).getHandle().createCommandSourceStack(); -+ // Paper start - account for other entity command senders -+ if (sender instanceof org.bukkit.craftbukkit.entity.CraftEntity craftEntity) { -+ return craftEntity.getHandle().createCommandSourceStack(); -+ // Paper end - } - if (sender instanceof BlockCommandSender) { - return ((CraftBlockCommandSender) sender).getWrapper(); diff --git a/work/CraftBukkit b/work/CraftBukkit index d548daac2f..b76ceb4f5d 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit d548daac2f99b1b570f9d229464f55d10d9a58b8 +Subproject commit b76ceb4f5dbeeedb6e0cff3b4545779b137bc125 diff --git a/work/Spigot b/work/Spigot index b41c46db51..94e187b577 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit b41c46db51ec4aca746def5ac9080ec319c4abdb +Subproject commit 94e187b577b93759e4f46e85c892049a6baa3bcc