diff --git a/build-data/dev-imports.txt b/build-data/dev-imports.txt index b818b96e27..286aeeaaa9 100644 --- a/build-data/dev-imports.txt +++ b/build-data/dev-imports.txt @@ -8,3 +8,4 @@ # To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId: # minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter # minecraft net/minecraft/world/level/entity/LevelEntityGetter.java + diff --git a/patches/unapplied/api/API-to-get-a-BlockState-without-a-snapshot.patch b/patches/api/API-to-get-a-BlockState-without-a-snapshot.patch similarity index 100% rename from patches/unapplied/api/API-to-get-a-BlockState-without-a-snapshot.patch rename to patches/api/API-to-get-a-BlockState-without-a-snapshot.patch diff --git a/patches/unapplied/api/Ability-to-apply-mending-to-XP-API.patch b/patches/api/Ability-to-apply-mending-to-XP-API.patch similarity index 100% rename from patches/unapplied/api/Ability-to-apply-mending-to-XP-API.patch rename to patches/api/Ability-to-apply-mending-to-XP-API.patch diff --git a/patches/unapplied/api/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch b/patches/api/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch similarity index 100% rename from patches/unapplied/api/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch rename to patches/api/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch diff --git a/patches/unapplied/api/Add-ArmorStand-Item-Meta.patch b/patches/api/Add-ArmorStand-Item-Meta.patch similarity index 100% rename from patches/unapplied/api/Add-ArmorStand-Item-Meta.patch rename to patches/api/Add-ArmorStand-Item-Meta.patch diff --git a/patches/unapplied/api/Add-PlayerArmorChangeEvent.patch b/patches/api/Add-PlayerArmorChangeEvent.patch similarity index 100% rename from patches/unapplied/api/Add-PlayerArmorChangeEvent.patch rename to patches/api/Add-PlayerArmorChangeEvent.patch diff --git a/patches/unapplied/api/Add-PlayerJumpEvent.patch b/patches/api/Add-PlayerJumpEvent.patch similarity index 100% rename from patches/unapplied/api/Add-PlayerJumpEvent.patch rename to patches/api/Add-PlayerJumpEvent.patch diff --git a/patches/unapplied/api/Add-UnknownCommandEvent.patch b/patches/api/Add-UnknownCommandEvent.patch similarity index 100% rename from patches/unapplied/api/Add-UnknownCommandEvent.patch rename to patches/api/Add-UnknownCommandEvent.patch diff --git a/patches/unapplied/api/Add-extended-PaperServerListPingEvent.patch b/patches/api/Add-extended-PaperServerListPingEvent.patch similarity index 100% rename from patches/unapplied/api/Add-extended-PaperServerListPingEvent.patch rename to patches/api/Add-extended-PaperServerListPingEvent.patch diff --git a/patches/unapplied/api/Add-getI18NDisplayName-API.patch b/patches/api/Add-getI18NDisplayName-API.patch similarity index 100% rename from patches/unapplied/api/Add-getI18NDisplayName-API.patch rename to patches/api/Add-getI18NDisplayName-API.patch diff --git a/patches/unapplied/api/Add-legacy-ping-support-to-PaperServerListPingEvent.patch b/patches/api/Add-legacy-ping-support-to-PaperServerListPingEvent.patch similarity index 100% rename from patches/unapplied/api/Add-legacy-ping-support-to-PaperServerListPingEvent.patch rename to patches/api/Add-legacy-ping-support-to-PaperServerListPingEvent.patch diff --git a/patches/unapplied/api/Add-setPlayerProfile-API-for-Skulls.patch b/patches/api/Add-setPlayerProfile-API-for-Skulls.patch similarity index 100% rename from patches/unapplied/api/Add-setPlayerProfile-API-for-Skulls.patch rename to patches/api/Add-setPlayerProfile-API-for-Skulls.patch diff --git a/patches/unapplied/api/Add-workaround-for-plugins-modifying-the-parent-of-t.patch b/patches/api/Add-workaround-for-plugins-modifying-the-parent-of-t.patch similarity index 100% rename from patches/unapplied/api/Add-workaround-for-plugins-modifying-the-parent-of-t.patch rename to patches/api/Add-workaround-for-plugins-modifying-the-parent-of-t.patch diff --git a/patches/unapplied/api/Allow-plugins-to-use-SLF4J-for-logging.patch b/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch similarity index 100% rename from patches/unapplied/api/Allow-plugins-to-use-SLF4J-for-logging.patch rename to patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch diff --git a/patches/unapplied/api/AsyncTabCompleteEvent.patch b/patches/api/AsyncTabCompleteEvent.patch similarity index 100% rename from patches/unapplied/api/AsyncTabCompleteEvent.patch rename to patches/api/AsyncTabCompleteEvent.patch diff --git a/patches/unapplied/api/Basic-PlayerProfile-API.patch b/patches/api/Basic-PlayerProfile-API.patch similarity index 100% rename from patches/unapplied/api/Basic-PlayerProfile-API.patch rename to patches/api/Basic-PlayerProfile-API.patch diff --git a/patches/unapplied/api/Display-warning-on-deprecated-recipe-API.patch b/patches/api/Display-warning-on-deprecated-recipe-API.patch similarity index 100% rename from patches/unapplied/api/Display-warning-on-deprecated-recipe-API.patch rename to patches/api/Display-warning-on-deprecated-recipe-API.patch diff --git a/patches/unapplied/api/Entity-fromMobSpawner.patch b/patches/api/Entity-fromMobSpawner.patch similarity index 100% rename from patches/unapplied/api/Entity-fromMobSpawner.patch rename to patches/api/Entity-fromMobSpawner.patch diff --git a/patches/unapplied/api/ExperienceOrbMergeEvent.patch b/patches/api/ExperienceOrbMergeEvent.patch similarity index 100% rename from patches/unapplied/api/ExperienceOrbMergeEvent.patch rename to patches/api/ExperienceOrbMergeEvent.patch diff --git a/patches/unapplied/api/Expose-client-protocol-version-and-virtual-host.patch b/patches/api/Expose-client-protocol-version-and-virtual-host.patch similarity index 100% rename from patches/unapplied/api/Expose-client-protocol-version-and-virtual-host.patch rename to patches/api/Expose-client-protocol-version-and-virtual-host.patch diff --git a/patches/unapplied/api/Fill-Profile-Property-Events.patch b/patches/api/Fill-Profile-Property-Events.patch similarity index 100% rename from patches/unapplied/api/Fill-Profile-Property-Events.patch rename to patches/api/Fill-Profile-Property-Events.patch diff --git a/patches/unapplied/api/Handle-plugin-prefixes-in-implementation-logging-con.patch b/patches/api/Handle-plugin-prefixes-in-implementation-logging-con.patch similarity index 100% rename from patches/unapplied/api/Handle-plugin-prefixes-in-implementation-logging-con.patch rename to patches/api/Handle-plugin-prefixes-in-implementation-logging-con.patch diff --git a/patches/unapplied/api/Improve-the-Saddle-API-for-Horses.patch b/patches/api/Improve-the-Saddle-API-for-Horses.patch similarity index 100% rename from patches/unapplied/api/Improve-the-Saddle-API-for-Horses.patch rename to patches/api/Improve-the-Saddle-API-for-Horses.patch diff --git a/patches/unapplied/api/LivingEntity-setKiller.patch b/patches/api/LivingEntity-setKiller.patch similarity index 100% rename from patches/unapplied/api/LivingEntity-setKiller.patch rename to patches/api/LivingEntity-setKiller.patch diff --git a/patches/unapplied/api/Make-plugins-list-alphabetical.patch b/patches/api/Make-plugins-list-alphabetical.patch similarity index 100% rename from patches/unapplied/api/Make-plugins-list-alphabetical.patch rename to patches/api/Make-plugins-list-alphabetical.patch diff --git a/patches/unapplied/api/Optimize-Hoppers.patch b/patches/api/Optimize-Hoppers.patch similarity index 100% rename from patches/unapplied/api/Optimize-Hoppers.patch rename to patches/api/Optimize-Hoppers.patch diff --git a/patches/unapplied/api/Player.setPlayerProfile-API.patch b/patches/api/Player.setPlayerProfile-API.patch similarity index 100% rename from patches/unapplied/api/Player.setPlayerProfile-API.patch rename to patches/api/Player.setPlayerProfile-API.patch diff --git a/patches/unapplied/api/PlayerAdvancementCriterionGrantEvent.patch b/patches/api/PlayerAdvancementCriterionGrantEvent.patch similarity index 100% rename from patches/unapplied/api/PlayerAdvancementCriterionGrantEvent.patch rename to patches/api/PlayerAdvancementCriterionGrantEvent.patch diff --git a/patches/unapplied/api/PlayerAttemptPickupItemEvent.patch b/patches/api/PlayerAttemptPickupItemEvent.patch similarity index 100% rename from patches/unapplied/api/PlayerAttemptPickupItemEvent.patch rename to patches/api/PlayerAttemptPickupItemEvent.patch diff --git a/patches/unapplied/api/PlayerNaturallySpawnCreaturesEvent.patch b/patches/api/PlayerNaturallySpawnCreaturesEvent.patch similarity index 100% rename from patches/unapplied/api/PlayerNaturallySpawnCreaturesEvent.patch rename to patches/api/PlayerNaturallySpawnCreaturesEvent.patch diff --git a/patches/unapplied/api/PlayerPickupExperienceEvent.patch b/patches/api/PlayerPickupExperienceEvent.patch similarity index 100% rename from patches/unapplied/api/PlayerPickupExperienceEvent.patch rename to patches/api/PlayerPickupExperienceEvent.patch diff --git a/patches/unapplied/api/PlayerPickupItemEvent-setFlyAtPlayer.patch b/patches/api/PlayerPickupItemEvent-setFlyAtPlayer.patch similarity index 100% rename from patches/unapplied/api/PlayerPickupItemEvent-setFlyAtPlayer.patch rename to patches/api/PlayerPickupItemEvent-setFlyAtPlayer.patch diff --git a/patches/unapplied/api/PreCreatureSpawnEvent.patch b/patches/api/PreCreatureSpawnEvent.patch similarity index 100% rename from patches/unapplied/api/PreCreatureSpawnEvent.patch rename to patches/api/PreCreatureSpawnEvent.patch diff --git a/patches/unapplied/api/Profile-Lookup-Events.patch b/patches/api/Profile-Lookup-Events.patch similarity index 100% rename from patches/unapplied/api/Profile-Lookup-Events.patch rename to patches/api/Profile-Lookup-Events.patch diff --git a/patches/unapplied/api/ProfileWhitelistVerifyEvent.patch b/patches/api/ProfileWhitelistVerifyEvent.patch similarity index 100% rename from patches/unapplied/api/ProfileWhitelistVerifyEvent.patch rename to patches/api/ProfileWhitelistVerifyEvent.patch diff --git a/patches/unapplied/api/Shoulder-Entities-Release-API.patch b/patches/api/Shoulder-Entities-Release-API.patch similarity index 100% rename from patches/unapplied/api/Shoulder-Entities-Release-API.patch rename to patches/api/Shoulder-Entities-Release-API.patch diff --git a/patches/unapplied/api/Tameable-getOwnerUniqueId-API.patch b/patches/api/Tameable-getOwnerUniqueId-API.patch similarity index 100% rename from patches/unapplied/api/Tameable-getOwnerUniqueId-API.patch rename to patches/api/Tameable-getOwnerUniqueId-API.patch diff --git a/patches/unapplied/api/ensureServerConversions-API.patch b/patches/api/ensureServerConversions-API.patch similarity index 100% rename from patches/unapplied/api/ensureServerConversions-API.patch rename to patches/api/ensureServerConversions-API.patch diff --git a/patches/unapplied/api/getPlayerUniqueId-API.patch b/patches/api/getPlayerUniqueId-API.patch similarity index 100% rename from patches/unapplied/api/getPlayerUniqueId-API.patch rename to patches/api/getPlayerUniqueId-API.patch diff --git a/patches/unapplied/server/API-to-get-a-BlockState-without-a-snapshot.patch b/patches/server/API-to-get-a-BlockState-without-a-snapshot.patch similarity index 93% rename from patches/unapplied/server/API-to-get-a-BlockState-without-a-snapshot.patch rename to patches/server/API-to-get-a-BlockState-without-a-snapshot.patch index 62900b68f5..73d6e33ffa 100644 --- a/patches/unapplied/server/API-to-get-a-BlockState-without-a-snapshot.patch +++ b/patches/server/API-to-get-a-BlockState-without-a-snapshot.patch @@ -16,15 +16,15 @@ diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.ja index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -@@ -0,0 +0,0 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { +@@ -0,0 +0,0 @@ public abstract class BlockEntity implements io.papermc.paper.util.KeyedObject { this.type = type; this.worldPosition = pos.immutable(); this.blockState = state; + this.persistentDataContainer = new CraftPersistentDataContainer(DATA_TYPE_REGISTRY); // Paper - always init } - // Paper start -@@ -0,0 +0,0 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { + public static BlockPos getPosFromTag(CompoundTag nbt) { +@@ -0,0 +0,0 @@ public abstract class BlockEntity implements io.papermc.paper.util.KeyedObject { // CraftBukkit start - read container public void load(CompoundTag nbt) { @@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 net.minecraft.nbt.Tag persistentDataTag = nbt.get("PublicBukkitValues"); if (persistentDataTag instanceof CompoundTag) { -@@ -0,0 +0,0 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { +@@ -0,0 +0,0 @@ public abstract class BlockEntity implements io.papermc.paper.util.KeyedObject { // CraftBukkit start - add method public InventoryHolder getOwner() { diff --git a/patches/unapplied/server/Ability-to-apply-mending-to-XP-API.patch b/patches/server/Ability-to-apply-mending-to-XP-API.patch similarity index 76% rename from patches/unapplied/server/Ability-to-apply-mending-to-XP-API.patch rename to patches/server/Ability-to-apply-mending-to-XP-API.patch index d4132ad311..4afd01d088 100644 --- a/patches/unapplied/server/Ability-to-apply-mending-to-XP-API.patch +++ b/patches/server/Ability-to-apply-mending-to-XP-API.patch @@ -31,21 +31,6 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -0,0 +0,0 @@ import net.minecraft.server.level.ServerPlayer; - import net.minecraft.server.network.ServerGamePacketListenerImpl; - import net.minecraft.server.players.UserWhiteListEntry; - import net.minecraft.world.entity.Entity; -+import net.minecraft.world.entity.ExperienceOrb; - import net.minecraft.world.entity.LivingEntity; - import net.minecraft.world.entity.ai.attributes.AttributeInstance; - import net.minecraft.world.entity.ai.attributes.AttributeMap; - import net.minecraft.world.entity.ai.attributes.Attributes; - import net.minecraft.world.inventory.AbstractContainerMenu; -+import net.minecraft.world.item.enchantment.EnchantmentHelper; -+import net.minecraft.world.item.enchantment.Enchantments; - import net.minecraft.world.level.GameType; - import net.minecraft.world.level.block.Blocks; - import net.minecraft.world.level.block.entity.SignBlockEntity; @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return GameMode.getByValue(this.getHandle().gameMode.getGameModeForPlayer().getId()); } @@ -55,10 +40,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public int applyMending(int amount) { + ServerPlayer handle = getHandle(); + // Logic copied from EntityExperienceOrb and remapped to unobfuscated methods/properties -+ net.minecraft.world.item.ItemStack itemstack = EnchantmentHelper.getRandomEquippedItemWithEnchant(Enchantments.MENDING, handle); ++ net.minecraft.world.item.ItemStack itemstack = net.minecraft.world.item.enchantment.EnchantmentHelper ++ .getRandomEquippedItemWithEnchant(net.minecraft.world.item.enchantment.Enchantments.MENDING, handle); + if (!itemstack.isEmpty() && itemstack.getItem().canBeDepleted()) { -+ -+ ExperienceOrb orb = net.minecraft.world.entity.EntityType.EXPERIENCE_ORB.create(handle.level); ++ net.minecraft.world.entity.ExperienceOrb orb = net.minecraft.world.entity.EntityType.EXPERIENCE_ORB.create(handle.level); + orb.value = amount; + orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM; + orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ()); diff --git a/patches/unapplied/server/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch b/patches/server/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch similarity index 100% rename from patches/unapplied/server/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch rename to patches/server/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch diff --git a/patches/unapplied/server/Add-ArmorStand-Item-Meta.patch b/patches/server/Add-ArmorStand-Item-Meta.patch similarity index 100% rename from patches/unapplied/server/Add-ArmorStand-Item-Meta.patch rename to patches/server/Add-ArmorStand-Item-Meta.patch diff --git a/patches/unapplied/server/Add-PlayerArmorChangeEvent.patch b/patches/server/Add-PlayerArmorChangeEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerArmorChangeEvent.patch rename to patches/server/Add-PlayerArmorChangeEvent.patch diff --git a/patches/unapplied/server/Add-PlayerJumpEvent.patch b/patches/server/Add-PlayerJumpEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerJumpEvent.patch rename to patches/server/Add-PlayerJumpEvent.patch diff --git a/patches/unapplied/server/Add-UnknownCommandEvent.patch b/patches/server/Add-UnknownCommandEvent.patch similarity index 100% rename from patches/unapplied/server/Add-UnknownCommandEvent.patch rename to patches/server/Add-UnknownCommandEvent.patch diff --git a/patches/unapplied/server/Add-setPlayerProfile-API-for-Skulls.patch b/patches/server/Add-setPlayerProfile-API-for-Skulls.patch similarity index 100% rename from patches/unapplied/server/Add-setPlayerProfile-API-for-Skulls.patch rename to patches/server/Add-setPlayerProfile-API-for-Skulls.patch diff --git a/patches/unapplied/server/Allow-specifying-a-custom-authentication-servers-dow.patch b/patches/server/Allow-specifying-a-custom-authentication-servers-dow.patch similarity index 100% rename from patches/unapplied/server/Allow-specifying-a-custom-authentication-servers-dow.patch rename to patches/server/Allow-specifying-a-custom-authentication-servers-dow.patch diff --git a/patches/unapplied/server/AsyncTabCompleteEvent.patch b/patches/server/AsyncTabCompleteEvent.patch similarity index 100% rename from patches/unapplied/server/AsyncTabCompleteEvent.patch rename to patches/server/AsyncTabCompleteEvent.patch diff --git a/patches/unapplied/server/Basic-PlayerProfile-API.patch b/patches/server/Basic-PlayerProfile-API.patch similarity index 99% rename from patches/unapplied/server/Basic-PlayerProfile-API.patch rename to patches/server/Basic-PlayerProfile-API.patch index 555ed46933..7107407af2 100644 --- a/patches/unapplied/server/Basic-PlayerProfile-API.patch +++ b/patches/server/Basic-PlayerProfile-API.patch @@ -332,7 +332,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private final Environment environment; + public PaperAuthenticationService(Proxy proxy) { + super(proxy); -+ this.environment = (Environment)EnvironmentParser.getEnvironmentFromProperties().orElse(YggdrasilEnvironment.PROD);; ++ this.environment = EnvironmentParser.getEnvironmentFromProperties().orElse(YggdrasilEnvironment.PROD.getEnvironment()); + } + + @Override diff --git a/patches/unapplied/server/Block-player-logins-during-server-shutdown.patch b/patches/server/Block-player-logins-during-server-shutdown.patch similarity index 100% rename from patches/unapplied/server/Block-player-logins-during-server-shutdown.patch rename to patches/server/Block-player-logins-during-server-shutdown.patch diff --git a/patches/server/Configurable-Grass-Spread-Tick-Rate.patch b/patches/server/Configurable-Grass-Spread-Tick-Rate.patch index db20a3050b..df68a362cf 100644 --- a/patches/server/Configurable-Grass-Spread-Tick-Rate.patch +++ b/patches/server/Configurable-Grass-Spread-Tick-Rate.patch @@ -35,9 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) { -- if (!SpreadingSnowyDirtBlock.canBeGrass(state, world, pos)) { + if (this instanceof GrassBlock && world.paperConfig.grassUpdateRate != 1 && (world.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig.grassUpdateRate != 0)) { return; } // Paper -+ if (!SpreadingSnowyDirtBlock.canBeGrass(state, (LevelReader) world, pos)) { + if (!SpreadingSnowyDirtBlock.canBeGrass(state, world, pos)) { // CraftBukkit start if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, pos, Blocks.DIRT.defaultBlockState()).isCancelled()) { - return; diff --git a/patches/unapplied/server/Disable-Explicit-Network-Manager-Flushing.patch b/patches/server/Disable-Explicit-Network-Manager-Flushing.patch similarity index 100% rename from patches/unapplied/server/Disable-Explicit-Network-Manager-Flushing.patch rename to patches/server/Disable-Explicit-Network-Manager-Flushing.patch diff --git a/patches/unapplied/server/Entity-fromMobSpawner.patch b/patches/server/Entity-fromMobSpawner.patch similarity index 97% rename from patches/unapplied/server/Entity-fromMobSpawner.patch rename to patches/server/Entity-fromMobSpawner.patch index 10206b74b3..9759305a11 100644 --- a/patches/unapplied/server/Entity-fromMobSpawner.patch +++ b/patches/server/Entity-fromMobSpawner.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 public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; public long activatedTick = Integer.MIN_VALUE; @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 protected int numCollisions = 0; // Paper public void inactiveTick() { } // Spigot 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 } nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ())); } @@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Paper end return nbt; } catch (Throwable throwable) { -@@ -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 this.originWorld = originWorld; origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2)); } diff --git a/patches/unapplied/server/Expose-client-protocol-version-and-virtual-host.patch b/patches/server/Expose-client-protocol-version-and-virtual-host.patch similarity index 100% rename from patches/unapplied/server/Expose-client-protocol-version-and-virtual-host.patch rename to patches/server/Expose-client-protocol-version-and-virtual-host.patch diff --git a/patches/unapplied/server/Extend-Player-Interact-cancellation.patch b/patches/server/Extend-Player-Interact-cancellation.patch similarity index 100% rename from patches/unapplied/server/Extend-Player-Interact-cancellation.patch rename to patches/server/Extend-Player-Interact-cancellation.patch diff --git a/patches/unapplied/server/Fill-Profile-Property-Events.patch b/patches/server/Fill-Profile-Property-Events.patch similarity index 100% rename from patches/unapplied/server/Fill-Profile-Property-Events.patch rename to patches/server/Fill-Profile-Property-Events.patch diff --git a/patches/unapplied/server/Fix-MC-117075-TE-Unload-Lag-Spike.patch b/patches/server/Fix-MC-117075-TE-Unload-Lag-Spike.patch similarity index 96% rename from patches/unapplied/server/Fix-MC-117075-TE-Unload-Lag-Spike.patch rename to patches/server/Fix-MC-117075-TE-Unload-Lag-Spike.patch index 215029b650..ec9a037f1f 100644 --- a/patches/unapplied/server/Fix-MC-117075-TE-Unload-Lag-Spike.patch +++ b/patches/server/Fix-MC-117075-TE-Unload-Lag-Spike.patch @@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - this.blockEntityTickers.remove(this.tileTickPosition--); + toRemove.add(tickingblockentity); // Paper - use removeAll // Spigot end - } else { + } else if (this.shouldTickBlocksAt(ChunkPos.asLong(tickingblockentity.getPos()))) { tickingblockentity.tick(); } } diff --git a/patches/unapplied/server/Fix-this-stupid-bullshit.patch b/patches/server/Fix-this-stupid-bullshit.patch similarity index 97% rename from patches/unapplied/server/Fix-this-stupid-bullshit.patch rename to patches/server/Fix-this-stupid-bullshit.patch index 0172efd719..2c9d725e48 100644 --- a/patches/unapplied/server/Fix-this-stupid-bullshit.patch +++ b/patches/server/Fix-this-stupid-bullshit.patch @@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ public class Main { Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -28); + deadline.add(Calendar.DAY_OF_YEAR, -7); if (buildDate.before(deadline.getTime())) { - System.err.println("*** Error, this build is outdated ***"); + // Paper start - This is some stupid bullshit diff --git a/patches/unapplied/server/Handle-plugin-prefixes-using-Log4J-configuration.patch b/patches/server/Handle-plugin-prefixes-using-Log4J-configuration.patch similarity index 98% rename from patches/unapplied/server/Handle-plugin-prefixes-using-Log4J-configuration.patch rename to patches/server/Handle-plugin-prefixes-using-Log4J-configuration.patch index 708e0afffa..fb4647a7d3 100644 --- a/patches/unapplied/server/Handle-plugin-prefixes-using-Log4J-configuration.patch +++ b/patches/server/Handle-plugin-prefixes-using-Log4J-configuration.patch @@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + implementation("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - implementation // Paper end implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") // Paper - implementation("org.apache.logging.log4j:log4j-api:2.14.1") // Paper + implementation("org.ow2.asm:asm:9.2") diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/patches/unapplied/server/Implement-ensureServerConversions-API.patch b/patches/server/Implement-ensureServerConversions-API.patch similarity index 100% rename from patches/unapplied/server/Implement-ensureServerConversions-API.patch rename to patches/server/Implement-ensureServerConversions-API.patch diff --git a/patches/unapplied/server/Implement-extended-PaperServerListPingEvent.patch b/patches/server/Implement-extended-PaperServerListPingEvent.patch similarity index 95% rename from patches/unapplied/server/Implement-extended-PaperServerListPingEvent.patch rename to patches/server/Implement-extended-PaperServerListPingEvent.patch index 186357a88a..adf79980ef 100644 --- a/patches/unapplied/server/Implement-extended-PaperServerListPingEvent.patch +++ b/patches/server/Implement-extended-PaperServerListPingEvent.patch @@ -204,14 +204,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= 5000000000L) { this.lastServerStatus = i; this.status.setPlayers(new ServerStatus.Players(this.getMaxPlayers(), this.getPlayerCount())); -- GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), 12)]; -+ GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), org.spigotmc.SpigotConfig.playerSample)]; // Paper - int j = Mth.nextInt(this.random, 0, this.getPlayerCount() - agameprofile.length); + if (!this.hidesOnlinePlayers()) { +- GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), 12)]; ++ GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), org.spigotmc.SpigotConfig.playerSample)]; // Paper + int j = Mth.nextInt(this.random, 0, this.getPlayerCount() - agameprofile.length); - for (int k = 0; k < agameprofile.length; ++k) { + for (int k = 0; k < agameprofile.length; ++k) { diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java @@ -226,15 +226,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // this.networkManager.sendPacket(new PacketStatusOutServerInfo(this.minecraftServer.getServerPing())); final Object[] players = this.server.getPlayerList().players.toArray(); @@ -0,0 +0,0 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene - ping.setVersion(new ServerStatus.Version(this.server.getServerModName() + " " + this.server.getServerVersion(), version)); this.connection.send(new ClientboundStatusResponsePacket(ping)); + // CraftBukkit end + */ + com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(this.server, this.connection); + // Paper end } - // CraftBukkit end } + diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/patches/unapplied/server/Implement-getI18NDisplayName.patch b/patches/server/Implement-getI18NDisplayName.patch similarity index 100% rename from patches/unapplied/server/Implement-getI18NDisplayName.patch rename to patches/server/Implement-getI18NDisplayName.patch diff --git a/patches/unapplied/server/Improve-Log4J-Configuration-Plugin-Loggers.patch b/patches/server/Improve-Log4J-Configuration-Plugin-Loggers.patch similarity index 100% rename from patches/unapplied/server/Improve-Log4J-Configuration-Plugin-Loggers.patch rename to patches/server/Improve-Log4J-Configuration-Plugin-Loggers.patch diff --git a/patches/unapplied/server/Improve-the-Saddle-API-for-Horses.patch b/patches/server/Improve-the-Saddle-API-for-Horses.patch similarity index 100% rename from patches/unapplied/server/Improve-the-Saddle-API-for-Horses.patch rename to patches/server/Improve-the-Saddle-API-for-Horses.patch diff --git a/patches/unapplied/server/LivingEntity-setKiller.patch b/patches/server/LivingEntity-setKiller.patch similarity index 100% rename from patches/unapplied/server/LivingEntity-setKiller.patch rename to patches/server/LivingEntity-setKiller.patch diff --git a/patches/unapplied/server/Ocelot-despawns-should-honor-nametags-and-leash.patch b/patches/server/Ocelot-despawns-should-honor-nametags-and-leash.patch similarity index 83% rename from patches/unapplied/server/Ocelot-despawns-should-honor-nametags-and-leash.patch rename to patches/server/Ocelot-despawns-should-honor-nametags-and-leash.patch index 6c1a88feed..5991b42c26 100644 --- a/patches/unapplied/server/Ocelot-despawns-should-honor-nametags-and-leash.patch +++ b/patches/server/Ocelot-despawns-should-honor-nametags-and-leash.patch @@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public boolean removeWhenFarAway(double distanceSquared) { -- return !this.isTrusting() /*&& this.ticksLived > 2400*/; // CraftBukkit -+ return !this.isTrusting() && !this.hasCustomName() && !this.isLeashed() /*&& this.ticksLived > 2400*/; // CraftBukkit // Paper - honor name and leash +- return !this.isTrusting() /*&& this.tickCount > 2400*/; // CraftBukkit ++ return !this.isTrusting() && !this.hasCustomName() && !this.isLeashed() /*&& this.tickCount > 2400*/; // CraftBukkit // Paper - honor name and leash } public static AttributeSupplier.Builder createAttributes() { diff --git a/patches/server/Only-send-Dragon-Wither-Death-sounds-to-same-world.patch b/patches/server/Only-send-Dragon-Wither-Death-sounds-to-same-world.patch index c4a1defa45..32e5da134a 100644 --- a/patches/server/Only-send-Dragon-Wither-Death-sounds-to-same-world.patch +++ b/patches/server/Only-send-Dragon-Wither-Death-sounds-to-same-world.patch @@ -30,8 +30,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start - Use relative location for far away sounds // this.world.globalLevelEvent(1023, new BlockPosition(this), 0); - int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16; +- for (ServerPlayer player : (List) MinecraftServer.getServer().getPlayerList().players) { + //int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API - for (ServerPlayer player : (List) MinecraftServer.getServer().getPlayerList().players) { ++ for (ServerPlayer player : (List)this.level.players()) { // Paper + final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch double deltaX = this.getX() - player.getX(); double deltaZ = this.getZ() - player.getZ(); diff --git a/patches/unapplied/server/Player.setPlayerProfile-API.patch b/patches/server/Player.setPlayerProfile-API.patch similarity index 98% rename from patches/unapplied/server/Player.setPlayerProfile-API.patch rename to patches/server/Player.setPlayerProfile-API.patch index 1e431d6fcf..3dd7b24c08 100644 --- a/patches/unapplied/server/Player.setPlayerProfile-API.patch +++ b/patches/server/Player.setPlayerProfile-API.patch @@ -42,8 +42,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -0,0 +0,0 @@ import net.minecraft.world.item.enchantment.EnchantmentHelper; - import net.minecraft.world.item.enchantment.Enchantments; +@@ -0,0 +0,0 @@ import net.minecraft.world.entity.ai.attributes.Attributes; + import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.level.GameType; import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.biome.BiomeManager; diff --git a/patches/unapplied/server/PlayerAdvancementCriterionGrantEvent.patch b/patches/server/PlayerAdvancementCriterionGrantEvent.patch similarity index 100% rename from patches/unapplied/server/PlayerAdvancementCriterionGrantEvent.patch rename to patches/server/PlayerAdvancementCriterionGrantEvent.patch diff --git a/patches/unapplied/server/PlayerAttemptPickupItemEvent.patch b/patches/server/PlayerAttemptPickupItemEvent.patch similarity index 97% rename from patches/unapplied/server/PlayerAttemptPickupItemEvent.patch rename to patches/server/PlayerAttemptPickupItemEvent.patch index 9b98d18bf5..55b2166913 100644 --- a/patches/unapplied/server/PlayerAttemptPickupItemEvent.patch +++ b/patches/server/PlayerAttemptPickupItemEvent.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -0,0 +0,0 @@ import net.minecraft.stats.Stats; +@@ -0,0 +0,0 @@ import net.minecraft.util.Mth; import org.bukkit.event.entity.EntityPickupItemEvent; import org.bukkit.event.player.PlayerPickupItemEvent; // CraftBukkit end diff --git a/patches/unapplied/server/PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/PlayerNaturallySpawnCreaturesEvent.patch similarity index 73% rename from patches/unapplied/server/PlayerNaturallySpawnCreaturesEvent.patch rename to patches/server/PlayerNaturallySpawnCreaturesEvent.patch index 01d7bbb7dd..c30c7823f9 100644 --- a/patches/unapplied/server/PlayerNaturallySpawnCreaturesEvent.patch +++ b/patches/server/PlayerNaturallySpawnCreaturesEvent.patch @@ -19,30 +19,34 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - double blockRange = (reducedRange) ? Math.pow(chunkRange << 4, 2) : 16384.0D; + final int finalChunkRange = chunkRange; // Paper for lambda below + //double blockRange = (reducedRange) ? Math.pow(chunkRange << 4, 2) : 16384.0D; // Paper - use from event ++ double blockRange = 16384.0D; // Paper // Spigot end long i = chunkcoordintpair.toLong(); - return !this.distanceManager.hasPlayersNearby(i) ? true : this.playerMap.getPlayers(i).noneMatch((entityplayer) -> { -+ // Paper start - add PlayerNaturallySpawnCreaturesEvent -+ com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent event; -+ double blockRange = 16384.0D; -+ if (reducedRange) { -+ event = entityplayer.playerNaturallySpawnedEvent; -+ if (event == null || event.isCancelled()) return false; -+ blockRange = (double) ((event.getSpawnRadius() << 4) * (event.getSpawnRadius() << 4)); -+ } -+ // Paper end - return !entityplayer.isSpectator() && ChunkMap.euclideanDistanceSquared(chunkcoordintpair, (Entity) entityplayer) < blockRange; // Spigot - }); - } +@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + } + + entityplayer = (ServerPlayer) iterator.next(); ++ // Paper start - add PlayerNaturallySpawnCreaturesEvent ++ com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent event; ++ blockRange = 16384.0D; ++ if (reducedRange) { ++ event = entityplayer.playerNaturallySpawnedEvent; ++ if (event == null || event.isCancelled()) return false; ++ blockRange = (double) ((event.getSpawnRadius() << 4) * (event.getSpawnRadius() << 4)); ++ } ++ // Paper end + } while (!this.playerIsCloseEnoughForSpawning(entityplayer, chunkcoordintpair, blockRange)); // Spigot + + return true; diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource { - List list = Lists.newArrayList(this.chunkMap.getChunks()); + boolean flag2 = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit - Collections.shuffle(list); + //Collections.shuffle(list); // Paper - no... just no... + // Paper start - call player naturally spawn event + int chunkRange = level.spigotConfig.mobSpawnRange; + chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange; @@ -52,9 +56,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + entityPlayer.playerNaturallySpawnedEvent.callEvent(); + }; + // Paper end - this.level.timings.chunkTicks.startTiming(); // Paper - list.forEach((playerchunk) -> { - Optional optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); + Iterator iterator1 = list.iterator(); + + while (iterator1.hasNext()) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/patches/unapplied/server/PlayerPickupExperienceEvent.patch b/patches/server/PlayerPickupExperienceEvent.patch similarity index 100% rename from patches/unapplied/server/PlayerPickupExperienceEvent.patch rename to patches/server/PlayerPickupExperienceEvent.patch diff --git a/patches/unapplied/server/PlayerPickupItemEvent-setFlyAtPlayer.patch b/patches/server/PlayerPickupItemEvent-setFlyAtPlayer.patch similarity index 100% rename from patches/unapplied/server/PlayerPickupItemEvent-setFlyAtPlayer.patch rename to patches/server/PlayerPickupItemEvent-setFlyAtPlayer.patch diff --git a/patches/unapplied/server/PreCreatureSpawnEvent.patch b/patches/server/PreCreatureSpawnEvent.patch similarity index 92% rename from patches/unapplied/server/PreCreatureSpawnEvent.patch rename to patches/server/PreCreatureSpawnEvent.patch index 54fae261d0..e957c69912 100644 --- a/patches/unapplied/server/PreCreatureSpawnEvent.patch +++ b/patches/server/PreCreatureSpawnEvent.patch @@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class EntityType implements EntityTypeTest { @Nullable - public T spawnCreature(ServerLevel worldserver, @Nullable CompoundTag nbttagcompound, @Nullable Component ichatbasecomponent, @Nullable Player entityhuman, BlockPos blockposition, MobSpawnType enummobspawn, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) { + public T spawn(ServerLevel worldserver, @Nullable CompoundTag nbttagcompound, @Nullable Component ichatbasecomponent, @Nullable Player entityhuman, BlockPos blockposition, MobSpawnType enummobspawn, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) { + // Paper start - Call PreCreatureSpawnEvent + org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(EntityType.getKey(this).getPath()); + if (type != null) { @@ -70,9 +70,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -0,0 +0,0 @@ public abstract class BaseSpawner { - double d2 = j >= 3 ? nbttaglist.getDouble(2) : (double) pos.getZ() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D; - - if (world.noCollision(((EntityType) optional.get()).getAABB(d0, d1, d2)) && SpawnPlacements.checkSpawnRules((EntityType) optional.get(), world, MobSpawnType.SPAWNER, new BlockPos(d0, d1, d2), world.getRandom())) { + } else if (!SpawnPlacements.checkSpawnRules((EntityType) optional.get(), world, MobSpawnType.SPAWNER, blockposition1, world.getRandom())) { + continue; + } + // Paper start + EntityType entityType = optional.get(); + String key = EntityType.getKey(entityType).getPath(); @@ -94,9 +94,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + // Paper end + Entity entity = EntityType.loadEntityRecursive(nbttagcompound, world, (entity1) -> { entity1.moveTo(d0, d1, d2, entity1.getYRot(), entity1.getXRot()); - return entity1; diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java diff --git a/patches/unapplied/server/Prevent-logins-from-being-processed-when-the-player-.patch b/patches/server/Prevent-logins-from-being-processed-when-the-player-.patch similarity index 100% rename from patches/unapplied/server/Prevent-logins-from-being-processed-when-the-player-.patch rename to patches/server/Prevent-logins-from-being-processed-when-the-player-.patch diff --git a/patches/unapplied/server/Profile-Lookup-Events.patch b/patches/server/Profile-Lookup-Events.patch similarity index 100% rename from patches/unapplied/server/Profile-Lookup-Events.patch rename to patches/server/Profile-Lookup-Events.patch diff --git a/patches/unapplied/server/ProfileWhitelistVerifyEvent.patch b/patches/server/ProfileWhitelistVerifyEvent.patch similarity index 100% rename from patches/unapplied/server/ProfileWhitelistVerifyEvent.patch rename to patches/server/ProfileWhitelistVerifyEvent.patch diff --git a/patches/unapplied/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch b/patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch similarity index 100% rename from patches/unapplied/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch rename to patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch diff --git a/patches/unapplied/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch b/patches/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch similarity index 95% rename from patches/unapplied/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch rename to patches/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch index 6a52128726..440d632240 100644 --- a/patches/unapplied/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch +++ b/patches/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch @@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - int i = b0 + EnchantmentHelper.getKnockbackBonus((LivingEntity) this); + int i = b0 + EnchantmentHelper.getKnockbackBonus(this); if (this.isSprinting() && flag) { - this.level.playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); @@ -56,7 +56,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - this.applyExhaustion(level.spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value + this.causeFoodExhaustion(level.spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value } else { - this.level.playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F); + sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility diff --git a/patches/unapplied/server/Shoulder-Entities-Release-API.patch b/patches/server/Shoulder-Entities-Release-API.patch similarity index 92% rename from patches/unapplied/server/Shoulder-Entities-Release-API.patch rename to patches/server/Shoulder-Entities-Release-API.patch index 53a7ff4c6b..40d6023288 100644 --- a/patches/unapplied/server/Shoulder-Entities-Release-API.patch +++ b/patches/server/Shoulder-Entities-Release-API.patch @@ -43,11 +43,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } entity.setPos(this.getX(), this.getY() + 0.699999988079071D, this.getZ()); -- return ((ServerLevel) this.level).addEntitySerialized(entity, CreatureSpawnEvent.SpawnReason.SHOULDER_ENTITY); // CraftBukkit +- return ((ServerLevel) this.level).addWithUUID(entity, CreatureSpawnEvent.SpawnReason.SHOULDER_ENTITY); // CraftBukkit - }).orElse(true); // CraftBukkit -+ boolean addedToWorld = ((ServerLevel) this.level).addEntitySerialized(entity, CreatureSpawnEvent.SpawnReason.SHOULDER_ENTITY); // CraftBukkit ++ boolean addedToWorld = ((ServerLevel) this.level).addWithUUID(entity, CreatureSpawnEvent.SpawnReason.SHOULDER_ENTITY); // CraftBukkit + return addedToWorld ? entity : null; -+ }).orElse(null); // CraftBukkit // Paper - false -> null ++ }).orElse(null); // CraftBukkit // Paper - true -> null } - return true; // CraftBukkit diff --git a/patches/unapplied/server/Tameable-getOwnerUniqueId-API.patch b/patches/server/Tameable-getOwnerUniqueId-API.patch similarity index 100% rename from patches/unapplied/server/Tameable-getOwnerUniqueId-API.patch rename to patches/server/Tameable-getOwnerUniqueId-API.patch diff --git a/patches/unapplied/server/Toggleable-player-crits-helps-mitigate-hacked-client.patch b/patches/server/Toggleable-player-crits-helps-mitigate-hacked-client.patch similarity index 100% rename from patches/unapplied/server/Toggleable-player-crits-helps-mitigate-hacked-client.patch rename to patches/server/Toggleable-player-crits-helps-mitigate-hacked-client.patch diff --git a/patches/unapplied/server/getPlayerUniqueId-API.patch b/patches/server/getPlayerUniqueId-API.patch similarity index 100% rename from patches/unapplied/server/getPlayerUniqueId-API.patch rename to patches/server/getPlayerUniqueId-API.patch diff --git a/patches/unapplied/server/handle-PacketPlayInKeepAlive-async.patch b/patches/server/handle-PacketPlayInKeepAlive-async.patch similarity index 100% rename from patches/unapplied/server/handle-PacketPlayInKeepAlive-async.patch rename to patches/server/handle-PacketPlayInKeepAlive-async.patch diff --git a/patches/unapplied/server/revert-serverside-behavior-of-keepalives.patch b/patches/server/revert-serverside-behavior-of-keepalives.patch similarity index 98% rename from patches/unapplied/server/revert-serverside-behavior-of-keepalives.patch rename to patches/server/revert-serverside-behavior-of-keepalives.patch index 6edfb3e3eb..921a9c4dfc 100644 --- a/patches/unapplied/server/revert-serverside-behavior-of-keepalives.patch +++ b/patches/server/revert-serverside-behavior-of-keepalives.patch @@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private boolean keepAlivePending; + private long keepAliveChallenge; // CraftBukkit start - multithreaded fields - private AtomicInteger chatSpamTickCount = new AtomicInteger(); + private final AtomicInteger chatSpamTickCount = new AtomicInteger(); // CraftBukkit end @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser private int aboveGroundVehicleTickCount; diff --git a/patches/unapplied/server/use-CB-BlockState-implementations-for-captured-block.patch b/patches/server/use-CB-BlockState-implementations-for-captured-block.patch similarity index 100% rename from patches/unapplied/server/use-CB-BlockState-implementations-for-captured-block.patch rename to patches/server/use-CB-BlockState-implementations-for-captured-block.patch diff --git a/patches/unapplied/server/Make-max-squid-spawn-height-configurable.patch b/patches/unapplied/Make-max-squid-spawn-height-configurable.patch similarity index 71% rename from patches/unapplied/server/Make-max-squid-spawn-height-configurable.patch rename to patches/unapplied/Make-max-squid-spawn-height-configurable.patch index 8d251bac95..2810390628 100644 --- a/patches/unapplied/server/Make-max-squid-spawn-height-configurable.patch +++ b/patches/unapplied/Make-max-squid-spawn-height-configurable.patch @@ -3,6 +3,7 @@ From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Thu, 11 Jan 2018 16:47:28 -0600 Subject: [PATCH] Make max squid spawn height configurable +#NOTE: Spigot removed the min option, Vanilla now has the same spawn rule for all ambient water animals I don't know why upstream made only the minimum height configurable but whatever @@ -25,12 +26,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/animal/Squid.java +++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java @@ -0,0 +0,0 @@ public class Squid extends WaterAnimal { + public void travel(Vec3 movementInput) { + this.move(MoverType.SELF, this.getDeltaMovement()); } - - public static boolean checkSquidSpawnRules(EntityType type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) { -- return pos.getY() > world.getMinecraftWorld().spigotConfig.squidSpawnRangeMin && pos.getY() < world.getSeaLevel(); // Spigot -+ final double maxHeight = world.getMinecraftWorld().paperConfig.squidMaxSpawnHeight > 0 ? world.getMinecraftWorld().paperConfig.squidMaxSpawnHeight : world.getSeaLevel(); // Paper -+ return pos.getY() > world.getMinecraftWorld().spigotConfig.squidSpawnRangeMin && pos.getY() < maxHeight; // Spigot // Paper - } - +- ++// AAA @Override + public void handleEntityEvent(byte status) { + if (status == 19) { diff --git a/patches/unapplied/Make-targetSize-more-aggressive-in-the-chunk-unload-.patch b/patches/unapplied/Make-targetSize-more-aggressive-in-the-chunk-unload-.patch index 0ca16ef996..f46d833e6b 100644 --- a/patches/unapplied/Make-targetSize-more-aggressive-in-the-chunk-unload-.patch +++ b/patches/unapplied/Make-targetSize-more-aggressive-in-the-chunk-unload-.patch @@ -3,6 +3,8 @@ From: Brokkonaut Date: Tue, 7 Feb 2017 16:55:35 -0600 Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue +#NOTE: Vanilla now does incremental chunk saves + diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 diff --git a/todo.txt b/todo.txt index 324373e68e..25f9921a9a 100644 --- a/todo.txt +++ b/todo.txt @@ -1,2 +1,3 @@ Add Timings to LevelTicks and EntityTickList Check IBlockDataList#GLOBAL_PALETTE +Check if PlayerNaturallySpawnedEvent is called correctly