@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/network/PlayerConnection.java
|
||||
+++ b/net/minecraft/server/network/PlayerConnection.java
|
||||
@@ -184,6 +184,69 @@
|
||||
@@ -185,6 +185,69 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
public class PlayerConnection implements ServerPlayerConnection, TickablePacketListener, PacketListenerPlayIn {
|
||||
|
||||
static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -200,7 +263,9 @@
|
||||
@@ -201,7 +264,9 @@
|
||||
private long keepAliveTime;
|
||||
private boolean keepAlivePending;
|
||||
private long keepAliveChallenge;
|
||||
@@ -81,7 +81,7 @@
|
||||
private int dropSpamTickCount;
|
||||
private double firstGoodX;
|
||||
private double firstGoodY;
|
||||
@@ -246,8 +311,31 @@
|
||||
@@ -247,8 +312,31 @@
|
||||
this.keepAliveTime = SystemUtils.getMillis();
|
||||
entityplayer.getTextFilter().join();
|
||||
this.signedMessageDecoder = minecraftserver.enforceSecureProfile() ? SignedMessageChain.b.REJECT_ALL : SignedMessageChain.b.unsigned(entityplayer.getUUID());
|
||||
@@ -114,7 +114,7 @@
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
@@ -302,7 +390,7 @@
|
||||
@@ -303,7 +391,7 @@
|
||||
this.server.getProfiler().push("keepAlive");
|
||||
long i = SystemUtils.getMillis();
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
if (this.keepAlivePending) {
|
||||
this.disconnect(IChatBaseComponent.translatable("disconnect.timeout"));
|
||||
} else {
|
||||
@@ -314,15 +402,21 @@
|
||||
@@ -315,15 +403,21 @@
|
||||
}
|
||||
|
||||
this.server.getProfiler().pop();
|
||||
@@ -140,12 +140,12 @@
|
||||
--this.dropSpamTickCount;
|
||||
}
|
||||
|
||||
if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && SystemUtils.getMillis() - this.player.getLastActionTime() > (long) (this.server.getPlayerIdleTimeout() * 1000 * 60)) {
|
||||
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.translatable("multiplayer.disconnect.idling"));
|
||||
}
|
||||
|
||||
@@ -346,16 +440,67 @@
|
||||
@@ -347,16 +441,67 @@
|
||||
return this.server.isSingleplayerOwner(this.player.getGameProfile());
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
}
|
||||
|
||||
private <T, R> CompletableFuture<R> filterTextPacket(T t0, BiFunction<ITextFilter, T, CompletableFuture<R>> bifunction) {
|
||||
@@ -419,7 +564,34 @@
|
||||
@@ -420,7 +565,34 @@
|
||||
double d9 = entity.getDeltaMovement().lengthSqr();
|
||||
double d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8});
|
||||
this.connection.send(new PacketPlayOutVehicleMove(entity));
|
||||
return;
|
||||
@@ -451,14 +623,72 @@
|
||||
@@ -460,14 +632,72 @@
|
||||
}
|
||||
|
||||
entity.absMoveTo(d3, d4, d5, f, f1);
|
||||
@@ -320,30 +320,30 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
this.player.getLevel().getChunkSource().move(this.player);
|
||||
this.player.serverLevel().getChunkSource().move(this.player);
|
||||
this.player.checkMovementStatistics(this.player.getX() - d0, this.player.getY() - d1, this.player.getZ() - d2);
|
||||
this.clientVehicleIsFloating = d11 >= -0.03125D && !flag1 && !this.server.isFlightAllowed() && !entity.isNoGravity() && this.noBlocksAround(entity);
|
||||
@@ -492,6 +722,7 @@
|
||||
@@ -501,6 +731,7 @@
|
||||
}
|
||||
|
||||
this.awaitingPositionFromClient = null;
|
||||
+ this.player.getLevel().getChunkSource().move(this.player); // CraftBukkit
|
||||
+ this.player.serverLevel().getChunkSource().move(this.player); // CraftBukkit
|
||||
}
|
||||
|
||||
}
|
||||
@@ -499,7 +730,7 @@
|
||||
@@ -508,7 +739,7 @@
|
||||
@Override
|
||||
public void handleRecipeBookSeenRecipePacket(PacketPlayInRecipeDisplayed packetplayinrecipedisplayed) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinrecipedisplayed, this, this.player.getLevel());
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinrecipedisplayed, this, this.player.serverLevel());
|
||||
- Optional optional = this.server.getRecipeManager().byKey(packetplayinrecipedisplayed.getRecipe());
|
||||
+ Optional<? extends IRecipe<?>> optional = this.server.getRecipeManager().byKey(packetplayinrecipedisplayed.getRecipe()); // CraftBukkit - decompile error
|
||||
RecipeBookServer recipebookserver = this.player.getRecipeBook();
|
||||
|
||||
Objects.requireNonNull(recipebookserver);
|
||||
@@ -529,6 +760,12 @@
|
||||
@@ -538,6 +769,12 @@
|
||||
@Override
|
||||
public void handleCustomCommandSuggestions(PacketPlayInTabComplete packetplayintabcomplete) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayintabcomplete, this, this.player.getLevel());
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayintabcomplete, this, this.player.serverLevel());
|
||||
+ // CraftBukkit start
|
||||
+ if (chatSpamTickCount.addAndGet(1) > 500 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) {
|
||||
+ this.disconnect(IChatBaseComponent.translatable("disconnect.spam"));
|
||||
@@ -353,7 +353,7 @@
|
||||
StringReader stringreader = new StringReader(packetplayintabcomplete.getCommand());
|
||||
|
||||
if (stringreader.canRead() && stringreader.peek() == '/') {
|
||||
@@ -538,6 +775,7 @@
|
||||
@@ -547,6 +784,7 @@
|
||||
ParseResults<CommandListenerWrapper> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
|
||||
|
||||
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
|
||||
@@ -361,7 +361,7 @@
|
||||
this.connection.send(new PacketPlayOutTabComplete(packetplayintabcomplete.getId(), suggestions));
|
||||
});
|
||||
}
|
||||
@@ -787,6 +1025,13 @@
|
||||
@@ -792,6 +1030,13 @@
|
||||
|
||||
if (container instanceof ContainerMerchant) {
|
||||
ContainerMerchant containermerchant = (ContainerMerchant) container;
|
||||
@@ -375,7 +375,7 @@
|
||||
|
||||
if (!containermerchant.stillValid(this.player)) {
|
||||
PlayerConnection.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, containermerchant);
|
||||
@@ -801,6 +1046,13 @@
|
||||
@@ -806,6 +1051,13 @@
|
||||
|
||||
@Override
|
||||
public void handleEditBook(PacketPlayInBEdit packetplayinbedit) {
|
||||
@@ -389,7 +389,7 @@
|
||||
int i = packetplayinbedit.getSlot();
|
||||
|
||||
if (PlayerInventory.isHotbarSlot(i) || i == 40) {
|
||||
@@ -809,7 +1061,7 @@
|
||||
@@ -814,7 +1066,7 @@
|
||||
|
||||
Objects.requireNonNull(list);
|
||||
optional.ifPresent(list::add);
|
||||
@@ -398,7 +398,7 @@
|
||||
|
||||
Objects.requireNonNull(list);
|
||||
stream.forEach(list::add);
|
||||
@@ -827,7 +1079,7 @@
|
||||
@@ -832,7 +1084,7 @@
|
||||
ItemStack itemstack = this.player.getInventory().getItem(i);
|
||||
|
||||
if (itemstack.is(Items.WRITABLE_BOOK)) {
|
||||
@@ -407,7 +407,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -852,16 +1104,16 @@
|
||||
@@ -857,16 +1109,16 @@
|
||||
|
||||
this.updateBookPages(list, (s) -> {
|
||||
return IChatBaseComponent.ChatSerializer.toJson(IChatBaseComponent.literal(s));
|
||||
@@ -428,7 +428,7 @@
|
||||
return NBTTagString.valueOf((String) unaryoperator.apply(filteredtext.filteredOrEmpty()));
|
||||
});
|
||||
|
||||
@@ -887,6 +1139,7 @@
|
||||
@@ -892,6 +1144,7 @@
|
||||
}
|
||||
|
||||
itemstack.addTagElement("pages", nbttaglist);
|
||||
@@ -436,16 +436,16 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -923,7 +1176,7 @@
|
||||
@@ -928,7 +1181,7 @@
|
||||
} else {
|
||||
WorldServer worldserver = this.player.getLevel();
|
||||
WorldServer worldserver = this.player.serverLevel();
|
||||
|
||||
- if (!this.player.wonGame) {
|
||||
+ if (!this.player.wonGame && !this.player.isImmobile()) { // CraftBukkit
|
||||
if (this.tickCount == 0) {
|
||||
this.resetPosition();
|
||||
}
|
||||
@@ -933,7 +1186,7 @@
|
||||
@@ -938,7 +1191,7 @@
|
||||
this.awaitingTeleportTime = this.tickCount;
|
||||
this.teleport(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
|
||||
}
|
||||
@@ -454,10 +454,10 @@
|
||||
} else {
|
||||
this.awaitingTeleportTime = this.tickCount;
|
||||
double d0 = clampHorizontal(packetplayinflying.getX(this.player.getX()));
|
||||
@@ -945,7 +1198,15 @@
|
||||
@@ -950,7 +1203,15 @@
|
||||
if (this.player.isPassenger()) {
|
||||
this.player.absMoveTo(this.player.getX(), this.player.getY(), this.player.getZ(), f, f1);
|
||||
this.player.getLevel().getChunkSource().move(this.player);
|
||||
this.player.serverLevel().getChunkSource().move(this.player);
|
||||
+ this.allowedPlayerTicks = 20; // CraftBukkit
|
||||
} else {
|
||||
+ // CraftBukkit - Make sure the move is valid but then reset it for plugins to modify
|
||||
@@ -470,7 +470,7 @@
|
||||
double d3 = this.player.getX();
|
||||
double d4 = this.player.getY();
|
||||
double d5 = this.player.getZ();
|
||||
@@ -965,15 +1226,33 @@
|
||||
@@ -969,15 +1230,33 @@
|
||||
++this.receivedMovePacketCount;
|
||||
int i = this.receivedMovePacketCount - this.knownMovePacketCount;
|
||||
|
||||
@@ -485,7 +485,7 @@
|
||||
i = 1;
|
||||
}
|
||||
|
||||
+ if (packetplayinflying.hasRot || d11 > 0) {
|
||||
+ if (packetplayinflying.hasRot || d10 > 0) {
|
||||
+ allowedPlayerTicks -= 1;
|
||||
+ } else {
|
||||
+ allowedPlayerTicks = 20;
|
||||
@@ -497,35 +497,32 @@
|
||||
+ speed = player.getAbilities().walkingSpeed * 10f;
|
||||
+ }
|
||||
+
|
||||
if (!this.player.isChangingDimension() && (!this.player.getLevel().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) {
|
||||
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) {
|
||||
float f2 = this.player.isFallFlying() ? 300.0F : 100.0F;
|
||||
|
||||
- if (d11 - d10 > (double) (f2 * (float) i) && !this.isSingleplayerOwner()) {
|
||||
+ if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||
- 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()) {
|
||||
+ // CraftBukkit end
|
||||
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d7, d8, d9});
|
||||
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;
|
||||
@@ -994,6 +1273,7 @@
|
||||
@@ -998,6 +1277,7 @@
|
||||
boolean flag1 = this.player.verticalCollisionBelow;
|
||||
|
||||
this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9));
|
||||
this.player.move(EnumMoveType.PLAYER, new Vec3D(d6, d7, d8));
|
||||
+ this.player.onGround = packetplayinflying.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
|
||||
double d12 = d8;
|
||||
double d11 = d7;
|
||||
|
||||
d7 = d0 - this.player.getX();
|
||||
@@ -1013,9 +1293,72 @@
|
||||
d6 = d0 - this.player.getX();
|
||||
@@ -1016,9 +1296,67 @@
|
||||
}
|
||||
|
||||
this.player.absMoveTo(d0, d1, d2, f, f1);
|
||||
if (!this.player.noPhysics && !this.player.isSleeping() && (flag2 && worldserver.noCollision(this.player, axisalignedbb) || this.isPlayerCollidingWithAnythingNew(worldserver, axisalignedbb))) {
|
||||
if (!this.player.noPhysics && !this.player.isSleeping() && (flag2 && 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.player.doCheckFallDamage(this.player.getY() - d6, packetplayinflying.isOnGround());
|
||||
this.player.doCheckFallDamage(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5, packetplayinflying.isOnGround());
|
||||
} else {
|
||||
+ // CraftBukkit start - fire PlayerMoveEvent
|
||||
+ // Rest to old location first
|
||||
+ this.player.absMoveTo(prevX, prevY, prevZ, prevYaw, prevPitch);
|
||||
+
|
||||
+ Player player = this.getCraftPlayer();
|
||||
+ Location from = new Location(player.getWorld(), lastPosX, lastPosY, lastPosZ, lastYaw, lastPitch); // Get the Players previous Event location.
|
||||
+ Location to = player.getLocation().clone(); // Start off the To location as the Players current location.
|
||||
@@ -582,13 +579,11 @@
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ this.player.absMoveTo(d0, d1, d2, f, f1); // Copied from above
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
this.clientIsFloating = d12 >= -0.03125D && !flag1 && this.player.gameMode.getGameModeForPlayer() != EnumGamemode.SPECTATOR && !this.server.isFlightAllowed() && !this.player.getAbilities().mayfly && !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.isFallFlying() && !this.player.isAutoSpinAttack() && this.noBlocksAround(this.player);
|
||||
this.player.getLevel().getChunkSource().move(this.player);
|
||||
this.player.doCheckFallDamage(this.player.getY() - d6, packetplayinflying.isOnGround());
|
||||
@@ -1054,11 +1397,68 @@
|
||||
this.player.absMoveTo(d0, d1, d2, f, f1);
|
||||
this.clientIsFloating = d11 >= -0.03125D && !flag1 && this.player.gameMode.getGameModeForPlayer() != EnumGamemode.SPECTATOR && !this.server.isFlightAllowed() && !this.player.getAbilities().mayfly && !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.isFallFlying() && !this.player.isAutoSpinAttack() && this.noBlocksAround(this.player);
|
||||
this.player.serverLevel().getChunkSource().move(this.player);
|
||||
@@ -1059,11 +1397,68 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -658,7 +653,7 @@
|
||||
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;
|
||||
@@ -1070,6 +1470,14 @@
|
||||
@@ -1075,6 +1470,14 @@
|
||||
this.awaitingTeleport = 0;
|
||||
}
|
||||
|
||||
@@ -673,15 +668,15 @@
|
||||
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));
|
||||
@@ -1078,6 +1486,7 @@
|
||||
@@ -1083,6 +1486,7 @@
|
||||
@Override
|
||||
public void handlePlayerAction(PacketPlayInBlockDig packetplayinblockdig) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinblockdig, this, this.player.getLevel());
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinblockdig, this, this.player.serverLevel());
|
||||
+ if (this.player.isImmobile()) return; // CraftBukkit
|
||||
BlockPosition blockposition = packetplayinblockdig.getPos();
|
||||
|
||||
this.player.resetLastActionTime();
|
||||
@@ -1088,14 +1497,46 @@
|
||||
@@ -1093,14 +1497,46 @@
|
||||
if (!this.player.isSpectator()) {
|
||||
ItemStack itemstack = this.player.getItemInHand(EnumHand.OFF_HAND);
|
||||
|
||||
@@ -730,15 +725,15 @@
|
||||
this.player.drop(false);
|
||||
}
|
||||
|
||||
@@ -1133,6 +1574,7 @@
|
||||
@@ -1138,6 +1574,7 @@
|
||||
@Override
|
||||
public void handleUseItemOn(PacketPlayInUseItem packetplayinuseitem) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinuseitem, this, this.player.getLevel());
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinuseitem, this, this.player.serverLevel());
|
||||
+ if (this.player.isImmobile()) return; // CraftBukkit
|
||||
this.player.connection.ackBlockChangesUpTo(packetplayinuseitem.getSequence());
|
||||
WorldServer worldserver = this.player.getLevel();
|
||||
WorldServer worldserver = this.player.serverLevel();
|
||||
EnumHand enumhand = packetplayinuseitem.getHand();
|
||||
@@ -1156,6 +1598,7 @@
|
||||
@@ -1161,6 +1598,7 @@
|
||||
|
||||
if (blockposition.getY() < i) {
|
||||
if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.mayInteract(this.player, blockposition)) {
|
||||
@@ -746,15 +741,15 @@
|
||||
EnumInteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
|
||||
|
||||
if (enumdirection == EnumDirection.UP && !enuminteractionresult.consumesAction() && blockposition.getY() >= i - 1 && wasBlockPlacementAttempt(this.player, itemstack)) {
|
||||
@@ -1184,6 +1627,7 @@
|
||||
@@ -1189,6 +1627,7 @@
|
||||
@Override
|
||||
public void handleUseItem(PacketPlayInBlockPlace packetplayinblockplace) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinblockplace, this, this.player.getLevel());
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinblockplace, this, this.player.serverLevel());
|
||||
+ if (this.player.isImmobile()) return; // CraftBukkit
|
||||
this.ackBlockChangesUpTo(packetplayinblockplace.getSequence());
|
||||
WorldServer worldserver = this.player.getLevel();
|
||||
WorldServer worldserver = this.player.serverLevel();
|
||||
EnumHand enumhand = packetplayinblockplace.getHand();
|
||||
@@ -1191,6 +1635,49 @@
|
||||
@@ -1196,6 +1635,49 @@
|
||||
|
||||
this.player.resetLastActionTime();
|
||||
if (!itemstack.isEmpty() && itemstack.isItemEnabled(worldserver.enabledFeatures())) {
|
||||
@@ -775,7 +770,7 @@
|
||||
+ float f8 = f3 * f5;
|
||||
+ double d3 = player.gameMode.getGameModeForPlayer()== EnumGamemode.CREATIVE ? 5.0D : 4.5D;
|
||||
+ Vec3D vec3d1 = vec3d.add((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
|
||||
+ MovingObjectPosition movingobjectposition = this.player.level.clip(new RayTrace(vec3d, vec3d1, RayTrace.BlockCollisionOption.OUTLINE, RayTrace.FluidCollisionOption.NONE, player));
|
||||
+ MovingObjectPosition movingobjectposition = this.player.level().clip(new RayTrace(vec3d, vec3d1, RayTrace.BlockCollisionOption.OUTLINE, RayTrace.FluidCollisionOption.NONE, player));
|
||||
+
|
||||
+ boolean cancelled;
|
||||
+ if (movingobjectposition == null || movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.BLOCK) {
|
||||
@@ -783,7 +778,7 @@
|
||||
+ cancelled = event.useItemInHand() == Event.Result.DENY;
|
||||
+ } else {
|
||||
+ MovingObjectPositionBlock movingobjectpositionblock = (MovingObjectPositionBlock) movingobjectposition;
|
||||
+ if (player.gameMode.firedInteract && player.gameMode.interactPosition.equals(movingobjectpositionblock.getBlockPos()) && player.gameMode.interactHand == enumhand && ItemStack.tagMatches(player.gameMode.interactItemStack, itemstack)) {
|
||||
+ if (player.gameMode.firedInteract && player.gameMode.interactPosition.equals(movingobjectpositionblock.getBlockPos()) && player.gameMode.interactHand == enumhand && ItemStack.isSameItemSameTags(player.gameMode.interactItemStack, itemstack)) {
|
||||
+ cancelled = player.gameMode.interactResult;
|
||||
+ } else {
|
||||
+ org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, movingobjectpositionblock.getBlockPos(), movingobjectpositionblock.getDirection(), itemstack, true, enumhand);
|
||||
@@ -804,7 +799,7 @@
|
||||
EnumInteractionResult enuminteractionresult = this.player.gameMode.useItem(this.player, worldserver, itemstack, enumhand);
|
||||
|
||||
if (enuminteractionresult.shouldSwing()) {
|
||||
@@ -1211,7 +1698,7 @@
|
||||
@@ -1216,7 +1698,7 @@
|
||||
Entity entity = packetplayinspectate.getEntity(worldserver);
|
||||
|
||||
if (entity != null) {
|
||||
@@ -813,7 +808,7 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1226,6 +1713,7 @@
|
||||
@@ -1231,6 +1713,7 @@
|
||||
PlayerConnection.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
|
||||
this.disconnect(IChatBaseComponent.translatable("multiplayer.requiredTexturePrompt.disconnect"));
|
||||
}
|
||||
@@ -821,7 +816,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -1247,12 +1735,27 @@
|
||||
@@ -1252,12 +1735,27 @@
|
||||
|
||||
@Override
|
||||
public void onDisconnect(IChatBaseComponent ichatbasecomponent) {
|
||||
@@ -850,7 +845,7 @@
|
||||
this.player.getTextFilter().leave();
|
||||
if (this.isSingleplayerOwner()) {
|
||||
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
|
||||
@@ -1275,6 +1778,15 @@
|
||||
@@ -1280,6 +1778,15 @@
|
||||
}
|
||||
|
||||
public void send(Packet<?> packet, @Nullable PacketSendListener packetsendlistener) {
|
||||
@@ -866,10 +861,10 @@
|
||||
try {
|
||||
this.connection.send(packet, packetsendlistener);
|
||||
} catch (Throwable throwable) {
|
||||
@@ -1291,7 +1803,16 @@
|
||||
@@ -1296,7 +1803,16 @@
|
||||
@Override
|
||||
public void handleSetCarriedItem(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinhelditemslot, this, this.player.getLevel());
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinhelditemslot, this, this.player.serverLevel());
|
||||
+ if (this.player.isImmobile()) return; // CraftBukkit
|
||||
if (packetplayinhelditemslot.getSlot() >= 0 && packetplayinhelditemslot.getSlot() < PlayerInventory.getSelectionSize()) {
|
||||
+ PlayerItemHeldEvent event = new PlayerItemHeldEvent(this.getCraftPlayer(), this.player.getInventory().selected, packetplayinhelditemslot.getSlot());
|
||||
@@ -883,7 +878,7 @@
|
||||
if (this.player.getInventory().selected != packetplayinhelditemslot.getSlot() && this.player.getUsedItemHand() == EnumHand.MAIN_HAND) {
|
||||
this.player.stopUsingItem();
|
||||
}
|
||||
@@ -1300,18 +1821,25 @@
|
||||
@@ -1305,18 +1821,25 @@
|
||||
this.player.resetLastActionTime();
|
||||
} else {
|
||||
PlayerConnection.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
|
||||
@@ -910,7 +905,7 @@
|
||||
PlayerChatMessage playerchatmessage;
|
||||
|
||||
try {
|
||||
@@ -1329,9 +1857,9 @@
|
||||
@@ -1334,9 +1857,9 @@
|
||||
PlayerChatMessage playerchatmessage1 = playerchatmessage.withUnsignedContent((IChatBaseComponent) completablefuture1.join()).filter(((FilteredText) completablefuture.join()).mask());
|
||||
|
||||
this.broadcastChatMessage(playerchatmessage1);
|
||||
@@ -922,7 +917,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1346,6 +1874,12 @@
|
||||
@@ -1351,6 +1874,12 @@
|
||||
|
||||
if (optional.isPresent()) {
|
||||
this.server.submit(() -> {
|
||||
@@ -935,7 +930,7 @@
|
||||
this.performChatCommand(serverboundchatcommandpacket, (LastSeenMessages) optional.get());
|
||||
this.detectRateSpam();
|
||||
});
|
||||
@@ -1355,12 +1889,25 @@
|
||||
@@ -1360,12 +1889,25 @@
|
||||
}
|
||||
|
||||
private void performChatCommand(ServerboundChatCommandPacket serverboundchatcommandpacket, LastSeenMessages lastseenmessages) {
|
||||
@@ -963,7 +958,7 @@
|
||||
} catch (SignedMessageChain.a signedmessagechain_a) {
|
||||
this.handleMessageDecodeFailure(signedmessagechain_a);
|
||||
return;
|
||||
@@ -1368,10 +1915,10 @@
|
||||
@@ -1373,10 +1915,10 @@
|
||||
|
||||
CommandSigningContext.a commandsigningcontext_a = new CommandSigningContext.a(map);
|
||||
|
||||
@@ -976,7 +971,7 @@
|
||||
}
|
||||
|
||||
private void handleMessageDecodeFailure(SignedMessageChain.a signedmessagechain_a) {
|
||||
@@ -1412,7 +1959,7 @@
|
||||
@@ -1417,7 +1959,7 @@
|
||||
} else {
|
||||
Optional<LastSeenMessages> optional = this.unpackAndApplyLastSeen(lastseenmessages_b);
|
||||
|
||||
@@ -985,7 +980,7 @@
|
||||
this.send(new ClientboundSystemChatPacket(IChatBaseComponent.translatable("chat.disabled.options").withStyle(EnumChatFormat.RED), false));
|
||||
return Optional.empty();
|
||||
} else {
|
||||
@@ -1460,6 +2007,122 @@
|
||||
@@ -1465,6 +2007,122 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1108,7 +1103,7 @@
|
||||
private PlayerChatMessage getSignedMessage(PacketPlayInChat packetplayinchat, LastSeenMessages lastseenmessages) throws SignedMessageChain.a {
|
||||
SignedMessageBody signedmessagebody = new SignedMessageBody(packetplayinchat.message(), packetplayinchat.timeStamp(), packetplayinchat.salt(), lastseenmessages);
|
||||
|
||||
@@ -1467,13 +2130,33 @@
|
||||
@@ -1472,13 +2130,33 @@
|
||||
}
|
||||
|
||||
private void broadcastChatMessage(PlayerChatMessage playerchatmessage) {
|
||||
@@ -1145,10 +1140,10 @@
|
||||
this.disconnect(IChatBaseComponent.translatable("disconnect.spam"));
|
||||
}
|
||||
|
||||
@@ -1495,13 +2178,59 @@
|
||||
@@ -1500,13 +2178,59 @@
|
||||
@Override
|
||||
public void handleAnimate(PacketPlayInArmAnimation packetplayinarmanimation) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinarmanimation, this, this.player.getLevel());
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinarmanimation, this, this.player.serverLevel());
|
||||
+ if (this.player.isImmobile()) return; // CraftBukkit
|
||||
this.player.resetLastActionTime();
|
||||
+ // CraftBukkit start - Raytrace to look for 'rogue armswings'
|
||||
@@ -1157,11 +1152,11 @@
|
||||
+ double d0 = this.player.getX();
|
||||
+ double d1 = this.player.getY() + (double) this.player.getEyeHeight();
|
||||
+ double d2 = this.player.getZ();
|
||||
+ Location origin = new Location(this.player.level.getWorld(), d0, d1, d2, f2, f1);
|
||||
+ Location origin = new Location(this.player.level().getWorld(), d0, d1, d2, f2, f1);
|
||||
+
|
||||
+ double d3 = player.gameMode.getGameModeForPlayer() == EnumGamemode.CREATIVE ? 5.0D : 4.5D;
|
||||
+ // SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time
|
||||
+ org.bukkit.util.RayTraceResult result = this.player.level.getWorld().rayTrace(origin, origin.getDirection(), d3, org.bukkit.FluidCollisionMode.NEVER, false, 0.1, entity -> entity != this.player.getBukkitEntity() && this.player.getBukkitEntity().canSee(entity));
|
||||
+ org.bukkit.util.RayTraceResult result = this.player.level().getWorld().rayTrace(origin, origin.getDirection(), d3, org.bukkit.FluidCollisionMode.NEVER, false, 0.1, entity -> entity != this.player.getBukkitEntity() && this.player.getBukkitEntity().canSee(entity));
|
||||
+
|
||||
+ if (result == null) {
|
||||
+ CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_AIR, this.player.getInventory().getSelected(), EnumHand.MAIN_HAND);
|
||||
@@ -1178,7 +1173,7 @@
|
||||
|
||||
@Override
|
||||
public void handlePlayerCommand(PacketPlayInEntityAction packetplayinentityaction) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinentityaction, this, this.player.getLevel());
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinentityaction, this, this.player.serverLevel());
|
||||
+ // CraftBukkit start
|
||||
+ if (this.player.isRemoved()) return;
|
||||
+ switch (packetplayinentityaction.getAction()) {
|
||||
@@ -1205,7 +1200,7 @@
|
||||
this.player.resetLastActionTime();
|
||||
Entity entity;
|
||||
IJumpable ijumpable;
|
||||
@@ -1583,6 +2312,12 @@
|
||||
@@ -1588,6 +2312,12 @@
|
||||
}
|
||||
|
||||
public void sendPlayerChatMessage(PlayerChatMessage playerchatmessage, ChatMessageType.a chatmessagetype_a) {
|
||||
@@ -1215,18 +1210,18 @@
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.send(new ClientboundPlayerChatPacket(playerchatmessage.link().sender(), playerchatmessage.link().index(), playerchatmessage.signature(), playerchatmessage.signedBody().pack(this.messageSignatureCache), playerchatmessage.unsignedContent(), playerchatmessage.filterMask(), chatmessagetype_a.toNetwork(this.player.level.registryAccess())));
|
||||
this.send(new ClientboundPlayerChatPacket(playerchatmessage.link().sender(), playerchatmessage.link().index(), playerchatmessage.signature(), playerchatmessage.signedBody().pack(this.messageSignatureCache), playerchatmessage.unsignedContent(), playerchatmessage.filterMask(), chatmessagetype_a.toNetwork(this.player.level().registryAccess())));
|
||||
this.addPendingMessage(playerchatmessage);
|
||||
}
|
||||
@@ -1598,6 +2333,7 @@
|
||||
@@ -1603,6 +2333,7 @@
|
||||
@Override
|
||||
public void handleInteract(PacketPlayInUseEntity packetplayinuseentity) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinuseentity, this, this.player.getLevel());
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinuseentity, this, this.player.serverLevel());
|
||||
+ if (this.player.isImmobile()) return; // CraftBukkit
|
||||
final WorldServer worldserver = this.player.getLevel();
|
||||
final WorldServer worldserver = this.player.serverLevel();
|
||||
final Entity entity = packetplayinuseentity.getTarget(worldserver);
|
||||
|
||||
@@ -1612,13 +2348,51 @@
|
||||
@@ -1617,13 +2348,51 @@
|
||||
|
||||
if (axisalignedbb.distanceToSqr(this.player.getEyePosition()) < PlayerConnection.MAX_INTERACTION_DISTANCE) {
|
||||
packetplayinuseentity.dispatch(new PacketPlayInUseEntity.c() {
|
||||
@@ -1279,7 +1274,7 @@
|
||||
if (enuminteractionresult.consumesAction()) {
|
||||
CriterionTriggers.PLAYER_INTERACTED_WITH_ENTITY.trigger(PlayerConnection.this.player, itemstack1, entity);
|
||||
if (enuminteractionresult.shouldSwing()) {
|
||||
@@ -1631,23 +2405,29 @@
|
||||
@@ -1636,23 +2405,29 @@
|
||||
|
||||
@Override
|
||||
public void onInteraction(EnumHand enumhand) {
|
||||
@@ -1312,7 +1307,7 @@
|
||||
}
|
||||
} else {
|
||||
PlayerConnection.this.disconnect(IChatBaseComponent.translatable("multiplayer.disconnect.invalid_entity_attacked"));
|
||||
@@ -1670,14 +2450,14 @@
|
||||
@@ -1675,14 +2450,14 @@
|
||||
case PERFORM_RESPAWN:
|
||||
if (this.player.wonGame) {
|
||||
this.player.wonGame = false;
|
||||
@@ -1328,11 +1323,11 @@
|
||||
+ this.player = this.server.getPlayerList().respawn(this.player, false, RespawnReason.DEATH);
|
||||
if (this.server.isHardcore()) {
|
||||
this.player.setGameMode(EnumGamemode.SPECTATOR);
|
||||
((GameRules.GameRuleBoolean) this.player.getLevel().getGameRules().getRule(GameRules.RULE_SPECTATORSGENERATECHUNKS)).set(false, this.server);
|
||||
@@ -1693,15 +2473,21 @@
|
||||
((GameRules.GameRuleBoolean) this.player.level().getGameRules().getRule(GameRules.RULE_SPECTATORSGENERATECHUNKS)).set(false, this.server);
|
||||
@@ -1698,15 +2473,21 @@
|
||||
@Override
|
||||
public void handleContainerClose(PacketPlayInCloseWindow packetplayinclosewindow) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinclosewindow, this, this.player.getLevel());
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinclosewindow, this, this.player.serverLevel());
|
||||
+
|
||||
+ if (this.player.isImmobile()) return; // CraftBukkit
|
||||
+ CraftEventFactory.handleInventoryCloseEvent(this.player); // CraftBukkit
|
||||
@@ -1342,7 +1337,7 @@
|
||||
|
||||
@Override
|
||||
public void handleContainerClick(PacketPlayInWindowClick packetplayinwindowclick) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinwindowclick, this, this.player.getLevel());
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinwindowclick, this, this.player.serverLevel());
|
||||
+ if (this.player.isImmobile()) return; // CraftBukkit
|
||||
this.player.resetLastActionTime();
|
||||
- if (this.player.containerMenu.containerId == packetplayinwindowclick.getContainerId()) {
|
||||
@@ -1353,7 +1348,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);
|
||||
@@ -1714,7 +2500,284 @@
|
||||
@@ -1719,7 +2500,284 @@
|
||||
boolean flag = packetplayinwindowclick.getStateId() != this.player.containerMenu.getStateId();
|
||||
|
||||
this.player.containerMenu.suppressRemoteUpdates();
|
||||
@@ -1400,7 +1395,7 @@
|
||||
+ if (cursor.isEmpty()) {
|
||||
+ action = packetplayinwindowclick.getButtonNum() == 0 ? InventoryAction.PICKUP_ALL : InventoryAction.PICKUP_HALF;
|
||||
+ } else if (slot.mayPlace(cursor)) {
|
||||
+ if (clickedItem.sameItem(cursor) && ItemStack.tagMatches(clickedItem, cursor)) {
|
||||
+ if (ItemStack.isSameItemSameTags(clickedItem, cursor)) {
|
||||
+ int toPlace = packetplayinwindowclick.getButtonNum() == 0 ? cursor.getCount() : 1;
|
||||
+ toPlace = Math.min(toPlace, clickedItem.getMaxStackSize() - clickedItem.getCount());
|
||||
+ toPlace = Math.min(toPlace, slot.container.getMaxStackSize() - clickedItem.getCount());
|
||||
@@ -1416,7 +1411,7 @@
|
||||
+ } else if (cursor.getCount() <= slot.getMaxStackSize()) {
|
||||
+ action = InventoryAction.SWAP_WITH_CURSOR;
|
||||
+ }
|
||||
+ } else if (cursor.getItem() == clickedItem.getItem() && ItemStack.tagMatches(cursor, clickedItem)) {
|
||||
+ } else if (ItemStack.isSameItemSameTags(cursor, clickedItem)) {
|
||||
+ if (clickedItem.getCount() >= 0) {
|
||||
+ if (clickedItem.getCount() + cursor.getCount() <= cursor.getMaxStackSize()) {
|
||||
+ // As of 1.5, this is result slots only
|
||||
@@ -1639,15 +1634,15 @@
|
||||
ObjectIterator objectiterator = Int2ObjectMaps.fastIterable(packetplayinwindowclick.getChangedSlots()).iterator();
|
||||
|
||||
while (objectiterator.hasNext()) {
|
||||
@@ -1754,6 +2817,7 @@
|
||||
@@ -1759,6 +2817,7 @@
|
||||
@Override
|
||||
public void handleContainerButtonClick(PacketPlayInEnchantItem packetplayinenchantitem) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinenchantitem, this, this.player.getLevel());
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinenchantitem, this, this.player.serverLevel());
|
||||
+ if (this.player.isImmobile()) return; // CraftBukkit
|
||||
this.player.resetLastActionTime();
|
||||
if (this.player.containerMenu.containerId == packetplayinenchantitem.getContainerId() && !this.player.isSpectator()) {
|
||||
if (!this.player.containerMenu.stillValid(this.player)) {
|
||||
@@ -1796,6 +2860,43 @@
|
||||
@@ -1801,6 +2860,43 @@
|
||||
|
||||
boolean flag1 = packetplayinsetcreativeslot.getSlotNum() >= 1 && packetplayinsetcreativeslot.getSlotNum() <= 45;
|
||||
boolean flag2 = itemstack.isEmpty() || itemstack.getDamageValue() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
|
||||
@@ -1691,66 +1686,26 @@
|
||||
|
||||
if (flag1 && flag2) {
|
||||
this.player.inventoryMenu.getSlot(packetplayinsetcreativeslot.getSlotNum()).setByPlayer(itemstack);
|
||||
@@ -1818,6 +2919,7 @@
|
||||
@@ -1823,6 +2919,7 @@
|
||||
}
|
||||
|
||||
private void updateSignText(PacketPlayInUpdateSign packetplayinupdatesign, List<FilteredText> list) {
|
||||
+ if (this.player.isImmobile()) return; // CraftBukkit
|
||||
this.player.resetLastActionTime();
|
||||
WorldServer worldserver = this.player.getLevel();
|
||||
WorldServer worldserver = this.player.serverLevel();
|
||||
BlockPosition blockposition = packetplayinupdatesign.getPos();
|
||||
@@ -1834,18 +2936,37 @@
|
||||
|
||||
if (!tileentitysign.isEditable() || !this.player.getUUID().equals(tileentitysign.getPlayerWhoMayEdit())) {
|
||||
PlayerConnection.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getName().getString());
|
||||
+ this.send(tileentity.getUpdatePacket()); // CraftBukkit
|
||||
return;
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ Player player = this.player.getBukkitEntity();
|
||||
+ int x = packetplayinupdatesign.getPos().getX();
|
||||
+ int y = packetplayinupdatesign.getPos().getY();
|
||||
+ int z = packetplayinupdatesign.getPos().getZ();
|
||||
+ String[] lines = new String[4];
|
||||
+
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
FilteredText filteredtext = (FilteredText) list.get(i);
|
||||
|
||||
if (this.player.isTextFilteringEnabled()) {
|
||||
- tileentitysign.setMessage(i, IChatBaseComponent.literal(filteredtext.filteredOrEmpty()));
|
||||
+ lines[i] = EnumChatFormat.stripFormatting(filteredtext.filteredOrEmpty());
|
||||
} else {
|
||||
- tileentitysign.setMessage(i, IChatBaseComponent.literal(filteredtext.raw()), IChatBaseComponent.literal(filteredtext.filteredOrEmpty()));
|
||||
+ lines[i] = EnumChatFormat.stripFormatting(filteredtext.raw());
|
||||
+ }
|
||||
+ }
|
||||
+ SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines);
|
||||
+ this.cserver.getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (!event.isCancelled()) {
|
||||
+ IChatBaseComponent[] components = org.bukkit.craftbukkit.block.CraftSign.sanitizeLines(event.getLines());
|
||||
+ for (int i = 0; i < components.length; i++) {
|
||||
+ tileentitysign.setMessage(i, components[i]);
|
||||
}
|
||||
+ tileentitysign.isEditable = false;
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
|
||||
tileentitysign.setChanged();
|
||||
worldserver.sendBlockUpdated(blockposition, iblockdata, iblockdata, 3);
|
||||
@@ -1855,6 +2976,7 @@
|
||||
@@ -1843,6 +2940,7 @@
|
||||
|
||||
@Override
|
||||
public void handleKeepAlive(PacketPlayInKeepAlive packetplayinkeepalive) {
|
||||
+ PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinkeepalive, this, this.player.getLevel()); // CraftBukkit
|
||||
+ PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinkeepalive, this, this.player.serverLevel()); // CraftBukkit
|
||||
if (this.keepAlivePending && packetplayinkeepalive.getId() == this.keepAliveChallenge) {
|
||||
int i = (int) (SystemUtils.getMillis() - this.keepAliveTime);
|
||||
|
||||
@@ -1869,7 +2991,17 @@
|
||||
@@ -1857,7 +2955,17 @@
|
||||
@Override
|
||||
public void handlePlayerAbilities(PacketPlayInAbilities packetplayinabilities) {
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinabilities, this, this.player.getLevel());
|
||||
PlayerConnectionUtils.ensureRunningOnSameThread(packetplayinabilities, this, this.player.serverLevel());
|
||||
- this.player.getAbilities().flying = packetplayinabilities.isFlying() && this.player.getAbilities().mayfly;
|
||||
+ // CraftBukkit start
|
||||
+ if (this.player.getAbilities().mayfly && this.player.getAbilities().flying != packetplayinabilities.isFlying()) {
|
||||
@@ -1766,7 +1721,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1878,8 +3010,50 @@
|
||||
@@ -1866,8 +2974,50 @@
|
||||
this.player.updateOptions(packetplayinsettings);
|
||||
}
|
||||
|
||||
@@ -1778,7 +1733,7 @@
|
||||
+
|
||||
+ @Override
|
||||
+ public void handleCustomPayload(PacketPlayInCustomPayload packetplayincustompayload) {
|
||||
+ PlayerConnectionUtils.ensureRunningOnSameThread(packetplayincustompayload, this, this.player.getLevel());
|
||||
+ PlayerConnectionUtils.ensureRunningOnSameThread(packetplayincustompayload, this, this.player.serverLevel());
|
||||
+ if (packetplayincustompayload.identifier.equals(CUSTOM_REGISTER)) {
|
||||
+ try {
|
||||
+ String channels = packetplayincustompayload.data.toString(com.google.common.base.Charsets.UTF_8);
|
||||
|
||||
Reference in New Issue
Block a user