From 8e37c573ecc1b30d6a934b1d300e0f95641fdc86 Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:09:14 -0500 Subject: [PATCH] Remove some patches --- .../Handle-Item-Meta-Inconsistencies.patch | 13 +------ ...ther-worlds-for-shooter-of-projectil.patch | 35 ------------------- ...-brigadier-child-sorting-performance.patch | 28 --------------- ...esh-ProjectileSource-for-projectiles.patch | 6 ++-- 4 files changed, 4 insertions(+), 78 deletions(-) delete mode 100644 patches/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch delete mode 100644 patches/server/Optimize-brigadier-child-sorting-performance.patch diff --git a/patches/server/Handle-Item-Meta-Inconsistencies.patch b/patches/server/Handle-Item-Meta-Inconsistencies.patch index fa13d6176d..7c138a34d1 100644 --- a/patches/server/Handle-Item-Meta-Inconsistencies.patch +++ b/patches/server/Handle-Item-Meta-Inconsistencies.patch @@ -112,18 +112,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return 0; } - return EnchantmentHelper.getItemEnchantmentLevel(CraftEnchantment.bukkitToMinecraft(ench), this.handle); -+ // Paper start - replace to allow custom enchantments -+ final ListTag enchantments = this.handle.getEnchantmentTags(); -+ for (int i = 0; i < enchantments.size(); i++) { -+ final CompoundTag tag = enchantments.getCompound(i); -+ final String id = tag.getString(CraftMetaItem.ENCHANTMENTS_ID.NBT); -+ final Enchantment enchant = Enchantment.getByKey(CraftNamespacedKey.fromStringOrNull(id)); -+ if (ench.equals(enchant)) { -+ return EnchantmentHelper.getEnchantmentLevel(tag); -+ } -+ } -+ return 0; -+ // Paper end - replace to allow custom enchantments ++ return EnchantmentHelper.getItemEnchantmentLevel(CraftEnchantment.getRaw(ench), handle); } @Override diff --git a/patches/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch b/patches/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch deleted file mode 100644 index 59d3d0a9cb..0000000000 --- a/patches/server/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 17 Oct 2018 19:17:27 -0400 -Subject: [PATCH] MC-50319: Check other worlds for shooter of projectiles - -Say a player shoots an arrow through a nether portal, the game -would lose the shooter for determining things such as Player Kills, -because the entity is in another world. - -If the projectile fails to find the shooter in the current world, check -other worlds. - -diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -@@ -0,0 +0,0 @@ public abstract class Projectile extends Entity implements TraceableEntity { - ServerLevel worldserver = (ServerLevel) world; - - this.cachedOwner = worldserver.getEntity(this.ownerUUID); -+ // Paper start - check all worlds -+ if (this.cachedOwner == null) { -+ for (final ServerLevel level : this.level().getServer().getAllLevels()) { -+ if (level == this.level()) continue; -+ final Entity entity = level.getEntity(this.ownerUUID); -+ if (entity != null) { -+ this.cachedOwner = entity; -+ break; -+ } -+ } -+ } -+ // Paper end - return this.cachedOwner; - } - } diff --git a/patches/server/Optimize-brigadier-child-sorting-performance.patch b/patches/server/Optimize-brigadier-child-sorting-performance.patch deleted file mode 100644 index 79a3c8d996..0000000000 --- a/patches/server/Optimize-brigadier-child-sorting-performance.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: virustotalop -Date: Thu, 16 Apr 2020 20:51:32 -0700 -Subject: [PATCH] Optimize brigadier child sorting performance - - -diff --git a/src/main/java/com/mojang/brigadier/tree/CommandNode.java b/src/main/java/com/mojang/brigadier/tree/CommandNode.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/com/mojang/brigadier/tree/CommandNode.java -+++ b/src/main/java/com/mojang/brigadier/tree/CommandNode.java -@@ -0,0 +0,0 @@ import java.util.function.Predicate; - import net.minecraft.commands.CommandSourceStack; - - public abstract class CommandNode implements Comparable> { -- private final Map> children = new LinkedHashMap<>(); -+ private Map> children = com.google.common.collect.Maps.newTreeMap(); // Paper - Switch to tree map for automatic sorting - private final Map> literals = new LinkedHashMap<>(); - private final Map> arguments = new LinkedHashMap<>(); - public Predicate requirement; -@@ -0,0 +0,0 @@ public abstract class CommandNode implements Comparable> { - this.arguments.put(node.getName(), (ArgumentCommandNode) node); - } - } -+ -+ // Paper - Remove manual sorting, it is no longer needed - } - - public void findAmbiguities(final AmbiguityConsumer consumer) { diff --git a/patches/server/Refresh-ProjectileSource-for-projectiles.patch b/patches/server/Refresh-ProjectileSource-for-projectiles.patch index ecadb17bca..8ece52b88e 100644 --- a/patches/server/Refresh-ProjectileSource-for-projectiles.patch +++ b/patches/server/Refresh-ProjectileSource-for-projectiles.patch @@ -64,9 +64,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else { if (this.ownerUUID != null) { @@ -0,0 +0,0 @@ public abstract class Projectile extends Entity implements TraceableEntity { - } - } - // Paper end + ServerLevel worldserver = (ServerLevel) world; + + this.cachedOwner = worldserver.getEntity(this.ownerUUID); + this.refreshProjectileSource(false); // Paper return this.cachedOwner; }