diff --git a/build-data/dev-imports.txt b/build-data/dev-imports.txt index 2a6e32ff20..286aeeaaa9 100644 --- a/build-data/dev-imports.txt +++ b/build-data/dev-imports.txt @@ -9,4 +9,3 @@ # minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter # minecraft net/minecraft/world/level/entity/LevelEntityGetter.java -minecraft net.minecraft.WorldVersion diff --git a/patches/unapplied/server/API-to-get-a-BlockState-without-a-snapshot.patch b/patches/server/API-to-get-a-BlockState-without-a-snapshot.patch similarity index 100% rename from patches/unapplied/server/API-to-get-a-BlockState-without-a-snapshot.patch rename to patches/server/API-to-get-a-BlockState-without-a-snapshot.patch diff --git a/patches/unapplied/server/Ability-to-apply-mending-to-XP-API.patch b/patches/server/Ability-to-apply-mending-to-XP-API.patch similarity index 100% rename from patches/unapplied/server/Ability-to-apply-mending-to-XP-API.patch rename to patches/server/Ability-to-apply-mending-to-XP-API.patch diff --git a/patches/unapplied/server/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch b/patches/server/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch similarity index 100% rename from patches/unapplied/server/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch rename to patches/server/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch diff --git a/patches/unapplied/server/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch b/patches/server/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch similarity index 100% rename from patches/unapplied/server/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch rename to patches/server/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch diff --git a/patches/unapplied/server/Add-ArmorStand-Item-Meta.patch b/patches/server/Add-ArmorStand-Item-Meta.patch similarity index 100% rename from patches/unapplied/server/Add-ArmorStand-Item-Meta.patch rename to patches/server/Add-ArmorStand-Item-Meta.patch diff --git a/patches/unapplied/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/patches/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch similarity index 100% rename from patches/unapplied/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch rename to patches/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch diff --git a/patches/unapplied/server/Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/Add-Early-Warning-Feature-to-WatchDog.patch similarity index 99% rename from patches/unapplied/server/Add-Early-Warning-Feature-to-WatchDog.patch rename to patches/server/Add-Early-Warning-Feature-to-WatchDog.patch index f9533d8250..3ab1e65665 100644 --- a/patches/unapplied/server/Add-Early-Warning-Feature-to-WatchDog.patch +++ b/patches/server/Add-Early-Warning-Feature-to-WatchDog.patch @@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0.0D) { this.hasImpulse = true; -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { Vec3 vec3d1 = (new Vec3(x, 0.0D, z)).normalize().scale(strength); this.setDeltaMovement(vec3d.x / 2.0D - vec3d1.x, this.onGround ? Math.min(0.4D, vec3d.y / 2.0D + strength) : vec3d.y, vec3d.z / 2.0D - vec3d1.z); @@ -86,7 +86,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { if (flag) { if (f1 > 0.0F && target instanceof LivingEntity) { @@ -102,7 +102,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class RamTarget extends Behavior { float f = 0.25F * (float)(i - j); float g = Mth.clamp(entity.getSpeed() * 1.65F, 0.2F, 3.0F) + f; - float h = livingEntity.isDamageSourceBlocked(DamageSource.mobAttack(entity)) ? 0.5F : 1.0F; + float h = livingEntity.isDamageSourceBlocked(world.damageSources().mobAttack(entity)) ? 0.5F : 1.0F; - livingEntity.knockback((double)(h * g) * this.getKnockbackForce.applyAsDouble(entity), this.ramDirection.x(), this.ramDirection.z()); + livingEntity.knockback((double)(h * g) * this.getKnockbackForce.applyAsDouble(entity), this.ramDirection.x(), this.ramDirection.z(), entity); // Paper this.finishRam(world, entity); @@ -113,7 +113,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/warden/SonicBoom.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/warden/SonicBoom.java @@ -0,0 +0,0 @@ public class SonicBoom extends Behavior { - target.hurt(DamageSource.sonicBoom(entity), 10.0F); + target.hurt(world.damageSources().sonicBoom(entity), 10.0F); double d = 0.5D * (1.0D - target.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE)); double e = 2.5D * (1.0D - target.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE)); - target.push(vec33.x() * e, vec33.y() * d, vec33.z() * e); @@ -132,7 +132,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - entity.push(d2 / d4 * 4.0D, 0.20000000298023224D, d3 / d4 * 4.0D); + entity.push(d2 / d4 * 4.0D, 0.20000000298023224D, d3 / d4 * 4.0D, this); // Paper if (!this.phaseManager.getCurrentPhase().isSitting() && ((LivingEntity) entity).getLastHurtByMobTimestamp() < entity.tickCount - 2) { - entity.hurt(DamageSource.mobAttack(this), 5.0F); + entity.hurt(this.damageSources().mobAttack(this), 5.0F); this.doEnchantDamageEffects(this, entity); diff --git a/src/main/java/net/minecraft/world/entity/monster/Ravager.java b/src/main/java/net/minecraft/world/entity/monster/Ravager.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -179,9 +179,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) { // CraftBukkit start - Only apply knockback if the damage hits - if (entityliving.hurt(DamageSource.playerAttack(this).sweep(), f4)) { + if (entityliving.hurt(this.damageSources().playerAttack(this).sweep(), f4)) { - entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F))); -+ entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this); // Paper ++ entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this); // Pa } // CraftBukkit end } diff --git a/patches/unapplied/server/Implement-EntityTeleportEndGatewayEvent.patch b/patches/server/Implement-EntityTeleportEndGatewayEvent.patch similarity index 100% rename from patches/unapplied/server/Implement-EntityTeleportEndGatewayEvent.patch rename to patches/server/Implement-EntityTeleportEndGatewayEvent.patch diff --git a/patches/unapplied/server/Implement-Expanded-ArmorStand-API.patch b/patches/server/Implement-Expanded-ArmorStand-API.patch similarity index 100% rename from patches/unapplied/server/Implement-Expanded-ArmorStand-API.patch rename to patches/server/Implement-Expanded-ArmorStand-API.patch diff --git a/patches/unapplied/server/Implement-World.getEntity-UUID-API.patch b/patches/server/Implement-World.getEntity-UUID-API.patch similarity index 100% rename from patches/unapplied/server/Implement-World.getEntity-UUID-API.patch rename to patches/server/Implement-World.getEntity-UUID-API.patch diff --git a/patches/unapplied/server/Implement-extended-PaperServerListPingEvent.patch b/patches/server/Implement-extended-PaperServerListPingEvent.patch similarity index 78% rename from patches/unapplied/server/Implement-extended-PaperServerListPingEvent.patch rename to patches/server/Implement-extended-PaperServerListPingEvent.patch index 5395001ac2..f0380287c7 100644 --- a/patches/unapplied/server/Implement-extended-PaperServerListPingEvent.patch +++ b/patches/server/Implement-extended-PaperServerListPingEvent.patch @@ -174,27 +174,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + +} -diff --git a/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java b/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java -+++ b/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java -@@ -0,0 +0,0 @@ import net.minecraft.util.GsonHelper; - import net.minecraft.util.LowerCaseEnumTypeAdapterFactory; - - public class ClientboundStatusResponsePacket implements Packet { -- private static final Gson GSON = (new GsonBuilder()).registerTypeAdapter(ServerStatus.Version.class, new ServerStatus.Version.Serializer()).registerTypeAdapter(ServerStatus.Players.class, new ServerStatus.Players.Serializer()).registerTypeAdapter(ServerStatus.class, new ServerStatus.Serializer()).registerTypeHierarchyAdapter(Component.class, new Component.Serializer()).registerTypeHierarchyAdapter(Style.class, new Style.Serializer()).registerTypeAdapterFactory(new LowerCaseEnumTypeAdapterFactory()).create(); -+ private static final Gson GSON = (new GsonBuilder()).registerTypeAdapter(ServerStatus.Version.class, new ServerStatus.Version.Serializer()).registerTypeAdapter(ServerStatus.Players.class, new ServerStatus.Players.Serializer()).registerTypeAdapter(ServerStatus.class, new ServerStatus.Serializer()).registerTypeHierarchyAdapter(Component.class, new Component.Serializer()).registerTypeHierarchyAdapter(Style.class, new Style.Serializer()).registerTypeAdapterFactory(new LowerCaseEnumTypeAdapterFactory()) -+ .registerTypeAdapter(io.papermc.paper.adventure.AdventureComponent.class, new io.papermc.paper.adventure.AdventureComponent.Serializer()) -+ .create(); - private final ServerStatus status; - - public ClientboundStatusResponsePacket(ServerStatus metadata) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java 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 @@ package net.minecraft.server; - + import com.google.common.base.Preconditions; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; +import co.aikar.timings.Timings; @@ -204,14 +189,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop objectarraylist = new ObjectArrayList(j); + int k = Mth.nextInt(this.random, 0, list.size() - j); - for (int k = 0; k < agameprofile.length; ++k) { diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java @@ -223,8 +208,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - Replace everything + /* // CraftBukkit start - // this.connection.send(new PacketStatusOutServerInfo(this.server.getStatus())); - final Object[] players = this.server.getPlayerList().players.toArray(); + // this.connection.send(new PacketStatusOutServerInfo(this.status)); + MinecraftServer server = MinecraftServer.getServer(); @@ -0,0 +0,0 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene this.connection.send(new ClientboundStatusResponsePacket(ping)); diff --git a/patches/unapplied/server/Improve-BlockPosition-inlining.patch b/patches/server/Improve-BlockPosition-inlining.patch similarity index 100% rename from patches/unapplied/server/Improve-BlockPosition-inlining.patch rename to patches/server/Improve-BlockPosition-inlining.patch diff --git a/patches/unapplied/server/Improve-EntityShootBowEvent.patch b/patches/server/Improve-EntityShootBowEvent.patch similarity index 100% rename from patches/unapplied/server/Improve-EntityShootBowEvent.patch rename to patches/server/Improve-EntityShootBowEvent.patch diff --git a/patches/unapplied/server/Improve-Log4J-Configuration-Plugin-Loggers.patch b/patches/server/Improve-Log4J-Configuration-Plugin-Loggers.patch similarity index 100% rename from patches/unapplied/server/Improve-Log4J-Configuration-Plugin-Loggers.patch rename to patches/server/Improve-Log4J-Configuration-Plugin-Loggers.patch diff --git a/patches/unapplied/server/Improved-Async-Task-Scheduler.patch b/patches/server/Improved-Async-Task-Scheduler.patch similarity index 100% rename from patches/unapplied/server/Improved-Async-Task-Scheduler.patch rename to patches/server/Improved-Async-Task-Scheduler.patch diff --git a/patches/unapplied/server/InventoryCloseEvent-Reason-API.patch b/patches/server/InventoryCloseEvent-Reason-API.patch similarity index 100% rename from patches/unapplied/server/InventoryCloseEvent-Reason-API.patch rename to patches/server/InventoryCloseEvent-Reason-API.patch diff --git a/patches/unapplied/server/ItemStack-getMaxItemUseDuration.patch b/patches/server/ItemStack-getMaxItemUseDuration.patch similarity index 100% rename from patches/unapplied/server/ItemStack-getMaxItemUseDuration.patch rename to patches/server/ItemStack-getMaxItemUseDuration.patch diff --git a/patches/unapplied/server/LivingEntity-Hand-Raised-Item-Use-API.patch b/patches/server/LivingEntity-Hand-Raised-Item-Use-API.patch similarity index 100% rename from patches/unapplied/server/LivingEntity-Hand-Raised-Item-Use-API.patch rename to patches/server/LivingEntity-Hand-Raised-Item-Use-API.patch diff --git a/patches/unapplied/server/Make-legacy-ping-handler-more-reliable.patch b/patches/server/Make-legacy-ping-handler-more-reliable.patch similarity index 100% rename from patches/unapplied/server/Make-legacy-ping-handler-more-reliable.patch rename to patches/server/Make-legacy-ping-handler-more-reliable.patch diff --git a/patches/unapplied/server/Make-shield-blocking-delay-configurable.patch b/patches/server/Make-shield-blocking-delay-configurable.patch similarity index 98% rename from patches/unapplied/server/Make-shield-blocking-delay-configurable.patch rename to patches/server/Make-shield-blocking-delay-configurable.patch index d658efd523..1f64361780 100644 --- a/patches/unapplied/server/Make-shield-blocking-delay-configurable.patch +++ b/patches/server/Make-shield-blocking-delay-configurable.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { if (this.isUsingItem() && !this.useItem.isEmpty()) { Item item = this.useItem.getItem(); diff --git a/patches/unapplied/server/Ocelot-despawns-should-honor-nametags-and-leash.patch b/patches/server/Ocelot-despawns-should-honor-nametags-and-leash.patch similarity index 100% rename from patches/unapplied/server/Ocelot-despawns-should-honor-nametags-and-leash.patch rename to patches/server/Ocelot-despawns-should-honor-nametags-and-leash.patch diff --git a/patches/unapplied/server/Optimize-BlockPosition-helper-methods.patch b/patches/server/Optimize-BlockPosition-helper-methods.patch similarity index 100% rename from patches/unapplied/server/Optimize-BlockPosition-helper-methods.patch rename to patches/server/Optimize-BlockPosition-helper-methods.patch diff --git a/patches/unapplied/server/Optimize-CraftBlockData-Creation.patch b/patches/server/Optimize-CraftBlockData-Creation.patch similarity index 100% rename from patches/unapplied/server/Optimize-CraftBlockData-Creation.patch rename to patches/server/Optimize-CraftBlockData-Creation.patch diff --git a/patches/unapplied/server/Optimize-MappedRegistry.patch b/patches/server/Optimize-MappedRegistry.patch similarity index 100% rename from patches/unapplied/server/Optimize-MappedRegistry.patch rename to patches/server/Optimize-MappedRegistry.patch diff --git a/patches/unapplied/server/Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/patches/server/Option-to-prevent-armor-stands-from-doing-entity-loo.patch similarity index 100% rename from patches/unapplied/server/Option-to-prevent-armor-stands-from-doing-entity-loo.patch rename to patches/server/Option-to-prevent-armor-stands-from-doing-entity-loo.patch diff --git a/patches/unapplied/server/Player.setPlayerProfile-API.patch b/patches/server/Player.setPlayerProfile-API.patch similarity index 87% rename from patches/unapplied/server/Player.setPlayerProfile-API.patch rename to patches/server/Player.setPlayerProfile-API.patch index 7cddd39ec9..f368750ddf 100644 --- a/patches/unapplied/server/Player.setPlayerProfile-API.patch +++ b/patches/server/Player.setPlayerProfile-API.patch @@ -8,6 +8,19 @@ This can be useful for changing name or skins after a player has logged in. == AT == public-f net.minecraft.world.entity.player.Player gameProfile +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + this.internalTeleport(dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch(), Collections.emptySet()); + } + +- private void internalTeleport(double d0, double d1, double d2, float f, float f1, Set set) { ++ public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set set) { // Paper + // CraftBukkit start + if (Float.isNaN(f)) { + f = 0; diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -66,8 +79,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public InetSocketAddress getAddress() { if (this.getHandle().connection == null) return null; @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - this.hiddenEntities.put(entity.getUniqueId(), hidingPlugins); + private void untrackAndHideEntity(org.bukkit.entity.Entity entity) { // Remove this entity from the hidden player's EntityTrackerEntry - ChunkMap tracker = ((ServerLevel) this.getHandle().level).getChunkSource().chunkMap; + // Paper start @@ -90,28 +103,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - server.getPluginManager().callEvent(new PlayerHideEntityEvent(this, entity)); } - @Override -@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - } - this.hiddenEntities.remove(entity.getUniqueId()); - -- ChunkMap tracker = ((ServerLevel) this.getHandle().level).getChunkSource().chunkMap; -+ // Paper start - Entity other = ((CraftEntity) entity).getHandle(); -+ registerEntity(other); -+ -+ server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); -+ } -+ private void registerEntity(Entity other) { -+ ChunkMap tracker = ((ServerLevel) this.getHandle().level).getChunkSource().chunkMap; -+ // Paper end - - if (other instanceof ServerPlayer) { - ServerPlayer otherPlayer = (ServerPlayer) other; + void resetAndHideEntity(org.bukkit.entity.Entity entity) { @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (entry != null && !entry.seenBy.contains(this.getHandle().connection)) { entry.updatePlayer(this.getHandle()); } ++ server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); // Paper + } + // Paper start + @Override @@ -130,22 +127,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + bukkitPlayer.unregisterEntity(self); + } + } - -- server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); ++ + // Set the game profile here, we should have unregistered the entity via iterating all player entities above. + self.gameProfile = gameProfile; -+ + +- server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); + // Re-register the game profile for all players + for (ServerPlayer player : players) { + CraftPlayer bukkitPlayer = player.getBukkitEntity(); + if (bukkitPlayer.canSee(this)) { -+ bukkitPlayer.registerEntity(self); ++ bukkitPlayer.trackAndShowEntity(self); + } + } + // Refresh misc player things AFTER sending game profile + this.refreshPlayer(); } + void resetAndShowEntity(org.bukkit.entity.Entity entity) { +@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + this.trackAndShowEntity(entity); + } + } ++ // Paper start + public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() { + return new com.destroystokyo.paper.profile.CraftPlayerProfile(this).clone(); + } @@ -160,7 +163,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + ServerLevel worldserver = handle.getLevel(); + connection.send(new net.minecraft.network.protocol.game.ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), net.minecraft.world.level.biome.BiomeManager.obfuscateSeed(worldserver.getSeed()), handle.gameMode.getGameModeForPlayer(), handle.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), net.minecraft.network.protocol.game.ClientboundRespawnPacket.KEEP_ALL_DATA, this.getHandle().getLastDeathLocation())); + handle.onUpdateAbilities(); -+ connection.internalTeleport(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet(), false); ++ connection.internalTeleport(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet()); + net.minecraft.server.MinecraftServer.getServer().getPlayerList().sendAllPlayerInfo(handle); + + if (this.isOp()) { @@ -169,10 +172,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + // Paper end -+ + public void onEntityRemove(Entity entity) { - this.hiddenEntities.remove(entity.getUUID()); - } + this.invertedVisibilityEntities.remove(entity.getUUID()); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java diff --git a/patches/unapplied/server/PlayerAdvancementCriterionGrantEvent.patch b/patches/server/PlayerAdvancementCriterionGrantEvent.patch similarity index 100% rename from patches/unapplied/server/PlayerAdvancementCriterionGrantEvent.patch rename to patches/server/PlayerAdvancementCriterionGrantEvent.patch diff --git a/patches/unapplied/server/PlayerElytraBoostEvent.patch b/patches/server/PlayerElytraBoostEvent.patch similarity index 100% rename from patches/unapplied/server/PlayerElytraBoostEvent.patch rename to patches/server/PlayerElytraBoostEvent.patch diff --git a/patches/unapplied/server/PlayerLaunchProjectileEvent.patch b/patches/server/PlayerLaunchProjectileEvent.patch similarity index 100% rename from patches/unapplied/server/PlayerLaunchProjectileEvent.patch rename to patches/server/PlayerLaunchProjectileEvent.patch diff --git a/patches/unapplied/server/PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/PlayerNaturallySpawnCreaturesEvent.patch similarity index 99% rename from patches/unapplied/server/PlayerNaturallySpawnCreaturesEvent.patch rename to patches/server/PlayerNaturallySpawnCreaturesEvent.patch index 64b136338e..2424632700 100644 --- a/patches/unapplied/server/PlayerNaturallySpawnCreaturesEvent.patch +++ b/patches/server/PlayerNaturallySpawnCreaturesEvent.patch @@ -68,8 +68,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent; import com.google.common.collect.Lists; + import com.google.common.net.InetAddresses; import com.mojang.authlib.GameProfile; - import com.mojang.datafixers.util.Either; @@ -0,0 +0,0 @@ public class ServerPlayer extends Player { // CraftBukkit end public boolean isRealPlayer; // Paper diff --git a/patches/unapplied/server/PlayerPickupExperienceEvent.patch b/patches/server/PlayerPickupExperienceEvent.patch similarity index 100% rename from patches/unapplied/server/PlayerPickupExperienceEvent.patch rename to patches/server/PlayerPickupExperienceEvent.patch diff --git a/patches/unapplied/server/PlayerReadyArrowEvent.patch b/patches/server/PlayerReadyArrowEvent.patch similarity index 100% rename from patches/unapplied/server/PlayerReadyArrowEvent.patch rename to patches/server/PlayerReadyArrowEvent.patch diff --git a/patches/unapplied/server/PreCreatureSpawnEvent.patch b/patches/server/PreCreatureSpawnEvent.patch similarity index 100% rename from patches/unapplied/server/PreCreatureSpawnEvent.patch rename to patches/server/PreCreatureSpawnEvent.patch diff --git a/patches/unapplied/server/Prevent-Frosted-Ice-from-loading-holding-chunks.patch b/patches/server/Prevent-Frosted-Ice-from-loading-holding-chunks.patch similarity index 100% rename from patches/unapplied/server/Prevent-Frosted-Ice-from-loading-holding-chunks.patch rename to patches/server/Prevent-Frosted-Ice-from-loading-holding-chunks.patch diff --git a/patches/unapplied/server/Prevent-logins-from-being-processed-when-the-player-.patch b/patches/server/Prevent-logins-from-being-processed-when-the-player-.patch similarity index 100% rename from patches/unapplied/server/Prevent-logins-from-being-processed-when-the-player-.patch rename to patches/server/Prevent-logins-from-being-processed-when-the-player-.patch diff --git a/patches/unapplied/server/Print-Error-details-when-failing-to-save-player-data.patch b/patches/server/Print-Error-details-when-failing-to-save-player-data.patch similarity index 100% rename from patches/unapplied/server/Print-Error-details-when-failing-to-save-player-data.patch rename to patches/server/Print-Error-details-when-failing-to-save-player-data.patch diff --git a/patches/unapplied/server/RangedEntity-API.patch b/patches/server/RangedEntity-API.patch similarity index 100% rename from patches/unapplied/server/RangedEntity-API.patch rename to patches/server/RangedEntity-API.patch diff --git a/patches/unapplied/server/Refresh-player-inventory-when-cancelling-PlayerInter.patch b/patches/server/Refresh-player-inventory-when-cancelling-PlayerInter.patch similarity index 100% rename from patches/unapplied/server/Refresh-player-inventory-when-cancelling-PlayerInter.patch rename to patches/server/Refresh-player-inventory-when-cancelling-PlayerInter.patch diff --git a/patches/unapplied/server/Remove-unnecessary-itemmeta-handling.patch b/patches/server/Remove-unnecessary-itemmeta-handling.patch similarity index 100% rename from patches/unapplied/server/Remove-unnecessary-itemmeta-handling.patch rename to patches/server/Remove-unnecessary-itemmeta-handling.patch diff --git a/patches/unapplied/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch b/patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch similarity index 100% rename from patches/unapplied/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch rename to patches/server/Reset-spawner-timer-when-spawner-event-is-cancelled.patch diff --git a/patches/unapplied/server/Restore-vanilla-default-mob-spawn-range-and-water-an.patch b/patches/server/Restore-vanilla-default-mob-spawn-range-and-water-an.patch similarity index 100% rename from patches/unapplied/server/Restore-vanilla-default-mob-spawn-range-and-water-an.patch rename to patches/server/Restore-vanilla-default-mob-spawn-range-and-water-an.patch diff --git a/patches/unapplied/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch b/patches/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch similarity index 100% rename from patches/unapplied/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch rename to patches/server/Send-attack-SoundEffects-only-to-players-who-can-see.patch diff --git a/patches/unapplied/server/SkeletonHorse-Additions.patch b/patches/server/SkeletonHorse-Additions.patch similarity index 100% rename from patches/unapplied/server/SkeletonHorse-Additions.patch rename to patches/server/SkeletonHorse-Additions.patch diff --git a/patches/unapplied/server/Slime-Pathfinder-Events.patch b/patches/server/Slime-Pathfinder-Events.patch similarity index 95% rename from patches/unapplied/server/Slime-Pathfinder-Events.patch rename to patches/server/Slime-Pathfinder-Events.patch index 2c5338e88b..b06123b5b2 100644 --- a/patches/unapplied/server/Slime-Pathfinder-Events.patch +++ b/patches/server/Slime-Pathfinder-Events.patch @@ -85,8 +85,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override @@ -0,0 +0,0 @@ public class Slime extends Mob implements Enemy { + } - ((Slime.SlimeMoveControl) this.slime.getMoveControl()).setDirection(this.slime.getYRot(), this.slime.isDealsDamage()); } + + // Paper start - clear timer and target when goal resets @@ -118,7 +118,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end } - ((Slime.SlimeMoveControl) this.slime.getMoveControl()).setDirection(this.chosenDegrees, false); + MoveControl controllermove = this.slime.getMoveControl(); @@ -0,0 +0,0 @@ public class Slime extends Mob implements Enemy { @Override @@ -129,7 +129,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override @@ -0,0 +0,0 @@ public class Slime extends Mob implements Enemy { - ((Slime.SlimeMoveControl) this.slime.getMoveControl()).setWantedMovement(1.0D); + } } + diff --git a/patches/unapplied/server/Tameable-getOwnerUniqueId-API.patch b/patches/server/Tameable-getOwnerUniqueId-API.patch similarity index 100% rename from patches/unapplied/server/Tameable-getOwnerUniqueId-API.patch rename to patches/server/Tameable-getOwnerUniqueId-API.patch diff --git a/patches/unapplied/server/Toggleable-player-crits-helps-mitigate-hacked-client.patch b/patches/server/Toggleable-player-crits-helps-mitigate-hacked-client.patch similarity index 100% rename from patches/unapplied/server/Toggleable-player-crits-helps-mitigate-hacked-client.patch rename to patches/server/Toggleable-player-crits-helps-mitigate-hacked-client.patch diff --git a/patches/unapplied/server/Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch b/patches/server/Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch similarity index 100% rename from patches/unapplied/server/Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch rename to patches/server/Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch diff --git a/patches/unapplied/server/Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch b/patches/server/Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch similarity index 94% rename from patches/unapplied/server/Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch rename to patches/server/Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch index 58f00826f5..5b3bccc1d7 100644 --- a/patches/unapplied/server/Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch +++ b/patches/server/Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch @@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/build.gradle.kts @@ -0,0 +0,0 @@ dependencies { implementation("commons-lang:commons-lang:2.6") - runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3") - runtimeOnly("mysql:mysql-connector-java:8.0.29") + runtimeOnly("org.xerial:sqlite-jdbc:3.41.0.0") + runtimeOnly("com.mysql:mysql-connector-j:8.0.32") + runtimeOnly("com.lmax:disruptor:3.4.4") // Paper runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5") diff --git a/patches/unapplied/server/Use-ConcurrentHashMap-in-JsonList.patch b/patches/server/Use-ConcurrentHashMap-in-JsonList.patch similarity index 100% rename from patches/unapplied/server/Use-ConcurrentHashMap-in-JsonList.patch rename to patches/server/Use-ConcurrentHashMap-in-JsonList.patch diff --git a/patches/unapplied/server/Use-a-Queue-for-Queueing-Commands.patch b/patches/server/Use-a-Queue-for-Queueing-Commands.patch similarity index 100% rename from patches/unapplied/server/Use-a-Queue-for-Queueing-Commands.patch rename to patches/server/Use-a-Queue-for-Queueing-Commands.patch diff --git a/patches/unapplied/server/Vanished-players-don-t-have-rights.patch b/patches/server/Vanished-players-don-t-have-rights.patch similarity index 97% rename from patches/unapplied/server/Vanished-players-don-t-have-rights.patch rename to patches/server/Vanished-players-don-t-have-rights.patch index d34b95c8c0..4a09dd6ce4 100644 --- a/patches/unapplied/server/Vanished-players-don-t-have-rights.patch +++ b/patches/server/Vanished-players-don-t-have-rights.patch @@ -8,21 +8,22 @@ diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -@@ -0,0 +0,0 @@ public abstract class Projectile extends Entity { - if (!entity.isSpectator() && entity.isAlive() && entity.isPickable()) { +@@ -0,0 +0,0 @@ public abstract class Projectile extends Entity implements TraceableEntity { + } else { Entity entity1 = this.getOwner(); + // Paper start - Cancel hit for vanished players + if (entity1 instanceof net.minecraft.server.level.ServerPlayer && entity instanceof net.minecraft.server.level.ServerPlayer) { + org.bukkit.entity.Player collided = (org.bukkit.entity.Player) entity.getBukkitEntity(); + org.bukkit.entity.Player shooter = (org.bukkit.entity.Player) entity1.getBukkitEntity(); -+ if (!shooter.canSee(collided)) return false; ++ if (!shooter.canSee(collided)) { ++ return false; ++ } + } - return entity1 == null || this.leftOwner || !entity1.isPassengerOfSameVehicle(entity); + // Paper end - } else { - return false; + return entity1 == null || this.leftOwner || !entity1.isPassengerOfSameVehicle(entity); } + } diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/BlockItem.java diff --git a/patches/unapplied/server/Vex-get-setSummoner-API.patch b/patches/server/Vex-get-setSummoner-API.patch similarity index 100% rename from patches/unapplied/server/Vex-get-setSummoner-API.patch rename to patches/server/Vex-get-setSummoner-API.patch diff --git a/patches/unapplied/server/WitchConsumePotionEvent.patch b/patches/server/WitchConsumePotionEvent.patch similarity index 100% rename from patches/unapplied/server/WitchConsumePotionEvent.patch rename to patches/server/WitchConsumePotionEvent.patch diff --git a/patches/unapplied/server/WitchReadyPotionEvent.patch b/patches/server/WitchReadyPotionEvent.patch similarity index 100% rename from patches/unapplied/server/WitchReadyPotionEvent.patch rename to patches/server/WitchReadyPotionEvent.patch diff --git a/patches/unapplied/server/WitchThrowPotionEvent.patch b/patches/server/WitchThrowPotionEvent.patch similarity index 100% rename from patches/unapplied/server/WitchThrowPotionEvent.patch rename to patches/server/WitchThrowPotionEvent.patch diff --git a/patches/unapplied/server/add-more-information-to-Entity.toString.patch b/patches/server/add-more-information-to-Entity.toString.patch similarity index 100% rename from patches/unapplied/server/add-more-information-to-Entity.toString.patch rename to patches/server/add-more-information-to-Entity.toString.patch diff --git a/patches/unapplied/server/getPlayerUniqueId-API.patch b/patches/server/getPlayerUniqueId-API.patch similarity index 100% rename from patches/unapplied/server/getPlayerUniqueId-API.patch rename to patches/server/getPlayerUniqueId-API.patch diff --git a/patches/unapplied/server/handle-ServerboundKeepAlivePacket-async.patch b/patches/server/handle-ServerboundKeepAlivePacket-async.patch similarity index 100% rename from patches/unapplied/server/handle-ServerboundKeepAlivePacket-async.patch rename to patches/server/handle-ServerboundKeepAlivePacket-async.patch diff --git a/patches/unapplied/server/revert-serverside-behavior-of-keepalives.patch b/patches/server/revert-serverside-behavior-of-keepalives.patch similarity index 100% rename from patches/unapplied/server/revert-serverside-behavior-of-keepalives.patch rename to patches/server/revert-serverside-behavior-of-keepalives.patch diff --git a/patches/unapplied/server/use-CB-BlockState-implementations-for-captured-block.patch b/patches/server/use-CB-BlockState-implementations-for-captured-block.patch similarity index 100% rename from patches/unapplied/server/use-CB-BlockState-implementations-for-captured-block.patch rename to patches/server/use-CB-BlockState-implementations-for-captured-block.patch