diff --git a/patches/unapplied/server/Ability-to-get-block-entities-from-a-chunk-without-s.patch b/patches/server/Ability-to-get-block-entities-from-a-chunk-without-s.patch similarity index 100% rename from patches/unapplied/server/Ability-to-get-block-entities-from-a-chunk-without-s.patch rename to patches/server/Ability-to-get-block-entities-from-a-chunk-without-s.patch diff --git a/patches/unapplied/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/patches/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch similarity index 97% rename from patches/unapplied/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch rename to patches/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index 9638d4a5d4..4eb8324504 100644 --- a/patches/unapplied/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/patches/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -46,7 +46,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, S +@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper private CraftEntity bukkitEntity; diff --git a/patches/unapplied/server/Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/Add-Early-Warning-Feature-to-WatchDog.patch similarity index 97% rename from patches/unapplied/server/Add-Early-Warning-Feature-to-WatchDog.patch rename to patches/server/Add-Early-Warning-Feature-to-WatchDog.patch index 738f90532d..16032b21cd 100644 --- a/patches/unapplied/server/Add-Early-Warning-Feature-to-WatchDog.patch +++ b/patches/server/Add-Early-Warning-Feature-to-WatchDog.patch @@ -45,9 +45,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile()); this.commandsConfiguration = YamlConfiguration.loadConfiguration(this.getCommandsConfigFile()); @@ -0,0 +0,0 @@ public final class CraftServer implements Server { - this.enablePlugins(PluginLoadOrder.STARTUP); this.enablePlugins(PluginLoadOrder.POSTWORLD); this.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.RELOAD)); + if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins + org.spigotmc.WatchdogThread.hasStarted = true; // Paper - Disable watchdog early timeout on reload } diff --git a/patches/unapplied/server/Add-More-Creeper-API.patch b/patches/server/Add-More-Creeper-API.patch similarity index 100% rename from patches/unapplied/server/Add-More-Creeper-API.patch rename to patches/server/Add-More-Creeper-API.patch diff --git a/patches/unapplied/server/Add-PhantomPreSpawnEvent.patch b/patches/server/Add-PhantomPreSpawnEvent.patch similarity index 96% rename from patches/unapplied/server/Add-PhantomPreSpawnEvent.patch rename to patches/server/Add-PhantomPreSpawnEvent.patch index aae239d3a4..7fee1d6f33 100644 --- a/patches/unapplied/server/Add-PhantomPreSpawnEvent.patch +++ b/patches/server/Add-PhantomPreSpawnEvent.patch @@ -33,17 +33,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override @@ -0,0 +0,0 @@ public class Phantom extends FlyingMob implements Enemy { - return -0.125F; + return entitysize.scale(1.0F + 0.15F * (float) i); } + // Paper start ++ @Nullable + java.util.UUID spawningEntity; + ++ @Nullable + public java.util.UUID getSpawningEntity() { -+ return spawningEntity; ++ return this.spawningEntity; + } + public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; } + // Paper end ++ private static enum AttackPhase { CIRCLE, SWOOP; @@ -69,7 +72,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (entityphantom != null) { + entityphantom.setSpawningEntity(entityplayer.getUUID()); // Paper - PhantomPreSpawnEvent entityphantom.moveTo(blockposition1, 0.0F, 0.0F); - groupdataentity = entityphantom.finalizeSpawn(world, difficultydamagescaler, MobSpawnType.NATURAL, groupdataentity, (CompoundTag) null); + groupdataentity = entityphantom.finalizeSpawn(world, difficultydamagescaler, MobSpawnType.NATURAL, groupdataentity); world.addFreshEntityWithPassengers(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 diff --git a/patches/unapplied/server/Add-TNTPrimeEvent.patch b/patches/server/Add-TNTPrimeEvent.patch similarity index 95% rename from patches/unapplied/server/Add-TNTPrimeEvent.patch rename to patches/server/Add-TNTPrimeEvent.patch index 8696d623ee..501a2c22aa 100644 --- a/patches/unapplied/server/Add-TNTPrimeEvent.patch +++ b/patches/server/Add-TNTPrimeEvent.patch @@ -50,7 +50,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/block/TntBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TntBlock.java @@ -0,0 +0,0 @@ public class TntBlock extends Block { - public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { + protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { if (!oldState.is(state.getBlock())) { if (world.hasNeighborSignal(pos) && CraftEventFactory.callTNTPrimeEvent(world, pos, PrimeCause.REDSTONE, null, null)) { // CraftBukkit - TNTPrimeEvent + // Paper start - TNTPrimeEvent @@ -64,7 +64,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @@ -0,0 +0,0 @@ public class TntBlock extends Block { @Override - public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) { + protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) { if (world.hasNeighborSignal(pos) && CraftEventFactory.callTNTPrimeEvent(world, pos, PrimeCause.REDSTONE, null, sourcePos)) { // CraftBukkit - TNTPrimeEvent + // Paper start - TNTPrimeEvent + org.bukkit.block.Block tntBlock = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos); @@ -90,7 +90,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 int i = entitytntprimed.getFuse(); @@ -0,0 +0,0 @@ public class TntBlock extends Block { - return InteractionResult.CONSUME; + return ItemInteractionResult.CONSUME; } // CraftBukkit end + // Paper start - TNTPrimeEvent @@ -101,7 +101,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end - TNTPrimeEvent TntBlock.explode(world, pos, player); world.setBlock(pos, Blocks.AIR.defaultBlockState(), 11); - Item item = itemstack.getItem(); + Item item = stack.getItem(); @@ -0,0 +0,0 @@ public class TntBlock extends Block { return; } diff --git a/patches/unapplied/server/Add-ray-tracing-methods-to-LivingEntity.patch b/patches/server/Add-ray-tracing-methods-to-LivingEntity.patch similarity index 100% rename from patches/unapplied/server/Add-ray-tracing-methods-to-LivingEntity.patch rename to patches/server/Add-ray-tracing-methods-to-LivingEntity.patch diff --git a/patches/unapplied/server/Allow-chests-to-be-placed-with-NBT-data.patch b/patches/server/Allow-chests-to-be-placed-with-NBT-data.patch similarity index 95% rename from patches/unapplied/server/Allow-chests-to-be-placed-with-NBT-data.patch rename to patches/server/Allow-chests-to-be-placed-with-NBT-data.patch index e6b38ecbc7..8c325ff8ce 100644 --- a/patches/unapplied/server/Allow-chests-to-be-placed-with-NBT-data.patch +++ b/patches/server/Allow-chests-to-be-placed-with-NBT-data.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/ja index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -0,0 +0,0 @@ public final class ItemStack { +@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { enuminteractionresult = InteractionResult.FAIL; // cancel placement // PAIL: Remove this when MC-99075 fixed placeEvent.getPlayer().updateInventory(); diff --git a/patches/unapplied/server/Allow-disabling-armor-stand-ticking.patch b/patches/server/Allow-disabling-armor-stand-ticking.patch similarity index 98% rename from patches/unapplied/server/Allow-disabling-armor-stand-ticking.patch rename to patches/server/Allow-disabling-armor-stand-ticking.patch index b384623ff9..1958b24972 100644 --- a/patches/unapplied/server/Allow-disabling-armor-stand-ticking.patch +++ b/patches/server/Allow-disabling-armor-stand-ticking.patch @@ -51,9 +51,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.canTickSetByAPI = true; + } + // Paper end - Allow ArmorStands not to tick - CompoundTag nbttagcompound1 = nbt.getCompound("Pose"); + CompoundTag nbttagcompound2 = nbt.getCompound("Pose"); - this.readPose(nbttagcompound1); + this.readPose(nbttagcompound2); @@ -0,0 +0,0 @@ public class ArmorStand extends LivingEntity { @Override diff --git a/patches/unapplied/server/AnvilDamageEvent.patch b/patches/server/AnvilDamageEvent.patch similarity index 93% rename from patches/unapplied/server/AnvilDamageEvent.patch rename to patches/server/AnvilDamageEvent.patch index d3748b8a9d..4fca641469 100644 --- a/patches/unapplied/server/AnvilDamageEvent.patch +++ b/patches/server/AnvilDamageEvent.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java @@ -0,0 +0,0 @@ public class AnvilMenu extends ItemCombinerMenu { - if (!player.getAbilities().instabuild && iblockdata.is(BlockTags.ANVIL) && player.getRandom().nextFloat() < 0.12F) { + if (!player.hasInfiniteMaterials() && iblockdata.is(BlockTags.ANVIL) && player.getRandom().nextFloat() < 0.12F) { BlockState iblockdata1 = AnvilBlock.damage(iblockdata); + // Paper start - AnvilDamageEvent diff --git a/patches/unapplied/server/Break-up-and-make-tab-spam-limits-configurable.patch b/patches/server/Break-up-and-make-tab-spam-limits-configurable.patch similarity index 100% rename from patches/unapplied/server/Break-up-and-make-tab-spam-limits-configurable.patch rename to patches/server/Break-up-and-make-tab-spam-limits-configurable.patch diff --git a/patches/unapplied/server/Configurable-speed-for-water-flowing-over-lava.patch b/patches/server/Configurable-speed-for-water-flowing-over-lava.patch similarity index 86% rename from patches/unapplied/server/Configurable-speed-for-water-flowing-over-lava.patch rename to patches/server/Configurable-speed-for-water-flowing-over-lava.patch index 1e4bf79493..f2f211fe28 100644 --- a/patches/unapplied/server/Configurable-speed-for-water-flowing-over-lava.patch +++ b/patches/server/Configurable-speed-for-water-flowing-over-lava.patch @@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java @@ -0,0 +0,0 @@ public class LiquidBlock extends Block implements BucketPickup { @Override - public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { + protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { if (this.shouldSpreadLiquid(world, pos, state)) { - world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world)); + world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava @@ -39,11 +39,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end - Configurable speed for water flowing over lava + @Override - public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { + protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { if (state.getFluidState().isSource() || neighborState.getFluidState().isSource()) { @@ -0,0 +0,0 @@ public class LiquidBlock extends Block implements BucketPickup { @Override - public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) { + protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) { if (this.shouldSpreadLiquid(world, pos, state)) { - world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world)); + world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava diff --git a/patches/unapplied/server/Don-t-call-getItemMeta-on-hasItemMeta.patch b/patches/server/Don-t-call-getItemMeta-on-hasItemMeta.patch similarity index 100% rename from patches/unapplied/server/Don-t-call-getItemMeta-on-hasItemMeta.patch rename to patches/server/Don-t-call-getItemMeta-on-hasItemMeta.patch diff --git a/patches/unapplied/server/Expand-ArmorStand-API.patch b/patches/server/Expand-ArmorStand-API.patch similarity index 100% rename from patches/unapplied/server/Expand-ArmorStand-API.patch rename to patches/server/Expand-ArmorStand-API.patch diff --git a/patches/unapplied/server/Expose-attack-cooldown-methods-for-Player.patch b/patches/server/Expose-attack-cooldown-methods-for-Player.patch similarity index 100% rename from patches/unapplied/server/Expose-attack-cooldown-methods-for-Player.patch rename to patches/server/Expose-attack-cooldown-methods-for-Player.patch diff --git a/patches/unapplied/server/Fix-NBT-type-issues.patch b/patches/server/Fix-NBT-type-issues.patch similarity index 100% rename from patches/unapplied/server/Fix-NBT-type-issues.patch rename to patches/server/Fix-NBT-type-issues.patch diff --git a/patches/unapplied/server/Improve-BlockPosition-inlining.patch b/patches/server/Improve-BlockPosition-inlining.patch similarity index 100% rename from patches/unapplied/server/Improve-BlockPosition-inlining.patch rename to patches/server/Improve-BlockPosition-inlining.patch diff --git a/patches/unapplied/server/Improve-death-events.patch b/patches/server/Improve-death-events.patch similarity index 98% rename from patches/unapplied/server/Improve-death-events.patch rename to patches/server/Improve-death-events.patch index 5e82b7b7ee..abe6c8f58d 100644 --- a/patches/unapplied/server/Improve-death-events.patch +++ b/patches/server/Improve-death-events.patch @@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end - cancellable death event // CraftBukkit start - public String displayName; + public CraftPlayer.TransferCookieConnection transferCookieConnection; @@ -0,0 +0,0 @@ public class ServerPlayer extends Player { @Override @@ -95,10 +95,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.isDeadOrDying()) { if (!this.checkTotemDeathProtection(source)) { -- SoundEvent soundeffect = this.getDeathSound(); -- -- if (flag1 && soundeffect != null) { -- this.playSound(soundeffect, this.getSoundVolume(), this.getVoicePitch()); +- if (flag1) { +- this.makeSound(this.getDeathSound()); - } + // Paper start - moved into CraftEventFactory event caller for cancellable death event + this.silentDeath = !flag1; // mark entity as dying silently @@ -131,8 +129,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (world instanceof ServerLevel) { ServerLevel worldserver = (ServerLevel) world; + // Paper - move below into if for onKill - -- if (entity == null || entity.killedEntity(worldserver, this)) { ++ + // Paper start + org.bukkit.event.entity.EntityDeathEvent deathEvent = this.dropAllDeathLoot(damageSource); + if (deathEvent == null || !deathEvent.isCancelled()) { @@ -155,7 +152,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (!this.level().isClientSide && this.hasCustomName()) { + if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot + } -+ + +- if (entity == null || entity.killedEntity(worldserver, this)) { + this.getCombatTracker().recheckStatus(); + if (entity != null) { + entity.killedEntity((ServerLevel) this.level(), this); @@ -237,7 +235,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n 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 implements Targeting { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti } @@ -250,7 +248,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) { super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops); -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti for (int k = 0; k < j; ++k) { EquipmentSlot enumitemslot = aenumitemslot[k]; @@ -258,7 +256,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ItemStack itemstack = this.getItemBySlot(enumitemslot); float f = this.getEquipmentDropChance(enumitemslot); boolean flag1 = f > 1.0F; -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti } this.spawnAtLocation(itemstack); @@ -317,7 +315,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return deathEvent; // Paper - Cancellable death event } - @Override + public static boolean isPathClear(Fox fox, LivingEntity chasedEntity) { diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java @@ -390,10 +388,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private org.bukkit.event.entity.EntityDeathEvent brokenByPlayer(DamageSource damageSource) { // Paper ItemStack itemstack = new ItemStack(Items.ARMOR_STAND); - if (this.hasCustomName()) { -@@ -0,0 +0,0 @@ public class ArmorStand extends LivingEntity { - } - + itemstack.set(DataComponents.CUSTOM_NAME, this.getCustomName()); this.drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops - this.brokenByAnything(damageSource); + return this.brokenByAnything(damageSource); // Paper diff --git a/patches/unapplied/server/Inventory-removeItemAnySlot.patch b/patches/server/Inventory-removeItemAnySlot.patch similarity index 100% rename from patches/unapplied/server/Inventory-removeItemAnySlot.patch rename to patches/server/Inventory-removeItemAnySlot.patch diff --git a/patches/unapplied/server/Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch b/patches/server/Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch similarity index 100% rename from patches/unapplied/server/Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch rename to patches/server/Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch diff --git a/patches/unapplied/server/Mob-Pathfinding-API.patch b/patches/server/Mob-Pathfinding-API.patch similarity index 100% rename from patches/unapplied/server/Mob-Pathfinding-API.patch rename to patches/server/Mob-Pathfinding-API.patch diff --git a/patches/unapplied/server/Optimize-BlockPosition-helper-methods.patch b/patches/server/Optimize-BlockPosition-helper-methods.patch similarity index 100% rename from patches/unapplied/server/Optimize-BlockPosition-helper-methods.patch rename to patches/server/Optimize-BlockPosition-helper-methods.patch diff --git a/patches/unapplied/server/Optimize-CraftBlockData-Creation.patch b/patches/server/Optimize-CraftBlockData-Creation.patch similarity index 100% rename from patches/unapplied/server/Optimize-CraftBlockData-Creation.patch rename to patches/server/Optimize-CraftBlockData-Creation.patch diff --git a/patches/unapplied/server/Optimize-MappedRegistry.patch b/patches/server/Optimize-MappedRegistry.patch similarity index 88% rename from patches/unapplied/server/Optimize-MappedRegistry.patch rename to patches/server/Optimize-MappedRegistry.patch index 9bde73651d..0d9d037d06 100644 --- a/patches/unapplied/server/Optimize-MappedRegistry.patch +++ b/patches/server/Optimize-MappedRegistry.patch @@ -19,12 +19,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - private final Map> byLocation = new HashMap<>(); - private final Map, Holder.Reference> byKey = new HashMap<>(); - private final Map> byValue = new IdentityHashMap<>(); -- private final Map lifecycles = new IdentityHashMap<>(); +- private final Map, RegistrationInfo> registrationInfos = new IdentityHashMap<>(); + private final Reference2IntMap toId = Util.make(new Reference2IntOpenHashMap<>(2048), map -> map.defaultReturnValue(-1)); // Paper - Perf: Use bigger expected size to reduce collisions + private final Map> byLocation = new HashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions + private final Map, Holder.Reference> byKey = new HashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions + private final Map> byValue = new IdentityHashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions -+ private final Map lifecycles = new IdentityHashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions ++ private final Map, RegistrationInfo> registrationInfos = new IdentityHashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions private Lifecycle registryLifecycle; private volatile Map, HolderSet.Named> tags = new IdentityHashMap<>(); private boolean frozen; diff --git a/patches/unapplied/server/Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/patches/server/Option-to-prevent-armor-stands-from-doing-entity-loo.patch similarity index 100% rename from patches/unapplied/server/Option-to-prevent-armor-stands-from-doing-entity-loo.patch rename to patches/server/Option-to-prevent-armor-stands-from-doing-entity-loo.patch diff --git a/patches/server/Remove-unnecessary-itemmeta-handling.patch b/patches/server/Remove-unnecessary-itemmeta-handling.patch new file mode 100644 index 0000000000..6ee3aacfdb --- /dev/null +++ b/patches/server/Remove-unnecessary-itemmeta-handling.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Tue, 22 Nov 2016 00:40:42 -0500 +Subject: [PATCH] Remove unnecessary itemmeta handling + + +diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/item/ItemStack.java ++++ b/src/main/java/net/minecraft/world/item/ItemStack.java +@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { + + // CraftBukkit start + ItemStack itemstack = new ItemStack(holder, i, datacomponentpatch); +- if (!datacomponentpatch.isEmpty()) { ++ if (false && !datacomponentpatch.isEmpty()) { // Paper - This is no longer needed with raw NBT being handled in metadata + CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack)); + } + return itemstack; +@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { + registryfriendlybytebuf.writeVarInt(itemstack.getCount()); + // Spigot start - filter + itemstack = itemstack.copy(); +- CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack)); ++ // CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack)); // Paper - This is no longer with raw NBT being handled in metadata + // Spigot end + ITEM_STREAM_CODEC.encode(registryfriendlybytebuf, itemstack.getItemHolder()); // CraftBukkit - decompile error + DataComponentPatch.STREAM_CODEC.encode(registryfriendlybytebuf, itemstack.components.asPatch()); diff --git a/patches/unapplied/server/Restore-vanilla-default-mob-spawn-range-and-water-an.patch b/patches/server/Restore-vanilla-default-mob-spawn-range-and-water-an.patch similarity index 100% rename from patches/unapplied/server/Restore-vanilla-default-mob-spawn-range-and-water-an.patch rename to patches/server/Restore-vanilla-default-mob-spawn-range-and-water-an.patch diff --git a/patches/unapplied/server/SkeletonHorse-Additions.patch b/patches/server/SkeletonHorse-Additions.patch similarity index 98% rename from patches/unapplied/server/SkeletonHorse-Additions.patch rename to patches/server/SkeletonHorse-Additions.patch index 6efd3bf5d9..8e97dca518 100644 --- a/patches/unapplied/server/SkeletonHorse-Additions.patch +++ b/patches/server/SkeletonHorse-Additions.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapG index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java -@@ -0,0 +0,0 @@ import net.minecraft.world.item.enchantment.EnchantmentHelper; +@@ -0,0 +0,0 @@ import net.minecraft.world.item.enchantment.ItemEnchantments; public class SkeletonTrapGoal extends Goal { private final SkeletonHorse horse; diff --git a/patches/unapplied/server/Slime-Pathfinder-Events.patch b/patches/server/Slime-Pathfinder-Events.patch similarity index 100% rename from patches/unapplied/server/Slime-Pathfinder-Events.patch rename to patches/server/Slime-Pathfinder-Events.patch diff --git a/patches/unapplied/server/Use-ConcurrentHashMap-in-JsonList.patch b/patches/server/Use-ConcurrentHashMap-in-JsonList.patch similarity index 100% rename from patches/unapplied/server/Use-ConcurrentHashMap-in-JsonList.patch rename to patches/server/Use-ConcurrentHashMap-in-JsonList.patch diff --git a/patches/unapplied/server/Use-a-Queue-for-Queueing-Commands.patch b/patches/server/Use-a-Queue-for-Queueing-Commands.patch similarity index 100% rename from patches/unapplied/server/Use-a-Queue-for-Queueing-Commands.patch rename to patches/server/Use-a-Queue-for-Queueing-Commands.patch diff --git a/patches/unapplied/server/Vanished-players-don-t-have-rights.patch b/patches/server/Vanished-players-don-t-have-rights.patch similarity index 100% rename from patches/unapplied/server/Vanished-players-don-t-have-rights.patch rename to patches/server/Vanished-players-don-t-have-rights.patch diff --git a/patches/unapplied/server/Remove-unnecessary-itemmeta-handling.patch b/patches/unapplied/server/Remove-unnecessary-itemmeta-handling.patch deleted file mode 100644 index 7f118f680d..0000000000 --- a/patches/unapplied/server/Remove-unnecessary-itemmeta-handling.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Tue, 22 Nov 2016 00:40:42 -0500 -Subject: [PATCH] Remove unnecessary itemmeta handling - - -diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java -+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -@@ -0,0 +0,0 @@ public class FriendlyByteBuf extends ByteBuf { - if (item.canBeDepleted() || item.shouldOverrideMultiplayerNbt()) { - // Spigot start - filter - stack = stack.copy(); -- CraftItemStack.setItemMeta(stack, CraftItemStack.getItemMeta(stack)); -+ // CraftItemStack.setItemMeta(stack, CraftItemStack.getItemMeta(stack)); // Paper - This is no longer with raw NBT being handled in metadata - // Spigot end - nbttagcompound = stack.getTag(); - } -@@ -0,0 +0,0 @@ public class FriendlyByteBuf extends ByteBuf { - - itemstack.setTag(this.readNbt()); - // CraftBukkit start -- if (itemstack.getTag() != null) { -+ if (false && itemstack.getTag() != null) { // Paper - This is no longer needed with raw NBT being handled in metadata - CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack)); - } - // CraftBukkit end