diff --git a/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch b/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch index e8ae603b7d5..6cd559b4cb4 100644 --- a/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch +++ b/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch @@ -45,6 +45,24 @@ 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.WorldServer; + import net.minecraft.server.network.PlayerConnection; + import net.minecraft.server.players.WhiteListEntry; + import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.EntityExperienceOrb; + import net.minecraft.world.entity.EntityLiving; ++import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.ai.attributes.AttributeMapBase; + import net.minecraft.world.entity.ai.attributes.AttributeModifiable; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.inventory.Container; + import net.minecraft.world.item.EnumColor; ++import net.minecraft.world.item.enchantment.EnchantmentManager; ++import net.minecraft.world.item.enchantment.Enchantments; + import net.minecraft.world.level.EnumGamemode; + import net.minecraft.world.level.block.entity.TileEntitySign; + import net.minecraft.world.level.saveddata.maps.MapIcon; @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return GameMode.getByValue(getHandle().playerInteractManager.getGameMode().getId()); } @@ -55,10 +73,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public int applyMending(int amount) { + EntityPlayer handle = getHandle(); + // Logic copied from EntityExperienceOrb and remapped to unobfuscated methods/properties -+ net.minecraft.server.ItemStack itemstack = net.minecraft.server.EnchantmentManager.getRandomEquippedItemWithEnchant(net.minecraft.server.Enchantments.MENDING, handle); ++ net.minecraft.world.item.ItemStack itemstack = EnchantmentManager.getRandomEquippedItemWithEnchant(Enchantments.MENDING, handle); + if (!itemstack.isEmpty() && itemstack.getItem().usesDurability()) { + -+ net.minecraft.server.EntityExperienceOrb orb = net.minecraft.server.EntityTypes.EXPERIENCE_ORB.create(handle.world); ++ EntityExperienceOrb orb = EntityTypes.EXPERIENCE_ORB.create(handle.world); + orb.value = amount; + orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM; + orb.setPositionRaw(handle.locX(), handle.locY(), handle.locZ()); diff --git a/Spigot-Server-Patches/Add-BellRingEvent.patch b/Spigot-Server-Patches/Add-BellRingEvent.patch index 2b70b2ad8b0..cbacd7cccfa 100644 --- a/Spigot-Server-Patches/Add-BellRingEvent.patch +++ b/Spigot-Server-Patches/Add-BellRingEvent.patch @@ -18,6 +18,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import javax.annotation.Nullable; import net.minecraft.core.BlockPosition; import net.minecraft.core.EnumDirection; ++import net.minecraft.server.MCUtil; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.stats.StatisticList; @@ -0,0 +0,0 @@ public class BlockBell extends BlockTileEntity { boolean flag1 = !flag || this.a(iblockdata, enumdirection, movingobjectpositionblock.getPos().y - (double) blockposition.getY()); diff --git a/Spigot-Server-Patches/Add-Heightmap-API.patch b/Spigot-Server-Patches/Add-Heightmap-API.patch index 568141b6046..49c2f327c74 100644 --- a/Spigot-Server-Patches/Add-Heightmap-API.patch +++ b/Spigot-Server-Patches/Add-Heightmap-API.patch @@ -37,13 +37,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + throw new UnsupportedOperationException(); // TODO + //return this.world.getHighestBlockY(HeightMap.Type.LIGHT_BLOCKING, x, z); + case ANY: -+ return this.world.getHighestBlockY(net.minecraft.server.HeightMap.Type.WORLD_SURFACE, x, z); ++ return this.world.getHighestBlockY(net.minecraft.world.level.levelgen.HeightMap.Type.WORLD_SURFACE, x, z); + case SOLID: -+ return this.world.getHighestBlockY(net.minecraft.server.HeightMap.Type.OCEAN_FLOOR, x, z); ++ return this.world.getHighestBlockY(net.minecraft.world.level.levelgen.HeightMap.Type.OCEAN_FLOOR, x, z); + case SOLID_OR_LIQUID: -+ return this.world.getHighestBlockY(net.minecraft.server.HeightMap.Type.MOTION_BLOCKING, x, z); ++ return this.world.getHighestBlockY(net.minecraft.world.level.levelgen.HeightMap.Type.MOTION_BLOCKING, x, z); + case SOLID_OR_LIQUID_NO_LEAVES: -+ return this.world.getHighestBlockY(net.minecraft.server.HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, x, z); ++ return this.world.getHighestBlockY(net.minecraft.world.level.levelgen.HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, x, z); + default: + throw new UnsupportedOperationException(); + } diff --git a/Spigot-Server-Patches/Add-PhantomPreSpawnEvent.patch b/Spigot-Server-Patches/Add-PhantomPreSpawnEvent.patch index 39cf8048481..83c8df08480 100644 --- a/Spigot-Server-Patches/Add-PhantomPreSpawnEvent.patch +++ b/Spigot-Server-Patches/Add-PhantomPreSpawnEvent.patch @@ -42,6 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public java.util.UUID getSpawningEntity() { + return spawningEntity; + } ++ public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; } + // Paper end + class b extends PathfinderGoal { @@ -51,6 +52,14 @@ diff --git a/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom. index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java +++ b/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java +@@ -0,0 +0,0 @@ import java.util.Iterator; + import java.util.Random; + import net.minecraft.core.BlockPosition; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.MCUtil; + import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.stats.ServerStatisticManager; @@ -0,0 +0,0 @@ public class MobSpawnerPhantom implements MobSpawner { int k = 1 + random.nextInt(difficultydamagescaler.a().a() + 1); @@ -66,7 +75,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end EntityPhantom entityphantom = (EntityPhantom) EntityTypes.PHANTOM.a((World) worldserver); - -+ entityphantom.spawningEntity = entityhuman.uniqueID; // Paper ++ entityphantom.setSpawningEntity(entityhuman.getUniqueID()); // Paper entityphantom.setPositionRotation(blockposition1, 0.0F, 0.0F); groupdataentity = entityphantom.prepare(worldserver, difficultydamagescaler, EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null); worldserver.addAllEntities(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit diff --git a/Spigot-Server-Patches/Add-PlayerShearBlockEvent.patch b/Spigot-Server-Patches/Add-PlayerShearBlockEvent.patch index 9655a5151f2..06bc02fb7d2 100644 --- a/Spigot-Server-Patches/Add-PlayerShearBlockEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerShearBlockEvent.patch @@ -29,6 +29,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import java.util.Iterator; import java.util.List; import java.util.Random; +@@ -0,0 +0,0 @@ import net.minecraft.core.BlockPosition; + import net.minecraft.core.EnumDirection; + import net.minecraft.nbt.NBTBase; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.MCUtil; + import net.minecraft.server.level.EntityPlayer; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffects; @@ -0,0 +0,0 @@ public class BlockBeehive extends BlockTileEntity { if (i >= 5) { @@ -54,6 +62,14 @@ diff --git a/src/main/java/net/minecraft/world/level/block/BlockPumpkin.java b/s index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/BlockPumpkin.java +++ b/src/main/java/net/minecraft/world/level/block/BlockPumpkin.java +@@ -0,0 +0,0 @@ package net.minecraft.world.level.block; + + import net.minecraft.core.BlockPosition; + import net.minecraft.core.EnumDirection; ++import net.minecraft.server.MCUtil; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.world.EnumHand; @@ -0,0 +0,0 @@ import net.minecraft.world.level.block.state.BlockBase; import net.minecraft.world.level.block.state.IBlockData; import net.minecraft.world.phys.MovingObjectPositionBlock; diff --git a/Spigot-Server-Patches/Add-Plugin-Tickets-to-API-Chunk-Methods.patch b/Spigot-Server-Patches/Add-Plugin-Tickets-to-API-Chunk-Methods.patch index f6c0dd1326d..70f3977097b 100644 --- a/Spigot-Server-Patches/Add-Plugin-Tickets-to-API-Chunk-Methods.patch +++ b/Spigot-Server-Patches/Add-Plugin-Tickets-to-API-Chunk-Methods.patch @@ -47,13 +47,21 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -0,0 +0,0 @@ import net.minecraft.network.protocol.game.PacketPlayOutCustomSoundEffect; + import net.minecraft.network.protocol.game.PacketPlayOutUpdateTime; + import net.minecraft.network.protocol.game.PacketPlayOutWorldEvent; + import net.minecraft.resources.MinecraftKey; ++import net.minecraft.server.MCUtil; + import net.minecraft.server.level.ChunkMapDistance; + import net.minecraft.server.level.PlayerChunk; + import net.minecraft.server.level.PlayerChunkMap; @@ -0,0 +0,0 @@ public class CraftWorld implements World { @Override public Chunk getChunkAt(int x, int z) { - return this.world.getChunkProvider().getChunkAt(x, z, true).bukkitChunk; + // Paper start - add ticket to hold chunk for a little while longer if plugin accesses it -+ net.minecraft.server.Chunk chunk = world.getChunkProvider().getChunkAtIfLoadedImmediately(x, z); ++ net.minecraft.world.level.chunk.Chunk chunk = world.getChunkProvider().getChunkAtIfLoadedImmediately(x, z); + if (chunk == null) { + addTicket(x, z); + chunk = this.world.getChunkProvider().getChunkAt(x, z, true); diff --git a/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch b/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch index 742f4dfb473..5a547998541 100644 --- a/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch +++ b/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch @@ -30,6 +30,14 @@ diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityFireball. index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java +++ b/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java +@@ -0,0 +0,0 @@ import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.level.World; + import net.minecraft.world.phys.MovingObjectPosition; ++import net.minecraft.world.phys.MovingObjectPositionEntity; + import net.minecraft.world.phys.Vec3D; + + import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit @@ -0,0 +0,0 @@ public abstract class EntityFireball extends IProjectile { MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a); @@ -52,6 +60,14 @@ diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityProjectil index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java +@@ -0,0 +0,0 @@ import net.minecraft.world.level.block.entity.TileEntityEndGateway; + import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.phys.MovingObjectPosition; + import net.minecraft.world.phys.MovingObjectPositionBlock; ++import net.minecraft.world.phys.MovingObjectPositionEntity; + import net.minecraft.world.phys.Vec3D; + + public abstract class EntityProjectile extends IProjectile { @@ -0,0 +0,0 @@ public abstract class EntityProjectile extends IProjectile { } diff --git a/Spigot-Server-Patches/Add-additional-open-container-api-to-HumanEntity.patch b/Spigot-Server-Patches/Add-additional-open-container-api-to-HumanEntity.patch index 43ab094a66c..d9f286da23b 100644 --- a/Spigot-Server-Patches/Add-additional-open-container-api-to-HumanEntity.patch +++ b/Spigot-Server-Patches/Add-additional-open-container-api-to-HumanEntity.patch @@ -54,7 +54,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return null; + } + } -+ net.minecraft.server.Block block; ++ net.minecraft.world.level.block.Block block; + if (material == Material.ANVIL) { + block = Blocks.ANVIL; + } else if (material == Material.CARTOGRAPHY_TABLE) { diff --git a/Spigot-Server-Patches/Add-exception-reporting-event.patch b/Spigot-Server-Patches/Add-exception-reporting-event.patch index 79a7d8a7961..cc82314f53f 100644 --- a/Spigot-Server-Patches/Add-exception-reporting-event.patch +++ b/Spigot-Server-Patches/Add-exception-reporting-event.patch @@ -188,8 +188,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - new Exception().printStackTrace(); + // Paper start + ServerInternalException e = new ServerInternalException( -+ "Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," -+ + tileentity.position.getY() + "," + tileentity.position.getZ() ++ "Attempted to place a tile entity (" + tileentity + ") at " + tileentity.getPosition().getX() + "," ++ + tileentity.getPosition().getY() + "," + tileentity.getPosition().getZ() + + " (" + getType(blockposition) + ") where there was no entity tile!\n" + + "Chunk coordinates: " + (this.loc.x * 16) + "," + (this.loc.z * 16)); + e.printStackTrace(); diff --git a/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch b/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch index 70cb6abed7c..f61e07ddd0f 100644 --- a/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch +++ b/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch @@ -8,6 +8,14 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +@@ -0,0 +0,0 @@ import net.minecraft.world.level.block.BlockWorkbench; + import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.level.block.entity.TileEntity; + import net.minecraft.world.level.block.entity.TileEntityContainer; ++import net.minecraft.world.level.block.entity.TileEntitySign; + import net.minecraft.world.level.block.state.IBlockData; + import org.bukkit.GameMode; + import org.bukkit.Location; @@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } } @@ -17,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public void openSign(org.bukkit.block.Sign sign) { + org.apache.commons.lang.Validate.isTrue(sign.getWorld().equals(this.getWorld()), "Sign must be in the same world as player is in"); + org.bukkit.craftbukkit.block.CraftSign craftSign = (org.bukkit.craftbukkit.block.CraftSign) sign; -+ net.minecraft.server.TileEntitySign teSign = craftSign.getTileEntity(); ++ TileEntitySign teSign = craftSign.getTileEntity(); + // Make sign editable temporarily, will be set back to false in PlayerConnection later + teSign.isEditable = true; + getHandle().openSign(teSign); diff --git a/Spigot-Server-Patches/Add-more-Evoker-API.patch b/Spigot-Server-Patches/Add-more-Evoker-API.patch index 770be641872..ee36abb7c87 100644 --- a/Spigot-Server-Patches/Add-more-Evoker-API.patch +++ b/Spigot-Server-Patches/Add-more-Evoker-API.patch @@ -30,6 +30,13 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java +@@ -0,0 +0,0 @@ + package org.bukkit.craftbukkit.entity; + ++import net.minecraft.world.entity.animal.EntitySheep; + import net.minecraft.world.entity.monster.EntityEvoker; + import net.minecraft.world.entity.monster.EntityIllagerWizard; + import org.bukkit.craftbukkit.CraftServer; @@ -0,0 +0,0 @@ public class CraftEvoker extends CraftSpellcaster implements Evoker { public void setCurrentSpell(Evoker.Spell spell) { getHandle().setSpell(spell == null ? EntityIllagerWizard.Spell.NONE : EntityIllagerWizard.Spell.a(spell.ordinal())); @@ -38,7 +45,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start + @Override + public org.bukkit.entity.Sheep getWololoTarget() { -+ net.minecraft.server.EntitySheep sheep = getHandle().getWololoTarget(); ++ EntitySheep sheep = getHandle().getWololoTarget(); + return sheep == null ? null : (org.bukkit.entity.Sheep) sheep.getBukkitEntity(); + } + diff --git a/Spigot-Server-Patches/Add-option-to-nerf-pigmen-from-nether-portals.patch b/Spigot-Server-Patches/Add-option-to-nerf-pigmen-from-nether-portals.patch index f6a40f3a29d..26a44dc3365 100644 --- a/Spigot-Server-Patches/Add-option-to-nerf-pigmen-from-nether-portals.patch +++ b/Spigot-Server-Patches/Add-option-to-nerf-pigmen-from-nether-portals.patch @@ -52,6 +52,14 @@ diff --git a/src/main/java/net/minecraft/world/level/block/BlockPortal.java b/sr index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/BlockPortal.java +++ b/src/main/java/net/minecraft/world/level/block/BlockPortal.java +@@ -0,0 +0,0 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.chat.IChatBaseComponent; + import net.minecraft.server.level.WorldServer; + import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.EntityInsentient; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMobSpawn; + import net.minecraft.world.entity.player.EntityHuman; @@ -0,0 +0,0 @@ public class BlockPortal extends Block { if (entity != null) { diff --git a/Spigot-Server-Patches/Add-phantom-creative-and-insomniac-controls.patch b/Spigot-Server-Patches/Add-phantom-creative-and-insomniac-controls.patch index fe371634ad4..5dd8f81044c 100644 --- a/Spigot-Server-Patches/Add-phantom-creative-and-insomniac-controls.patch +++ b/Spigot-Server-Patches/Add-phantom-creative-and-insomniac-controls.patch @@ -24,6 +24,16 @@ diff --git a/src/main/java/net/minecraft/world/entity/IEntitySelector.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/IEntitySelector.java +++ b/src/main/java/net/minecraft/world/entity/IEntitySelector.java +@@ -0,0 +0,0 @@ package net.minecraft.world.entity; + import com.google.common.base.Predicates; + import java.util.function.Predicate; + import javax.annotation.Nullable; ++import net.minecraft.server.level.EntityPlayer; ++import net.minecraft.stats.StatisticList; ++import net.minecraft.util.MathHelper; + import net.minecraft.world.EnumDifficulty; + import net.minecraft.world.IInventory; + import net.minecraft.world.entity.player.EntityHuman; @@ -0,0 +0,0 @@ public final class IEntitySelector { public static final Predicate g = (entity) -> { return !entity.isSpectator(); diff --git a/Spigot-Server-Patches/Add-some-Debug-to-Chunk-Entity-slices.patch b/Spigot-Server-Patches/Add-some-Debug-to-Chunk-Entity-slices.patch index 4616deb6e22..3b372d38055 100644 --- a/Spigot-Server-Patches/Add-some-Debug-to-Chunk-Entity-slices.patch +++ b/Spigot-Server-Patches/Add-some-Debug-to-Chunk-Entity-slices.patch @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } }; -+ List entitySlice = null; ++ public List entitySlice = null; // Paper end public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper @@ -24,6 +24,15 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +@@ -0,0 +0,0 @@ import net.minecraft.ReportedException; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.IRegistry; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.MinecraftServer; ++import net.minecraft.server.level.ChunkProviderServer; + import net.minecraft.server.level.PlayerChunk; + import net.minecraft.server.level.WorldServer; + import net.minecraft.util.EntitySlice; @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { if (k >= this.entitySlices.length) { k = this.entitySlices.length - 1; diff --git a/Spigot-Server-Patches/Add-villager-reputation-API.patch b/Spigot-Server-Patches/Add-villager-reputation-API.patch index 7257694b403..faf1f63d510 100644 --- a/Spigot-Server-Patches/Add-villager-reputation-API.patch +++ b/Spigot-Server-Patches/Add-villager-reputation-API.patch @@ -113,7 +113,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - Add villager reputation API + @Override + public Reputation getReputation(UUID uniqueId) { -+ net.minecraft.server.Reputation.a rep = getHandle().getReputation().getReputations().get(uniqueId); ++ net.minecraft.world.entity.ai.gossip.Reputation.a rep = getHandle().getReputation().getReputations().get(uniqueId); + if (rep == null) { + return new Reputation(Maps.newHashMap()); + } @@ -130,10 +130,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public void setReputation(UUID uniqueId, Reputation reputation) { -+ net.minecraft.server.Reputation.a nmsReputation = ++ net.minecraft.world.entity.ai.gossip.Reputation.a nmsReputation = + getHandle().getReputation().getReputations().computeIfAbsent( + uniqueId, -+ key -> new net.minecraft.server.Reputation.a() ++ key -> new net.minecraft.world.entity.ai.gossip.Reputation.a() + ); + nmsReputation.assignFromPaperReputation(reputation); + } diff --git a/Spigot-Server-Patches/Allow-spawning-Item-entities-with-World.spawnEntity.patch b/Spigot-Server-Patches/Allow-spawning-Item-entities-with-World.spawnEntity.patch index 13f6771c9ae..859a04e3dfe 100644 --- a/Spigot-Server-Patches/Allow-spawning-Item-entities-with-World.spawnEntity.patch +++ b/Spigot-Server-Patches/Allow-spawning-Item-entities-with-World.spawnEntity.patch @@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 entity.setPositionRotation(x, y, z, yaw, pitch); + // Paper start + } else if (org.bukkit.entity.Item.class.isAssignableFrom(clazz)) { -+ entity = new EntityItem(world, x, y, z, new net.minecraft.server.ItemStack(net.minecraft.server.Item.getItemOf(net.minecraft.server.Blocks.DIRT))); ++ entity = new EntityItem(world, x, y, z, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Item.getItemOf(net.minecraft.world.level.block.Blocks.DIRT))); + // Paper end } else if (FallingBlock.class.isAssignableFrom(clazz)) { entity = new EntityFallingBlock(world, x, y, z, world.getType(new BlockPosition(x, y, z))); diff --git a/Spigot-Server-Patches/Anti-Xray.patch b/Spigot-Server-Patches/Anti-Xray.patch index 1cd90adb9ca..21fb5699803 100644 --- a/Spigot-Server-Patches/Anti-Xray.patch +++ b/Spigot-Server-Patches/Anti-Xray.patch @@ -1243,6 +1243,14 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkEmpty.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkEmpty.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkEmpty.java +@@ -0,0 +0,0 @@ import net.minecraft.SystemUtils; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.IRegistry; + import net.minecraft.data.worldgen.biome.BiomeRegistry; ++import net.minecraft.server.MinecraftServer; + import net.minecraft.server.level.PlayerChunk; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.level.ChunkCoordIntPair; @@ -0,0 +0,0 @@ public class ChunkEmpty extends Chunk { }); diff --git a/Spigot-Server-Patches/Async-command-map-building.patch b/Spigot-Server-Patches/Async-command-map-building.patch index 3c4300ae4f0..ba0645dcad8 100644 --- a/Spigot-Server-Patches/Async-command-map-building.patch +++ b/Spigot-Server-Patches/Async-command-map-building.patch @@ -8,6 +8,14 @@ diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/m index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/commands/CommandDispatcher.java +++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java +@@ -0,0 +0,0 @@ import net.minecraft.network.chat.ChatHoverable; + import net.minecraft.network.chat.ChatMessage; + import net.minecraft.network.chat.IChatMutableComponent; + import net.minecraft.network.protocol.game.PacketPlayOutCommands; ++import net.minecraft.server.MinecraftServer; + import net.minecraft.server.commands.CommandAdvancement; + import net.minecraft.server.commands.CommandAttribute; + import net.minecraft.server.commands.CommandBan; @@ -0,0 +0,0 @@ public class CommandDispatcher { if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot // CraftBukkit start diff --git a/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch index 0a1e530a191..e4032b2ad83 100644 --- a/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch +++ b/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch @@ -4126,19 +4126,37 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +@@ -0,0 +0,0 @@ import net.minecraft.nbt.NBTBase; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.chat.IChatBaseComponent; + import net.minecraft.server.level.EntityPlayer; ++import net.minecraft.server.level.PlayerChunk; ++import net.minecraft.server.level.PlayerChunkMap; ++import net.minecraft.server.level.TicketType; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityAreaEffectCloud; +@@ -0,0 +0,0 @@ import net.minecraft.world.entity.vehicle.EntityMinecartHopper; + import net.minecraft.world.entity.vehicle.EntityMinecartMobSpawner; + import net.minecraft.world.entity.vehicle.EntityMinecartRideable; + import net.minecraft.world.entity.vehicle.EntityMinecartTNT; ++import net.minecraft.world.level.ChunkCoordIntPair; + import net.minecraft.world.phys.AxisAlignedBB; + import org.bukkit.Chunk; // Paper + import org.bukkit.EntityEffect; @@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { entity.setHeadRotation(yaw); } + @Override// Paper start + public java.util.concurrent.CompletableFuture teleportAsync(Location loc, @javax.annotation.Nonnull org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) { -+ net.minecraft.server.PlayerChunkMap playerChunkMap = ((CraftWorld) loc.getWorld()).getHandle().getChunkProvider().playerChunkMap; ++ PlayerChunkMap playerChunkMap = ((CraftWorld) loc.getWorld()).getHandle().getChunkProvider().playerChunkMap; + java.util.concurrent.CompletableFuture future = new java.util.concurrent.CompletableFuture<>(); + + loc.getWorld().getChunkAtAsyncUrgently(loc).thenCompose(chunk -> { -+ net.minecraft.server.ChunkCoordIntPair pair = new net.minecraft.server.ChunkCoordIntPair(chunk.getX(), chunk.getZ()); -+ ((CraftWorld) loc.getWorld()).getHandle().getChunkProvider().addTicketAtLevel(net.minecraft.server.TicketType.POST_TELEPORT, pair, 31, 0); -+ net.minecraft.server.PlayerChunk updatingChunk = playerChunkMap.getUpdatingChunk(pair.pair()); ++ ChunkCoordIntPair pair = new ChunkCoordIntPair(chunk.getX(), chunk.getZ()); ++ ((CraftWorld) loc.getWorld()).getHandle().getChunkProvider().addTicketAtLevel(TicketType.POST_TELEPORT, pair, 31, 0); ++ PlayerChunk updatingChunk = playerChunkMap.getUpdatingChunk(pair.pair()); + if (updatingChunk != null) { + return updatingChunk.getEntityTickingFuture(); + } else { diff --git a/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch b/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch index 81771016c1e..0b285428303 100644 --- a/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch +++ b/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch @@ -29,6 +29,20 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +@@ -0,0 +0,0 @@ import net.minecraft.server.level.PlayerChunk; + import net.minecraft.server.level.WorldServer; + import net.minecraft.util.EntitySlice; + import net.minecraft.util.MathHelper; ++import net.minecraft.world.IInventory; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.IEntitySelector; + import net.minecraft.world.entity.boss.EntityComplexPart; + import net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon; ++import net.minecraft.world.entity.item.EntityItem; + import net.minecraft.world.level.ChunkCoordIntPair; + import net.minecraft.world.level.GeneratorAccess; + import net.minecraft.world.level.TickList; @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { return removed; } diff --git a/Spigot-Server-Patches/Cache-block-data-strings.patch b/Spigot-Server-Patches/Cache-block-data-strings.patch index d7cc663fc39..1b8e7d42f27 100644 --- a/Spigot-Server-Patches/Cache-block-data-strings.patch +++ b/Spigot-Server-Patches/Cache-block-data-strings.patch @@ -20,6 +20,14 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +@@ -0,0 +0,0 @@ import net.minecraft.commands.arguments.blocks.ArgumentBlock; + import net.minecraft.core.EnumDirection; + import net.minecraft.core.IRegistry; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.resources.MinecraftKey; + import net.minecraft.util.INamable; + import net.minecraft.world.level.block.Block; + import net.minecraft.world.level.block.state.IBlockData; @@ -0,0 +0,0 @@ public class CraftBlockData implements BlockData { Preconditions.checkState(MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit); } @@ -46,7 +54,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (material != null) { + Block block = CraftMagicNumbers.getBlock(material); + if (block != null) { -+ net.minecraft.server.MinecraftKey key = IRegistry.BLOCK.getKey(block); ++ MinecraftKey key = IRegistry.BLOCK.getKey(block); + data = data == null ? key.toString() : key + data; + } + } diff --git a/Spigot-Server-Patches/Catch-JsonParseException-in-Entity-and-TE-names.patch b/Spigot-Server-Patches/Catch-JsonParseException-in-Entity-and-TE-names.patch index 0285ecc840f..33fd6333d7e 100644 --- a/Spigot-Server-Patches/Catch-JsonParseException-in-Entity-and-TE-names.patch +++ b/Spigot-Server-Patches/Catch-JsonParseException-in-Entity-and-TE-names.patch @@ -49,6 +49,14 @@ diff --git a/src/main/java/net/minecraft/world/level/CommandBlockListenerAbstrac index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/CommandBlockListenerAbstract.java +++ b/src/main/java/net/minecraft/world/level/CommandBlockListenerAbstract.java +@@ -0,0 +0,0 @@ import net.minecraft.commands.ICommandListener; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.chat.ChatComponentText; + import net.minecraft.network.chat.IChatBaseComponent; ++import net.minecraft.server.MCUtil; + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.util.UtilColor; @@ -0,0 +0,0 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener { this.command = nbttagcompound.getString("Command"); this.successCount = nbttagcompound.getInt("SuccessCount"); @@ -62,6 +70,14 @@ diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBann index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBanner.java +++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBanner.java +@@ -0,0 +0,0 @@ import net.minecraft.nbt.NBTTagList; + import net.minecraft.network.chat.ChatMessage; + import net.minecraft.network.chat.IChatBaseComponent; + import net.minecraft.network.protocol.game.PacketPlayOutTileEntityData; ++import net.minecraft.server.MCUtil; + import net.minecraft.world.INamableTileEntity; + import net.minecraft.world.item.EnumColor; + import net.minecraft.world.item.ItemStack; @@ -0,0 +0,0 @@ public class TileEntityBanner extends TileEntity implements INamableTileEntity { public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) { super.load(iblockdata, nbttagcompound); @@ -75,6 +91,14 @@ diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityCont index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityContainer.java +++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityContainer.java +@@ -0,0 +0,0 @@ import javax.annotation.Nullable; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.chat.ChatMessage; + import net.minecraft.network.chat.IChatBaseComponent; ++import net.minecraft.server.MCUtil; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.world.ChestLock; @@ -0,0 +0,0 @@ public abstract class TileEntityContainer extends TileEntity implements IInvento super.load(iblockdata, nbttagcompound); this.chestLock = ChestLock.b(nbttagcompound); diff --git a/Spigot-Server-Patches/Catch-exceptions-from-dispenser-entity-spawns.patch b/Spigot-Server-Patches/Catch-exceptions-from-dispenser-entity-spawns.patch index 96ad5a7c458..dee3ad4e061 100644 --- a/Spigot-Server-Patches/Catch-exceptions-from-dispenser-entity-spawns.patch +++ b/Spigot-Server-Patches/Catch-exceptions-from-dispenser-entity-spawns.patch @@ -8,6 +8,14 @@ diff --git a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java b index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java +@@ -0,0 +0,0 @@ import net.minecraft.core.BlockPosition; + import net.minecraft.core.EnumDirection; + import net.minecraft.core.IPosition; + import net.minecraft.core.ISourceBlock; ++import net.minecraft.server.MinecraftServer; + import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundCategory; @@ -0,0 +0,0 @@ public interface IDispenseBehavior { } } diff --git a/Spigot-Server-Patches/Collision-option-for-requiring-a-player-participant.patch b/Spigot-Server-Patches/Collision-option-for-requiring-a-player-participant.patch index ec8ebf4c83d..597b2b9b6ee 100644 --- a/Spigot-Server-Patches/Collision-option-for-requiring-a-player-participant.patch +++ b/Spigot-Server-Patches/Collision-option-for-requiring-a-player-participant.patch @@ -43,6 +43,14 @@ diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java b/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java +@@ -0,0 +0,0 @@ import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.tags.Tag; @@ -0,0 +0,0 @@ public class EntityBoat extends Entity { @Override @@ -55,6 +63,14 @@ diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbst index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java +@@ -0,0 +0,0 @@ import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.tags.Tag; + import net.minecraft.tags.TagsBlock; + import net.minecraft.util.MathHelper; @@ -0,0 +0,0 @@ public abstract class EntityMinecartAbstract extends Entity { public void collide(Entity entity) { if (!this.world.isClientSide) { diff --git a/Spigot-Server-Patches/Configurable-Grass-Spread-Tick-Rate.patch b/Spigot-Server-Patches/Configurable-Grass-Spread-Tick-Rate.patch index f7be964c690..25c227684c3 100644 --- a/Spigot-Server-Patches/Configurable-Grass-Spread-Tick-Rate.patch +++ b/Spigot-Server-Patches/Configurable-Grass-Spread-Tick-Rate.patch @@ -23,6 +23,14 @@ diff --git a/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadab index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java +++ b/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java +@@ -0,0 +0,0 @@ package net.minecraft.world.level.block; + import java.util.Random; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.EnumDirection; ++import net.minecraft.server.MinecraftServer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.tags.Tag; + import net.minecraft.tags.TagsFluid; @@ -0,0 +0,0 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow { @Override diff --git a/Spigot-Server-Patches/Configurable-Player-Collision.patch b/Spigot-Server-Patches/Configurable-Player-Collision.patch index 03c7fd0bfd5..00c04944a3d 100644 --- a/Spigot-Server-Patches/Configurable-Player-Collision.patch +++ b/Spigot-Server-Patches/Configurable-Player-Collision.patch @@ -35,6 +35,14 @@ diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -0,0 +0,0 @@ import net.minecraft.world.phys.Vec2F; + import net.minecraft.world.phys.Vec3D; + import net.minecraft.world.scores.PersistentScoreboard; + import net.minecraft.world.scores.Scoreboard; ++import net.minecraft.world.scores.ScoreboardTeam; + import org.apache.commons.lang3.Validate; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant playersByName = new java.util.HashMap<>(); -+ @Nullable String collideRuleTeamName; // Paper - Team name used for collideRule ++ public @Nullable String collideRuleTeamName; // Paper - Team name used for collideRule public PlayerList(MinecraftServer minecraftserver, IRegistryCustom.Dimension iregistrycustom_dimension, WorldNBTStorage worldnbtstorage, int i) { this.cserver = minecraftserver.server = new CraftServer((DedicatedServer) minecraftserver, this); diff --git a/Spigot-Server-Patches/Configurable-speed-for-water-flowing-over-lava.patch b/Spigot-Server-Patches/Configurable-speed-for-water-flowing-over-lava.patch index 97fd314b678..288cc82aa06 100644 --- a/Spigot-Server-Patches/Configurable-speed-for-water-flowing-over-lava.patch +++ b/Spigot-Server-Patches/Configurable-speed-for-water-flowing-over-lava.patch @@ -23,6 +23,14 @@ diff --git a/src/main/java/net/minecraft/world/level/block/BlockFluids.java b/sr index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/BlockFluids.java +++ b/src/main/java/net/minecraft/world/level/block/BlockFluids.java +@@ -0,0 +0,0 @@ import net.minecraft.world.level.material.Fluid; + import net.minecraft.world.level.material.FluidType; + import net.minecraft.world.level.material.FluidTypeFlowing; + import net.minecraft.world.level.material.FluidTypes; ++import net.minecraft.world.level.material.Material; + import net.minecraft.world.level.pathfinder.PathMode; + import net.minecraft.world.level.storage.loot.LootTableInfo; + import net.minecraft.world.phys.shapes.VoxelShape; @@ -0,0 +0,0 @@ public class BlockFluids extends Block implements IFluidSource { @Override public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { diff --git a/Spigot-Server-Patches/Don-t-allow-null-UUID-s-for-chat.patch b/Spigot-Server-Patches/Don-t-allow-null-UUID-s-for-chat.patch index b1e65022169..920dbfc4bc1 100644 --- a/Spigot-Server-Patches/Don-t-allow-null-UUID-s-for-chat.patch +++ b/Spigot-Server-Patches/Don-t-allow-null-UUID-s-for-chat.patch @@ -8,6 +8,14 @@ diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java +++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutChat.java +@@ -0,0 +0,0 @@ package net.minecraft.network.protocol.game; + + import java.io.IOException; + import java.util.UUID; ++import net.minecraft.SystemUtils; + import net.minecraft.network.PacketDataSerializer; + import net.minecraft.network.chat.ChatMessageType; + import net.minecraft.network.chat.IChatBaseComponent; @@ -0,0 +0,0 @@ public class PacketPlayOutChat implements Packet { public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent, ChatMessageType chatmessagetype, UUID uuid) { this.a = ichatbasecomponent; diff --git a/Spigot-Server-Patches/Entity-getEntitySpawnReason.patch b/Spigot-Server-Patches/Entity-getEntitySpawnReason.patch index 295d0546f65..226993e7032 100644 --- a/Spigot-Server-Patches/Entity-getEntitySpawnReason.patch +++ b/Spigot-Server-Patches/Entity-getEntitySpawnReason.patch @@ -50,7 +50,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne } }; - List entitySlice = null; + public List entitySlice = null; + public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason; // Paper end diff --git a/Spigot-Server-Patches/EntityPathfindEvent.patch b/Spigot-Server-Patches/EntityPathfindEvent.patch index 0800748ea28..977943725e4 100644 --- a/Spigot-Server-Patches/EntityPathfindEvent.patch +++ b/Spigot-Server-Patches/EntityPathfindEvent.patch @@ -22,6 +22,14 @@ diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAb index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java +++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java +@@ -0,0 +0,0 @@ import net.minecraft.core.BaseBlockPosition; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.IPosition; + import net.minecraft.network.protocol.game.PacketDebug; ++import net.minecraft.server.MCUtil; + import net.minecraft.util.MathHelper; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityInsentient; @@ -0,0 +0,0 @@ import net.minecraft.world.phys.Vec3D; public abstract class NavigationAbstract { diff --git a/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch b/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch index ee9110d0186..e00fc0449a7 100644 --- a/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch +++ b/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch @@ -16,6 +16,22 @@ diff --git a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java +@@ -0,0 +0,0 @@ import net.minecraft.core.BlockPosition; + import net.minecraft.core.EnumDirection; + import net.minecraft.network.protocol.game.PacketPlayInBlockDig; + import net.minecraft.network.protocol.game.PacketPlayOutBlockBreak; ++import net.minecraft.network.protocol.game.PacketPlayOutCloseWindow; + import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo; + import net.minecraft.world.EnumHand; + import net.minecraft.world.EnumInteractionResult; +@@ -0,0 +0,0 @@ import net.minecraft.world.level.EnumGamemode; + import net.minecraft.world.level.World; + import net.minecraft.world.level.block.Block; + import net.minecraft.world.level.block.BlockCommand; ++import net.minecraft.world.level.block.BlockFlowerPot; + import net.minecraft.world.level.block.BlockJigsaw; + import net.minecraft.world.level.block.BlockStructure; + import net.minecraft.world.level.block.entity.TileEntity; @@ -0,0 +0,0 @@ public class PlayerInteractManager { PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, blockposition, enumdirection, this.player.inventory.getItemInHand(), EnumHand.MAIN_HAND); if (event.isCancelled()) { diff --git a/Spigot-Server-Patches/Extend-block-drop-capture-to-capture-all-items-added.patch b/Spigot-Server-Patches/Extend-block-drop-capture-to-capture-all-items-added.patch index a00d020df71..dee692b5010 100644 --- a/Spigot-Server-Patches/Extend-block-drop-capture-to-capture-all-items-added.patch +++ b/Spigot-Server-Patches/Extend-block-drop-capture-to-capture-all-items-added.patch @@ -9,6 +9,14 @@ diff --git a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java +@@ -0,0 +0,0 @@ import net.minecraft.world.EnumHand; + import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.ITileInventory; + import net.minecraft.world.InteractionResultWrapper; ++import net.minecraft.world.entity.item.EntityItem; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.context.ItemActionContext; @@ -0,0 +0,0 @@ public class PlayerInteractManager { // return true; // CraftBukkit } diff --git a/Spigot-Server-Patches/Fire-event-on-GS4-query.patch b/Spigot-Server-Patches/Fire-event-on-GS4-query.patch index cc3a8d2e4a2..5c99706b1e2 100644 --- a/Spigot-Server-Patches/Fire-event-on-GS4-query.patch +++ b/Spigot-Server-Patches/Fire-event-on-GS4-query.patch @@ -40,6 +40,14 @@ diff --git a/src/main/java/net/minecraft/server/rcon/thread/RemoteStatusListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/rcon/thread/RemoteStatusListener.java +++ b/src/main/java/net/minecraft/server/rcon/thread/RemoteStatusListener.java +@@ -0,0 +0,0 @@ import java.util.Random; + import javax.annotation.Nullable; + import net.minecraft.SystemUtils; + import net.minecraft.server.IMinecraftServer; ++import net.minecraft.server.dedicated.DedicatedServer; + import net.minecraft.server.rcon.RemoteStatusReply; + import net.minecraft.server.rcon.StatusChallengeUtils; + import org.apache.logging.log4j.LogManager; @@ -0,0 +0,0 @@ public class RemoteStatusListener extends RemoteConnectionThread { private static final Logger LOGGER = LogManager.getLogger(); private long e; diff --git a/Spigot-Server-Patches/Firework-API-s.patch b/Spigot-Server-Patches/Firework-API-s.patch index 00c02bd3cd1..679b40524e7 100644 --- a/Spigot-Server-Patches/Firework-API-s.patch +++ b/Spigot-Server-Patches/Firework-API-s.patch @@ -96,6 +96,14 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/sr index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java +@@ -0,0 +0,0 @@ + package org.bukkit.craftbukkit.entity; + + import java.util.Random; ++import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.projectile.EntityFireworks; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; @@ -0,0 +0,0 @@ public class CraftFirework extends CraftProjectile implements Firework { public void setShotAtAngle(boolean shotAtAngle) { getHandle().getDataWatcher().set(EntityFireworks.SHOT_AT_ANGLE, shotAtAngle); @@ -109,7 +117,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public org.bukkit.entity.LivingEntity getBoostedEntity() { -+ net.minecraft.server.EntityLiving boostedEntity = getHandle().ridingEntity; ++ EntityLiving boostedEntity = getHandle().ridingEntity; + return boostedEntity != null ? (org.bukkit.entity.LivingEntity) boostedEntity.getBukkitEntity() : null; + } + // Paper end diff --git a/Spigot-Server-Patches/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch b/Spigot-Server-Patches/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch index bfd07555c7e..026814dee7c 100644 --- a/Spigot-Server-Patches/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch +++ b/Spigot-Server-Patches/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch @@ -86,7 +86,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private boolean m = true; + // Paper start - fix advancement data player leakage -+ final Map> criterionData = Maps.newIdentityHashMap(); ++ public final Map> criterionData = Maps.newIdentityHashMap(); + // Paper end - fix advancement data player leakage + public AdvancementDataPlayer(DataFixer datafixer, PlayerList playerlist, AdvancementDataWorld advancementdataworld, File file, EntityPlayer entityplayer) { diff --git a/Spigot-Server-Patches/Fix-Light-Command.patch b/Spigot-Server-Patches/Fix-Light-Command.patch index 795810b36f7..c4cc00e0806 100644 --- a/Spigot-Server-Patches/Fix-Light-Command.patch +++ b/Spigot-Server-Patches/Fix-Light-Command.patch @@ -169,19 +169,6 @@ diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java -@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - private final ChunkTaskQueueSorter p; - private final Mailbox> mailboxWorldGen; - final Mailbox> mailboxMain; // Paper - private -> package private -+ // Paper start -+ final Mailbox> mailboxLight; -+ public void addLightTask(PlayerChunk playerchunk, Runnable run) { -+ this.mailboxLight.a(ChunkTaskQueueSorter.a(playerchunk, run)); -+ } -+ // Paper end - public final WorldLoadListener worldLoadListener; - public final PlayerChunkMap.a chunkDistanceManager; - private final AtomicInteger u; @@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { Mailbox mailbox = Mailbox.a("main", iasynctaskhandler::a); diff --git a/Spigot-Server-Patches/Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch b/Spigot-Server-Patches/Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch index 80ed2edd5b8..d23e0dd88c5 100644 --- a/Spigot-Server-Patches/Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch +++ b/Spigot-Server-Patches/Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch @@ -19,6 +19,14 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLo index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java +@@ -0,0 +0,0 @@ import net.minecraft.core.BlockPosition; + import net.minecraft.core.IRegistry; + import net.minecraft.core.RegistryBlocks; + import net.minecraft.core.SectionPosition; ++import net.minecraft.nbt.NBTBase; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.nbt.NBTTagList; + import net.minecraft.nbt.NBTTagLongArray; @@ -0,0 +0,0 @@ public class ChunkRegionLoader { object2 = protochunkticklist1; } diff --git a/Spigot-Server-Patches/Fix-Not-a-string-Map-Conversion-spam.patch b/Spigot-Server-Patches/Fix-Not-a-string-Map-Conversion-spam.patch index 349453455fd..b5c0e017cf9 100644 --- a/Spigot-Server-Patches/Fix-Not-a-string-Map-Conversion-spam.patch +++ b/Spigot-Server-Patches/Fix-Not-a-string-Map-Conversion-spam.patch @@ -13,6 +13,17 @@ diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java +++ b/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java +@@ -0,0 +0,0 @@ import javax.annotation.Nullable; + import net.minecraft.core.BlockPosition; + import net.minecraft.nbt.DynamicOpsNBT; + import net.minecraft.nbt.NBTBase; ++import net.minecraft.nbt.NBTNumber; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.nbt.NBTTagList; ++import net.minecraft.nbt.NBTTagString; + import net.minecraft.network.chat.IChatBaseComponent; + import net.minecraft.network.protocol.Packet; + import net.minecraft.network.protocol.game.PacketPlayOutMap; @@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase { @Override @@ -28,7 +39,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.uniqueId = new UUID(most, least); + CraftWorld world = (CraftWorld) server.getWorld(this.uniqueId); + if (world != null) { -+ dimension = NBTTagString.create("minecaft:" + world.getName().toLowerCase(java.util.Locale.ENGLISH)); ++ dimension = NBTTagString.create("minecraft:" + world.getName().toLowerCase(java.util.Locale.ENGLISH)); + } else { + dimension = NBTTagString.create("bukkit:_invalidworld_"); + } diff --git a/Spigot-Server-Patches/Fix-Old-Sign-Conversion.patch b/Spigot-Server-Patches/Fix-Old-Sign-Conversion.patch index c676680f101..cfd60433209 100644 --- a/Spigot-Server-Patches/Fix-Old-Sign-Conversion.patch +++ b/Spigot-Server-Patches/Fix-Old-Sign-Conversion.patch @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public CraftPersistentDataContainer persistentDataContainer; // CraftBukkit end private static final Logger LOGGER = LogManager.getLogger(); -+ boolean isLoadingStructure = false; // Paper ++ public boolean isLoadingStructure = false; // Paper private final TileEntityTypes tileType; public TileEntityTypes getTileEntityType() { return tileType; } // Paper - OBFHELPER @Nullable protected World world; diff --git a/Spigot-Server-Patches/Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/Spigot-Server-Patches/Fix-Per-World-Difficulty-Remembering-Difficulty.patch index 77e8bbddd8f..7f346fc26ba 100644 --- a/Spigot-Server-Patches/Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/Spigot-Server-Patches/Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -36,6 +36,14 @@ diff --git a/src/main/java/net/minecraft/server/commands/CommandDifficulty.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/commands/CommandDifficulty.java +++ b/src/main/java/net/minecraft/server/commands/CommandDifficulty.java +@@ -0,0 +0,0 @@ import com.mojang.brigadier.exceptions.DynamicCommandExceptionType; + import net.minecraft.commands.CommandListenerWrapper; + import net.minecraft.network.chat.ChatMessage; + import net.minecraft.server.MinecraftServer; ++import net.minecraft.server.level.WorldServer; + import net.minecraft.world.EnumDifficulty; + + public class CommandDifficulty { @@ -0,0 +0,0 @@ public class CommandDifficulty { public static int a(CommandListenerWrapper commandlistenerwrapper, EnumDifficulty enumdifficulty) throws CommandSyntaxException { MinecraftServer minecraftserver = commandlistenerwrapper.getServer(); diff --git a/Spigot-Server-Patches/Fix-World-isChunkGenerated-calls.patch b/Spigot-Server-Patches/Fix-World-isChunkGenerated-calls.patch index c77bf9248b2..633f6d1a8dd 100644 --- a/Spigot-Server-Patches/Fix-World-isChunkGenerated-calls.patch +++ b/Spigot-Server-Patches/Fix-World-isChunkGenerated-calls.patch @@ -42,6 +42,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Paper end @Nullable +@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider { + return this.p; + } + +- final class a extends IAsyncTaskHandler { ++ public final class a extends IAsyncTaskHandler { // Paper - package -> public + + private a(World world) { + super("Chunk source main thread executor for " + world.getDimensionKey().a()); diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/PlayerChunk.java @@ -311,7 +320,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + chunk = world.getChunkProvider().playerChunkMap.getUnloadingChunk(x, z); + } + if (chunk != null) { -+ return chunk instanceof ProtoChunkExtension || chunk instanceof net.minecraft.server.Chunk; ++ return chunk instanceof ProtoChunkExtension || chunk instanceof net.minecraft.world.level.chunk.Chunk; + } try { - return world.getChunkProvider().getChunkAtIfCachedImmediately(x, z) != null || world.getChunkProvider().playerChunkMap.read(new ChunkCoordIntPair(x, z)) != null; // Paper (TODO check if the first part can be removed) diff --git a/Spigot-Server-Patches/Fix-client-rendering-skulls-from-same-user.patch b/Spigot-Server-Patches/Fix-client-rendering-skulls-from-same-user.patch index 917f4b8353a..41ae25611f1 100644 --- a/Spigot-Server-Patches/Fix-client-rendering-skulls-from-same-user.patch +++ b/Spigot-Server-Patches/Fix-client-rendering-skulls-from-same-user.patch @@ -15,6 +15,14 @@ diff --git a/src/main/java/net/minecraft/network/PacketDataSerializer.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/network/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/network/PacketDataSerializer.java +@@ -0,0 +0,0 @@ import net.minecraft.network.chat.IChatBaseComponent; + import net.minecraft.resources.MinecraftKey; + import net.minecraft.world.item.Item; + import net.minecraft.world.item.ItemStack; ++import net.minecraft.world.level.block.entity.TileEntitySkull; + import net.minecraft.world.phys.MovingObjectPositionBlock; + import net.minecraft.world.phys.Vec3D; + @@ -0,0 +0,0 @@ public class PacketDataSerializer extends ByteBuf { if (item.usesDurability() || item.n()) { // Spigot start - filter @@ -82,7 +90,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Deprecated private Item item; - private NBTTagCompound tag; -+ NBTTagCompound tag; // Paper -> package private ++ public NBTTagCompound tag; // Paper private -> public private boolean j; private Entity k; private ShapeDetectorBlock l; @@ -115,7 +123,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return cmp; + } + -+ static void sanitizeUUID(NBTTagCompound owner) { ++ public static void sanitizeUUID(NBTTagCompound owner) { + NBTTagCompound properties = owner.getCompound("Properties"); + NBTTagList list = null; + if (!properties.isEmpty()) { diff --git a/Spigot-Server-Patches/Fix-harming-potion-dupe.patch b/Spigot-Server-Patches/Fix-harming-potion-dupe.patch index 53e71b0b87e..de56bb26e25 100644 --- a/Spigot-Server-Patches/Fix-harming-potion-dupe.patch +++ b/Spigot-Server-Patches/Fix-harming-potion-dupe.patch @@ -11,6 +11,14 @@ diff --git a/src/main/java/net/minecraft/world/item/ItemPotion.java b/src/main/j index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/ItemPotion.java +++ b/src/main/java/net/minecraft/world/item/ItemPotion.java +@@ -0,0 +0,0 @@ import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.alchemy.PotionRegistry; + import net.minecraft.world.item.alchemy.PotionUtil; + import net.minecraft.world.item.alchemy.Potions; ++import net.minecraft.world.level.GameRules; + import net.minecraft.world.level.World; + + public class ItemPotion extends Item { @@ -0,0 +0,0 @@ public class ItemPotion extends Item { CriterionTriggers.z.a((EntityPlayer) entityhuman, itemstack); } diff --git a/Spigot-Server-Patches/Fix-item-locations-dropped-from-campfires.patch b/Spigot-Server-Patches/Fix-item-locations-dropped-from-campfires.patch index 8cd8c34e2e2..c300f1e3385 100644 --- a/Spigot-Server-Patches/Fix-item-locations-dropped-from-campfires.patch +++ b/Spigot-Server-Patches/Fix-item-locations-dropped-from-campfires.patch @@ -9,6 +9,14 @@ diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityCamp index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityCampfire.java +++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityCampfire.java +@@ -0,0 +0,0 @@ import net.minecraft.world.Clearable; + import net.minecraft.world.ContainerUtil; + import net.minecraft.world.InventorySubcontainer; + import net.minecraft.world.InventoryUtils; ++import net.minecraft.world.entity.item.EntityItem; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.crafting.RecipeCampfire; + import net.minecraft.world.item.crafting.Recipes; @@ -0,0 +0,0 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab result = blockCookEvent.getResult(); itemstack1 = CraftItemStack.asNMSCopy(result); diff --git a/Spigot-Server-Patches/Guard-against-serializing-mismatching-chunk-coordina.patch b/Spigot-Server-Patches/Guard-against-serializing-mismatching-chunk-coordina.patch index d2e193379b3..9e984b559a6 100644 --- a/Spigot-Server-Patches/Guard-against-serializing-mismatching-chunk-coordina.patch +++ b/Spigot-Server-Patches/Guard-against-serializing-mismatching-chunk-coordina.patch @@ -38,6 +38,14 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/IChunkLoader. index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/IChunkLoader.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/IChunkLoader.java +@@ -0,0 +0,0 @@ import net.minecraft.SharedConstants; + import net.minecraft.nbt.GameProfileSerializer; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.resources.ResourceKey; ++import net.minecraft.server.level.PlayerChunkMap; + import net.minecraft.util.datafix.DataFixTypes; + import net.minecraft.world.level.ChunkCoordIntPair; + import net.minecraft.world.level.World; @@ -0,0 +0,0 @@ public class IChunkLoader implements AutoCloseable { public void a(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) throws IOException { write(chunkcoordintpair, nbttagcompound); } // Paper OBFHELPER diff --git a/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch index ba14c6912e1..15779944793 100644 --- a/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch +++ b/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch @@ -635,6 +635,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import it.unimi.dsi.fastutil.shorts.ShortArraySet; import it.unimi.dsi.fastutil.shorts.ShortSet; import java.util.List; +@@ -0,0 +0,0 @@ import net.minecraft.network.protocol.game.PacketPlayOutBlockChange; + import net.minecraft.network.protocol.game.PacketPlayOutLightUpdate; + import net.minecraft.network.protocol.game.PacketPlayOutMultiBlockChange; + import net.minecraft.network.protocol.game.PacketPlayOutTileEntityData; ++import net.minecraft.server.MCUtil; + import net.minecraft.util.MathHelper; + import net.minecraft.world.level.ChunkCoordIntPair; + import net.minecraft.world.level.EnumSkyBlock; @@ -0,0 +0,0 @@ public class PlayerChunk { private CompletableFuture chunkSave; public int oldTicketLevel; @@ -1201,7 +1209,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class PlayerList { final ChunkCoordIntPair pos = new ChunkCoordIntPair(chunkX, chunkZ); PlayerChunkMap playerChunkMap = worldserver1.getChunkProvider().playerChunkMap; - playerChunkMap.chunkDistanceManager.addTicketAtLevel(TicketType.LOGIN, pos, 31, pos.pair()); + playerChunkMap.getChunkDistanceManager().addTicketAtLevel(TicketType.LOGIN, pos, 31, pos.pair()); - worldserver1.getChunkProvider().tickDistanceManager(); - worldserver1.getChunkProvider().getChunkAtAsynchronously(chunkX, chunkZ, true, true).thenApply(chunk -> { + worldserver1.getChunkProvider().markAreaHighPriority(pos, 28, 3); @@ -1256,6 +1264,22 @@ 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.PlayerChunkMap; + import net.minecraft.server.level.WorldServer; + import net.minecraft.server.network.PlayerConnection; + import net.minecraft.server.players.WhiteListEntry; ++import net.minecraft.util.MathHelper; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityExperienceOrb; + import net.minecraft.world.entity.EntityLiving; +@@ -0,0 +0,0 @@ import net.minecraft.world.inventory.Container; + import net.minecraft.world.item.EnumColor; + import net.minecraft.world.item.enchantment.EnchantmentManager; + import net.minecraft.world.item.enchantment.Enchantments; ++import net.minecraft.world.level.ChunkCoordIntPair; + import net.minecraft.world.level.EnumGamemode; + import net.minecraft.world.level.biome.BiomeManager; + import net.minecraft.world.level.block.entity.TileEntitySign; @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { throw new UnsupportedOperationException("Cannot set rotation of players. Consider teleporting instead."); } @@ -1263,7 +1287,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start + @Override + public java.util.concurrent.CompletableFuture teleportAsync(Location loc, @javax.annotation.Nonnull PlayerTeleportEvent.TeleportCause cause) { -+ ((CraftWorld)loc.getWorld()).getHandle().getChunkProvider().markAreaHighPriority(new net.minecraft.server.ChunkCoordIntPair(net.minecraft.server.MathHelper.floor(loc.getX()) >> 4, net.minecraft.server.MathHelper.floor(loc.getZ()) >> 4), 28, 3); // Paper - load area high priority ++ ((CraftWorld)loc.getWorld()).getHandle().getChunkProvider().markAreaHighPriority(new ChunkCoordIntPair(MathHelper.floor(loc.getX()) >> 4, MathHelper.floor(loc.getZ()) >> 4), 28, 3); // Paper - load area high priority + return super.teleportAsync(loc, cause); + } + // Paper end diff --git a/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch b/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch index 36ff2ae0596..74ffbf06ae6 100644 --- a/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch +++ b/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch @@ -23,6 +23,14 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +@@ -0,0 +0,0 @@ + package org.bukkit.craftbukkit.entity; + + import net.minecraft.core.Vector3f; ++import net.minecraft.world.entity.EnumItemSlot; + import net.minecraft.world.entity.decoration.EntityArmorStand; + import org.bukkit.craftbukkit.CraftEquipmentSlot; + import org.bukkit.craftbukkit.CraftServer; @@ -0,0 +0,0 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { public void setCanMove(boolean move) { getHandle().canMove = move; @@ -76,7 +84,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + int disabled = 0; + for (org.bukkit.inventory.EquipmentSlot slot : slots) { + if (slot == org.bukkit.inventory.EquipmentSlot.OFF_HAND) continue; -+ net.minecraft.server.EnumItemSlot nmsSlot = org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot); ++ EnumItemSlot nmsSlot = org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot); + disabled += (1 << nmsSlot.getSlotFlag()) + (1 << (nmsSlot.getSlotFlag() + 8)) + (1 << (nmsSlot.getSlotFlag() + 16)); + } + getHandle().disabledSlots = disabled; diff --git a/Spigot-Server-Patches/Implement-Mob-Goal-API.patch b/Spigot-Server-Patches/Implement-Mob-Goal-API.patch index 154b53a6945..b0df718fbf1 100644 --- a/Spigot-Server-Patches/Implement-Mob-Goal-API.patch +++ b/Spigot-Server-Patches/Implement-Mob-Goal-API.patch @@ -1066,9 +1066,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.entity.ai; + -+import net.minecraft.server.EntityInsentient; -+import net.minecraft.server.PathfinderGoal; -+ ++import net.minecraft.world.entity.EntityInsentient; ++import net.minecraft.world.entity.ai.goal.PathfinderGoal; +import org.junit.Assert; +import org.junit.Test; + diff --git a/Spigot-Server-Patches/Implement-World.getEntity-UUID-API.patch b/Spigot-Server-Patches/Implement-World.getEntity-UUID-API.patch index db0eba72f85..401e353db7b 100644 --- a/Spigot-Server-Patches/Implement-World.getEntity-UUID-API.patch +++ b/Spigot-Server-Patches/Implement-World.getEntity-UUID-API.patch @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Override + public Entity getEntity(UUID uuid) { + Validate.notNull(uuid, "UUID cannot be null"); -+ net.minecraft.server.Entity entity = world.getEntity(uuid); ++ net.minecraft.world.entity.Entity entity = world.getEntity(uuid); + return entity == null ? null : entity.getBukkitEntity(); + } + // Paper end diff --git a/Spigot-Server-Patches/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/Spigot-Server-Patches/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch index 7bf11946f35..a220233e9c2 100644 --- a/Spigot-Server-Patches/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch +++ b/Spigot-Server-Patches/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch @@ -35,6 +35,21 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +@@ -0,0 +0,0 @@ import java.util.logging.Level; + import java.util.logging.Logger; + import javax.annotation.Nonnull; + import javax.annotation.Nullable; ++import net.minecraft.commands.arguments.blocks.ArgumentBlock; + import net.minecraft.nbt.NBTBase; + import net.minecraft.nbt.NBTCompressedStreamTools; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.nbt.NBTTagList; + import net.minecraft.nbt.NBTTagString; + import net.minecraft.network.chat.ChatComponentText; ++import net.minecraft.resources.MinecraftKey; + import net.minecraft.world.entity.EnumItemSlot; + import net.minecraft.world.item.ItemBlock; + import org.apache.commons.codec.binary.Base64; @@ -0,0 +0,0 @@ import org.bukkit.persistence.PersistentDataContainer; import static org.spigotmc.ValidateUtils.*; // Spigot end @@ -377,7 +392,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + private @Nullable Namespaced deserializeNamespaced(String raw) { + boolean isTag = raw.length() > 0 && raw.codePointAt(0) == '#'; -+ net.minecraft.server.ArgumentBlock blockParser = new net.minecraft.server.ArgumentBlock(new com.mojang.brigadier.StringReader(raw), true); ++ ArgumentBlock blockParser = new ArgumentBlock(new com.mojang.brigadier.StringReader(raw), true); + try { + blockParser = blockParser.parse(false); + } catch (com.mojang.brigadier.exceptions.CommandSyntaxException e) { @@ -385,7 +400,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return null; + } + -+ net.minecraft.server.MinecraftKey key; ++ MinecraftKey key; + if (isTag) { + key = blockParser.getTagKey(); + } else { diff --git a/Spigot-Server-Patches/Inventory-getHolder-method-without-block-snapshot.patch b/Spigot-Server-Patches/Inventory-getHolder-method-without-block-snapshot.patch index 83300c99a93..61853fe17c4 100644 --- a/Spigot-Server-Patches/Inventory-getHolder-method-without-block-snapshot.patch +++ b/Spigot-Server-Patches/Inventory-getHolder-method-without-block-snapshot.patch @@ -8,6 +8,14 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +@@ -0,0 +0,0 @@ import net.minecraft.world.inventory.InventoryCrafting; + import net.minecraft.world.inventory.InventoryEnderChest; + import net.minecraft.world.inventory.InventoryMerchant; + import net.minecraft.world.level.block.entity.IHopper; ++import net.minecraft.world.level.block.entity.TileEntity; + import net.minecraft.world.level.block.entity.TileEntityBarrel; + import net.minecraft.world.level.block.entity.TileEntityBlastFurnace; + import net.minecraft.world.level.block.entity.TileEntityBrewingStand; @@ -0,0 +0,0 @@ public class CraftInventory implements Inventory { return inventory.getOwner(); } @@ -15,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - getHolder without snapshot + @Override + public InventoryHolder getHolder(boolean useSnapshot) { -+ return inventory instanceof net.minecraft.server.TileEntity ? ((net.minecraft.server.TileEntity) inventory).getOwner(useSnapshot) : getHolder(); ++ return inventory instanceof TileEntity ? ((TileEntity) inventory).getOwner(useSnapshot) : getHolder(); + } + // Paper end + diff --git a/Spigot-Server-Patches/Load-Chunks-for-Login-Asynchronously.patch b/Spigot-Server-Patches/Load-Chunks-for-Login-Asynchronously.patch index 32eece5198f..09115b8b210 100644 --- a/Spigot-Server-Patches/Load-Chunks-for-Login-Asynchronously.patch +++ b/Spigot-Server-Patches/Load-Chunks-for-Login-Asynchronously.patch @@ -37,6 +37,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public Integer clientViewDistance; // CraftBukkit end public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + private final Mailbox> mailboxWorldGen; + private final Mailbox> mailboxMain; + public final WorldLoadListener worldLoadListener; +- public final PlayerChunkMap.a chunkDistanceManager; ++ public final PlayerChunkMap.a chunkDistanceManager; public final ChunkMapDistance getChunkDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER + private final AtomicInteger u; + public final DefinedStructureManager definedStructureManager; // Paper - private -> public + private final File w; diff --git a/src/main/java/net/minecraft/server/level/TicketType.java b/src/main/java/net/minecraft/server/level/TicketType.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/TicketType.java @@ -174,7 +187,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + int chunkZ = loc.getBlockZ() >> 4; + final ChunkCoordIntPair pos = new ChunkCoordIntPair(chunkX, chunkZ); + PlayerChunkMap playerChunkMap = worldserver1.getChunkProvider().playerChunkMap; -+ playerChunkMap.chunkDistanceManager.addTicketAtLevel(TicketType.LOGIN, pos, 31, pos.pair()); ++ playerChunkMap.getChunkDistanceManager().addTicketAtLevel(TicketType.LOGIN, pos, 31, pos.pair()); + worldserver1.getChunkProvider().tickDistanceManager(); + worldserver1.getChunkProvider().getChunkAtAsynchronously(chunkX, chunkZ, true, true).thenApply(chunk -> { + PlayerChunk updatingChunk = playerChunkMap.getUpdatingChunk(pos.pair()); diff --git a/Spigot-Server-Patches/MC-145656-Fix-Follow-Range-Initial-Target.patch b/Spigot-Server-Patches/MC-145656-Fix-Follow-Range-Initial-Target.patch index 4b4528644a3..ec0a78043d3 100644 --- a/Spigot-Server-Patches/MC-145656-Fix-Follow-Range-Initial-Target.patch +++ b/Spigot-Server-Patches/MC-145656-Fix-Follow-Range-Initial-Target.patch @@ -34,6 +34,15 @@ diff --git a/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTar index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java +++ b/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java +@@ -0,0 +0,0 @@ import java.util.function.Predicate; + import javax.annotation.Nullable; + import net.minecraft.world.entity.EntityInsentient; + import net.minecraft.world.entity.EntityLiving; ++import net.minecraft.world.entity.ai.attributes.AttributeModifiable; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; + + public class PathfinderTargetCondition { + @@ -0,0 +0,0 @@ public class PathfinderTargetCondition { if (this.b > 0.0D) { diff --git a/Spigot-Server-Patches/MC-Dev-fixes.patch b/Spigot-Server-Patches/MC-Dev-fixes.patch index 6403dffa534..e755fd705a2 100644 --- a/Spigot-Server-Patches/MC-Dev-fixes.patch +++ b/Spigot-Server-Patches/MC-Dev-fixes.patch @@ -185,7 +185,38 @@ diff --git a/src/main/java/net/minecraft/network/EnumProtocol.java b/src/main/ja index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/network/EnumProtocol.java +++ b/src/main/java/net/minecraft/network/EnumProtocol.java -@@ -0,0 +0,0 @@ import org.apache.logging.log4j.LogManager; +@@ -0,0 +0,0 @@ import javax.annotation.Nullable; + import net.minecraft.SystemUtils; + import net.minecraft.network.protocol.EnumProtocolDirection; + import net.minecraft.network.protocol.Packet; ++import net.minecraft.network.protocol.game.PacketListenerPlayIn; ++import net.minecraft.network.protocol.game.PacketListenerPlayOut; + import net.minecraft.network.protocol.game.PacketPlayInAbilities; + import net.minecraft.network.protocol.game.PacketPlayInAdvancements; + import net.minecraft.network.protocol.game.PacketPlayInArmAnimation; +@@ -0,0 +0,0 @@ import net.minecraft.network.protocol.game.PacketPlayOutWindowItems; + import net.minecraft.network.protocol.game.PacketPlayOutWorldBorder; + import net.minecraft.network.protocol.game.PacketPlayOutWorldEvent; + import net.minecraft.network.protocol.game.PacketPlayOutWorldParticles; ++import net.minecraft.network.protocol.handshake.PacketHandshakingInListener; + import net.minecraft.network.protocol.handshake.PacketHandshakingInSetProtocol; + import net.minecraft.network.protocol.login.PacketLoginInCustomPayload; + import net.minecraft.network.protocol.login.PacketLoginInEncryptionBegin; ++import net.minecraft.network.protocol.login.PacketLoginInListener; + import net.minecraft.network.protocol.login.PacketLoginInStart; + import net.minecraft.network.protocol.login.PacketLoginOutCustomPayload; + import net.minecraft.network.protocol.login.PacketLoginOutDisconnect; + import net.minecraft.network.protocol.login.PacketLoginOutEncryptionBegin; ++import net.minecraft.network.protocol.login.PacketLoginOutListener; + import net.minecraft.network.protocol.login.PacketLoginOutSetCompression; + import net.minecraft.network.protocol.login.PacketLoginOutSuccess; ++import net.minecraft.network.protocol.status.PacketStatusInListener; + import net.minecraft.network.protocol.status.PacketStatusInPing; + import net.minecraft.network.protocol.status.PacketStatusInStart; ++import net.minecraft.network.protocol.status.PacketStatusOutListener; + import net.minecraft.network.protocol.status.PacketStatusOutPong; + import net.minecraft.network.protocol.status.PacketStatusOutServerInfo; + import org.apache.logging.log4j.LogManager; public enum EnumProtocol { @@ -216,7 +247,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return stream.map(resourcepackrepository::a).filter(Objects::nonNull).map(ResourcePackLoader::d).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error // Paper - decompile error }, this).thenCompose((immutablelist) -> { - return DataPackResources.a(immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this); -+ return DataPackResources.a((List) immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this); // Paper - decompile error ++ return DataPackResources.a(immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this); // Paper - decompile error }).thenAcceptAsync((datapackresources) -> { this.dataPackResources.close(); this.dataPackResources = datapackresources; diff --git a/Spigot-Server-Patches/MC-Utils.patch b/Spigot-Server-Patches/MC-Utils.patch index fb0fa316cee..8f5b167197c 100644 --- a/Spigot-Server-Patches/MC-Utils.patch +++ b/Spigot-Server-Patches/MC-Utils.patch @@ -3057,7 +3057,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return x & 3 | ((z & 3) << 2); + } + -+ void addLoadedChunk(Chunk chunk) { ++ public void addLoadedChunk(Chunk chunk) { + this.loadedChunkMapSeqLock.acquireWrite(); + try { + this.loadedChunkMap.put(chunk.coordinateKey, chunk); @@ -3072,7 +3072,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.lastLoadedChunks[cacheKey] = chunk; + } + -+ void removeLoadedChunk(Chunk chunk) { ++ public void removeLoadedChunk(Chunk chunk) { + this.loadedChunkMapSeqLock.acquireWrite(); + try { + this.loadedChunkMap.remove(chunk.coordinateKey); @@ -3893,6 +3893,14 @@ diff --git a/src/main/java/net/minecraft/world/level/ChunkCache.java b/src/main/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/ChunkCache.java +++ b/src/main/java/net/minecraft/world/level/ChunkCache.java +@@ -0,0 +0,0 @@ import java.util.function.Predicate; + import java.util.stream.Stream; + import javax.annotation.Nullable; + import net.minecraft.core.BlockPosition; ++import net.minecraft.server.level.WorldServer; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.level.block.entity.TileEntity; @@ -0,0 +0,0 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess { protected final int b; protected final IChunkAccess[][] c; diff --git a/Spigot-Server-Patches/No-Tick-view-distance-implementation.patch b/Spigot-Server-Patches/No-Tick-view-distance-implementation.patch index 55041534082..cf09d4b0b91 100644 --- a/Spigot-Server-Patches/No-Tick-view-distance-implementation.patch +++ b/Spigot-Server-Patches/No-Tick-view-distance-implementation.patch @@ -199,9 +199,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private final ChunkTaskQueueSorter p; private final Mailbox> mailboxWorldGen; - private final Mailbox> mailboxMain; -+ final Mailbox> mailboxMain; // Paper - private -> package private ++ public final Mailbox> mailboxMain; // Paper - private -> public ++ // Paper start ++ final Mailbox> mailboxLight; ++ public void addLightTask(PlayerChunk playerchunk, Runnable run) { ++ this.mailboxLight.a(ChunkTaskQueueSorter.a(playerchunk, run)); ++ } ++ // Paper end public final WorldLoadListener worldLoadListener; - public final PlayerChunkMap.a chunkDistanceManager; + public final PlayerChunkMap.a chunkDistanceManager; public final ChunkMapDistance getChunkDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER private final AtomicInteger u; @@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerMobSpawnMap; // this map is absent from updateMaps since it's controlled at the start of the chunkproviderserver tick @@ -510,7 +516,48 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - private final void sendChunk(EntityPlayer entityplayer, Packet[] apacket, Chunk chunk) { this.a(entityplayer, apacket, chunk); } // Paper - OBFHELPER -+ final void sendChunk(EntityPlayer entityplayer, Packet[] apacket, Chunk chunk) { this.a(entityplayer, apacket, chunk); } // Paper - OBFHELPER ++ // Paper start ++ private static int getLightMask(final Chunk chunk) { ++ final ChunkSection[] chunkSections = chunk.getSections(); ++ int mask = 0; ++ ++ for (int i = 0; i < chunkSections.length; ++i) { ++ /* ++ ++ ++Lightmasks have 18 bits, from the -1 (void) section until the 17th (air) section. ++Sections go from 0..16. Now whenever a section is not empty, it can potentially change lighting for the section itself, the section below and the section above, hence the bitmask 111b, which is 7d. ++ ++ */ ++ mask |= (ChunkSection.isEmpty(chunkSections[i]) ? 0 : 7) << i; ++ } ++ ++ return mask; ++ } ++ ++ private static int getCeilingLightMask(final Chunk chunk) { ++ int mask = getLightMask(chunk); ++ ++ /* ++ It is similar to get highest bit, it would turn an 001010 into an 001111 so basically the highest bit and all below. ++ We then invert this, so we'd have 110000 and compare that to the "main" chunk. ++ This is because the bug only appears when the current chunks lightmaps are higher than those of the neighbors, thus we can omit sending neighbors which are lower than the current chunks lights. ++ ++ so TLDR is that getCeilingLightMask returns a light mask with all bits set below the highest affected section. We could also count the number of leading zeros and invert them, somehow. ++ @TODO: Implement Leafs suggestion ++ either use Integer#numberOfLeadingZeros or document what this bithack is supposed to be doing then ++ */ ++ mask |= mask >> 1; ++ mask |= mask >> 2; ++ mask |= mask >> 4; ++ mask |= mask >> 8; ++ mask |= mask >> 16; ++ ++ return mask; ++ } ++ // Paper end ++ ++ public final void sendChunk(EntityPlayer entityplayer, Packet[] apacket, Chunk chunk) { this.a(entityplayer, apacket, chunk); } // Paper - OBFHELPER private void a(EntityPlayer entityplayer, Packet[] apacket, Chunk chunk) { if (apacket[0] == null) { apacket[0] = new PacketPlayOutMapChunk(chunk, 65535, chunk.world.chunkPacketBlockController.shouldModify(entityplayer, chunk, 65535)); // Paper - Anti-Xray - Bypass @@ -577,6 +624,19 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +@@ -0,0 +0,0 @@ import net.minecraft.core.IRegistry; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.level.ChunkProviderServer; ++import net.minecraft.network.protocol.Packet; ++import net.minecraft.server.level.ChunkTaskQueueSorter; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.PlayerChunk; ++import net.minecraft.server.level.PlayerChunkMap; ++import net.minecraft.server.level.TicketType; + import net.minecraft.server.level.WorldServer; + import net.minecraft.util.EntitySlice; + import net.minecraft.util.MathHelper; @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { } @@ -642,6 +702,14 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -0,0 +0,0 @@ import net.minecraft.network.protocol.game.PacketPlayOutWorldEvent; + import net.minecraft.resources.MinecraftKey; + import net.minecraft.server.level.ChunkMapDistance; + import net.minecraft.server.level.PlayerChunk; ++import net.minecraft.server.level.PlayerChunkMap; + import net.minecraft.server.level.Ticket; + import net.minecraft.server.level.TicketType; + import net.minecraft.server.level.WorldServer; @@ -0,0 +0,0 @@ public class CraftWorld implements World { // Spigot start @Override @@ -657,7 +725,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (viewDistance < 2 || viewDistance > 32) { + throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]"); + } -+ net.minecraft.server.PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap; ++ PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap; + if (viewDistance != chunkMap.getEffectiveViewDistance()) { + chunkMap.setViewDistance(viewDistance); + } @@ -673,7 +741,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if ((viewDistance < 2 || viewDistance > 32) && viewDistance != -1) { + throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]"); + } -+ net.minecraft.server.PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap; ++ PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap; + if (viewDistance != chunkMap.getRawNoTickViewDistance()) { + chunkMap.setNoTickViewDistance(viewDistance); + } @@ -687,12 +755,20 @@ diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java +@@ -0,0 +0,0 @@ package org.spigotmc; + + import java.util.Collection; + import net.minecraft.server.MinecraftServer; ++import net.minecraft.server.level.WorldServer; + import net.minecraft.util.MathHelper; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityCreature; @@ -0,0 +0,0 @@ public class ActivationRange maxRange = Math.max( maxRange, waterActivationRange ); maxRange = Math.max( maxRange, villagerActivationRange ); // Paper end - maxRange = Math.min( ( world.spigotConfig.viewDistance << 4 ) - 8, maxRange ); -+ maxRange = Math.min( ( ((net.minecraft.server.WorldServer)world).getChunkProvider().playerChunkMap.getEffectiveViewDistance() << 4 ) - 8, maxRange ); // Paper - no-tick view distance ++ maxRange = Math.min( ( ((WorldServer)world).getChunkProvider().playerChunkMap.getEffectiveViewDistance() << 4 ) - 8, maxRange ); // Paper - no-tick view distance for ( EntityHuman player : world.getPlayers() ) { diff --git a/Spigot-Server-Patches/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/Spigot-Server-Patches/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch index b6d1534aa89..09abcba5dfc 100644 --- a/Spigot-Server-Patches/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch +++ b/Spigot-Server-Patches/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch @@ -55,6 +55,14 @@ diff --git a/src/main/java/net/minecraft/world/level/block/BlockPlant.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/BlockPlant.java +++ b/src/main/java/net/minecraft/world/level/block/BlockPlant.java +@@ -0,0 +0,0 @@ package net.minecraft.world.level.block; + + import net.minecraft.core.BlockPosition; + import net.minecraft.core.EnumDirection; ++import net.minecraft.server.level.WorldServer; + import net.minecraft.world.level.GeneratorAccess; + import net.minecraft.world.level.IBlockAccess; + import net.minecraft.world.level.IWorldReader; @@ -0,0 +0,0 @@ public class BlockPlant extends Block { public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { // CraftBukkit start @@ -68,6 +76,14 @@ diff --git a/src/main/java/net/minecraft/world/level/block/BlockTallPlant.java b index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/BlockTallPlant.java +++ b/src/main/java/net/minecraft/world/level/block/BlockTallPlant.java +@@ -0,0 +0,0 @@ package net.minecraft.world.level.block; + import javax.annotation.Nullable; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.EnumDirection; ++import net.minecraft.server.level.WorldServer; + import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemStack; @@ -0,0 +0,0 @@ public class BlockTallPlant extends BlockPlant { protected static void b(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) { diff --git a/Spigot-Server-Patches/Optimise-TickListServer-by-rewriting-it.patch b/Spigot-Server-Patches/Optimise-TickListServer-by-rewriting-it.patch index e6b47258757..490d3eac810 100644 --- a/Spigot-Server-Patches/Optimise-TickListServer-by-rewriting-it.patch +++ b/Spigot-Server-Patches/Optimise-TickListServer-by-rewriting-it.patch @@ -1075,6 +1075,14 @@ diff --git a/src/main/java/net/minecraft/world/level/TickListChunk.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/TickListChunk.java +++ b/src/main/java/net/minecraft/world/level/TickListChunk.java +@@ -0,0 +0,0 @@ import net.minecraft.core.BlockPosition; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.nbt.NBTTagList; + import net.minecraft.resources.MinecraftKey; ++import net.minecraft.server.MinecraftServer; + + public class TickListChunk implements TickList { + @@ -0,0 +0,0 @@ public class TickListChunk implements TickList { return nbttaglist; } diff --git a/Spigot-Server-Patches/Optimise-random-block-ticking.patch b/Spigot-Server-Patches/Optimise-random-block-ticking.patch index da28faa3762..d6ca4bae21f 100644 --- a/Spigot-Server-Patches/Optimise-random-block-ticking.patch +++ b/Spigot-Server-Patches/Optimise-random-block-ticking.patch @@ -251,7 +251,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + @FunctionalInterface -+ static interface DataBitConsumer { ++ public static interface DataBitConsumer { + + void accept(int location, int data); + diff --git a/Spigot-Server-Patches/Optimize-Collision-to-not-load-chunks.patch b/Spigot-Server-Patches/Optimize-Collision-to-not-load-chunks.patch index 470762f973a..8f50c1b412d 100644 --- a/Spigot-Server-Patches/Optimize-Collision-to-not-load-chunks.patch +++ b/Spigot-Server-Patches/Optimize-Collision-to-not-load-chunks.patch @@ -71,6 +71,16 @@ diff --git a/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java +++ b/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java +@@ -0,0 +0,0 @@ import java.util.function.Consumer; + import javax.annotation.Nullable; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.CursorPosition; ++import net.minecraft.server.MCUtil; ++import net.minecraft.server.level.EntityPlayer; ++import net.minecraft.server.level.RegionLimitedWorldAccess; + import net.minecraft.util.MathHelper; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.level.block.Blocks; @@ -0,0 +0,0 @@ import net.minecraft.world.phys.shapes.VoxelShapes; public class VoxelShapeSpliterator extends AbstractSpliterator { diff --git a/Spigot-Server-Patches/Optimize-Hoppers.patch b/Spigot-Server-Patches/Optimize-Hoppers.patch index 5c43c83e140..cb232f1e138 100644 --- a/Spigot-Server-Patches/Optimize-Hoppers.patch +++ b/Spigot-Server-Patches/Optimize-Hoppers.patch @@ -34,6 +34,14 @@ diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -0,0 +0,0 @@ import net.minecraft.world.level.WorldSettings; + import net.minecraft.world.level.biome.BiomeManager; + import net.minecraft.world.level.biome.WorldChunkManager; + import net.minecraft.world.level.block.Block; ++import net.minecraft.world.level.block.entity.TileEntityHopper; + import net.minecraft.world.level.border.IWorldBorderListener; + import net.minecraft.world.level.border.WorldBorder; + import net.minecraft.world.level.chunk.ChunkGenerator; @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant> { @@ -0,0 +0,0 @@ public abstract class LightEngineStorageArray chunks = world.getChunkProvider().playerChunkMap.visibleChunks; -+ return chunks.values().stream().map(PlayerChunk::getFullChunk).filter(Objects::nonNull).map(net.minecraft.server.Chunk::getBukkitChunk).toArray(Chunk[]::new); ++ return chunks.values().stream().map(PlayerChunk::getFullChunk).filter(Objects::nonNull).map(net.minecraft.world.level.chunk.Chunk::getBukkitChunk).toArray(Chunk[]::new); + } + } + // Paper end diff --git a/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch b/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch index 5c06b25083a..5013cc7ac59 100644 --- a/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch +++ b/Spigot-Server-Patches/Optimize-TileEntity-Ticking.patch @@ -47,6 +47,14 @@ diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityChes index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java +++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java +@@ -0,0 +0,0 @@ import net.minecraft.core.NonNullList; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.chat.ChatMessage; + import net.minecraft.network.chat.IChatBaseComponent; ++import net.minecraft.server.MCUtil; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; @@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.entity.HumanEntity; // CraftBukkit end @@ -133,7 +141,12 @@ diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnde index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnderChest.java +++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnderChest.java -@@ -0,0 +0,0 @@ import net.minecraft.sounds.SoundEffects; +@@ -0,0 +0,0 @@ + package net.minecraft.world.level.block.entity; + ++import net.minecraft.server.MCUtil; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffects; import net.minecraft.world.entity.player.EntityHuman; import net.minecraft.world.level.block.Blocks; diff --git a/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch b/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch index cf5ef2e2a7a..79ce6211936 100644 --- a/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch +++ b/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch @@ -39,6 +39,14 @@ diff --git a/src/main/java/net/minecraft/server/players/UserCache.java b/src/mai index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/players/UserCache.java +++ b/src/main/java/net/minecraft/server/players/UserCache.java +@@ -0,0 +0,0 @@ import java.util.concurrent.atomic.AtomicLong; + import java.util.concurrent.atomic.AtomicReference; + import java.util.stream.Stream; + import javax.annotation.Nullable; ++import net.minecraft.server.MCUtil; + import net.minecraft.world.entity.player.EntityHuman; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; @@ -0,0 +0,0 @@ public class UserCache { return UserCache.b; } diff --git a/Spigot-Server-Patches/Optional-TNT-doesn-t-move-in-water.patch b/Spigot-Server-Patches/Optional-TNT-doesn-t-move-in-water.patch index 48221235e31..09689e1db1e 100644 --- a/Spigot-Server-Patches/Optional-TNT-doesn-t-move-in-water.patch +++ b/Spigot-Server-Patches/Optional-TNT-doesn-t-move-in-water.patch @@ -64,6 +64,21 @@ diff --git a/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/world/entity/item/EntityTNTPrimed.java +@@ -0,0 +0,0 @@ import javax.annotation.Nullable; + import net.minecraft.core.particles.Particles; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.protocol.Packet; ++import net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport; ++import net.minecraft.network.protocol.game.PacketPlayOutEntityVelocity; + import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.level.PlayerChunkMap; ++import net.minecraft.server.level.WorldServer; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.EntityPose; @@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity { this.world.addParticle(Particles.SMOKE, this.locX(), this.locY() + 0.5D, this.locZ(), 0.0D, 0.0D, 0.0D); } diff --git a/Spigot-Server-Patches/Pillager-patrol-spawn-settings-and-per-player-option.patch b/Spigot-Server-Patches/Pillager-patrol-spawn-settings-and-per-player-option.patch index 27171e38abe..36bcdaeed74 100644 --- a/Spigot-Server-Patches/Pillager-patrol-spawn-settings-and-per-player-option.patch +++ b/Spigot-Server-Patches/Pillager-patrol-spawn-settings-and-per-player-option.patch @@ -63,6 +63,16 @@ diff --git a/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPatrol.j index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPatrol.java +++ b/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPatrol.java +@@ -0,0 +0,0 @@ package net.minecraft.world.level.levelgen; + import java.util.Random; + import net.minecraft.core.BlockPosition; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; ++import net.minecraft.stats.StatisticList; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMobSpawn; + import net.minecraft.world.entity.GroupDataEntity; @@ -0,0 +0,0 @@ import net.minecraft.world.level.block.state.IBlockData; public class MobSpawnerPatrol implements MobSpawner { diff --git a/Spigot-Server-Patches/Player-elytra-boost-API.patch b/Spigot-Server-Patches/Player-elytra-boost-API.patch index ba7bffdc21b..5b5a7579a1a 100644 --- a/Spigot-Server-Patches/Player-elytra-boost-API.patch +++ b/Spigot-Server-Patches/Player-elytra-boost-API.patch @@ -8,6 +8,21 @@ 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.entity.ai.attributes.AttributeMapBase; + import net.minecraft.world.entity.ai.attributes.AttributeModifiable; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.player.EntityHuman; ++import net.minecraft.world.entity.projectile.EntityFireworks; + import net.minecraft.world.inventory.Container; + import net.minecraft.world.item.EnumColor; + import net.minecraft.world.item.enchantment.EnchantmentManager; + import net.minecraft.world.item.enchantment.Enchantments; + import net.minecraft.world.level.ChunkCoordIntPair; + import net.minecraft.world.level.EnumGamemode; ++import net.minecraft.world.level.World; + import net.minecraft.world.level.biome.BiomeManager; + import net.minecraft.world.level.block.entity.TileEntitySign; + import net.minecraft.world.level.saveddata.maps.MapIcon; @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } throw new RuntimeException("Unknown settings type"); @@ -19,9 +34,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + Validate.isTrue(firework != null, "firework == null"); + Validate.isTrue(firework.getType() == Material.FIREWORK_ROCKET, "Firework must be Material.FIREWORK_ROCKET"); + -+ net.minecraft.server.ItemStack item = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(firework); -+ net.minecraft.server.World world = ((CraftWorld) getWorld()).getHandle(); -+ net.minecraft.server.EntityFireworks entity = new net.minecraft.server.EntityFireworks(world, item, getHandle()); ++ net.minecraft.world.item.ItemStack item = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(firework); ++ World world = ((CraftWorld) getWorld()).getHandle(); ++ EntityFireworks entity = new EntityFireworks(world, item, getHandle()); + return world.addEntity(entity) + ? (org.bukkit.entity.Firework) entity.getBukkitEntity() + : null; diff --git a/Spigot-Server-Patches/Player.setPlayerProfile-API.patch b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch index 2334f176ea0..c9c2661e70c 100644 --- a/Spigot-Server-Patches/Player.setPlayerProfile-API.patch +++ b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch @@ -51,6 +51,14 @@ 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.EnumColor; + import net.minecraft.world.item.enchantment.EnchantmentManager; + import net.minecraft.world.item.enchantment.Enchantments; + import net.minecraft.world.level.EnumGamemode; ++import net.minecraft.world.level.biome.BiomeManager; + import net.minecraft.world.level.block.entity.TileEntitySign; + import net.minecraft.world.level.saveddata.maps.MapIcon; + import net.minecraft.world.phys.Vec3D; @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { hiddenPlayers.put(player.getUniqueId(), hidingPlugins); @@ -118,7 +126,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + //Respawn the player then update their position and selected slot + WorldServer worldserver = handle.getWorldServer(); -+ connection.sendPacket(new net.minecraft.network.protocol.game.PacketPlayOutRespawn(worldserver.getDimensionManager(), worldserver.getDimensionKey(), net.minecraft.server.BiomeManager.a(worldserver.getSeed()), handle.playerInteractManager.getGameMode(), handle.playerInteractManager.c(), worldserver.isDebugWorld(), worldserver.isFlatWorld(), true)); ++ connection.sendPacket(new net.minecraft.network.protocol.game.PacketPlayOutRespawn(worldserver.getDimensionManager(), worldserver.getDimensionKey(), BiomeManager.a(worldserver.getSeed()), handle.playerInteractManager.getGameMode(), handle.playerInteractManager.c(), worldserver.isDebugWorld(), worldserver.isFlatWorld(), true)); + handle.updateAbilities(); + connection.sendPacket(new net.minecraft.network.protocol.game.PacketPlayOutPosition(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), new HashSet<>(), 0)); + net.minecraft.server.MinecraftServer.getServer().getPlayerList().updateClient(handle); diff --git a/Spigot-Server-Patches/PlayerLaunchProjectileEvent.patch b/Spigot-Server-Patches/PlayerLaunchProjectileEvent.patch index 2e589194366..9148d213c77 100644 --- a/Spigot-Server-Patches/PlayerLaunchProjectileEvent.patch +++ b/Spigot-Server-Patches/PlayerLaunchProjectileEvent.patch @@ -116,6 +116,20 @@ diff --git a/src/main/java/net/minecraft/world/item/ItemExpBottle.java b/src/mai index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/ItemExpBottle.java +++ b/src/main/java/net/minecraft/world/item/ItemExpBottle.java +@@ -0,0 +0,0 @@ + package net.minecraft.world.item; + ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.stats.StatisticList; + import net.minecraft.world.EnumHand; ++import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.InteractionResultWrapper; ++import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.entity.projectile.EntityThrownExpBottle; + import net.minecraft.world.level.World; @@ -0,0 +0,0 @@ public class ItemExpBottle extends Item { public InteractionResultWrapper a(World world, EntityHuman entityhuman, EnumHand enumhand) { ItemStack itemstack = entityhuman.b(enumhand); @@ -161,6 +175,14 @@ diff --git a/src/main/java/net/minecraft/world/item/ItemFireworks.java b/src/mai index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/ItemFireworks.java +++ b/src/main/java/net/minecraft/world/item/ItemFireworks.java +@@ -0,0 +0,0 @@ package net.minecraft.world.item; + import java.util.Arrays; + import java.util.Comparator; + import net.minecraft.core.EnumDirection; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.world.EnumHand; + import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.InteractionResultWrapper; @@ -0,0 +0,0 @@ public class ItemFireworks extends Item { EntityFireworks entityfireworks = new EntityFireworks(world, itemactioncontext.getEntity(), vec3d.x + (double) enumdirection.getAdjacentX() * 0.15D, vec3d.y + (double) enumdirection.getAdjacentY() * 0.15D, vec3d.z + (double) enumdirection.getAdjacentZ() * 0.15D, itemstack); entityfireworks.spawningEntity = itemactioncontext.getEntity().getUniqueID(); // Paper @@ -180,6 +202,14 @@ diff --git a/src/main/java/net/minecraft/world/item/ItemLingeringPotion.java b/s index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/ItemLingeringPotion.java +++ b/src/main/java/net/minecraft/world/item/ItemLingeringPotion.java +@@ -0,0 +0,0 @@ package net.minecraft.world.item; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.world.EnumHand; ++import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.InteractionResultWrapper; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.level.World; @@ -0,0 +0,0 @@ public class ItemLingeringPotion extends ItemPotionThrowable { @Override @@ -199,6 +229,16 @@ diff --git a/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java b/s index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java +++ b/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java +@@ -0,0 +0,0 @@ + package net.minecraft.world.item; + ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.stats.StatisticList; + import net.minecraft.world.EnumHand; ++import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.InteractionResultWrapper; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.entity.projectile.EntityPotion; @@ -0,0 +0,0 @@ public class ItemPotionThrowable extends ItemPotion { entitypotion.setItem(itemstack); @@ -265,6 +305,14 @@ diff --git a/src/main/java/net/minecraft/world/item/ItemSplashPotion.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/ItemSplashPotion.java +++ b/src/main/java/net/minecraft/world/item/ItemSplashPotion.java +@@ -0,0 +0,0 @@ package net.minecraft.world.item; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.world.EnumHand; ++import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.InteractionResultWrapper; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.level.World; @@ -0,0 +0,0 @@ public class ItemSplashPotion extends ItemPotionThrowable { @Override diff --git a/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch b/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch index d5411bf47b1..c40dd0dde52 100644 --- a/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch +++ b/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch @@ -9,6 +9,14 @@ diff --git a/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java b index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java +@@ -0,0 +0,0 @@ import net.minecraft.core.BlockPosition; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.protocol.Packet; + import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntityExperienceOrb; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.tags.Tag; + import net.minecraft.tags.TagsFluid; @@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity { @Override public void pickup(EntityHuman entityhuman) { diff --git a/Spigot-Server-Patches/PlayerTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/PlayerTeleportEndGatewayEvent.patch index 2a4a0e5aca5..e7ac1cca424 100644 --- a/Spigot-Server-Patches/PlayerTeleportEndGatewayEvent.patch +++ b/Spigot-Server-Patches/PlayerTeleportEndGatewayEvent.patch @@ -9,6 +9,14 @@ diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndG index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java +++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java +@@ -0,0 +0,0 @@ import net.minecraft.data.worldgen.BiomeDecoratorGroups; + import net.minecraft.nbt.GameProfileSerializer; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.protocol.game.PacketPlayOutTileEntityData; ++import net.minecraft.server.MCUtil; + import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.util.MathHelper; @@ -0,0 +0,0 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick location.setPitch(player.getLocation().getPitch()); location.setYaw(player.getLocation().getYaw()); diff --git a/Spigot-Server-Patches/Potential-bed-API.patch b/Spigot-Server-Patches/Potential-bed-API.patch index e99bfb9b92f..efbe6e21136 100644 --- a/Spigot-Server-Patches/Potential-bed-API.patch +++ b/Spigot-Server-Patches/Potential-bed-API.patch @@ -11,6 +11,14 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +@@ -0,0 +0,0 @@ import net.minecraft.network.chat.IChatBaseComponent; + import net.minecraft.network.protocol.game.PacketPlayInCloseWindow; + import net.minecraft.network.protocol.game.PacketPlayOutOpenWindow; + import net.minecraft.server.level.EntityPlayer; ++import net.minecraft.server.level.WorldServer; + import net.minecraft.world.ITileInventory; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityTypes; @@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { return getHandle().sleepTicks; } @@ -24,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return null; + } + -+ net.minecraft.server.WorldServer worldServer = handle.server.getWorldServer(handle.getSpawnDimension()); ++ WorldServer worldServer = handle.server.getWorldServer(handle.getSpawnDimension()); + if (worldServer == null) { + return null; + } diff --git a/Spigot-Server-Patches/PreCreatureSpawnEvent.patch b/Spigot-Server-Patches/PreCreatureSpawnEvent.patch index a9374a7baac..232861a26b6 100644 --- a/Spigot-Server-Patches/PreCreatureSpawnEvent.patch +++ b/Spigot-Server-Patches/PreCreatureSpawnEvent.patch @@ -72,6 +72,14 @@ diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +@@ -0,0 +0,0 @@ import net.minecraft.network.protocol.game.PacketDebug; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.MCUtil; + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; @@ -0,0 +0,0 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation BlockPosition blockposition1 = this.a(blockposition, d0, d1); @@ -98,6 +106,14 @@ diff --git a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java b/s index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java +@@ -0,0 +0,0 @@ import net.minecraft.core.particles.Particles; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.nbt.NBTTagList; + import net.minecraft.resources.MinecraftKey; ++import net.minecraft.server.MCUtil; + import net.minecraft.server.level.WorldServer; + import net.minecraft.util.UtilColor; + import net.minecraft.util.WeightedRandom; @@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract { WorldServer worldserver = (WorldServer) world; @@ -130,6 +146,14 @@ diff --git a/src/main/java/net/minecraft/world/level/SpawnerCreature.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/SpawnerCreature.java +++ b/src/main/java/net/minecraft/world/level/SpawnerCreature.java +@@ -0,0 +0,0 @@ import net.minecraft.core.EnumDirection; + import net.minecraft.core.IPosition; + import net.minecraft.core.IRegistry; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.MCUtil; + import net.minecraft.server.level.WorldServer; + import net.minecraft.tags.Tag; + import net.minecraft.tags.TagsBlock; @@ -0,0 +0,0 @@ public final class SpawnerCreature { j1 = biomesettingsmobs_c.d + worldserver.random.nextInt(1 + biomesettingsmobs_c.e - biomesettingsmobs_c.d); } diff --git a/Spigot-Server-Patches/Prevent-Mob-AI-Rules-from-Loading-Chunks.patch b/Spigot-Server-Patches/Prevent-Mob-AI-Rules-from-Loading-Chunks.patch index 1d5a25f9d3d..cef8ca71cb7 100644 --- a/Spigot-Server-Patches/Prevent-Mob-AI-Rules-from-Loading-Chunks.patch +++ b/Spigot-Server-Patches/Prevent-Mob-AI-Rules-from-Loading-Chunks.patch @@ -55,6 +55,14 @@ diff --git a/src/main/java/net/minecraft/world/entity/ai/util/RandomPositionGene index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/ai/util/RandomPositionGenerator.java +++ b/src/main/java/net/minecraft/world/entity/ai/util/RandomPositionGenerator.java +@@ -0,0 +0,0 @@ import net.minecraft.util.MathHelper; + import net.minecraft.world.entity.EntityCreature; + import net.minecraft.world.entity.ai.navigation.NavigationAbstract; + import net.minecraft.world.level.IBlockAccess; ++import net.minecraft.world.level.material.Fluid; + import net.minecraft.world.level.pathfinder.PathType; + import net.minecraft.world.level.pathfinder.PathfinderNormal; + import net.minecraft.world.phys.Vec3D; @@ -0,0 +0,0 @@ public class RandomPositionGenerator { } diff --git a/Spigot-Server-Patches/Prevent-Saving-Bad-entities-to-chunks.patch b/Spigot-Server-Patches/Prevent-Saving-Bad-entities-to-chunks.patch index d54f129f34c..c710a657227 100644 --- a/Spigot-Server-Patches/Prevent-Saving-Bad-entities-to-chunks.patch +++ b/Spigot-Server-Patches/Prevent-Saving-Bad-entities-to-chunks.patch @@ -59,6 +59,14 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLo index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java +@@ -0,0 +0,0 @@ import net.minecraft.nbt.NBTTagList; + import net.minecraft.nbt.NBTTagLongArray; + import net.minecraft.nbt.NBTTagShort; + import net.minecraft.server.level.ChunkProviderServer; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.LightEngineThreaded; + import net.minecraft.server.level.WorldServer; + import net.minecraft.world.entity.Entity; @@ -0,0 +0,0 @@ public class ChunkRegionLoader { nbttagcompound1.set("TileEntities", nbttaglist1); NBTTagList nbttaglist2 = new NBTTagList(); diff --git a/Spigot-Server-Patches/Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-Server-Patches/Provide-E-TE-Chunk-count-stat-methods.patch index ad0cf1e1124..772ef6cfe3f 100644 --- a/Spigot-Server-Patches/Provide-E-TE-Chunk-count-stat-methods.patch +++ b/Spigot-Server-Patches/Provide-E-TE-Chunk-count-stat-methods.patch @@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - Provide fast information methods + public int getEntityCount() { + int ret = 0; -+ for (net.minecraft.server.Entity entity : world.entitiesById.values()) { ++ for (net.minecraft.world.entity.Entity entity : world.entitiesById.values()) { + if (entity.isChunkLoaded()) { + ++ret; + } @@ -28,8 +28,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // We don't use the full world tile entity list, so we must iterate chunks + Long2ObjectLinkedOpenHashMap chunks = world.getChunkProvider().playerChunkMap.visibleChunks; + int size = 0; -+ for (net.minecraft.server.PlayerChunk playerchunk : chunks.values()) { -+ net.minecraft.server.Chunk chunk = playerchunk.getChunk(); ++ for (PlayerChunk playerchunk : chunks.values()) { ++ net.minecraft.world.level.chunk.Chunk chunk = playerchunk.getChunk(); + if (chunk == null) { + continue; + } diff --git a/Spigot-Server-Patches/Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/Spigot-Server-Patches/Reduce-allocation-of-Vec3D-by-entity-tracker.patch index 1301da88018..fb60d2b8f93 100644 --- a/Spigot-Server-Patches/Reduce-allocation-of-Vec3D-by-entity-tracker.patch +++ b/Spigot-Server-Patches/Reduce-allocation-of-Vec3D-by-entity-tracker.patch @@ -42,7 +42,7 @@ diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java -@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -0,0 +0,0 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially public void updatePlayer(EntityPlayer entityplayer) { org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot if (entityplayer != this.tracker) { diff --git a/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch b/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch index b5c68d59eb2..714ebcd9612 100644 --- a/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch +++ b/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch @@ -8,6 +8,18 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +@@ -0,0 +0,0 @@ import net.minecraft.world.level.TickListChunk; + import net.minecraft.world.level.TickListEmpty; + import net.minecraft.world.level.World; + import net.minecraft.world.level.block.Block; ++import net.minecraft.world.level.block.BlockMobSpawner; + import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.level.block.ITileEntity; + import net.minecraft.world.level.block.entity.TileEntity; ++import net.minecraft.world.level.block.entity.TileEntityMobSpawner; + import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.level.levelgen.ChunkProviderDebug; + import net.minecraft.world.level.levelgen.HeightMap; @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { } diff --git a/Spigot-Server-Patches/Remove-some-streams-from-structures.patch b/Spigot-Server-Patches/Remove-some-streams-from-structures.patch index 26ea65bd35c..5b1d1c58c32 100644 --- a/Spigot-Server-Patches/Remove-some-streams-from-structures.patch +++ b/Spigot-Server-Patches/Remove-some-streams-from-structures.patch @@ -112,6 +112,14 @@ diff --git a/src/main/java/net/minecraft/world/level/levelgen/ChunkGeneratorAbst index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java +++ b/src/main/java/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java +@@ -0,0 +0,0 @@ import net.minecraft.world.level.levelgen.feature.structures.WorldGenFeatureDefi + import net.minecraft.world.level.levelgen.feature.structures.WorldGenFeatureDefinedStructurePoolTemplate; + import net.minecraft.world.level.levelgen.structure.StructureBoundingBox; + import net.minecraft.world.level.levelgen.structure.StructurePiece; ++import net.minecraft.world.level.levelgen.structure.StructureStart; + import net.minecraft.world.level.levelgen.structure.WorldGenFeaturePillagerOutpostPoolPiece; + import net.minecraft.world.level.levelgen.synth.NoiseGenerator; + import net.minecraft.world.level.levelgen.synth.NoiseGenerator3; @@ -0,0 +0,0 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { while (iterator.hasNext()) { StructureGenerator structuregenerator = (StructureGenerator) iterator.next(); diff --git a/Spigot-Server-Patches/Significantly-improve-performance-of-the-end-generat.patch b/Spigot-Server-Patches/Significantly-improve-performance-of-the-end-generat.patch index 7785a84e7d9..eed9579a8e3 100644 --- a/Spigot-Server-Patches/Significantly-improve-performance-of-the-end-generat.patch +++ b/Spigot-Server-Patches/Significantly-improve-performance-of-the-end-generat.patch @@ -23,6 +23,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import java.util.List; import net.minecraft.core.IRegistry; import net.minecraft.resources.RegistryLookupCodec; + import net.minecraft.util.MathHelper; ++import net.minecraft.world.level.ChunkCoordIntPair; + import net.minecraft.world.level.levelgen.SeededRandom; + import net.minecraft.world.level.levelgen.synth.NoiseGenerator3Handler; + @@ -0,0 +0,0 @@ public class WorldChunkManagerTheEnd extends WorldChunkManager { private final BiomeBase k; private final BiomeBase l; diff --git a/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch b/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch index 401300aae50..89889269459 100644 --- a/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch +++ b/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch @@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // Paper start -+ java.lang.ref.WeakReference currentChunk = null; ++ public java.lang.ref.WeakReference currentChunk = null; + + public void setCurrentChunk(net.minecraft.world.level.chunk.Chunk chunk) { + this.currentChunk = chunk != null ? new java.lang.ref.WeakReference<>(chunk) : null; diff --git a/Spigot-Server-Patches/Turtle-API.patch b/Spigot-Server-Patches/Turtle-API.patch index fd53acc390d..a3c1c74ebc4 100644 --- a/Spigot-Server-Patches/Turtle-API.patch +++ b/Spigot-Server-Patches/Turtle-API.patch @@ -21,6 +21,14 @@ diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java b index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java +++ b/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java +@@ -0,0 +0,0 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.MCUtil; + import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundCategory; @@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal { this.datawatcher.set(EntityTurtle.bp, blockposition); } diff --git a/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch index c1426380b15..a13342fd2be 100644 --- a/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch @@ -21,6 +21,14 @@ diff --git a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java +@@ -0,0 +0,0 @@ import java.util.Iterator; + import java.util.UUID; + import javax.annotation.Nullable; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.util.MathHelper; + import net.minecraft.world.entity.Entity; @@ -0,0 +0,0 @@ public abstract class IProjectile extends Entity { protected boolean a(Entity entity) { if (!entity.isSpectator() && entity.isAlive() && entity.isInteractable()) { diff --git a/Spigot-Server-Patches/Workaround-for-Client-Lag-Spikes-MC-162253.patch b/Spigot-Server-Patches/Workaround-for-Client-Lag-Spikes-MC-162253.patch index 0d08522d506..6409f2945f5 100644 --- a/Spigot-Server-Patches/Workaround-for-Client-Lag-Spikes-MC-162253.patch +++ b/Spigot-Server-Patches/Workaround-for-Client-Lag-Spikes-MC-162253.patch @@ -23,52 +23,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import net.minecraft.world.level.chunk.ChunkStatus; import net.minecraft.world.level.chunk.IChunkAccess; import net.minecraft.world.level.chunk.ILightAccess; -@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - - } - -+ // Paper start -+ private static int getLightMask(final Chunk chunk) { -+ final ChunkSection[] chunkSections = chunk.getSections(); -+ int mask = 0; -+ -+ for (int i = 0; i < chunkSections.length; ++i) { -+ /* -+ -+ -+Lightmasks have 18 bits, from the -1 (void) section until the 17th (air) section. -+Sections go from 0..16. Now whenever a section is not empty, it can potentially change lighting for the section itself, the section below and the section above, hence the bitmask 111b, which is 7d. -+ -+ */ -+ mask |= (ChunkSection.isEmpty(chunkSections[i]) ? 0 : 7) << i; -+ } -+ -+ return mask; -+ } -+ -+ private static int getCeilingLightMask(final Chunk chunk) { -+ int mask = getLightMask(chunk); -+ -+ /* -+ It is similar to get highest bit, it would turn an 001010 into an 001111 so basically the highest bit and all below. -+ We then invert this, so we'd have 110000 and compare that to the "main" chunk. -+ This is because the bug only appears when the current chunks lightmaps are higher than those of the neighbors, thus we can omit sending neighbors which are lower than the current chunks lights. -+ -+ so TLDR is that getCeilingLightMask returns a light mask with all bits set below the highest affected section. We could also count the number of leading zeros and invert them, somehow. -+ @TODO: Implement Leafs suggestion -+ either use Integer#numberOfLeadingZeros or document what this bithack is supposed to be doing then -+ */ -+ mask |= mask >> 1; -+ mask |= mask >> 2; -+ mask |= mask >> 4; -+ mask |= mask >> 8; -+ mask |= mask >> 16; -+ -+ return mask; -+ } -+ // Paper end -+ - final void sendChunk(EntityPlayer entityplayer, Packet[] apacket, Chunk chunk) { this.a(entityplayer, apacket, chunk); } // Paper - OBFHELPER +@@ -0,0 +0,0 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially + public final void sendChunk(EntityPlayer entityplayer, Packet[] apacket, Chunk chunk) { this.a(entityplayer, apacket, chunk); } // Paper - OBFHELPER private void a(EntityPlayer entityplayer, Packet[] apacket, Chunk chunk) { if (apacket[0] == null) { + // Paper start - add 8 for light fix workaround diff --git a/Spigot-Server-Patches/added-PlayerNameEntityEvent.patch b/Spigot-Server-Patches/added-PlayerNameEntityEvent.patch index 660601b079e..fa726857e7f 100644 --- a/Spigot-Server-Patches/added-PlayerNameEntityEvent.patch +++ b/Spigot-Server-Patches/added-PlayerNameEntityEvent.patch @@ -8,7 +8,13 @@ diff --git a/src/main/java/net/minecraft/world/item/ItemNameTag.java b/src/main/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/ItemNameTag.java +++ b/src/main/java/net/minecraft/world/item/ItemNameTag.java -@@ -0,0 +0,0 @@ import net.minecraft.world.entity.EntityInsentient; +@@ -0,0 +0,0 @@ + package net.minecraft.world.item; + ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.world.EnumHand; + import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.entity.EntityInsentient; import net.minecraft.world.entity.EntityLiving; import net.minecraft.world.entity.player.EntityHuman; diff --git a/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch b/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch index a833b1736f1..c616567c911 100644 --- a/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch +++ b/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch @@ -674,6 +674,14 @@ diff --git a/src/main/java/net/minecraft/world/level/SpawnerCreature.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/SpawnerCreature.java +++ b/src/main/java/net/minecraft/world/level/SpawnerCreature.java +@@ -0,0 +0,0 @@ import net.minecraft.core.IPosition; + import net.minecraft.core.IRegistry; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.server.MCUtil; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.tags.Tag; + import net.minecraft.tags.TagsBlock; @@ -0,0 +0,0 @@ public final class SpawnerCreature { }); diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh index 597f797c1f9..fb795a84b22 100755 --- a/scripts/importmcdev.sh +++ b/scripts/importmcdev.sh @@ -62,7 +62,7 @@ function importLibrary { files=$(cat "$basedir/Spigot-Server-Patches/"* | grep "+++ b/src/main/java/net/minecraft/" | sort | uniq | sed 's/\+\+\+ b\/src\/main\/java\/net\/minecraft\///g') -nonnms=$(grep -R "new file mode" -B 1 "$basedir/Spigot-Server-Patches/" | grep -v "new file mode" | grep -oE "net\/minecraft\/**\/.*.java" | grep -oE "[A-Za-z]+?.java$" --color=none | sed 's/.java//g') +nonnms=$(grep -R "new file mode" -B 1 "$basedir/Spigot-Server-Patches/" | grep -v "new file mode" | grep -oE "net\/minecraft\/**\/.*.java" | sed -E 's/.*\/net\/minecraft\/(.*)/\1/g') function containsElement { local e for e in "${@:2}"; do @@ -78,12 +78,16 @@ for f in $files; do f="$(echo "$f" | sed 's/.java//g')" if [ ! -f "$decompiledir/$nms/$f.java" ]; then echo "$(color 1 31) ERROR!!! Missing NMS$(color 1 34) $f $(colorend)"; + error=true else import $f fi fi fi done +if [ -n "$error" ]; then + exit 1 +fi ######################################################## ########################################################