From 8868dd196d59daeea15d209aaef1e04d1986b0ee Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Wed, 24 Nov 2021 20:24:51 -0500 Subject: [PATCH] all api patches done* *still waiting for leaf to port datafixer to 1.18 so i can do entity serialization --- .../api/Add-API-for-resetting-a-single-score.patch | 0 .../api/Add-BlockBreakBlockEvent.patch | 0 .../api/Add-ItemFactory-getMonsterEgg-API.patch | 0 .../api/Add-advancement-display-API.patch | 0 .../api/Add-critical-damage-API.patch | 0 ...dd-helpers-for-left-right-click-to-Action.patch} | 2 +- ...Add-isCollidable-methods-to-various-places.patch | 0 ...hods-to-find-targets-for-lightning-strikes.patch | 0 .../Add-missing-team-sidebar-display-slots.patch | 0 .../api/Fix-issues-with-mob-conversion.patch | 0 .../api/Fix-plugin-provides-load-order.patch | 0 .../api/Get-entity-default-attributes.patch | 0 patches/{unapplied => }/api/Goat-ram-API.patch | 0 patches/{unapplied => }/api/Left-handed-API.patch | 0 .../{unapplied => }/api/More-CommandBlock-API.patch | 0 ...on-to-prevent-NBT-copy-in-smithing-recipes.patch | 0 .../api/add-back-EntityPortalExitEvent.patch | 0 .../Add-API-for-resetting-a-single-score.patch | 0 .../server/Add-BlockBreakBlockEvent.patch | 4 ++-- .../server/Add-ItemFactory-getMonsterEgg-API.patch | 0 .../server/Add-advancement-display-API.patch | 0 .../server/Add-back-EntityPortalExitEvent.patch | 6 +++--- .../server/Add-critical-damage-API.patch | 2 +- ...Add-isCollidable-methods-to-various-places.patch | 0 ...hods-to-find-targets-for-lightning-strikes.patch | 0 .../Add-missing-team-sidebar-display-slots.patch | 0 .../server/Fix-issues-with-mob-conversion.patch | 13 ------------- .../server/Get-entity-default-attributes.patch | 0 patches/{unapplied => }/server/Goat-ram-API.patch | 4 ++-- .../{unapplied => }/server/Left-handed-API.patch | 0 .../More-CommandBlock-API.patch} | 2 +- ...on-to-prevent-NBT-copy-in-smithing-recipes.patch | 0 .../server/Add-Raw-Byte-Entity-Serialization.patch | 2 +- 33 files changed, 11 insertions(+), 24 deletions(-) rename patches/{unapplied => }/api/Add-API-for-resetting-a-single-score.patch (100%) rename patches/{unapplied => }/api/Add-BlockBreakBlockEvent.patch (100%) rename patches/{unapplied => }/api/Add-ItemFactory-getMonsterEgg-API.patch (100%) rename patches/{unapplied => }/api/Add-advancement-display-API.patch (100%) rename patches/{unapplied => }/api/Add-critical-damage-API.patch (100%) rename patches/{unapplied/api/Add-helpers-for-left-right-hand-to-Action.patch => api/Add-helpers-for-left-right-click-to-Action.patch} (94%) rename patches/{unapplied => }/api/Add-isCollidable-methods-to-various-places.patch (100%) rename patches/{unapplied => }/api/Add-methods-to-find-targets-for-lightning-strikes.patch (100%) rename patches/{unapplied => }/api/Add-missing-team-sidebar-display-slots.patch (100%) rename patches/{unapplied => }/api/Fix-issues-with-mob-conversion.patch (100%) rename patches/{unapplied => }/api/Fix-plugin-provides-load-order.patch (100%) rename patches/{unapplied => }/api/Get-entity-default-attributes.patch (100%) rename patches/{unapplied => }/api/Goat-ram-API.patch (100%) rename patches/{unapplied => }/api/Left-handed-API.patch (100%) rename patches/{unapplied => }/api/More-CommandBlock-API.patch (100%) rename patches/{unapplied => }/api/Option-to-prevent-NBT-copy-in-smithing-recipes.patch (100%) rename patches/{unapplied => }/api/add-back-EntityPortalExitEvent.patch (100%) rename patches/{unapplied => }/server/Add-API-for-resetting-a-single-score.patch (100%) rename patches/{unapplied => }/server/Add-BlockBreakBlockEvent.patch (96%) rename patches/{unapplied => }/server/Add-ItemFactory-getMonsterEgg-API.patch (100%) rename patches/{unapplied => }/server/Add-advancement-display-API.patch (100%) rename patches/{unapplied => }/server/Add-back-EntityPortalExitEvent.patch (94%) rename patches/{unapplied => }/server/Add-critical-damage-API.patch (98%) rename patches/{unapplied => }/server/Add-isCollidable-methods-to-various-places.patch (100%) rename patches/{unapplied => }/server/Add-methods-to-find-targets-for-lightning-strikes.patch (100%) rename patches/{unapplied => }/server/Add-missing-team-sidebar-display-slots.patch (100%) rename patches/{unapplied => }/server/Fix-issues-with-mob-conversion.patch (72%) rename patches/{unapplied => }/server/Get-entity-default-attributes.patch (100%) rename patches/{unapplied => }/server/Goat-ram-API.patch (91%) rename patches/{unapplied => }/server/Left-handed-API.patch (100%) rename patches/{unapplied/server/More-CommmandBlock-API.patch => server/More-CommandBlock-API.patch} (99%) rename patches/{unapplied => }/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch (100%) diff --git a/patches/unapplied/api/Add-API-for-resetting-a-single-score.patch b/patches/api/Add-API-for-resetting-a-single-score.patch similarity index 100% rename from patches/unapplied/api/Add-API-for-resetting-a-single-score.patch rename to patches/api/Add-API-for-resetting-a-single-score.patch diff --git a/patches/unapplied/api/Add-BlockBreakBlockEvent.patch b/patches/api/Add-BlockBreakBlockEvent.patch similarity index 100% rename from patches/unapplied/api/Add-BlockBreakBlockEvent.patch rename to patches/api/Add-BlockBreakBlockEvent.patch diff --git a/patches/unapplied/api/Add-ItemFactory-getMonsterEgg-API.patch b/patches/api/Add-ItemFactory-getMonsterEgg-API.patch similarity index 100% rename from patches/unapplied/api/Add-ItemFactory-getMonsterEgg-API.patch rename to patches/api/Add-ItemFactory-getMonsterEgg-API.patch diff --git a/patches/unapplied/api/Add-advancement-display-API.patch b/patches/api/Add-advancement-display-API.patch similarity index 100% rename from patches/unapplied/api/Add-advancement-display-API.patch rename to patches/api/Add-advancement-display-API.patch diff --git a/patches/unapplied/api/Add-critical-damage-API.patch b/patches/api/Add-critical-damage-API.patch similarity index 100% rename from patches/unapplied/api/Add-critical-damage-API.patch rename to patches/api/Add-critical-damage-API.patch diff --git a/patches/unapplied/api/Add-helpers-for-left-right-hand-to-Action.patch b/patches/api/Add-helpers-for-left-right-click-to-Action.patch similarity index 94% rename from patches/unapplied/api/Add-helpers-for-left-right-hand-to-Action.patch rename to patches/api/Add-helpers-for-left-right-click-to-Action.patch index 561d5894e1..8f8638bb5c 100644 --- a/patches/unapplied/api/Add-helpers-for-left-right-hand-to-Action.patch +++ b/patches/api/Add-helpers-for-left-right-click-to-Action.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Madeline Miller Date: Sun, 29 Aug 2021 17:00:56 +1000 -Subject: [PATCH] Add helpers for left/right hand to Action +Subject: [PATCH] Add helpers for left/right click to Action diff --git a/src/main/java/org/bukkit/event/block/Action.java b/src/main/java/org/bukkit/event/block/Action.java diff --git a/patches/unapplied/api/Add-isCollidable-methods-to-various-places.patch b/patches/api/Add-isCollidable-methods-to-various-places.patch similarity index 100% rename from patches/unapplied/api/Add-isCollidable-methods-to-various-places.patch rename to patches/api/Add-isCollidable-methods-to-various-places.patch diff --git a/patches/unapplied/api/Add-methods-to-find-targets-for-lightning-strikes.patch b/patches/api/Add-methods-to-find-targets-for-lightning-strikes.patch similarity index 100% rename from patches/unapplied/api/Add-methods-to-find-targets-for-lightning-strikes.patch rename to patches/api/Add-methods-to-find-targets-for-lightning-strikes.patch diff --git a/patches/unapplied/api/Add-missing-team-sidebar-display-slots.patch b/patches/api/Add-missing-team-sidebar-display-slots.patch similarity index 100% rename from patches/unapplied/api/Add-missing-team-sidebar-display-slots.patch rename to patches/api/Add-missing-team-sidebar-display-slots.patch diff --git a/patches/unapplied/api/Fix-issues-with-mob-conversion.patch b/patches/api/Fix-issues-with-mob-conversion.patch similarity index 100% rename from patches/unapplied/api/Fix-issues-with-mob-conversion.patch rename to patches/api/Fix-issues-with-mob-conversion.patch diff --git a/patches/unapplied/api/Fix-plugin-provides-load-order.patch b/patches/api/Fix-plugin-provides-load-order.patch similarity index 100% rename from patches/unapplied/api/Fix-plugin-provides-load-order.patch rename to patches/api/Fix-plugin-provides-load-order.patch diff --git a/patches/unapplied/api/Get-entity-default-attributes.patch b/patches/api/Get-entity-default-attributes.patch similarity index 100% rename from patches/unapplied/api/Get-entity-default-attributes.patch rename to patches/api/Get-entity-default-attributes.patch diff --git a/patches/unapplied/api/Goat-ram-API.patch b/patches/api/Goat-ram-API.patch similarity index 100% rename from patches/unapplied/api/Goat-ram-API.patch rename to patches/api/Goat-ram-API.patch diff --git a/patches/unapplied/api/Left-handed-API.patch b/patches/api/Left-handed-API.patch similarity index 100% rename from patches/unapplied/api/Left-handed-API.patch rename to patches/api/Left-handed-API.patch diff --git a/patches/unapplied/api/More-CommandBlock-API.patch b/patches/api/More-CommandBlock-API.patch similarity index 100% rename from patches/unapplied/api/More-CommandBlock-API.patch rename to patches/api/More-CommandBlock-API.patch diff --git a/patches/unapplied/api/Option-to-prevent-NBT-copy-in-smithing-recipes.patch b/patches/api/Option-to-prevent-NBT-copy-in-smithing-recipes.patch similarity index 100% rename from patches/unapplied/api/Option-to-prevent-NBT-copy-in-smithing-recipes.patch rename to patches/api/Option-to-prevent-NBT-copy-in-smithing-recipes.patch diff --git a/patches/unapplied/api/add-back-EntityPortalExitEvent.patch b/patches/api/add-back-EntityPortalExitEvent.patch similarity index 100% rename from patches/unapplied/api/add-back-EntityPortalExitEvent.patch rename to patches/api/add-back-EntityPortalExitEvent.patch diff --git a/patches/unapplied/server/Add-API-for-resetting-a-single-score.patch b/patches/server/Add-API-for-resetting-a-single-score.patch similarity index 100% rename from patches/unapplied/server/Add-API-for-resetting-a-single-score.patch rename to patches/server/Add-API-for-resetting-a-single-score.patch diff --git a/patches/unapplied/server/Add-BlockBreakBlockEvent.patch b/patches/server/Add-BlockBreakBlockEvent.patch similarity index 96% rename from patches/unapplied/server/Add-BlockBreakBlockEvent.patch rename to patches/server/Add-BlockBreakBlockEvent.patch index 675ecf5e9b..ae17f28959 100644 --- a/patches/unapplied/server/Add-BlockBreakBlockEvent.patch +++ b/patches/server/Add-BlockBreakBlockEvent.patch @@ -40,8 +40,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 iblockdata1 = world.getBlockState(blockposition3); BlockEntity tileentity = iblockdata1.hasBlockEntity() ? world.getBlockEntity(blockposition3) : null; -- dropResources(iblockdata1, (LevelAccessor) world, blockposition3, tileentity); -+ dropResources(iblockdata1, (LevelAccessor) world, blockposition3, tileentity, pos); // Paper +- dropResources(iblockdata1, world, blockposition3, tileentity); ++ dropResources(iblockdata1, world, blockposition3, tileentity, pos); // Paper world.setBlock(blockposition3, Blocks.AIR.defaultBlockState(), 18); if (!iblockdata1.is((Tag) BlockTags.FIRE)) { world.addDestroyBlockEffect(blockposition3, iblockdata1); diff --git a/patches/unapplied/server/Add-ItemFactory-getMonsterEgg-API.patch b/patches/server/Add-ItemFactory-getMonsterEgg-API.patch similarity index 100% rename from patches/unapplied/server/Add-ItemFactory-getMonsterEgg-API.patch rename to patches/server/Add-ItemFactory-getMonsterEgg-API.patch diff --git a/patches/unapplied/server/Add-advancement-display-API.patch b/patches/server/Add-advancement-display-API.patch similarity index 100% rename from patches/unapplied/server/Add-advancement-display-API.patch rename to patches/server/Add-advancement-display-API.patch diff --git a/patches/unapplied/server/Add-back-EntityPortalExitEvent.patch b/patches/server/Add-back-EntityPortalExitEvent.patch similarity index 94% rename from patches/unapplied/server/Add-back-EntityPortalExitEvent.patch rename to patches/server/Add-back-EntityPortalExitEvent.patch index 3b81fdb6c4..b41726cb12 100644 --- a/patches/unapplied/server/Add-back-EntityPortalExitEvent.patch +++ b/patches/server/Add-back-EntityPortalExitEvent.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i } else { // CraftBukkit start worldserver = shapedetectorshape.world; @@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.unRide(); // CraftBukkit end -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i if (entity != null) { entity.restoreFrom(this); @@ -43,5 +43,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + entity.moveTo(position.x, position.y, position.z, yaw, pitch); // Paper - use EntityPortalExitEvent values + entity.setDeltaMovement(velocity); // Paper - use EntityPortalExitEvent values worldserver.addDuringTeleport(entity); - if (worldserver.getTypeKey() == DimensionType.END_LOCATION) { // CraftBukkit + if (worldserver.getTypeKey() == LevelStem.END) { // CraftBukkit ServerLevel.makeObsidianPlatform(worldserver, this); // CraftBukkit diff --git a/patches/unapplied/server/Add-critical-damage-API.patch b/patches/server/Add-critical-damage-API.patch similarity index 98% rename from patches/unapplied/server/Add-critical-damage-API.patch rename to patches/server/Add-critical-damage-API.patch index 86fb9ce88c..7d881ab273 100644 --- a/patches/unapplied/server/Add-critical-damage-API.patch +++ b/patches/server/Add-critical-damage-API.patch @@ -85,7 +85,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (i > 0) { @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - if (entityliving != this && entityliving != target && !this.isAlliedTo(entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) { + if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) { // CraftBukkit start - Only apply knockback if the damage hits - if (entityliving.hurt(DamageSource.playerAttack(this).sweep(), f4)) { + if (entityliving.hurt(DamageSource.playerAttack(this).sweep().critical(flag2), f4)) { // Paper - add critical damage API diff --git a/patches/unapplied/server/Add-isCollidable-methods-to-various-places.patch b/patches/server/Add-isCollidable-methods-to-various-places.patch similarity index 100% rename from patches/unapplied/server/Add-isCollidable-methods-to-various-places.patch rename to patches/server/Add-isCollidable-methods-to-various-places.patch diff --git a/patches/unapplied/server/Add-methods-to-find-targets-for-lightning-strikes.patch b/patches/server/Add-methods-to-find-targets-for-lightning-strikes.patch similarity index 100% rename from patches/unapplied/server/Add-methods-to-find-targets-for-lightning-strikes.patch rename to patches/server/Add-methods-to-find-targets-for-lightning-strikes.patch diff --git a/patches/unapplied/server/Add-missing-team-sidebar-display-slots.patch b/patches/server/Add-missing-team-sidebar-display-slots.patch similarity index 100% rename from patches/unapplied/server/Add-missing-team-sidebar-display-slots.patch rename to patches/server/Add-missing-team-sidebar-display-slots.patch diff --git a/patches/unapplied/server/Fix-issues-with-mob-conversion.patch b/patches/server/Fix-issues-with-mob-conversion.patch similarity index 72% rename from patches/unapplied/server/Fix-issues-with-mob-conversion.patch rename to patches/server/Fix-issues-with-mob-conversion.patch index dcf79c4723..7748fd3c44 100644 --- a/patches/unapplied/server/Fix-issues-with-mob-conversion.patch +++ b/patches/server/Fix-issues-with-mob-conversion.patch @@ -42,16 +42,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java -@@ -0,0 +0,0 @@ public class CraftSkeleton extends CraftAbstractSkeleton implements Skeleton { - this.getHandle().conversionTime = -1; - this.getHandle().getEntityData().set(net.minecraft.world.entity.monster.Skeleton.DATA_STRAY_CONVERSION_ID, false); - } else { -- this.getHandle().getSwimAmount(time); // PAIL rename startStrayConversion -+ this.getHandle().startFreezeConversion(time); // PAIL rename startStrayConversion // Paper - nope, that's not the right method - } - } - diff --git a/patches/unapplied/server/Get-entity-default-attributes.patch b/patches/server/Get-entity-default-attributes.patch similarity index 100% rename from patches/unapplied/server/Get-entity-default-attributes.patch rename to patches/server/Get-entity-default-attributes.patch diff --git a/patches/unapplied/server/Goat-ram-API.patch b/patches/server/Goat-ram-API.patch similarity index 91% rename from patches/unapplied/server/Goat-ram-API.patch rename to patches/server/Goat-ram-API.patch index 064eb6377e..18f82c31df 100644 --- a/patches/unapplied/server/Goat-ram-API.patch +++ b/patches/server/Goat-ram-API.patch @@ -9,11 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java @@ -0,0 +0,0 @@ public class Goat extends Animal { - return new Goat.GoatPathNavigation(this, world); + return world.getBlockState(pos.below()).is((Tag) BlockTags.GOATS_SPAWNABLE_ON) && isBrightEnoughToSpawn(world, pos); } + // Paper start - Goat ram API -+ public void ram(LivingEntity entity) { ++ public void ram(net.minecraft.world.entity.LivingEntity entity) { + Brain brain = this.getBrain(); + brain.setMemory(MemoryModuleType.RAM_TARGET, entity.position()); + brain.eraseMemory(MemoryModuleType.RAM_COOLDOWN_TICKS); diff --git a/patches/unapplied/server/Left-handed-API.patch b/patches/server/Left-handed-API.patch similarity index 100% rename from patches/unapplied/server/Left-handed-API.patch rename to patches/server/Left-handed-API.patch diff --git a/patches/unapplied/server/More-CommmandBlock-API.patch b/patches/server/More-CommandBlock-API.patch similarity index 99% rename from patches/unapplied/server/More-CommmandBlock-API.patch rename to patches/server/More-CommandBlock-API.patch index 1499624bb9..3c862c9b0d 100644 --- a/patches/unapplied/server/More-CommmandBlock-API.patch +++ b/patches/server/More-CommandBlock-API.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 23 Sep 2021 10:40:09 -0700 -Subject: [PATCH] More CommmandBlock API +Subject: [PATCH] More CommandBlock API diff --git a/src/main/java/io/papermc/paper/commands/PaperCommandBlockHolder.java b/src/main/java/io/papermc/paper/commands/PaperCommandBlockHolder.java diff --git a/patches/unapplied/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch b/patches/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch similarity index 100% rename from patches/unapplied/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch rename to patches/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch diff --git a/patches/unapplied/server/Add-Raw-Byte-Entity-Serialization.patch b/patches/unapplied/server/Add-Raw-Byte-Entity-Serialization.patch index 47f538a846..a8cb66c006 100644 --- a/patches/unapplied/server/Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/unapplied/server/Add-Raw-Byte-Entity-Serialization.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i } }