3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00
Dieser Commit ist enthalten in:
Jake Potrebic 2021-06-12 09:56:13 -07:00 committet von GitHub
Ursprung 79da8f0eca
Commit 2397b86efa
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
29 geänderte Dateien mit 178 neuen und 364 gelöschten Zeilen

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent
This will allow you to change the players name or skin on login. This will allow you to change the players name or skin on login.
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
index 992d1025ca02020e87a9ab5db83d249427f41d69..a40b57edb1aeff71fc0b9767d410950da5c06283 100644 index d3b4219a57fff4519ef8d803c333c854fafa7859..d512c23ad0275061593d99f005c72292dbb07e81 100644
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java --- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
@@ -2,6 +2,9 @@ package org.bukkit.event.player; @@ -2,6 +2,9 @@ package org.bukkit.event.player;

Datei anzeigen

@ -3,6 +3,7 @@ From: Aikar <aikar@aikar.co>
Date: Sat, 10 Mar 2018 16:33:15 -0500 Date: Sat, 10 Mar 2018 16:33:15 -0500
Subject: [PATCH] Prevent Frosted Ice from loading/holding chunks Subject: [PATCH] Prevent Frosted Ice from loading/holding chunks
1.17: Shouldn't be needed as blocks no longer tick without at least 1 radius chunk loaded.
diff --git a/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java b/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java b/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java
index ae2f5acd008d5d7163b56cb4a2d29354299959ca..99843f1ca4737d40ae0626fce931c97bbf5ab81d 100644 index ae2f5acd008d5d7163b56cb4a2d29354299959ca..99843f1ca4737d40ae0626fce931c97bbf5ab81d 100644

Datei anzeigen

@ -3518,6 +3518,24 @@ index 65bd706ca96f5c0ec4573da9fb144fb51d2de919..3a2e8bdc215a6af604bfaad01b670a36
public long[] getRaw() { public long[] getRaw() {
return this.data; return this.data;
} }
diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
index 08fb847add9f5a2c1ca6dfef31de7e711c8b9840..5b38966093fe60b298844961d015d5a9f03412a2 100644
--- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
+++ b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
@@ -78,6 +78,13 @@ public abstract class BlockableEventLoop<R extends Runnable> implements Profiler
}
}
+ // Paper start
+ public void scheduleOnMain(Runnable r0) {
+ // postToMainThread does not work the same as older versions of mc
+ // This method is actually used to create a TickTask, which can then be posted onto main
+ this.tell(this.wrapRunnable(r0));
+ }
+ // Paper end
@Override
public void tell(R runnable) {
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 7f3d83d3d071f6b441ad119b1c93be035e911e70..89e7d02b88404ac5dce06595432ae95c9a4e5015 100644 index 7f3d83d3d071f6b441ad119b1c93be035e911e70..89e7d02b88404ac5dce06595432ae95c9a4e5015 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java --- a/src/main/java/net/minecraft/world/entity/EntityType.java

Datei anzeigen

@ -95,7 +95,7 @@ index 89e7d02b88404ac5dce06595432ae95c9a4e5015..3ffaeb72be8cda7a2b9398b8909db5c2
return this.serialize; return this.serialize;
} }
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index 33884161de688c47c90a7b86196234acc80f9434..e4601134598e509a158ceacec6099a78bbabe89d 100644 index 33884161de688c47c90a7b86196234acc80f9434..92b042080f06fb95958ff5e824830a84f2d1f2a6 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -20,7 +20,7 @@ import org.bukkit.inventory.InventoryHolder; @@ -20,7 +20,7 @@ import org.bukkit.inventory.InventoryHolder;
@ -107,15 +107,6 @@ index 33884161de688c47c90a7b86196234acc80f9434..e4601134598e509a158ceacec6099a78
public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot
// CraftBukkit start - data containers // CraftBukkit start - data containers
@@ -28,7 +28,7 @@ public abstract class BlockEntity {
public CraftPersistentDataContainer persistentDataContainer;
// CraftBukkit end
private static final Logger LOGGER = LogManager.getLogger();
- private final BlockEntityType<?> type;
+ private final BlockEntityType<?> type; public BlockEntityType getTileEntityType() { return type; } // Paper - OBFHELPER
@Nullable
protected Level level;
protected final BlockPos worldPosition;
@@ -41,6 +41,26 @@ public abstract class BlockEntity { @@ -41,6 +41,26 @@ public abstract class BlockEntity {
this.blockState = state; this.blockState = state;
} }
@ -127,7 +118,7 @@ index 33884161de688c47c90a7b86196234acc80f9434..e4601134598e509a158ceacec6099a78
+ @Override + @Override
+ public ResourceLocation getMinecraftKey() { + public ResourceLocation getMinecraftKey() {
+ if (tileEntityKey == null) { + if (tileEntityKey == null) {
+ tileEntityKey = BlockEntityType.getKey(this.getTileEntityType()); + tileEntityKey = BlockEntityType.getKey(this.type);
+ tileEntityKeyString = tileEntityKey != null ? tileEntityKey.toString() : null; + tileEntityKeyString = tileEntityKey != null ? tileEntityKey.toString() : null;
+ } + }
+ return tileEntityKey; + return tileEntityKey;

Datei anzeigen

@ -9,7 +9,7 @@ Subject: [PATCH] Fix Old Sign Conversion
This causes Igloos and such to render broken signs. We fix this by ignoring sign conversion for Defined Structures This causes Igloos and such to render broken signs. We fix this by ignoring sign conversion for Defined Structures
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index d6a4a2a59f1be0cc2e373dc326287b60db5559d2..9d777fce673c8f6b3ee2d69f5a6360a8a5ad8e84 100644 index 66ab4deedd177f507d170a61ceca4c3ebbac9adc..77645019c88d61dde28b7598d8a29b7d0c23c209 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -30,6 +30,7 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { @@ -30,6 +30,7 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject {
@ -17,7 +17,7 @@ index d6a4a2a59f1be0cc2e373dc326287b60db5559d2..9d777fce673c8f6b3ee2d69f5a6360a8
// CraftBukkit end // CraftBukkit end
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
+ public boolean isLoadingStructure = false; // Paper + public boolean isLoadingStructure = false; // Paper
private final BlockEntityType<?> type; public BlockEntityType getTileEntityType() { return type; } // Paper - OBFHELPER private final BlockEntityType<?> type;
@Nullable @Nullable
protected Level level; protected Level level;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java

Datei anzeigen

@ -4,18 +4,6 @@ Date: Fri, 10 Nov 2017 23:46:34 -0500
Subject: [PATCH] Add PlayerArmorChangeEvent Subject: [PATCH] Add PlayerArmorChangeEvent
diff --git a/src/main/java/net/minecraft/world/entity/EquipmentSlot.java b/src/main/java/net/minecraft/world/entity/EquipmentSlot.java
index c82bb38b5b1c9204daef21455723d21509ad1c44..135a62fcdbd801c9997bc28c071743e8ff8c64c2 100644
--- a/src/main/java/net/minecraft/world/entity/EquipmentSlot.java
+++ b/src/main/java/net/minecraft/world/entity/EquipmentSlot.java
@@ -20,6 +20,7 @@ public enum EquipmentSlot {
this.name = name;
}
+ public EquipmentSlot.Type getType() { return this.getType(); } // Paper - OBFHELPER
public EquipmentSlot.Type getType() {
return this.type;
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 89913edf98d65f08f379d0d201f9963c23573478..28de49c8b5771491b168bba26e6033669c48e3c9 100644 index 89913edf98d65f08f379d0d201f9963c23573478..28de49c8b5771491b168bba26e6033669c48e3c9 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java

Datei anzeigen

@ -13,18 +13,9 @@ also Avoid NPE during CraftBlockEntityState load if could not get TE
If Tile Entity was null, correct Sign to return empty lines instead of null If Tile Entity was null, correct Sign to return empty lines instead of null
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index 9d777fce673c8f6b3ee2d69f5a6360a8a5ad8e84..c3706b87ad36332a837caffb58bd4575cbc0172a 100644 index 77645019c88d61dde28b7598d8a29b7d0c23c209..8a079ee3ed243fd19b1dd7eed2de1dd33785faa1 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -31,7 +31,7 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject {
// CraftBukkit end
private static final Logger LOGGER = LogManager.getLogger();
public boolean isLoadingStructure = false; // Paper
- private final BlockEntityType<?> type; public BlockEntityType getTileEntityType() { return type; } // Paper - OBFHELPER
+ private final BlockEntityType<?> type;
@Nullable
protected Level level;
protected final BlockPos worldPosition;
@@ -42,6 +42,7 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { @@ -42,6 +42,7 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject {
this.type = type; this.type = type;
this.worldPosition = pos.immutable(); this.worldPosition = pos.immutable();

Datei anzeigen

@ -14,7 +14,7 @@ completion, such as offline players.
Also adds isCommand and getLocation to the sync TabCompleteEvent Also adds isCommand and getLocation to the sync TabCompleteEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b2bbd25e5572f59add71579b676d5a4c719be239..737296e90e3547505a012fc516a4fc39a565343e 100644 index b2bbd25e5572f59add71579b676d5a4c719be239..205e4ef25f49edc11a408c302d9ba68a59c68a5a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -703,10 +703,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -703,10 +703,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@ -39,7 +39,7 @@ index b2bbd25e5572f59add71579b676d5a4c719be239..737296e90e3547505a012fc516a4fc39
+ com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event; + com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event;
+ java.util.List<String> completions = new java.util.ArrayList<>(); + java.util.List<String> completions = new java.util.ArrayList<>();
+ String buffer = packet.getCommand(); + String buffer = packet.getCommand();
+ event = new com.destroystokyo.paper.event.server.AsyncTabCompleteEvent(this.getPlayer(), completions, + event = new com.destroystokyo.paper.event.server.AsyncTabCompleteEvent(this.getCraftPlayer(), completions,
+ buffer, true, null); + buffer, true, null);
+ event.callEvent(); + event.callEvent();
+ completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.getCompletions(); + completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.getCompletions();

Datei anzeigen

@ -27,22 +27,25 @@ index 8203c93dcb56646df2614f2233aaf3a36f745d1c..71fb831ed3359e7986e279c987211f39
return experienceAmount * 2; return experienceAmount * 2;
} }
diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
index 27cdfbeb6cb2159075b35dd4f9e9557ec0eac7c2..d2d7b303e66bbba489e2003cc130dcd53e2a9854 100644 index 27cdfbeb6cb2159075b35dd4f9e9557ec0eac7c2..069ce59faab5184ab9da8ca3fe1cebf7449cd7fe 100644
--- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java --- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
+++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java +++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
@@ -246,8 +246,8 @@ public class EnchantmentHelper { @@ -246,8 +246,11 @@ public class EnchantmentHelper {
return getItemEnchantmentLevel(Enchantments.CHANNELING, stack) > 0; return getItemEnchantmentLevel(Enchantments.CHANNELING, stack) > 0;
} }
- @Nullable - @Nullable
- public static Entry<EquipmentSlot, ItemStack> getRandomItemWith(Enchantment enchantment, LivingEntity entity) { - public static Entry<EquipmentSlot, ItemStack> getRandomItemWith(Enchantment enchantment, LivingEntity entity) {
+ public static @javax.annotation.Nonnull ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, LivingEntity entityliving) { Entry<EquipmentSlot, ItemStack> entry = getRandomItemWith(enchantment, entityliving); return entry != null ? entry.getValue() : ItemStack.NULL_ITEM; } // Paper - OBFHELPER + public static @javax.annotation.Nonnull ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, LivingEntity entityliving) {
+ Entry<EquipmentSlot, ItemStack> entry = getRandomItemWith(enchantment, entityliving);
+ return entry != null ? entry.getValue() : ItemStack.EMPTY;
+ } // Paper - OBFHELPER
+ @Nullable public static Entry<EquipmentSlot, ItemStack> getRandomItemWith(Enchantment enchantment, LivingEntity entity) { + @Nullable public static Entry<EquipmentSlot, ItemStack> getRandomItemWith(Enchantment enchantment, LivingEntity entity) {
return getRandomItemWith(enchantment, entity, (stack) -> { return getRandomItemWith(enchantment, entity, (stack) -> {
return true; return true;
}); });
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ed1c57f22adc8b96012eca426ed1e7b409e7d663..b1778f53de7974e03c7b56b0df69e31cdae8dd62 100644 index ed1c57f22adc8b96012eca426ed1e7b409e7d663..75963a28b39f8835f1daba3d1b44655603124bf3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -61,11 +61,14 @@ import net.minecraft.server.level.ServerPlayer; @@ -61,11 +61,14 @@ import net.minecraft.server.level.ServerPlayer;
@ -80,7 +83,7 @@ index ed1c57f22adc8b96012eca426ed1e7b409e7d663..b1778f53de7974e03c7b56b0df69e31c
+ int i = Math.min(orb.xpToDur(amount), itemstack.getDamageValue()); + int i = Math.min(orb.xpToDur(amount), itemstack.getDamageValue());
+ org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, i); + org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, i);
+ i = event.getRepairAmount(); + i = event.getRepairAmount();
+ orb.removed = true; + orb.discard();
+ if (!event.isCancelled()) { + if (!event.isCancelled()) {
+ amount -= orb.durToXp(i); + amount -= orb.durToXp(i);
+ itemstack.setDamageValue(itemstack.getDamageValue() - i); + itemstack.setDamageValue(itemstack.getDamageValue() - i);

Datei anzeigen

@ -7,7 +7,7 @@ This allows you to create already filled textures on Skulls to avoid texture loo
which commonly cause rate limit issues with Mojang API which commonly cause rate limit issues with Mojang API
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java
index 2047ea32489d03051783d18a0dbaf456bfdbb2a1..a06c51a56846750ce59a70e9698c2b57c3517aad 100644 index 1879ae835c437883f76330d6e2707460273d02db..df0ba7ed56fc635a4aa30934d1990043dbc3d8dc 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java
@@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
@ -18,15 +18,7 @@ index 2047ea32489d03051783d18a0dbaf456bfdbb2a1..a06c51a56846750ce59a70e9698c2b57
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
@@ -15,6 +17,7 @@ import org.bukkit.block.data.BlockData; @@ -105,6 +107,20 @@ public class CraftSkull extends CraftBlockEntityState<SkullBlockEntity> implemen
import org.bukkit.block.data.Directional;
import org.bukkit.block.data.Rotatable;
import org.bukkit.craftbukkit.entity.CraftPlayer;
+import javax.annotation.Nullable;
public class CraftSkull extends CraftBlockEntityState<SkullBlockEntity> implements Skull {
@@ -105,6 +108,20 @@ public class CraftSkull extends CraftBlockEntityState<SkullBlockEntity> implemen
} }
} }
@ -37,7 +29,7 @@ index 2047ea32489d03051783d18a0dbaf456bfdbb2a1..a06c51a56846750ce59a70e9698c2b57
+ this.profile = CraftPlayerProfile.asAuthlibCopy(profile); + this.profile = CraftPlayerProfile.asAuthlibCopy(profile);
+ } + }
+ +
+ @Nullable + @javax.annotation.Nullable
+ @Override + @Override
+ public PlayerProfile getPlayerProfile() { + public PlayerProfile getPlayerProfile() {
+ return profile != null ? CraftPlayerProfile.asBukkitCopy(profile) : null; + return profile != null ? CraftPlayerProfile.asBukkitCopy(profile) : null;
@ -48,7 +40,7 @@ index 2047ea32489d03051783d18a0dbaf456bfdbb2a1..a06c51a56846750ce59a70e9698c2b57
public BlockFace getRotation() { public BlockFace getRotation() {
BlockData blockData = getBlockData(); BlockData blockData = getBlockData();
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
index 750661540f55d3c59119dcc909e706e571a2123b..aa64ffc23d8941ff05ea7791ddd628c3c6be90e4 100644 index 5e345224e698bd80133dc194385c033369a60a33..33994a050826d10d69f375f65ecce2b56116cca0 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
@@ -4,10 +4,8 @@ import com.google.common.collect.ImmutableMap.Builder; @@ -4,10 +4,8 @@ import com.google.common.collect.ImmutableMap.Builder;
@ -77,7 +69,7 @@ index 750661540f55d3c59119dcc909e706e571a2123b..aa64ffc23d8941ff05ea7791ddd628c3
class CraftMetaSkull extends CraftMetaItem implements SkullMeta { class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@@ -149,6 +152,19 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { @@ -149,6 +152,19 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
return hasOwner() ? profile.getName() : null; return this.hasOwner() ? this.profile.getName() : null;
} }
+ // Paper start + // Paper start
@ -95,15 +87,4 @@ index 750661540f55d3c59119dcc909e706e571a2123b..aa64ffc23d8941ff05ea7791ddd628c3
+ +
@Override @Override
public OfflinePlayer getOwningPlayer() { public OfflinePlayer getOwningPlayer() {
if (hasOwner()) { if (this.hasOwner()) {
@@ -175,8 +191,8 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
} else {
// Paper start - Use Online Players Skull
GameProfile newProfile = null;
- net.minecraft.server.EntityPlayer player = net.minecraft.server.MinecraftServer.getServer().getPlayerList().getPlayerByName(name);
- if (player != null) newProfile = player.getProfile();
+ net.minecraft.server.level.ServerPlayer player = net.minecraft.server.MinecraftServer.getServer().getPlayerList().getPlayerByName(name);
+ if (player != null) newProfile = player.getGameProfile();
if (newProfile == null) newProfile = new GameProfile(null, name);
setProfile(newProfile);
// Paper end

Datei anzeigen

@ -5,16 +5,16 @@ Subject: [PATCH] PlayerAdvancementCriterionGrantEvent
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
index 8df1803754817707a5ad292f65276871dacc4508..5ab62fc74085bbbb0c81b2f4d16a35c9345cd1f1 100644 index f26bdd3d6eb0ae38c1d7b50f29942fcf2207e3a1..3d82f984648605d58fae3c57f145d0da8a2ae225 100644
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java --- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java +++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
@@ -297,6 +297,12 @@ public class PlayerAdvancements { @@ -277,6 +277,12 @@ public class PlayerAdvancements {
boolean flag1 = advancementprogress.isDone(); boolean flag1 = advancementprogress.isDone();
if (advancementprogress.a(criterionName)) { if (advancementprogress.grantProgress(criterionName)) {
+ // Paper start + // Paper start
+ if (!new com.destroystokyo.paper.event.player.PlayerAdvancementCriterionGrantEvent(this.player.getBukkitEntity(), advancement.bukkit, criterionName).callEvent()) { + if (!new com.destroystokyo.paper.event.player.PlayerAdvancementCriterionGrantEvent(this.player.getBukkitEntity(), advancement.bukkit, criterionName).callEvent()) {
+ advancementprogress.b(criterionName); + advancementprogress.revokeProgress(criterionName);
+ return false; + return false;
+ } + }
+ // Paper end + // Paper end

Datei anzeigen

@ -13,7 +13,7 @@ starting point for future additions in this area.
Fixes GH-559 Fixes GH-559
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
index 783b9c7283492fb71776b61f9820c21a39868c47..6521f4f6f660885f59f024640239609fb67d691f 100644 index aee796567f11c8b93ac9ec0b8cb8f3a8412b23ce..39b98305632271e7375afe6c7001f241c17e103d 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
@@ -9,9 +9,22 @@ import org.bukkit.configuration.serialization.DelegateDeserialization; @@ -9,9 +9,22 @@ import org.bukkit.configuration.serialization.DelegateDeserialization;
@ -54,10 +54,10 @@ index 783b9c7283492fb71776b61f9820c21a39868c47..6521f4f6f660885f59f024640239609f
this.entityTag = armorStand.entityTag; this.entityTag = armorStand.entityTag;
} }
@@ -30,11 +50,47 @@ public class CraftMetaArmorStand extends CraftMetaItem { @@ -30,11 +50,40 @@ public class CraftMetaArmorStand extends CraftMetaItem {
if (tag.contains(ENTITY_TAG.NBT)) { if (tag.contains(ENTITY_TAG.NBT)) {
entityTag = tag.getCompound(ENTITY_TAG.NBT); this.entityTag = tag.getCompound(ENTITY_TAG.NBT);
+ +
+ // Paper start + // Paper start
+ if (entityTag.contains(INVISIBLE.NBT)) { + if (entityTag.contains(INVISIBLE.NBT)) {
@ -85,120 +85,112 @@ index 783b9c7283492fb71776b61f9820c21a39868c47..6521f4f6f660885f59f024640239609f
CraftMetaArmorStand(Map<String, Object> map) { CraftMetaArmorStand(Map<String, Object> map) {
super(map); super(map);
+
+ // Paper start + // Paper start
+ boolean invis = SerializableMeta.getBoolean(map, INVISIBLE.BUKKIT); + this.invisible = SerializableMeta.getBoolean(map, INVISIBLE.BUKKIT);
+ boolean noBase = SerializableMeta.getBoolean(map, NO_BASE_PLATE.BUKKIT); + this.noBasePlate = SerializableMeta.getBoolean(map, NO_BASE_PLATE.BUKKIT);
+ boolean showArms = SerializableMeta.getBoolean(map, SHOW_ARMS.BUKKIT); + this.showArms = SerializableMeta.getBoolean(map, SHOW_ARMS.BUKKIT);
+ boolean small = SerializableMeta.getBoolean(map, SMALL.BUKKIT); + this.small = SerializableMeta.getBoolean(map, SMALL.BUKKIT);
+ boolean marker = SerializableMeta.getBoolean(map, MARKER.BUKKIT); + this.marker = SerializableMeta.getBoolean(map, MARKER.BUKKIT);
+
+ this.invisible = invis;
+ this.noBasePlate = noBase;
+ this.showArms = showArms;
+ this.small = small;
+ this.marker = marker;
+ // Paper end + // Paper end
} }
@Override @Override
@@ -57,6 +113,32 @@ public class CraftMetaArmorStand extends CraftMetaItem { @@ -57,6 +106,31 @@ public class CraftMetaArmorStand extends CraftMetaItem {
void applyToItem(CompoundTag tag) { void applyToItem(CompoundTag tag) {
super.applyToItem(tag); super.applyToItem(tag);
+ // Paper start + // Paper start
+ if (!isArmorStandEmpty() && entityTag == null) { + if (!isArmorStandEmpty() && this.entityTag == null) {
+ entityTag = new CompoundTag(); + this.entityTag = new CompoundTag();
+ } + }
+ +
+ if (isInvisible()) { + if (isInvisible()) {
+ entityTag.putBoolean(INVISIBLE.NBT, invisible); + this.entityTag.putBoolean(INVISIBLE.NBT, this.invisible);
+ } + }
+ +
+ if (hasNoBasePlate()) { + if (hasNoBasePlate()) {
+ entityTag.putBoolean(NO_BASE_PLATE.NBT, noBasePlate); + this.entityTag.putBoolean(NO_BASE_PLATE.NBT, this.noBasePlate);
+ } + }
+ +
+ if (shouldShowArms()) { + if (shouldShowArms()) {
+ entityTag.putBoolean(SHOW_ARMS.NBT, showArms); + this.entityTag.putBoolean(SHOW_ARMS.NBT, this.showArms);
+ } + }
+ +
+ if (isSmall()) { + if (isSmall()) {
+ entityTag.putBoolean(SMALL.NBT, small); + this.entityTag.putBoolean(SMALL.NBT, this.small);
+ } + }
+ +
+ if (isMarker()) { + if (isMarker()) {
+ entityTag.putBoolean(MARKER.NBT, marker); + this.entityTag.putBoolean(MARKER.NBT, this.marker);
+ } + }
+ // Paper end + // Paper end
+ if (this.entityTag != null) {
if (entityTag != null) {
tag.put(ENTITY_TAG.NBT, entityTag); tag.put(ENTITY_TAG.NBT, entityTag);
} }
@@ -78,7 +160,7 @@ public class CraftMetaArmorStand extends CraftMetaItem { @@ -78,7 +152,7 @@ public class CraftMetaArmorStand extends CraftMetaItem {
} }
boolean isArmorStandEmpty() { boolean isArmorStandEmpty() {
- return !(entityTag != null); - return !(this.entityTag != null);
+ return !(isInvisible() || hasNoBasePlate() || shouldShowArms() || isSmall() || isMarker() || entityTag != null); + return !(this.isInvisible() || this.hasNoBasePlate() || this.shouldShowArms() || this.isSmall() || this.isMarker() || this.entityTag != null);
} }
@Override @Override
@@ -89,7 +171,13 @@ public class CraftMetaArmorStand extends CraftMetaItem { @@ -89,7 +163,13 @@ public class CraftMetaArmorStand extends CraftMetaItem {
if (meta instanceof CraftMetaArmorStand) { if (meta instanceof CraftMetaArmorStand) {
CraftMetaArmorStand that = (CraftMetaArmorStand) meta; CraftMetaArmorStand that = (CraftMetaArmorStand) meta;
- return entityTag != null ? that.entityTag != null && this.entityTag.equals(that.entityTag) : entityTag == null; - return this.entityTag != null ? that.entityTag != null && this.entityTag.equals(that.entityTag) : this.entityTag == null;
+ // Paper start + // Paper start
+ return invisible == that.invisible && + return this.invisible == that.invisible &&
+ noBasePlate == that.noBasePlate && + this.noBasePlate == that.noBasePlate &&
+ showArms == that.showArms && + this.showArms == that.showArms &&
+ small == that.small && + this.small == that.small &&
+ marker == that.marker; + this.marker == that.marker;
+ // Paper end + // Paper end
} }
return true; return true;
} }
@@ -104,9 +192,14 @@ public class CraftMetaArmorStand extends CraftMetaItem { @@ -104,9 +184,14 @@ public class CraftMetaArmorStand extends CraftMetaItem {
final int original; final int original;
int hash = original = super.applyHash(); int hash = original = super.applyHash();
- if (entityTag != null) { - if (this.entityTag != null) {
- hash = 73 * hash + entityTag.hashCode(); - hash = 73 * hash + this.entityTag.hashCode();
- } - }
+ // Paper start + // Paper start
+ hash += entityTag != null ? 73 * hash + entityTag.hashCode() : 0; + hash += this.entityTag != null ? 73 * hash + this.entityTag.hashCode() : 0;
+ hash += isInvisible() ? 61 * hash + 1231 : 0; + hash += this.isInvisible() ? 61 * hash + 1231 : 0;
+ hash += hasNoBasePlate() ? 61 * hash + 1231 : 0; + hash += this.hasNoBasePlate() ? 61 * hash + 1231 : 0;
+ hash += shouldShowArms() ? 61 * hash + 1231 : 0; + hash += this.shouldShowArms() ? 61 * hash + 1231 : 0;
+ hash += isSmall() ? 61 * hash + 1231 : 0; + hash += this.isSmall() ? 61 * hash + 1231 : 0;
+ hash += isMarker() ? 61 * hash + 1231 : 0; + hash += this.isMarker() ? 61 * hash + 1231 : 0;
+ // Paper end + // Paper end
return original != hash ? CraftMetaArmorStand.class.hashCode() ^ hash : hash; return original != hash ? CraftMetaArmorStand.class.hashCode() ^ hash : hash;
} }
@@ -115,6 +208,28 @@ public class CraftMetaArmorStand extends CraftMetaItem { @@ -115,6 +200,28 @@ public class CraftMetaArmorStand extends CraftMetaItem {
Builder<String, Object> serialize(Builder<String, Object> builder) { Builder<String, Object> serialize(Builder<String, Object> builder) {
super.serialize(builder); super.serialize(builder);
+ // Paper start + // Paper start
+ if (isInvisible()) { + if (this.isInvisible()) {
+ builder.put(INVISIBLE.BUKKIT, invisible); + builder.put(INVISIBLE.BUKKIT, invisible);
+ } + }
+ +
+ if (hasNoBasePlate()) { + if (this.hasNoBasePlate()) {
+ builder.put(NO_BASE_PLATE.BUKKIT, noBasePlate); + builder.put(NO_BASE_PLATE.BUKKIT, noBasePlate);
+ } + }
+ +
+ if (shouldShowArms()) { + if (this.shouldShowArms()) {
+ builder.put(SHOW_ARMS.BUKKIT, showArms); + builder.put(SHOW_ARMS.BUKKIT, showArms);
+ } + }
+ +
+ if (isSmall()) { + if (this.isSmall()) {
+ builder.put(SMALL.BUKKIT, small); + builder.put(SMALL.BUKKIT, small);
+ } + }
+ +
+ if (isMarker()) { + if (this.isMarker()) {
+ builder.put(MARKER.BUKKIT, marker); + builder.put(MARKER.BUKKIT, marker);
+ } + }
+ // Paper end + // Paper end
@ -206,7 +198,7 @@ index 783b9c7283492fb71776b61f9820c21a39868c47..6521f4f6f660885f59f024640239609f
return builder; return builder;
} }
@@ -128,4 +243,56 @@ public class CraftMetaArmorStand extends CraftMetaItem { @@ -128,4 +235,56 @@ public class CraftMetaArmorStand extends CraftMetaItem {
return clone; return clone;
} }
@ -264,10 +256,10 @@ index 783b9c7283492fb71776b61f9820c21a39868c47..6521f4f6f660885f59f024640239609f
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 521699615778c4b724d10edfee1d3915e036eb2e..64f166fa93e998a58a895d785ff8c9e62dacb1bb 100644 index 45f4f8265c51a5b08db8aa7f53915c4bd0536d39..4ad6fd7e110f949f0bd859331ed6a5109ade3008 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -1441,6 +1441,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1442,6 +1442,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
CraftMetaCrossbow.CHARGED.NBT, CraftMetaCrossbow.CHARGED.NBT,
CraftMetaCrossbow.CHARGED_PROJECTILES.NBT, CraftMetaCrossbow.CHARGED_PROJECTILES.NBT,
CraftMetaSuspiciousStew.EFFECTS.NBT, CraftMetaSuspiciousStew.EFFECTS.NBT,
@ -281,15 +273,15 @@ index 521699615778c4b724d10edfee1d3915e036eb2e..64f166fa93e998a58a895d785ff8c9e6
+ // Paper end + // Paper end
CraftMetaCompass.LODESTONE_DIMENSION.NBT, CraftMetaCompass.LODESTONE_DIMENSION.NBT,
CraftMetaCompass.LODESTONE_POS.NBT, CraftMetaCompass.LODESTONE_POS.NBT,
CraftMetaCompass.LODESTONE_TRACKED.NBT CraftMetaCompass.LODESTONE_TRACKED.NBT,
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
index 9a351c137776ac622f4df7353bb353142b3a6ccc..42f577ed3508ba5a380648461e149f16ce97c9bd 100644 index c1fc48881dffa61f461078bea5640f8c1a1f6570..b0bb30aebdba99a8fa929ec3c56e46b59d2467c9 100644
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
@@ -313,6 +313,7 @@ public class ItemMetaTest extends AbstractTestingBase { @@ -314,6 +314,7 @@ public class ItemMetaTest extends AbstractTestingBase {
final CraftMetaArmorStand meta = (CraftMetaArmorStand) cleanStack.getItemMeta(); final CraftMetaArmorStand meta = (CraftMetaArmorStand) cleanStack.getItemMeta();
meta.entityTag = new NBTTagCompound(); meta.entityTag = new CompoundTag();
meta.entityTag.setBoolean("Small", true); meta.entityTag.putBoolean("Small", true);
+ meta.setInvisible(true); // Paper + meta.setInvisible(true); // Paper
cleanStack.setItemMeta(meta); cleanStack.setItemMeta(meta);
return cleanStack; return cleanStack;

Datei anzeigen

@ -13,19 +13,11 @@ Update adjacent blocks of doors, double plants, pistons and beds
when cancelling interaction. when cancelling interaction.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index 26ce794cb8d089c03fab5dd0a0c910783d10b72e..b1a53093eb5b5f359eedb6c252cf6d0d1ae8e409 100644 index 9d303a962950c7464d1d4a2a0ce3f658628cc785..a67b7c82236d448bf10c257ab0a10476372ce89c 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -23,6 +23,7 @@ import net.minecraft.core.BlockPos; @@ -178,6 +178,11 @@ public class ServerPlayerGameMode {
import net.minecraft.core.Direction; PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, pos, direction, this.player.getInventory().getSelected(), InteractionHand.MAIN_HAND);
import net.minecraft.network.protocol.game.ClientboundBlockBreakAckPacket;
import net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket;
+import net.minecraft.network.protocol.game.ClientboundContainerClosePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoPacket;
import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket;
import net.minecraft.server.MinecraftServer;
@@ -180,6 +181,11 @@ public class ServerPlayerGameMode {
PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, pos, direction, this.player.inventory.getSelected(), InteractionHand.MAIN_HAND);
if (event.isCancelled()) { if (event.isCancelled()) {
// Let the client know the block still exists // Let the client know the block still exists
+ // Paper start - brute force neighbor blocks for any attached blocks + // Paper start - brute force neighbor blocks for any attached blocks
@ -36,23 +28,15 @@ index 26ce794cb8d089c03fab5dd0a0c910783d10b72e..b1a53093eb5b5f359eedb6c252cf6d0d
this.player.connection.send(new ClientboundBlockUpdatePacket(this.level, pos)); this.player.connection.send(new ClientboundBlockUpdatePacket(this.level, pos));
// Update any tile entity data for this block // Update any tile entity data for this block
BlockEntity tileentity = this.level.getBlockEntity(pos); BlockEntity tileentity = this.level.getBlockEntity(pos);
@@ -484,6 +490,7 @@ public class ServerPlayerGameMode { @@ -493,7 +498,13 @@ public class ServerPlayerGameMode {
interactItemStack = stack.copy();
if (event.useInteractedBlock() == Event.Result.DENY) {
+
// If we denied a door from opening, we need to send a correcting update to the client, as it already opened the door.
if (iblockdata.getBlock() instanceof DoorBlock) {
boolean bottom = iblockdata.getValue(DoorBlock.HALF) == DoubleBlockHalf.LOWER;
@@ -496,7 +503,13 @@ public class ServerPlayerGameMode {
// send a correcting update to the client for the block above as well, this because of replaceable blocks (such as grass, sea grass etc) // send a correcting update to the client for the block above as well, this because of replaceable blocks (such as grass, sea grass etc)
player.connection.send(new ClientboundBlockUpdatePacket(world, blockposition.above())); player.connection.send(new ClientboundBlockUpdatePacket(world, blockposition.above()));
+ // Paper start - extend Player Interact cancellation // TODO: consider merging this into the extracted method + // Paper start - extend Player Interact cancellation // TODO: consider merging this into the extracted method
+ } else if (iblockdata.getBlock() instanceof StructureBlock) { + } else if (iblockdata.getBlock() instanceof net.minecraft.world.level.block.StructureBlock) {
+ player.connection.send(new ClientboundContainerClosePacket()); + player.connection.send(new net.minecraft.network.protocol.game.ClientboundContainerClosePacket(this.player.containerMenu.containerId));
+ } else if (iblockdata.getBlock() instanceof CommandBlock) { + } else if (iblockdata.getBlock() instanceof net.minecraft.world.level.block.CommandBlock) {
+ player.connection.send(new ClientboundContainerClosePacket()); + player.connection.send(new net.minecraft.network.protocol.game.ClientboundContainerClosePacket(this.player.containerMenu.containerId));
} }
+ // Paper end - extend Player Interact cancellation + // Paper end - extend Player Interact cancellation
player.getBukkitEntity().updateInventory(); // SPIGOT-2867 player.getBukkitEntity().updateInventory(); // SPIGOT-2867

Datei anzeigen

@ -7,30 +7,32 @@ This is faster if all you need is the UUID, as .getOwner() will cause
an OfflinePlayer to be loaded from disk. an OfflinePlayer to be loaded from disk.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
index 6136b3322a340d506ce744bcd15f71a158e46ad1..04b0b2449f20220c74892788080d40e3693151c5 100644 index 27a1ca43792644fc239af81dea5510f25d3328e9..69c95644b2531c1fe1c4a6cf7fee12e997dd67f4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
@@ -89,6 +89,9 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac @@ -89,6 +89,10 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac
} }
} }
+ @Override
+ public UUID getOwnerUniqueId() { + public UUID getOwnerUniqueId() {
+ return getOwnerUUID(); + return getOwnerUUID();
+ } + }
public UUID getOwnerUUID() { public UUID getOwnerUUID() {
return getHandle().getOwnerUUID(); return this.getHandle().getOwnerUUID();
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
index 35587fd6d90dfd1da2075c3268692eac7a2eaa25..85fe4f07d35c514f2a7c7920ec416fb651434c83 100644 index cc90c09c26b04689e4fffa890baf0e89c38665a3..0b152d8d20924fc1ce7f5bafb050216d250f6536 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
@@ -17,6 +17,9 @@ public class CraftTameableAnimal extends CraftAnimals implements Tameable, Creat @@ -17,6 +17,10 @@ public class CraftTameableAnimal extends CraftAnimals implements Tameable, Creat
return (TamableAnimal) super.getHandle(); return (TamableAnimal) super.getHandle();
} }
+ @Override
+ public UUID getOwnerUniqueId() { + public UUID getOwnerUniqueId() {
+ return getOwnerUUID(); + return getOwnerUUID();
+ } + }
public UUID getOwnerUUID() { public UUID getOwnerUUID() {
try { try {
return getHandle().getOwnerUUID(); return this.getHandle().getOwnerUUID();

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Toggleable player crits, helps mitigate hacked clients.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 3c39f1bb3d88baaaed4dd43c51faeef89bb5c6c2..48f0385c7203c7955de5a015f3dc42be2ab7b681 100644 index 3577100f850975020b74f077d688f59dbca78962..da4a110809eee691c1d5b072de335d75e1516eae 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -192,6 +192,11 @@ public class PaperWorldConfig { @@ -192,6 +192,11 @@ public class PaperWorldConfig {
@ -21,10 +21,10 @@ index 3c39f1bb3d88baaaed4dd43c51faeef89bb5c6c2..48f0385c7203c7955de5a015f3dc42be
private void allChunksAreSlimeChunks() { private void allChunksAreSlimeChunks() {
allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false); allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 43868c1e2d2c858a4f02119c3238f615f9b1ee72..63871a3a1981b2e8c7ad74214196e35684acb584 100644 index d3fe3eabf4465101760951113b23edf2ce03e57d..4e8d38a6379d3dc1b7167b27479e6a27ea19ea19 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1131,6 +1131,7 @@ public abstract class Player extends LivingEntity { @@ -1191,6 +1191,7 @@ public abstract class Player extends LivingEntity {
boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity; boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity;

Datei anzeigen

@ -12,10 +12,10 @@ flushing on the netty event loop, so it won't do the flush on the main thread.
Renable flushing by passing -Dpaper.explicit-flush=true Renable flushing by passing -Dpaper.explicit-flush=true
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 3429c813a5b471cdfa561bd20849a303e5aacead..7f4681910751047a26fdfc6b59bc460449c02001 100644 index 1d46187969b5792c255d0bf1966b427b905cb69c..0c5c62be83223e20f216df84413b8c2438db81ff 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -73,6 +73,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -86,6 +86,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
// Paper start - NetworkClient implementation // Paper start - NetworkClient implementation
public int protocolVersion; public int protocolVersion;
public java.net.InetSocketAddress virtualHost; public java.net.InetSocketAddress virtualHost;
@ -23,7 +23,7 @@ index 3429c813a5b471cdfa561bd20849a303e5aacead..7f4681910751047a26fdfc6b59bc4604
// Paper end // Paper end
public Connection(PacketFlow side) { public Connection(PacketFlow side) {
@@ -240,7 +241,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -259,7 +260,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
} }
if (this.channel != null) { if (this.channel != null) {

Datei anzeigen

@ -175,55 +175,22 @@ index 0000000000000000000000000000000000000000..4c2351b03b58511b80017b58ee9b20ab
+ +
+} +}
diff --git a/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java b/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java 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 b985d238eadf857602636ba5e5c277d4b1992d35..5b2081f920304244df96de78b2c66cf8a49a5b85 100644 index 67455a5ba75c9b816213e44d6872c5ddf8e27e98..23efad80934930beadf15e65781551d4ba7ff81b 100644
--- a/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java --- a/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java
+++ b/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java +++ b/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java
@@ -2,6 +2,7 @@ package net.minecraft.network.protocol.status; @@ -10,7 +10,9 @@ import net.minecraft.util.GsonHelper;
import net.minecraft.util.LowerCaseEnumTypeAdapterFactory;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
+import io.papermc.paper.adventure.AdventureComponent; // Paper
import java.io.IOException;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.chat.Component;
@@ -12,7 +13,9 @@ import net.minecraft.util.LowerCaseEnumTypeAdapterFactory;
public class ClientboundStatusResponsePacket implements Packet<ClientStatusPacketListener> { public class ClientboundStatusResponsePacket implements Packet<ClientStatusPacketListener> {
- 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()).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()) + 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(AdventureComponent.class, new AdventureComponent.Serializer()) + .registerTypeAdapter(io.papermc.paper.adventure.AdventureComponent.class, new io.papermc.paper.adventure.AdventureComponent.Serializer())
+ .create(); + .create();
private ServerStatus status; private final ServerStatus status;
public ClientboundStatusResponsePacket() {} public ClientboundStatusResponsePacket(ServerStatus metadata) {
diff --git a/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java b/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java
index d6be3dd6cfed3f65325398fc33663cb251f87ac7..31d45cd635eae2ff406cb0441f2cd2aee833b945 100644
--- a/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java
+++ b/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java
@@ -31,6 +31,7 @@ public class ServerStatus {
this.description = description;
}
+ public Players getPlayers() { return getPlayers(); } // Paper - OBFHELPER
public ServerStatus.Players getPlayers() {
return this.players;
}
@@ -162,10 +163,12 @@ public class ServerStatus {
return this.numPlayers;
}
+ public GameProfile[] getSample() { return getSample(); } // Paper - OBFHELPER
public GameProfile[] getSample() {
return this.sample;
}
+ public void setSample(GameProfile[] sample) { setSample(sample); } // Paper - OBFHELPER
public void setSample(GameProfile[] sample) {
this.sample = sample;
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4b3341877629c7065496fb0f0b4d509f5a48db6d..d34da1eb172a7dcda564680afecf3dc145bf09f3 100644 index fb4385333ef8dd4fa22275753606df3020000539..a0c436fd5e7e03a0a01e59c046e65ebdcd88021a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2,6 +2,9 @@ package net.minecraft.server; @@ -2,6 +2,9 @@ package net.minecraft.server;
@ -236,7 +203,7 @@ index 4b3341877629c7065496fb0f0b4d509f5a48db6d..d34da1eb172a7dcda564680afecf3dc1
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
@@ -1238,7 +1241,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1310,7 +1313,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (i - this.lastServerStatus >= 5000000000L) { if (i - this.lastServerStatus >= 5000000000L) {
this.lastServerStatus = i; this.lastServerStatus = i;
this.status.setPlayers(new ServerStatus.Players(this.getMaxPlayers(), this.getPlayerCount())); this.status.setPlayers(new ServerStatus.Players(this.getMaxPlayers(), this.getPlayerCount()));
@ -246,28 +213,10 @@ index 4b3341877629c7065496fb0f0b4d509f5a48db6d..d34da1eb172a7dcda564680afecf3dc1
for (int k = 0; k < agameprofile.length; ++k) { for (int k = 0; k < agameprofile.length; ++k) {
diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
index 223df8d27c2ff1cbff634bca3dbde5cc24de7f98..f74e3cbdff8c2d83809f04f42717501d7b1a1ed2 100644 index 9baa56d6da9c24706f1dbc8851fd68ca752cab26..d65191a50349ec86fe35df4ac1070f94fbb77b4c 100644
--- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
@@ -1,7 +1,7 @@ @@ -47,6 +47,8 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
package net.minecraft.server.network;
import net.minecraft.server.MinecraftServer;
-import net.minecraft.server.level.ServerPlayer;
+
// CraftBukkit start
import com.mojang.authlib.GameProfile;
import java.net.InetSocketAddress;
@@ -11,8 +11,6 @@ import net.minecraft.network.Connection;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.network.protocol.status.ClientboundPongResponsePacket;
-import net.minecraft.network.protocol.status.ClientboundStatusResponsePacket;
-import net.minecraft.network.protocol.status.ServerStatus;
import net.minecraft.network.protocol.status.ServerStatusPacketListener;
import net.minecraft.network.protocol.status.ServerboundPingRequestPacket;
import net.minecraft.network.protocol.status.ServerboundStatusRequestPacket;
@@ -47,15 +45,17 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
this.connection.disconnect(ServerStatusPacketListenerImpl.DISCONNECT_REASON); this.connection.disconnect(ServerStatusPacketListenerImpl.DISCONNECT_REASON);
} else { } else {
this.hasRequestedStatus = true; this.hasRequestedStatus = true;
@ -275,88 +224,11 @@ index 223df8d27c2ff1cbff634bca3dbde5cc24de7f98..f74e3cbdff8c2d83809f04f42717501d
+ /* + /*
// CraftBukkit start // CraftBukkit start
// this.networkManager.sendPacket(new PacketStatusOutServerInfo(this.minecraftServer.getServerPing())); // this.networkManager.sendPacket(new PacketStatusOutServerInfo(this.minecraftServer.getServerPing()));
- final Object[] players = server.getPlayerList().players.toArray(); final Object[] players = this.server.getPlayerList().players.toArray();
+ final Object[] players = minecraftServer.getPlayerList().players.toArray(); @@ -142,6 +144,9 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
class ServerListPingEvent extends org.bukkit.event.server.ServerListPingEvent { ping.setVersion(new ServerStatus.Version(this.server.getServerModName() + " " + this.server.getServerVersion(), version));
- CraftIconCache icon = server.server.getServerIcon(); this.connection.send(new ClientboundStatusResponsePacket(ping));
+ CraftIconCache icon = minecraftServer.server.getServerIcon();
ServerListPingEvent() {
- super(((InetSocketAddress) connection.getRemoteAddress()).getAddress(), server.server.motd(), server.getPlayerList().getMaxPlayers()); // Paper - Adventure
+ super(((InetSocketAddress) networkManager.getSocketAddress()).getAddress(), minecraftServer.server.motd(), minecraftServer.getPlayerList().getMaxPlayers()); // Paper - Adventure
}
@Override
@@ -71,7 +71,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
return new Iterator<Player>() {
int i;
int ret = Integer.MIN_VALUE;
- ServerPlayer player;
+ EntityPlayer player;
@Override
public boolean hasNext() {
@@ -80,7 +80,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
}
final Object[] currentPlayers = players;
for (int length = currentPlayers.length, i = this.i; i < length; i++) {
- final ServerPlayer player = (ServerPlayer) currentPlayers[i];
+ final EntityPlayer player = (EntityPlayer) currentPlayers[i];
if (player != null) {
this.i = i + 1;
this.player = player;
@@ -95,7 +95,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
if (!hasNext()) {
throw new java.util.NoSuchElementException();
}
- final ServerPlayer player = this.player;
+ final EntityPlayer player = this.player;
this.player = null;
this.ret = this.i - 1;
return player.getBukkitEntity();
@@ -115,16 +115,16 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
}
ServerListPingEvent event = new ServerListPingEvent();
- this.server.server.getPluginManager().callEvent(event);
+ this.minecraftServer.server.getPluginManager().callEvent(event);
java.util.List<GameProfile> profiles = new java.util.ArrayList<GameProfile>(players.length);
for (Object player : players) {
if (player != null) {
- profiles.add(((ServerPlayer) player).getGameProfile());
+ profiles.add(((EntityPlayer) player).getProfile());
}
}
- ServerStatus.Players playerSample = new ServerStatus.Players(event.getMaxPlayers(), profiles.size());
+ ServerPing.ServerPingPlayerSample playerSample = new ServerPing.ServerPingPlayerSample(event.getMaxPlayers(), profiles.size());
// Spigot Start
if ( !profiles.isEmpty() )
{
@@ -132,16 +132,19 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
profiles = profiles.subList( 0, Math.min( profiles.size(), org.spigotmc.SpigotConfig.playerSample ) ); // Cap the sample to n (or less) displayed players, ie: Vanilla behaviour
}
// Spigot End
- playerSample.setSample(profiles.toArray(new GameProfile[profiles.size()]));
+ playerSample.a(profiles.toArray(new GameProfile[profiles.size()]));
- ServerStatus ping = new ServerStatus();
+ ServerPing ping = new ServerPing();
ping.setFavicon(event.icon.value);
- ping.setDescription(CraftChatMessage.fromString(event.getMotd(), true)[0]);
- ping.setPlayers(playerSample);
- int version = SharedConstants.getCurrentVersion().getProtocolVersion();
- ping.setVersion(new ServerStatus.Version(server.getServerModName() + " " + server.getServerVersion(), version));
-
- this.connection.send(new ClientboundStatusResponsePacket(ping));
+ ping.setMOTD(CraftChatMessage.fromString(event.getMotd(), true)[0]);
+ ping.setPlayerSample(playerSample);
+ int version = SharedConstants.getGameVersion().getProtocolVersion();
+ ping.setServerInfo(new ServerPing.ServerData(minecraftServer.getServerModName() + " " + minecraftServer.getVersion(), version));
+
+ this.networkManager.sendPacket(new PacketStatusOutServerInfo(ping));
+ */ + */
+ com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(this.server, this.connection); + com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(this.server, this.connection);
+ // Paper end + // Paper end
@ -364,15 +236,15 @@ index 223df8d27c2ff1cbff634bca3dbde5cc24de7f98..f74e3cbdff8c2d83809f04f42717501d
// CraftBukkit end // CraftBukkit end
} }
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 3981ba5957fdc2929d54515f2b98bb7a4611e938..652b820a4c0bbf7b6bbb8200927a663665583606 100644 index e7586c325290ceb8669f9f9d430c73080a37dd05..314fa148fe783a0558ba00b068e0bf69a91577e1 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java --- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -289,7 +289,7 @@ public class SpigotConfig @@ -289,7 +289,7 @@ public class SpigotConfig
public static int playerSample; public static int playerSample;
private static void playerSample() private static void playerSample()
{ {
- playerSample = getInt( "settings.sample-count", 12 ); - SpigotConfig.playerSample = SpigotConfig.getInt( "settings.sample-count", 12 );
+ playerSample = Math.max( getInt( "settings.sample-count", 12 ), 0 ); // Paper - Avoid negative counts + SpigotConfig.playerSample = Math.max( SpigotConfig.getInt( "settings.sample-count", 12 ), 0 ); // Paper - Avoid negative counts
Bukkit.getLogger().log( Level.INFO, "Server Ping Player Sample Count: {0}", playerSample ); // Paper - Use logger Bukkit.getLogger().log( Level.INFO, "Server Ping Player Sample Count: {0}", playerSample ); // Paper - Use logger
} }

Datei anzeigen

@ -159,7 +159,7 @@ index 0000000000000000000000000000000000000000..3c1992e212a6d6f1db4d5b807b38d719
+ } + }
+} +}
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 0e0f361c3af363539d5d1d865603114bdb84fd67..ca90237a53c9a026919d28adaedf483ca3c7c2a8 100644 index 6435d53dcddc1a43420f1ea66fa08e154b82586d..dd1e8b170e87bff2089f642f41dcf7442a8ccd16 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -63,7 +63,7 @@ public class CraftScheduler implements BukkitScheduler { @@ -63,7 +63,7 @@ public class CraftScheduler implements BukkitScheduler {
@ -190,7 +190,7 @@ index 0e0f361c3af363539d5d1d865603114bdb84fd67..ca90237a53c9a026919d28adaedf483c
@@ -94,12 +95,31 @@ public class CraftScheduler implements BukkitScheduler { @@ -94,12 +95,31 @@ public class CraftScheduler implements BukkitScheduler {
} }
}; };
private CraftAsyncDebugger debugTail = debugHead; private CraftAsyncDebugger debugTail = this.debugHead;
+ +
+ */ // Paper end + */ // Paper end
private static final int RECENT_TICKS; private static final int RECENT_TICKS;
@ -223,8 +223,8 @@ index 0e0f361c3af363539d5d1d865603114bdb84fd67..ca90237a53c9a026919d28adaedf483c
} else if (period < CraftTask.NO_REPEATING) { } else if (period < CraftTask.NO_REPEATING) {
period = CraftTask.NO_REPEATING; period = CraftTask.NO_REPEATING;
} }
- return handle(new CraftAsyncTask(runners, plugin, runnable, nextId(), period), delay); - return this.handle(new CraftAsyncTask(this.runners, plugin, runnable, this.nextId(), period), delay);
+ return handle(new CraftAsyncTask(this.asyncScheduler.runners, plugin, runnable, nextId(), period), delay); // Paper + return this.handle(new CraftAsyncTask(this.asyncScheduler.runners, plugin, runnable, this.nextId(), period), delay); // Paper
} }
@Override @Override
@ -237,7 +237,7 @@ index 0e0f361c3af363539d5d1d865603114bdb84fd67..ca90237a53c9a026919d28adaedf483c
+ this.asyncScheduler.cancelTask(taskId); + this.asyncScheduler.cancelTask(taskId);
+ } + }
+ // Paper end + // Paper end
CraftTask task = runners.get(taskId); CraftTask task = this.runners.get(taskId);
if (task != null) { if (task != null) {
task.cancel0(); task.cancel0();
@@ -280,6 +305,11 @@ public class CraftScheduler implements BukkitScheduler { @@ -280,6 +305,11 @@ public class CraftScheduler implements BukkitScheduler {
@ -257,13 +257,13 @@ index 0e0f361c3af363539d5d1d865603114bdb84fd67..ca90237a53c9a026919d28adaedf483c
@Override @Override
public boolean isCurrentlyRunning(final int taskId) { public boolean isCurrentlyRunning(final int taskId) {
+ // Paper start + // Paper start
+ if (!isAsyncScheduler) { + if (!this.isAsyncScheduler) {
+ if (this.asyncScheduler.isCurrentlyRunning(taskId)) { + if (this.asyncScheduler.isCurrentlyRunning(taskId)) {
+ return true; + return true;
+ } + }
+ } + }
+ // Paper end + // Paper end
final CraftTask task = runners.get(taskId); final CraftTask task = this.runners.get(taskId);
if (task == null) { if (task == null) {
return false; return false;
@@ -337,6 +374,11 @@ public class CraftScheduler implements BukkitScheduler { @@ -337,6 +374,11 @@ public class CraftScheduler implements BukkitScheduler {
@ -275,7 +275,7 @@ index 0e0f361c3af363539d5d1d865603114bdb84fd67..ca90237a53c9a026919d28adaedf483c
+ return true; + return true;
+ } + }
+ // Paper end + // Paper end
for (CraftTask task = head.getNext(); task != null; task = task.getNext()) { for (CraftTask task = this.head.getNext(); task != null; task = task.getNext()) {
if (task.getTaskId() == taskId) { if (task.getTaskId() == taskId) {
return task.getPeriod() >= CraftTask.NO_REPEATING; // The task will run return task.getPeriod() >= CraftTask.NO_REPEATING; // The task will run
@@ -348,6 +390,12 @@ public class CraftScheduler implements BukkitScheduler { @@ -348,6 +390,12 @@ public class CraftScheduler implements BukkitScheduler {
@ -289,7 +289,7 @@ index 0e0f361c3af363539d5d1d865603114bdb84fd67..ca90237a53c9a026919d28adaedf483c
+ } + }
+ // Paper end + // Paper end
final ArrayList<BukkitWorker> workers = new ArrayList<BukkitWorker>(); final ArrayList<BukkitWorker> workers = new ArrayList<BukkitWorker>();
for (final CraftTask taskObj : runners.values()) { for (final CraftTask taskObj : this.runners.values()) {
// Iterator will be a best-effort (may fail to grab very new values) if called from an async thread // Iterator will be a best-effort (may fail to grab very new values) if called from an async thread
@@ -385,6 +433,11 @@ public class CraftScheduler implements BukkitScheduler { @@ -385,6 +433,11 @@ public class CraftScheduler implements BukkitScheduler {
pending.add(task); pending.add(task);
@ -314,18 +314,18 @@ index 0e0f361c3af363539d5d1d865603114bdb84fd67..ca90237a53c9a026919d28adaedf483c
+ // Paper end + // Paper end
this.currentTick = currentTick; this.currentTick = currentTick;
final List<CraftTask> temp = this.temp; final List<CraftTask> temp = this.temp;
parsePending(); this.parsePending();
@@ -431,7 +489,7 @@ public class CraftScheduler implements BukkitScheduler { @@ -431,7 +489,7 @@ public class CraftScheduler implements BukkitScheduler {
parsePending(); this.parsePending();
} else { } else {
//debugTail = debugTail.setNext(new CraftAsyncDebugger(currentTick + RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper //this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
- executor.execute(new ServerSchedulerReportingWrapper(task)); // Paper - this.executor.execute(new ServerSchedulerReportingWrapper(task)); // Paper
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Paper"); // Paper + task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Paper"); // Paper
// We don't need to parse pending // We don't need to parse pending
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code) // (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
} }
@@ -450,7 +508,7 @@ public class CraftScheduler implements BukkitScheduler { @@ -450,7 +508,7 @@ public class CraftScheduler implements BukkitScheduler {
//debugHead = debugHead.getNextHead(currentTick); // Paper //this.debugHead = this.debugHead.getNextHead(currentTick); // Paper
} }
- private void addTask(final CraftTask task) { - private void addTask(final CraftTask task) {
@ -345,11 +345,11 @@ index 0e0f361c3af363539d5d1d865603114bdb84fd67..ca90237a53c9a026919d28adaedf483c
+ return task; + return task;
+ } + }
+ // Paper end + // Paper end
task.setNextRun(currentTick + delay); task.setNextRun(this.currentTick + delay);
addTask(task); this.addTask(task);
return task; return task;
@@ -478,8 +542,8 @@ public class CraftScheduler implements BukkitScheduler { @@ -478,8 +542,8 @@ public class CraftScheduler implements BukkitScheduler {
return ids.incrementAndGet(); return this.ids.incrementAndGet();
} }
- private void parsePending() { - private void parsePending() {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent
This will allow you to change the players name or skin on login. This will allow you to change the players name or skin on login.
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index ff83fb15d0d0adb62c630fc7aafc134972bf15fc..e5be45ac86907c1f8cc154bd38fd624a2320180f 100644 index 7923078a4235a6169eb94b7c0ce85e4cd51eb593..f39ccd15c037138a933eb529bec17d49349c0264 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
@ -17,7 +17,7 @@ index ff83fb15d0d0adb62c630fc7aafc134972bf15fc..e5be45ac86907c1f8cc154bd38fd624a
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import com.mojang.authlib.exceptions.AuthenticationUnavailableException; import com.mojang.authlib.exceptions.AuthenticationUnavailableException;
import java.math.BigInteger; import java.math.BigInteger;
@@ -36,6 +38,7 @@ import org.apache.commons.lang3.Validate; @@ -37,6 +39,7 @@ import org.apache.commons.lang3.Validate;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import io.papermc.paper.adventure.PaperAdventure; // Paper import io.papermc.paper.adventure.PaperAdventure; // Paper
@ -25,8 +25,8 @@ index ff83fb15d0d0adb62c630fc7aafc134972bf15fc..e5be45ac86907c1f8cc154bd38fd624a
import org.bukkit.craftbukkit.util.Waitable; import org.bukkit.craftbukkit.util.Waitable;
import org.bukkit.event.player.AsyncPlayerPreLoginEvent; import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
import org.bukkit.event.player.PlayerPreLoginEvent; import org.bukkit.event.player.PlayerPreLoginEvent;
@@ -314,8 +317,16 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener @@ -336,8 +339,16 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
java.util.UUID uniqueId = gameProfile.getId(); java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId();
final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server;
- AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId); - AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId);

Datei anzeigen

@ -6,61 +6,52 @@ Subject: [PATCH] Player.setPlayerProfile API
This can be useful for changing name or skins after a player has logged in. This can be useful for changing name or skins after a player has logged in.
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index e5be45ac86907c1f8cc154bd38fd624a2320180f..0aa3a154d68f00edcc09b947a24b2b59b1e135e6 100644 index f39ccd15c037138a933eb529bec17d49349c0264..1d05725374bdffad6a8ab1502ee732775345024d 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -54,7 +54,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener @@ -340,12 +340,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
public final Connection connection;
private ServerLoginPacketListenerImpl.State state;
private int tick;
- private GameProfile gameProfile;
+ private GameProfile gameProfile; private void setGameProfile(final GameProfile profile) { this.gameProfile = profile; } private GameProfile getGameProfile() { return this.gameProfile; } // Paper - OBFHELPER
private final String serverId;
private SecretKey secretKey;
private ServerPlayer delayedAcceptPlayer;
@@ -318,12 +318,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server;
// Paper start // Paper start
- PlayerProfile profile = Bukkit.createProfile(uniqueId, playerName); - PlayerProfile profile = Bukkit.createProfile(uniqueId, playerName);
+ PlayerProfile profile = CraftPlayerProfile.asBukkitMirror(getGameProfile()); + PlayerProfile profile = CraftPlayerProfile.asBukkitMirror(ServerLoginPacketListenerImpl.this.gameProfile);
AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile); AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile);
server.getPluginManager().callEvent(asyncEvent); server.getPluginManager().callEvent(asyncEvent);
profile = asyncEvent.getPlayerProfile(); profile = asyncEvent.getPlayerProfile();
- profile.complete(); - profile.complete();
- gameProfile = CraftPlayerProfile.asAuthlibCopy(profile); - gameProfile = CraftPlayerProfile.asAuthlibCopy(profile);
+ profile.complete(true); + profile.complete(true);
+ setGameProfile(CraftPlayerProfile.asAuthlib(profile)); + ServerLoginPacketListenerImpl.this.gameProfile = CraftPlayerProfile.asAuthlib(profile);
playerName = gameProfile.getName(); playerName = gameProfile.getName();
uniqueId = gameProfile.getId(); uniqueId = gameProfile.getId();
// Paper end // Paper end
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 63871a3a1981b2e8c7ad74214196e35684acb584..c4aa824d03de952fe6b306e539baa47af979add1 100644 index 4e8d38a6379d3dc1b7167b27479e6a27ea19ea19..3c0aca2b90521da83cf494d9fff953a17a57701d 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -159,7 +159,7 @@ public abstract class Player extends LivingEntity { @@ -173,7 +173,7 @@ public abstract class Player extends LivingEntity {
protected int enchantmentSeed; protected int enchantmentSeed;
protected final float defaultFlySpeed = 0.02F; protected final float defaultFlySpeed = 0.02F;
private int lastLevelUpTime; private int lastLevelUpTime;
- private final GameProfile gameProfile; - private final GameProfile gameProfile;
+ private GameProfile gameProfile; public final void setProfile(final GameProfile profile) { this.gameProfile = profile; } // Paper - OBFHELPER + public GameProfile gameProfile; // Paper - private->public
private boolean reducedDebugInfo;
private ItemStack lastItemInMainHand; private ItemStack lastItemInMainHand;
private final ItemCooldowns cooldowns; private final ItemCooldowns cooldowns;
@Nullable
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index efdcb8dac8db15c4bbaed84a7861ce98339e516a..9d853733ff9054cc48925e22c8bb3c8d9b898808 100644 index 75963a28b39f8835f1daba3d1b44655603124bf3..8bf0c74ee32e8cb7c0f48bc964552811ad6ee468 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -67,6 +67,7 @@ import net.minecraft.world.inventory.AbstractContainerMenu; @@ -71,6 +71,7 @@ import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.GameType; import net.minecraft.world.level.GameType;
import net.minecraft.world.level.block.Blocks;
+import net.minecraft.world.level.biome.BiomeManager; +import net.minecraft.world.level.biome.BiomeManager;
import net.minecraft.world.level.block.entity.SignBlockEntity; import net.minecraft.world.level.block.entity.SignBlockEntity;
import net.minecraft.world.level.saveddata.maps.MapDecoration; import net.minecraft.world.level.saveddata.maps.MapDecoration;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.level.saveddata.maps.MapItemSavedData;
@@ -1307,8 +1308,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1320,8 +1321,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
hiddenPlayers.put(player.getUniqueId(), hidingPlugins); this.hiddenPlayers.put(player.getUniqueId(), hidingPlugins);
// Remove this player from the hidden player's EntityTrackerEntry // Remove this player from the hidden player's EntityTrackerEntry
- ChunkMap tracker = ((ServerLevel) entity.level).getChunkSource().chunkMap; - ChunkMap tracker = ((ServerLevel) entity.level).getChunkSource().chunkMap;
@ -73,10 +64,10 @@ index efdcb8dac8db15c4bbaed84a7861ce98339e516a..9d853733ff9054cc48925e22c8bb3c8d
+ // Paper end + // Paper end
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
if (entry != null) { if (entry != null) {
entry.removePlayer(getHandle()); entry.removePlayer(this.getHandle());
@@ -1349,8 +1355,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1362,8 +1368,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
hiddenPlayers.remove(player.getUniqueId()); this.hiddenPlayers.remove(player.getUniqueId());
- ChunkMap tracker = ((ServerLevel) entity.level).getChunkSource().chunkMap; - ChunkMap tracker = ((ServerLevel) entity.level).getChunkSource().chunkMap;
+ // Paper start + // Paper start
@ -87,10 +78,10 @@ index efdcb8dac8db15c4bbaed84a7861ce98339e516a..9d853733ff9054cc48925e22c8bb3c8d
+ ChunkMap tracker = ((ServerLevel) entity.level).getChunkSource().chunkMap; + ChunkMap tracker = ((ServerLevel) entity.level).getChunkSource().chunkMap;
+ // Paper end + // Paper end
getHandle().connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, other)); this.getHandle().connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, other));
@@ -1359,6 +1370,50 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1372,6 +1383,50 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
entry.updatePlayer(getHandle()); entry.updatePlayer(this.getHandle());
} }
} }
+ // Paper start + // Paper start
@ -102,7 +93,7 @@ index efdcb8dac8db15c4bbaed84a7861ce98339e516a..9d853733ff9054cc48925e22c8bb3c8d
+ } + }
+ public void setPlayerProfile(com.destroystokyo.paper.profile.PlayerProfile profile) { + public void setPlayerProfile(com.destroystokyo.paper.profile.PlayerProfile profile) {
+ ServerPlayer self = getHandle(); + ServerPlayer self = getHandle();
+ self.setProfile(com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile)); + self.gameProfile = com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile);
+ if (!self.sentListPacket) { + if (!self.sentListPacket) {
+ return; + return;
+ } + }
@ -128,7 +119,7 @@ index efdcb8dac8db15c4bbaed84a7861ce98339e516a..9d853733ff9054cc48925e22c8bb3c8d
+ ServerLevel worldserver = handle.getLevel(); + ServerLevel worldserver = handle.getLevel();
+ connection.send(new net.minecraft.network.protocol.game.ClientboundRespawnPacket(worldserver.dimensionType(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), handle.gameMode.getGameModeForPlayer(), handle.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), true)); + connection.send(new net.minecraft.network.protocol.game.ClientboundRespawnPacket(worldserver.dimensionType(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), handle.gameMode.getGameModeForPlayer(), handle.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), true));
+ handle.onUpdateAbilities(); + handle.onUpdateAbilities();
+ connection.send(new net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), new HashSet<>(), 0)); + connection.send(new net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet(), 0, false));
+ net.minecraft.server.MinecraftServer.getServer().getPlayerList().sendAllPlayerInfo(handle); + net.minecraft.server.MinecraftServer.getServer().getPlayerList().sendAllPlayerInfo(handle);
+ +
+ if (this.isOp()) { + if (this.isOp()) {
@ -139,4 +130,4 @@ index efdcb8dac8db15c4bbaed84a7861ce98339e516a..9d853733ff9054cc48925e22c8bb3c8d
+ // Paper end + // Paper end
public void removeDisconnectingPlayer(Player player) { public void removeDisconnectingPlayer(Player player) {
hiddenPlayers.remove(player.getUniqueId()); this.hiddenPlayers.remove(player.getUniqueId());