mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 21:33:49 -07:00
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/network/PlayerConnection.java
|
||||
+++ b/net/minecraft/server/network/PlayerConnection.java
|
||||
@@ -191,6 +191,67 @@
|
||||
@@ -196,6 +196,69 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
+import net.minecraft.network.chat.OutgoingChatMessage;
|
||||
+import net.minecraft.network.protocol.game.PacketPlayOutAttachEntity;
|
||||
+import net.minecraft.network.protocol.game.PacketPlayOutEntityEquipment;
|
||||
+import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
|
||||
+import net.minecraft.network.protocol.game.PacketPlayOutSetSlot;
|
||||
+import net.minecraft.world.entity.EntityInsentient;
|
||||
+import net.minecraft.world.entity.animal.Bucketable;
|
||||
+import net.minecraft.world.entity.EntityLiving;
|
||||
@@ -30,7 +30,9 @@
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemType;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
|
||||
+import org.bukkit.craftbukkit.util.CraftChatMessage;
|
||||
+import org.bukkit.craftbukkit.util.CraftLocation;
|
||||
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
+import org.bukkit.craftbukkit.util.LazyPlayerSet;
|
||||
+import org.bukkit.craftbukkit.util.Waitable;
|
||||
@@ -68,18 +70,7 @@
|
||||
public class PlayerConnection extends ServerCommonPacketListenerImpl implements PacketListenerPlayIn, ServerPlayerConnection, TickablePacketListener {
|
||||
|
||||
static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -204,7 +265,9 @@
|
||||
public final PlayerChunkSender chunkSender;
|
||||
private int tickCount;
|
||||
private int ackBlockChangesUpTo = -1;
|
||||
- private int chatSpamTickCount;
|
||||
+ // CraftBukkit start - multithreaded fields
|
||||
+ private final AtomicInteger chatSpamTickCount = new AtomicInteger();
|
||||
+ // CraftBukkit end
|
||||
private int dropSpamTickCount;
|
||||
private double firstGoodX;
|
||||
private double firstGoodY;
|
||||
@@ -239,7 +302,7 @@
|
||||
@@ -245,7 +308,7 @@
|
||||
private boolean waitingForSwitchToConfig;
|
||||
|
||||
public PlayerConnection(MinecraftServer minecraftserver, NetworkManager networkmanager, EntityPlayer entityplayer, CommonListenerCookie commonlistenercookie) {
|
||||
@@ -88,7 +79,7 @@
|
||||
this.chunkSender = new PlayerChunkSender(networkmanager.isMemoryConnection());
|
||||
this.player = entityplayer;
|
||||
entityplayer.connection = this;
|
||||
@@ -248,9 +311,25 @@
|
||||
@@ -254,9 +317,25 @@
|
||||
|
||||
Objects.requireNonNull(minecraftserver);
|
||||
this.signedMessageDecoder = SignedMessageChain.b.unsigned(uuid, minecraftserver::enforceSecureProfile);
|
||||
@@ -115,29 +106,15 @@
|
||||
@Override
|
||||
public void tick() {
|
||||
if (this.ackBlockChangesUpTo > -1) {
|
||||
@@ -302,15 +381,21 @@
|
||||
}
|
||||
|
||||
this.keepConnectionAlive();
|
||||
+ // CraftBukkit start
|
||||
+ for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !chatSpamTickCount.compareAndSet(spam, spam - 1); ) ;
|
||||
+ /* Use thread-safe field access instead
|
||||
if (this.chatSpamTickCount > 0) {
|
||||
--this.chatSpamTickCount;
|
||||
}
|
||||
+ */
|
||||
+ // CraftBukkit end
|
||||
|
||||
if (this.dropSpamTickCount > 0) {
|
||||
--this.dropSpamTickCount;
|
||||
}
|
||||
|
||||
@@ -311,6 +390,7 @@
|
||||
this.chatSpamThrottler.tick();
|
||||
this.dropSpamThrottler.tick();
|
||||
if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && SystemUtils.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) {
|
||||
+ this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
|
||||
this.disconnect((IChatBaseComponent) IChatBaseComponent.translatable("multiplayer.disconnect.idling"));
|
||||
}
|
||||
|
||||
@@ -399,6 +484,13 @@
|
||||
@@ -399,6 +479,13 @@
|
||||
|
||||
if (entity != this.player && entity.getControllingPassenger() == this.player && entity == this.lastVehicle) {
|
||||
WorldServer worldserver = this.player.serverLevel();
|
||||
@@ -151,7 +128,7 @@
|
||||
double d0 = entity.getX();
|
||||
double d1 = entity.getY();
|
||||
double d2 = entity.getZ();
|
||||
@@ -413,7 +505,33 @@
|
||||
@@ -413,7 +500,33 @@
|
||||
double d9 = entity.getDeltaMovement().lengthSqr();
|
||||
double d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
||||
|
||||
@@ -186,7 +163,7 @@
|
||||
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8});
|
||||
this.send(new PacketPlayOutVehicleMove(entity));
|
||||
return;
|
||||
@@ -453,14 +571,76 @@
|
||||
@@ -453,14 +566,76 @@
|
||||
}
|
||||
|
||||
entity.absMoveTo(d3, d4, d5, f, f1);
|
||||
@@ -261,9 +238,9 @@
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
this.player.serverLevel().getChunkSource().move(this.player);
|
||||
entity.recordMovementThroughBlocks(new Vec3D(d0, d1, d2), entity.position());
|
||||
Vec3D vec3d = new Vec3D(entity.getX() - d0, entity.getY() - d1, entity.getZ() - d2);
|
||||
|
||||
@@ -497,6 +677,7 @@
|
||||
@@ -498,6 +673,7 @@
|
||||
}
|
||||
|
||||
this.awaitingPositionFromClient = null;
|
||||
@@ -271,16 +248,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -504,7 +685,7 @@
|
||||
@Override
|
||||
public void handleRecipeBookSeenRecipePacket(PacketPlayInRecipeDisplayed packetplayinrecipedisplayed) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinrecipedisplayed, this, this.player.serverLevel());
|
||||
- Optional optional = this.server.getRecipeManager().byKey(packetplayinrecipedisplayed.getRecipe());
|
||||
+ Optional<? extends RecipeHolder<?>> optional = this.server.getRecipeManager().byKey(packetplayinrecipedisplayed.getRecipe()); // CraftBukkit - decompile error
|
||||
RecipeBookServer recipebookserver = this.player.getRecipeBook();
|
||||
|
||||
Objects.requireNonNull(recipebookserver);
|
||||
@@ -514,6 +695,7 @@
|
||||
@@ -521,6 +697,7 @@
|
||||
@Override
|
||||
public void handleRecipeBookChangeSettingsPacket(PacketPlayInRecipeSettings packetplayinrecipesettings) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinrecipesettings, this, this.player.serverLevel());
|
||||
@@ -288,12 +256,12 @@
|
||||
this.player.getRecipeBook().setBookSetting(packetplayinrecipesettings.getBookType(), packetplayinrecipesettings.isOpen(), packetplayinrecipesettings.isFiltering());
|
||||
}
|
||||
|
||||
@@ -534,6 +716,12 @@
|
||||
@@ -541,6 +718,12 @@
|
||||
@Override
|
||||
public void handleCustomCommandSuggestions(PacketPlayInTabComplete packetplayintabcomplete) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayintabcomplete, this, this.player.serverLevel());
|
||||
+ // CraftBukkit start
|
||||
+ if (chatSpamTickCount.addAndGet(1) > 500 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) {
|
||||
+ if (!this.chatSpamThrottler.isIncrementAndUnderThreshold(1, 500) && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) {
|
||||
+ this.disconnect(IChatBaseComponent.translatable("disconnect.spam"));
|
||||
+ return;
|
||||
+ }
|
||||
@@ -301,7 +269,7 @@
|
||||
StringReader stringreader = new StringReader(packetplayintabcomplete.getCommand());
|
||||
|
||||
if (stringreader.canRead() && stringreader.peek() == '/') {
|
||||
@@ -543,6 +731,7 @@
|
||||
@@ -550,6 +733,7 @@
|
||||
ParseResults<CommandListenerWrapper> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
|
||||
|
||||
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
|
||||
@@ -309,7 +277,7 @@
|
||||
Suggestions suggestions1 = suggestions.getList().size() <= 1000 ? suggestions : new Suggestions(suggestions.getRange(), suggestions.getList().subList(0, 1000));
|
||||
|
||||
this.send(new PacketPlayOutTabComplete(packetplayintabcomplete.getId(), suggestions1));
|
||||
@@ -787,6 +976,13 @@
|
||||
@@ -796,6 +980,13 @@
|
||||
Container container = this.player.containerMenu;
|
||||
|
||||
if (container instanceof ContainerMerchant containermerchant) {
|
||||
@@ -323,7 +291,7 @@
|
||||
if (!containermerchant.stillValid(this.player)) {
|
||||
PlayerConnection.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, containermerchant);
|
||||
return;
|
||||
@@ -800,6 +996,13 @@
|
||||
@@ -809,6 +1000,13 @@
|
||||
|
||||
@Override
|
||||
public void handleEditBook(PacketPlayInBEdit packetplayinbedit) {
|
||||
@@ -337,16 +305,7 @@
|
||||
int i = packetplayinbedit.slot();
|
||||
|
||||
if (PlayerInventory.isHotbarSlot(i) || i == 40) {
|
||||
@@ -808,7 +1011,7 @@
|
||||
|
||||
Objects.requireNonNull(list);
|
||||
optional.ifPresent(list::add);
|
||||
- Stream stream = packetplayinbedit.pages().stream().limit(100L);
|
||||
+ Stream<String> stream = packetplayinbedit.pages().stream().limit(100L); // CraftBukkit - decompile error
|
||||
|
||||
Objects.requireNonNull(list);
|
||||
stream.forEach(list::add);
|
||||
@@ -823,12 +1026,16 @@
|
||||
@@ -829,12 +1027,16 @@
|
||||
}
|
||||
|
||||
private void updateBookContents(List<FilteredText> list, int i) {
|
||||
@@ -356,7 +315,7 @@
|
||||
+ ItemStack itemstack = handItem.copy();
|
||||
+ // CraftBukkit end
|
||||
|
||||
if (itemstack.is(Items.WRITABLE_BOOK)) {
|
||||
if (itemstack.has(DataComponents.WRITABLE_BOOK_CONTENT)) {
|
||||
List<Filterable<String>> list1 = list.stream().map(this::filterableFromOutgoing).toList();
|
||||
|
||||
itemstack.set(DataComponents.WRITABLE_BOOK_CONTENT, new WritableBookContent(list1));
|
||||
@@ -364,7 +323,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -839,12 +1046,13 @@
|
||||
@@ -845,12 +1047,13 @@
|
||||
ItemStack itemstack1 = itemstack.transmuteCopy(Items.WRITTEN_BOOK);
|
||||
|
||||
itemstack1.remove(DataComponents.WRITABLE_BOOK_CONTENT);
|
||||
@@ -380,7 +339,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -906,7 +1114,7 @@
|
||||
@@ -912,7 +1115,7 @@
|
||||
} else {
|
||||
WorldServer worldserver = this.player.serverLevel();
|
||||
|
||||
@@ -389,7 +348,7 @@
|
||||
if (this.tickCount == 0) {
|
||||
this.resetPosition();
|
||||
}
|
||||
@@ -921,7 +1129,15 @@
|
||||
@@ -927,7 +1130,15 @@
|
||||
if (this.player.isPassenger()) {
|
||||
this.player.absMoveTo(this.player.getX(), this.player.getY(), this.player.getZ(), f, f1);
|
||||
this.player.serverLevel().getChunkSource().move(this.player);
|
||||
@@ -405,7 +364,7 @@
|
||||
double d3 = this.player.getX();
|
||||
double d4 = this.player.getY();
|
||||
double d5 = this.player.getZ();
|
||||
@@ -943,15 +1159,33 @@
|
||||
@@ -949,15 +1160,33 @@
|
||||
++this.receivedMovePacketCount;
|
||||
int i = this.receivedMovePacketCount - this.knownMovePacketCount;
|
||||
|
||||
@@ -432,16 +391,16 @@
|
||||
+ speed = player.getAbilities().walkingSpeed * 10f;
|
||||
+ }
|
||||
+
|
||||
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !flag)) {
|
||||
if (this.shouldCheckPlayerMovement(flag)) {
|
||||
float f2 = flag ? 300.0F : 100.0F;
|
||||
|
||||
- if (d10 - d9 > (double) (f2 * (float) i) && !this.isSingleplayerOwner()) {
|
||||
+ if (d10 - d9 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||
- if (d10 - d9 > (double) (f2 * (float) i)) {
|
||||
+ if (d10 - d9 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2))) {
|
||||
+ // CraftBukkit end
|
||||
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d6, d7, d8});
|
||||
this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
|
||||
return;
|
||||
@@ -973,6 +1207,7 @@
|
||||
@@ -979,6 +1208,7 @@
|
||||
boolean flag2 = this.player.verticalCollisionBelow;
|
||||
|
||||
this.player.move(EnumMoveType.PLAYER, new Vec3D(d6, d7, d8));
|
||||
@@ -449,12 +408,12 @@
|
||||
double d11 = d7;
|
||||
|
||||
d6 = d0 - this.player.getX();
|
||||
@@ -991,9 +1226,75 @@
|
||||
@@ -997,9 +1227,75 @@
|
||||
}
|
||||
|
||||
if (!this.player.noPhysics && !this.player.isSleeping() && (flag3 && worldserver.noCollision(this.player, axisalignedbb) || this.isPlayerCollidingWithAnythingNew(worldserver, axisalignedbb, d0, d1, d2))) {
|
||||
- this.teleport(d3, d4, d5, f, f1);
|
||||
+ this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet()); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet.
|
||||
+ this.internalTeleport(d3, d4, d5, f, f1); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet.
|
||||
this.player.doCheckFallDamage(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5, packetplayinflying.isOnGround());
|
||||
} else {
|
||||
+ // CraftBukkit start - fire PlayerMoveEvent
|
||||
@@ -526,7 +485,7 @@
|
||||
this.player.absMoveTo(d0, d1, d2, f, f1);
|
||||
boolean flag4 = this.player.isAutoSpinAttack();
|
||||
|
||||
@@ -1030,6 +1331,7 @@
|
||||
@@ -1049,6 +1345,7 @@
|
||||
this.awaitingTeleportTime = this.tickCount;
|
||||
this.teleport(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
|
||||
}
|
||||
@@ -534,38 +493,33 @@
|
||||
|
||||
return true;
|
||||
} else {
|
||||
@@ -1057,11 +1359,68 @@
|
||||
return true;
|
||||
@@ -1077,10 +1374,62 @@
|
||||
}
|
||||
|
||||
+ // CraftBukkit start - Delegate to teleport(Location)
|
||||
public void teleport(double d0, double d1, double d2, float f, float f1) {
|
||||
- this.teleport(d0, d1, d2, f, f1, Collections.emptySet());
|
||||
- this.teleport(new PositionMoveRotation(new Vec3D(d0, d1, d2), Vec3D.ZERO, f, f1), Collections.emptySet());
|
||||
+ // CraftBukkit start - Delegate to teleport(Location)
|
||||
+ this.teleport(d0, d1, d2, f, f1, PlayerTeleportEvent.TeleportCause.UNKNOWN);
|
||||
+ }
|
||||
+
|
||||
+ public boolean teleport(double d0, double d1, double d2, float f, float f1, PlayerTeleportEvent.TeleportCause cause) {
|
||||
+ return this.teleport(d0, d1, d2, f, f1, Collections.emptySet(), cause);
|
||||
+ return this.teleport(new PositionMoveRotation(new Vec3D(d0, d1, d2), Vec3D.ZERO, f, f1), Collections.emptySet(), cause);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
public void teleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set) {
|
||||
+ this.teleport(d0, d1, d2, f, f1, set, PlayerTeleportEvent.TeleportCause.UNKNOWN);
|
||||
public void teleport(PositionMoveRotation positionmoverotation, Set<Relative> set) {
|
||||
+ // CraftBukkit start
|
||||
+ this.teleport(positionmoverotation, set, PlayerTeleportEvent.TeleportCause.UNKNOWN);
|
||||
+ }
|
||||
+
|
||||
+ public boolean teleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set, PlayerTeleportEvent.TeleportCause cause) { // CraftBukkit - Return event status
|
||||
+ public boolean teleport(PositionMoveRotation positionmoverotation, Set<Relative> set, PlayerTeleportEvent.TeleportCause cause) { // CraftBukkit - Return event status
|
||||
+ Player player = this.getCraftPlayer();
|
||||
+ Location from = player.getLocation();
|
||||
+
|
||||
+ double x = d0;
|
||||
+ double y = d1;
|
||||
+ double z = d2;
|
||||
+ float yaw = f;
|
||||
+ float pitch = f1;
|
||||
+
|
||||
+ Location to = new Location(this.getCraftPlayer().getWorld(), x, y, z, yaw, pitch);
|
||||
+ PositionMoveRotation absolutePosition = PositionMoveRotation.calculateAbsolute(PositionMoveRotation.of(this.player), positionmoverotation, set);
|
||||
+ Location to = CraftLocation.toBukkit(absolutePosition.position(), this.getCraftPlayer().getWorld(), absolutePosition.yRot(), absolutePosition.xRot());
|
||||
+ // SPIGOT-5171: Triggered on join
|
||||
+ if (from.equals(to)) {
|
||||
+ this.internalTeleport(d0, d1, d2, f, f1, set);
|
||||
+ this.internalTeleport(positionmoverotation, set);
|
||||
+ return true; // CraftBukkit - Return event status
|
||||
+ }
|
||||
+
|
||||
@@ -575,51 +529,48 @@
|
||||
+ if (event.isCancelled() || !to.equals(event.getTo())) {
|
||||
+ set = Collections.emptySet(); // Can't relative teleport
|
||||
+ to = event.isCancelled() ? event.getFrom() : event.getTo();
|
||||
+ d0 = to.getX();
|
||||
+ d1 = to.getY();
|
||||
+ d2 = to.getZ();
|
||||
+ f = to.getYaw();
|
||||
+ f1 = to.getPitch();
|
||||
+ positionmoverotation = new PositionMoveRotation(CraftLocation.toVec3D(to), Vec3D.ZERO, to.getYaw(), to.getPitch());
|
||||
+ }
|
||||
+
|
||||
+ this.internalTeleport(d0, d1, d2, f, f1, set);
|
||||
+ this.internalTeleport(positionmoverotation, set);
|
||||
+ return !event.isCancelled(); // CraftBukkit - Return event status
|
||||
+ }
|
||||
+
|
||||
+ public void teleport(Location dest) {
|
||||
+ internalTeleport(dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch(), Collections.emptySet());
|
||||
+ this.internalTeleport(dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch());
|
||||
+ }
|
||||
+
|
||||
+ private void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set) {
|
||||
+ // CraftBukkit start
|
||||
+ if (Float.isNaN(f)) {
|
||||
+ f = 0;
|
||||
+ private void internalTeleport(double d0, double d1, double d2, float f, float f1) {
|
||||
+ this.internalTeleport(new PositionMoveRotation(new Vec3D(d0, d1, d2), Vec3D.ZERO, f, f1), Collections.emptySet());
|
||||
+ }
|
||||
+
|
||||
+ public void internalTeleport(PositionMoveRotation positionmoverotation, Set<Relative> set) {
|
||||
+ if (Float.isNaN(positionmoverotation.yRot())) {
|
||||
+ positionmoverotation = new PositionMoveRotation(positionmoverotation.position(), positionmoverotation.deltaMovement(), 0, positionmoverotation.xRot());
|
||||
+ }
|
||||
+ if (Float.isNaN(f1)) {
|
||||
+ f1 = 0;
|
||||
+ if (Float.isNaN(positionmoverotation.xRot())) {
|
||||
+ positionmoverotation = new PositionMoveRotation(positionmoverotation.position(), positionmoverotation.deltaMovement(), positionmoverotation.yRot(), 0);
|
||||
+ }
|
||||
+
|
||||
+ this.justTeleported = true;
|
||||
+ // CraftBukkit end
|
||||
double d3 = set.contains(RelativeMovement.X) ? this.player.getX() : 0.0D;
|
||||
double d4 = set.contains(RelativeMovement.Y) ? this.player.getY() : 0.0D;
|
||||
double d5 = set.contains(RelativeMovement.Z) ? this.player.getZ() : 0.0D;
|
||||
@@ -1073,6 +1432,14 @@
|
||||
this.awaitingTeleportTime = this.tickCount;
|
||||
if (++this.awaitingTeleport == Integer.MAX_VALUE) {
|
||||
this.awaitingTeleport = 0;
|
||||
}
|
||||
@@ -1088,12 +1437,20 @@
|
||||
|
||||
this.player.teleportSetPosition(positionmoverotation, set);
|
||||
this.awaitingPositionFromClient = this.player.position();
|
||||
+ // CraftBukkit start - update last location
|
||||
+ this.lastPosX = this.awaitingPositionFromClient.x;
|
||||
+ this.lastPosY = this.awaitingPositionFromClient.y;
|
||||
+ this.lastPosZ = this.awaitingPositionFromClient.z;
|
||||
+ this.lastYaw = f;
|
||||
+ this.lastPitch = f1;
|
||||
+ this.lastYaw = this.player.getYRot();
|
||||
+ this.lastPitch = this.player.getXRot();
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
this.awaitingTeleportTime = this.tickCount;
|
||||
this.player.absMoveTo(d0, d1, d2, f, f1);
|
||||
this.player.connection.send(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport));
|
||||
@@ -1081,6 +1448,7 @@
|
||||
this.player.connection.send(PacketPlayOutPosition.of(this.awaitingTeleport, positionmoverotation, set));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePlayerAction(PacketPlayInBlockDig packetplayinblockdig) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinblockdig, this, this.player.serverLevel());
|
||||
@@ -627,7 +578,7 @@
|
||||
BlockPosition blockposition = packetplayinblockdig.getPos();
|
||||
|
||||
this.player.resetLastActionTime();
|
||||
@@ -1091,14 +1459,46 @@
|
||||
@@ -1104,14 +1461,46 @@
|
||||
if (!this.player.isSpectator()) {
|
||||
ItemStack itemstack = this.player.getItemInHand(EnumHand.OFF_HAND);
|
||||
|
||||
@@ -676,7 +627,7 @@
|
||||
this.player.drop(false);
|
||||
}
|
||||
|
||||
@@ -1136,6 +1536,7 @@
|
||||
@@ -1149,6 +1538,7 @@
|
||||
@Override
|
||||
public void handleUseItemOn(PacketPlayInUseItem packetplayinuseitem) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinuseitem, this, this.player.serverLevel());
|
||||
@@ -684,15 +635,15 @@
|
||||
this.player.connection.ackBlockChangesUpTo(packetplayinuseitem.getSequence());
|
||||
WorldServer worldserver = this.player.serverLevel();
|
||||
EnumHand enumhand = packetplayinuseitem.getHand();
|
||||
@@ -1158,6 +1559,7 @@
|
||||
@@ -1171,6 +1561,7 @@
|
||||
|
||||
if (blockposition.getY() < i) {
|
||||
if (blockposition.getY() <= i) {
|
||||
if (this.awaitingPositionFromClient == null && worldserver.mayInteract(this.player, blockposition)) {
|
||||
+ this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
|
||||
EnumInteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
|
||||
|
||||
if (enuminteractionresult.consumesAction()) {
|
||||
@@ -1190,6 +1592,7 @@
|
||||
@@ -1207,6 +1598,7 @@
|
||||
@Override
|
||||
public void handleUseItem(PacketPlayInBlockPlace packetplayinblockplace) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinblockplace, this, this.player.serverLevel());
|
||||
@@ -700,7 +651,7 @@
|
||||
this.ackBlockChangesUpTo(packetplayinblockplace.getSequence());
|
||||
WorldServer worldserver = this.player.serverLevel();
|
||||
EnumHand enumhand = packetplayinblockplace.getHand();
|
||||
@@ -1204,6 +1607,47 @@
|
||||
@@ -1221,6 +1613,47 @@
|
||||
this.player.absRotateTo(f, f1);
|
||||
}
|
||||
|
||||
@@ -747,17 +698,17 @@
|
||||
+ // CraftBukkit end
|
||||
EnumInteractionResult enuminteractionresult = this.player.gameMode.useItem(this.player, worldserver, itemstack, enumhand);
|
||||
|
||||
if (enuminteractionresult.shouldSwing()) {
|
||||
@@ -1224,7 +1668,7 @@
|
||||
if (enuminteractionresult instanceof EnumInteractionResult.d) {
|
||||
@@ -1245,7 +1678,7 @@
|
||||
Entity entity = packetplayinspectate.getEntity(worldserver);
|
||||
|
||||
if (entity != null) {
|
||||
- this.player.teleportTo(worldserver, entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot());
|
||||
+ this.player.teleportTo(worldserver, entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot(), org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.SPECTATE); // CraftBukkit
|
||||
- this.player.teleportTo(worldserver, entity.getX(), entity.getY(), entity.getZ(), Set.of(), entity.getYRot(), entity.getXRot(), true);
|
||||
+ this.player.teleportTo(worldserver, entity.getX(), entity.getY(), entity.getZ(), Set.of(), entity.getYRot(), entity.getXRot(), true, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.SPECTATE); // CraftBukkit
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1245,6 +1689,13 @@
|
||||
@@ -1266,6 +1699,13 @@
|
||||
|
||||
@Override
|
||||
public void onDisconnect(DisconnectionDetails disconnectiondetails) {
|
||||
@@ -771,7 +722,7 @@
|
||||
PlayerConnection.LOGGER.info("{} lost connection: {}", this.player.getName().getString(), disconnectiondetails.reason().getString());
|
||||
this.removePlayerFromWorld();
|
||||
super.onDisconnect(disconnectiondetails);
|
||||
@@ -1252,10 +1703,18 @@
|
||||
@@ -1273,10 +1713,18 @@
|
||||
|
||||
private void removePlayerFromWorld() {
|
||||
this.chatMessageChain.close();
|
||||
@@ -791,7 +742,7 @@
|
||||
this.player.getTextFilter().leave();
|
||||
}
|
||||
|
||||
@@ -1270,7 +1729,16 @@
|
||||
@@ -1291,7 +1739,16 @@
|
||||
@Override
|
||||
public void handleSetCarriedItem(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinhelditemslot, this, this.player.serverLevel());
|
||||
@@ -808,7 +759,7 @@
|
||||
if (this.player.getInventory().selected != packetplayinhelditemslot.getSlot() && this.player.getUsedItemHand() == EnumHand.MAIN_HAND) {
|
||||
this.player.stopUsingItem();
|
||||
}
|
||||
@@ -1279,11 +1747,18 @@
|
||||
@@ -1300,11 +1757,18 @@
|
||||
this.player.resetLastActionTime();
|
||||
} else {
|
||||
PlayerConnection.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
|
||||
@@ -827,7 +778,7 @@
|
||||
Optional<LastSeenMessages> optional = this.unpackAndApplyLastSeen(packetplayinchat.lastSeenMessages());
|
||||
|
||||
if (!optional.isEmpty()) {
|
||||
@@ -1297,7 +1772,7 @@
|
||||
@@ -1318,7 +1782,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -836,7 +787,7 @@
|
||||
IChatBaseComponent ichatbasecomponent = this.server.getChatDecorator().decorate(this.player, playerchatmessage.decoratedContent());
|
||||
|
||||
this.chatMessageChain.append(completablefuture, (filteredtext) -> {
|
||||
@@ -1305,19 +1780,36 @@
|
||||
@@ -1326,19 +1790,36 @@
|
||||
|
||||
this.broadcastChatMessage(playerchatmessage1);
|
||||
});
|
||||
@@ -875,7 +826,7 @@
|
||||
ParseResults<CommandListenerWrapper> parseresults = this.parseCommand(s);
|
||||
|
||||
if (this.server.enforceSecureProfile() && SignableCommand.hasSignableArguments(parseresults)) {
|
||||
@@ -1334,19 +1826,37 @@
|
||||
@@ -1355,19 +1836,37 @@
|
||||
|
||||
if (!optional.isEmpty()) {
|
||||
this.tryHandleChat(serverboundchatcommandsignedpacket.command(), () -> {
|
||||
@@ -916,7 +867,7 @@
|
||||
} catch (SignedMessageChain.a signedmessagechain_a) {
|
||||
this.handleMessageDecodeFailure(signedmessagechain_a);
|
||||
return;
|
||||
@@ -1354,10 +1864,10 @@
|
||||
@@ -1375,10 +1874,10 @@
|
||||
|
||||
CommandSigningContext.a commandsigningcontext_a = new CommandSigningContext.a(map);
|
||||
|
||||
@@ -929,7 +880,7 @@
|
||||
}
|
||||
|
||||
private void handleMessageDecodeFailure(SignedMessageChain.a signedmessagechain_a) {
|
||||
@@ -1433,14 +1943,20 @@
|
||||
@@ -1454,14 +1953,20 @@
|
||||
return com_mojang_brigadier_commanddispatcher.parse(s, this.player.createCommandSourceStack());
|
||||
}
|
||||
|
||||
@@ -953,7 +904,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1469,6 +1985,116 @@
|
||||
@@ -1490,6 +1995,116 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1070,7 +1021,7 @@
|
||||
private PlayerChatMessage getSignedMessage(PacketPlayInChat packetplayinchat, LastSeenMessages lastseenmessages) throws SignedMessageChain.a {
|
||||
SignedMessageBody signedmessagebody = new SignedMessageBody(packetplayinchat.message(), packetplayinchat.timeStamp(), packetplayinchat.salt(), lastseenmessages);
|
||||
|
||||
@@ -1476,13 +2102,33 @@
|
||||
@@ -1497,13 +2112,33 @@
|
||||
}
|
||||
|
||||
private void broadcastChatMessage(PlayerChatMessage playerchatmessage) {
|
||||
@@ -1098,16 +1049,16 @@
|
||||
}
|
||||
|
||||
private void detectRateSpam() {
|
||||
- this.chatSpamTickCount += 20;
|
||||
- if (this.chatSpamTickCount > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) {
|
||||
- this.chatSpamThrottler.increment();
|
||||
- if (!this.chatSpamThrottler.isUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) {
|
||||
+ // CraftBukkit start - replaced with thread safe throttle
|
||||
+ // this.chatSpamTickCount += 20;
|
||||
+ if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) {
|
||||
+ // this.chatSpamThrottler.increment();
|
||||
+ if (!this.chatSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) {
|
||||
+ // CraftBukkit end
|
||||
this.disconnect((IChatBaseComponent) IChatBaseComponent.translatable("disconnect.spam"));
|
||||
}
|
||||
|
||||
@@ -1504,13 +2150,62 @@
|
||||
@@ -1525,13 +2160,62 @@
|
||||
@Override
|
||||
public void handleAnimate(PacketPlayInArmAnimation packetplayinarmanimation) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinarmanimation, this, this.player.serverLevel());
|
||||
@@ -1170,7 +1121,7 @@
|
||||
this.player.resetLastActionTime();
|
||||
Entity entity;
|
||||
|
||||
@@ -1587,6 +2282,12 @@
|
||||
@@ -1608,6 +2292,12 @@
|
||||
}
|
||||
|
||||
public void sendPlayerChatMessage(PlayerChatMessage playerchatmessage, ChatMessageType.a chatmessagetype_a) {
|
||||
@@ -1183,7 +1134,7 @@
|
||||
this.send(new ClientboundPlayerChatPacket(playerchatmessage.link().sender(), playerchatmessage.link().index(), playerchatmessage.signature(), playerchatmessage.signedBody().pack(this.messageSignatureCache), playerchatmessage.unsignedContent(), playerchatmessage.filterMask(), chatmessagetype_a));
|
||||
this.addPendingMessage(playerchatmessage);
|
||||
}
|
||||
@@ -1614,6 +2315,7 @@
|
||||
@@ -1635,6 +2325,7 @@
|
||||
@Override
|
||||
public void handleInteract(PacketPlayInUseEntity packetplayinuseentity) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinuseentity, this, this.player.serverLevel());
|
||||
@@ -1191,9 +1142,9 @@
|
||||
final WorldServer worldserver = this.player.serverLevel();
|
||||
final Entity entity = packetplayinuseentity.getTarget(worldserver);
|
||||
|
||||
@@ -1628,13 +2330,51 @@
|
||||
@@ -1649,13 +2340,51 @@
|
||||
|
||||
if (this.player.canInteractWithEntity(axisalignedbb, 1.0D)) {
|
||||
if (this.player.canInteractWithEntity(axisalignedbb, 3.0D)) {
|
||||
packetplayinuseentity.dispatch(new PacketPlayInUseEntity.c() {
|
||||
- private void performInteraction(EnumHand enumhand, PlayerConnection.a playerconnection_a) {
|
||||
+ private void performInteraction(EnumHand enumhand, PlayerConnection.a playerconnection_a, PlayerInteractEntityEvent event) { // CraftBukkit
|
||||
@@ -1241,10 +1192,10 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
if (enuminteractionresult.consumesAction()) {
|
||||
CriterionTriggers.PLAYER_INTERACTED_WITH_ENTITY.trigger(PlayerConnection.this.player, enuminteractionresult.indicateItemUse() ? itemstack1 : ItemStack.EMPTY, entity);
|
||||
if (enuminteractionresult.shouldSwing()) {
|
||||
@@ -1647,19 +2387,20 @@
|
||||
if (enuminteractionresult instanceof EnumInteractionResult.d) {
|
||||
EnumInteractionResult.d enuminteractionresult_d = (EnumInteractionResult.d) enuminteractionresult;
|
||||
ItemStack itemstack2 = enuminteractionresult_d.wasItemInteraction() ? itemstack1 : ItemStack.EMPTY;
|
||||
@@ -1671,19 +2400,20 @@
|
||||
|
||||
@Override
|
||||
public void onInteraction(EnumHand enumhand) {
|
||||
@@ -1268,7 +1219,7 @@
|
||||
label23:
|
||||
{
|
||||
if (entity instanceof EntityArrow) {
|
||||
@@ -1677,6 +2418,11 @@
|
||||
@@ -1701,6 +2431,11 @@
|
||||
}
|
||||
|
||||
PlayerConnection.this.player.attack(entity);
|
||||
@@ -1280,28 +1231,30 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1700,17 +2446,17 @@
|
||||
@@ -1724,7 +2459,7 @@
|
||||
case PERFORM_RESPAWN:
|
||||
if (this.player.wonGame) {
|
||||
this.player.wonGame = false;
|
||||
- this.player = this.server.getPlayerList().respawn(this.player, true, Entity.RemovalReason.CHANGED_DIMENSION);
|
||||
+ this.player = this.server.getPlayerList().respawn(this.player, true, Entity.RemovalReason.CHANGED_DIMENSION, RespawnReason.END_PORTAL); // CraftBukkit
|
||||
this.resetPosition();
|
||||
CriterionTriggers.CHANGED_DIMENSION.trigger(this.player, World.END, World.OVERWORLD);
|
||||
} else {
|
||||
if (this.player.getHealth() > 0.0F) {
|
||||
@@ -1732,11 +2467,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- this.player = this.server.getPlayerList().respawn(this.player, false, Entity.RemovalReason.KILLED);
|
||||
+ this.player = this.server.getPlayerList().respawn(this.player, false, Entity.RemovalReason.KILLED, RespawnReason.DEATH); // CraftBukkit
|
||||
this.resetPosition();
|
||||
if (this.server.isHardcore()) {
|
||||
this.player.setGameMode(EnumGamemode.SPECTATOR);
|
||||
- ((GameRules.GameRuleBoolean) this.player.level().getGameRules().getRule(GameRules.RULE_SPECTATORSGENERATECHUNKS)).set(false, this.server);
|
||||
+ ((GameRules.GameRuleBoolean) this.player.level().getGameRules().getRule(GameRules.RULE_SPECTATORSGENERATECHUNKS)).set(false, this.player.serverLevel()); // CraftBukkit - per-world
|
||||
- ((GameRules.GameRuleBoolean) this.player.serverLevel().getGameRules().getRule(GameRules.RULE_SPECTATORSGENERATECHUNKS)).set(false, this.server);
|
||||
+ ((GameRules.GameRuleBoolean) this.player.serverLevel().getGameRules().getRule(GameRules.RULE_SPECTATORSGENERATECHUNKS)).set(false, this.player.serverLevel()); // CraftBukkit - per-world
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1723,15 +2469,21 @@
|
||||
@@ -1749,15 +2484,21 @@
|
||||
@Override
|
||||
public void handleContainerClose(PacketPlayInCloseWindow packetplayinclosewindow) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinclosewindow, this, this.player.serverLevel());
|
||||
@@ -1325,7 +1278,7 @@
|
||||
this.player.containerMenu.sendAllDataToRemote();
|
||||
} else if (!this.player.containerMenu.stillValid(this.player)) {
|
||||
PlayerConnection.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu);
|
||||
@@ -1744,7 +2496,284 @@
|
||||
@@ -1770,7 +2511,284 @@
|
||||
boolean flag = packetplayinwindowclick.getStateId() != this.player.containerMenu.getStateId();
|
||||
|
||||
this.player.containerMenu.suppressRemoteUpdates();
|
||||
@@ -1611,28 +1564,30 @@
|
||||
ObjectIterator objectiterator = Int2ObjectMaps.fastIterable(packetplayinwindowclick.getChangedSlots()).iterator();
|
||||
|
||||
while (objectiterator.hasNext()) {
|
||||
@@ -1774,9 +2803,18 @@
|
||||
if (!this.player.containerMenu.stillValid(this.player)) {
|
||||
PlayerConnection.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu);
|
||||
} else {
|
||||
- this.server.getRecipeManager().byKey(packetplayinautorecipe.getRecipe()).ifPresent((recipeholder) -> {
|
||||
- ((ContainerRecipeBook) this.player.containerMenu).handlePlacement(packetplayinautorecipe.isShiftDown(), recipeholder, this.player);
|
||||
+ // CraftBukkit start - implement PlayerRecipeBookClickEvent
|
||||
+ org.bukkit.inventory.Recipe recipe = this.cserver.getRecipe(CraftNamespacedKey.fromMinecraft(packetplayinautorecipe.getRecipe()));
|
||||
+ if (recipe == null) {
|
||||
+ return;
|
||||
+ }
|
||||
+ org.bukkit.event.player.PlayerRecipeBookClickEvent event = CraftEventFactory.callRecipeBookClickEvent(this.player, recipe, packetplayinautorecipe.isShiftDown());
|
||||
@@ -1816,7 +2834,21 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- ContainerRecipeBook.a containerrecipebook_a = containerrecipebook.handlePlacement(packetplayinautorecipe.useMaxItems(), this.player.isCreative(), recipeholder, this.player.serverLevel(), this.player.getInventory());
|
||||
+ // CraftBukkit start - implement PlayerRecipeBookClickEvent
|
||||
+ org.bukkit.inventory.Recipe recipe = recipeholder.toBukkitRecipe();
|
||||
+ if (recipe == null) {
|
||||
+ return;
|
||||
+ }
|
||||
+ org.bukkit.event.player.PlayerRecipeBookClickEvent event = CraftEventFactory.callRecipeBookClickEvent(this.player, recipe, packetplayinautorecipe.useMaxItems());
|
||||
+
|
||||
+ // Cast to keyed should be safe as the recipe will never be a MerchantRecipe.
|
||||
+ this.server.getRecipeManager().byKey(CraftNamespacedKey.toMinecraft(((org.bukkit.Keyed) event.getRecipe()).getKey())).ifPresent((recipeholder) -> {
|
||||
+ ((ContainerRecipeBook) this.player.containerMenu).handlePlacement(event.isShiftClick(), recipeholder, this.player);
|
||||
});
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1784,6 +2822,7 @@
|
||||
+ // Cast to keyed should be safe as the recipe will never be a MerchantRecipe.
|
||||
+ recipeholder = this.server.getRecipeManager().byKey(CraftRecipe.toMinecraft(((org.bukkit.Keyed) event.getRecipe()).getKey())).orElse(null);
|
||||
+ if (recipeholder == null) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ ContainerRecipeBook.a containerrecipebook_a = containerrecipebook.handlePlacement(event.isShiftClick(), this.player.isCreative(), recipeholder, this.player.serverLevel(), this.player.getInventory());
|
||||
+ // CraftBukkit end
|
||||
|
||||
if (containerrecipebook_a == ContainerRecipeBook.a.PLACE_GHOST_RECIPE) {
|
||||
this.player.connection.send(new PacketPlayOutAutoRecipe(this.player.containerMenu.containerId, craftingmanager_d.display().display()));
|
||||
@@ -1832,6 +2864,7 @@
|
||||
@Override
|
||||
public void handleContainerButtonClick(PacketPlayInEnchantItem packetplayinenchantitem) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinenchantitem, this, this.player.serverLevel());
|
||||
@@ -1640,7 +1595,7 @@
|
||||
this.player.resetLastActionTime();
|
||||
if (this.player.containerMenu.containerId == packetplayinenchantitem.containerId() && !this.player.isSpectator()) {
|
||||
if (!this.player.containerMenu.stillValid(this.player)) {
|
||||
@@ -1826,6 +2865,43 @@
|
||||
@@ -1875,6 +2908,43 @@
|
||||
|
||||
boolean flag1 = packetplayinsetcreativeslot.slotNum() >= 1 && packetplayinsetcreativeslot.slotNum() <= 45;
|
||||
boolean flag2 = itemstack.isEmpty() || itemstack.getCount() <= itemstack.getMaxStackSize();
|
||||
@@ -1684,7 +1639,7 @@
|
||||
|
||||
if (flag1 && flag2) {
|
||||
this.player.inventoryMenu.getSlot(packetplayinsetcreativeslot.slotNum()).setByPlayer(itemstack);
|
||||
@@ -1848,6 +2924,7 @@
|
||||
@@ -1902,6 +2972,7 @@
|
||||
}
|
||||
|
||||
private void updateSignText(PacketPlayInUpdateSign packetplayinupdatesign, List<FilteredText> list) {
|
||||
@@ -1692,7 +1647,7 @@
|
||||
this.player.resetLastActionTime();
|
||||
WorldServer worldserver = this.player.serverLevel();
|
||||
BlockPosition blockposition = packetplayinupdatesign.getPos();
|
||||
@@ -1869,7 +2946,17 @@
|
||||
@@ -1923,7 +2994,17 @@
|
||||
@Override
|
||||
public void handlePlayerAbilities(PacketPlayInAbilities packetplayinabilities) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinabilities, this, this.player.serverLevel());
|
||||
@@ -1711,7 +1666,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1928,7 +3015,7 @@
|
||||
@@ -1982,7 +3063,7 @@
|
||||
if (!this.waitingForSwitchToConfig) {
|
||||
throw new IllegalStateException("Client acknowledged config, but none was requested");
|
||||
} else {
|
||||
@@ -1720,7 +1675,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1953,8 +3040,10 @@
|
||||
@@ -2007,8 +3088,10 @@
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1732,4 +1687,4 @@
|
||||
+ // CraftBukkit end
|
||||
|
||||
@Override
|
||||
public EntityPlayer getPlayer() {
|
||||
public void handleClientTickEnd(ServerboundClientTickEndPacket serverboundclienttickendpacket) {
|
||||
|
Reference in New Issue
Block a user