@@ -267,7 +267,7 @@
|
||||
+
|
||||
this.minecraftServer.getPlayerList().d(this.player);
|
||||
this.player.checkMovement(this.player.locX - d0, this.player.locY - d1, this.player.locZ - d2);
|
||||
this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.d(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
|
||||
this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.c(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
|
||||
@@ -260,7 +442,7 @@
|
||||
} else {
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
@@ -300,113 +300,113 @@
|
||||
double d0 = this.player.locX;
|
||||
double d1 = this.player.locY;
|
||||
double d2 = this.player.locZ;
|
||||
@@ -295,15 +485,33 @@
|
||||
++this.receivedMovePackets;
|
||||
int i = this.receivedMovePackets - this.processedMovePackets;
|
||||
@@ -301,15 +491,33 @@
|
||||
++this.receivedMovePackets;
|
||||
int i = this.receivedMovePackets - this.processedMovePackets;
|
||||
|
||||
- if (i > 5) {
|
||||
+ // CraftBukkit start - handle custom speeds and skipped ticks
|
||||
+ this.allowedPlayerTicks += (System.currentTimeMillis() / 50) - this.lastTick;
|
||||
+ this.allowedPlayerTicks = Math.max(this.allowedPlayerTicks, 1);
|
||||
+ this.lastTick = (int) (System.currentTimeMillis() / 50);
|
||||
- if (i > 5) {
|
||||
+ // CraftBukkit start - handle custom speeds and skipped ticks
|
||||
+ this.allowedPlayerTicks += (System.currentTimeMillis() / 50) - this.lastTick;
|
||||
+ this.allowedPlayerTicks = Math.max(this.allowedPlayerTicks, 1);
|
||||
+ this.lastTick = (int) (System.currentTimeMillis() / 50);
|
||||
+
|
||||
+ if (i > Math.max(this.allowedPlayerTicks, 5)) {
|
||||
PlayerConnection.LOGGER.debug("{} is sending move packets too frequently ({} packets since last tick)", new Object[] { this.player.getName(), Integer.valueOf(i)});
|
||||
i = 1;
|
||||
}
|
||||
|
||||
+ if (packetplayinflying.hasLook || d11 > 0) {
|
||||
+ allowedPlayerTicks -= 1;
|
||||
+ } else {
|
||||
+ allowedPlayerTicks = 20;
|
||||
+ }
|
||||
+ float speed;
|
||||
+ if (player.abilities.isFlying) {
|
||||
+ speed = player.abilities.flySpeed * 20f;
|
||||
+ } else {
|
||||
+ speed = player.abilities.walkSpeed * 10f;
|
||||
+ }
|
||||
+
|
||||
if (!this.player.K() && (!this.player.x().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.cH())) {
|
||||
float f2 = this.player.cH() ? 300.0F : 100.0F;
|
||||
|
||||
- if (d11 - d10 > (double) (f2 * (float) i) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
|
||||
+ if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
|
||||
+ // CraftBukkit end
|
||||
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[] { this.player.getName(), Double.valueOf(d7), Double.valueOf(d8), Double.valueOf(d9)});
|
||||
this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch);
|
||||
return;
|
||||
@@ -349,6 +557,69 @@
|
||||
+ if (i > Math.max(this.allowedPlayerTicks, 5)) {
|
||||
PlayerConnection.LOGGER.debug("{} is sending move packets too frequently ({} packets since last tick)", new Object[] { this.player.getName(), Integer.valueOf(i)});
|
||||
i = 1;
|
||||
}
|
||||
}
|
||||
|
||||
+ // CraftBukkit start - fire PlayerMoveEvent
|
||||
+ // Rest to old location first
|
||||
+ this.player.setLocation(prevX, prevY, prevZ, prevYaw, prevPitch);
|
||||
+ if (packetplayinflying.hasLook || d11 > 0) {
|
||||
+ allowedPlayerTicks -= 1;
|
||||
+ } else {
|
||||
+ allowedPlayerTicks = 20;
|
||||
+ }
|
||||
+ float speed;
|
||||
+ if (player.abilities.isFlying) {
|
||||
+ speed = player.abilities.flySpeed * 20f;
|
||||
+ } else {
|
||||
+ speed = player.abilities.walkSpeed * 10f;
|
||||
+ }
|
||||
+
|
||||
+ Player player = this.getPlayer();
|
||||
+ 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.
|
||||
if (!this.player.K() && (!this.player.x().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.cH())) {
|
||||
float f2 = this.player.cH() ? 300.0F : 100.0F;
|
||||
|
||||
- if (d11 - d10 > (double) (f2 * (float) i) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
|
||||
+ if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
|
||||
+ // CraftBukkit end
|
||||
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[] { this.player.getName(), Double.valueOf(d7), Double.valueOf(d8), Double.valueOf(d9)});
|
||||
this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch);
|
||||
return;
|
||||
@@ -355,6 +563,69 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ // CraftBukkit start - fire PlayerMoveEvent
|
||||
+ // Rest to old location first
|
||||
+ this.player.setLocation(prevX, prevY, prevZ, prevYaw, prevPitch);
|
||||
+
|
||||
+ // If the packet contains movement information then we update the To location with the correct XYZ.
|
||||
+ if (packetplayinflying.hasPos) {
|
||||
+ to.setX(packetplayinflying.x);
|
||||
+ to.setY(packetplayinflying.y);
|
||||
+ to.setZ(packetplayinflying.z);
|
||||
+ }
|
||||
+ Player player = this.getPlayer();
|
||||
+ 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.
|
||||
+
|
||||
+ // If the packet contains look information then we update the To location with the correct Yaw & Pitch.
|
||||
+ if (packetplayinflying.hasLook) {
|
||||
+ to.setYaw(packetplayinflying.yaw);
|
||||
+ to.setPitch(packetplayinflying.pitch);
|
||||
+ }
|
||||
+ // If the packet contains movement information then we update the To location with the correct XYZ.
|
||||
+ if (packetplayinflying.hasPos) {
|
||||
+ to.setX(packetplayinflying.x);
|
||||
+ to.setY(packetplayinflying.y);
|
||||
+ to.setZ(packetplayinflying.z);
|
||||
+ }
|
||||
+
|
||||
+ // Prevent 40 event-calls for less than a single pixel of movement >.>
|
||||
+ double delta = Math.pow(this.lastPosX - to.getX(), 2) + Math.pow(this.lastPosY - to.getY(), 2) + Math.pow(this.lastPosZ - to.getZ(), 2);
|
||||
+ float deltaAngle = Math.abs(this.lastYaw - to.getYaw()) + Math.abs(this.lastPitch - to.getPitch());
|
||||
+ // If the packet contains look information then we update the To location with the correct Yaw & Pitch.
|
||||
+ if (packetplayinflying.hasLook) {
|
||||
+ to.setYaw(packetplayinflying.yaw);
|
||||
+ to.setPitch(packetplayinflying.pitch);
|
||||
+ }
|
||||
+
|
||||
+ if ((delta > 1f / 256 || deltaAngle > 10f) && !this.player.isFrozen()) {
|
||||
+ this.lastPosX = to.getX();
|
||||
+ this.lastPosY = to.getY();
|
||||
+ this.lastPosZ = to.getZ();
|
||||
+ this.lastYaw = to.getYaw();
|
||||
+ this.lastPitch = to.getPitch();
|
||||
+ // Prevent 40 event-calls for less than a single pixel of movement >.>
|
||||
+ double delta = Math.pow(this.lastPosX - to.getX(), 2) + Math.pow(this.lastPosY - to.getY(), 2) + Math.pow(this.lastPosZ - to.getZ(), 2);
|
||||
+ float deltaAngle = Math.abs(this.lastYaw - to.getYaw()) + Math.abs(this.lastPitch - to.getPitch());
|
||||
+
|
||||
+ // Skip the first time we do this
|
||||
+ if (from.getX() != Double.MAX_VALUE) {
|
||||
+ Location oldTo = to.clone();
|
||||
+ PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||
+ this.server.getPluginManager().callEvent(event);
|
||||
+ if ((delta > 1f / 256 || deltaAngle > 10f) && !this.player.isFrozen()) {
|
||||
+ this.lastPosX = to.getX();
|
||||
+ this.lastPosY = to.getY();
|
||||
+ this.lastPosZ = to.getZ();
|
||||
+ this.lastYaw = to.getYaw();
|
||||
+ this.lastPitch = to.getPitch();
|
||||
+
|
||||
+ // If the event is cancelled we move the player back to their old location.
|
||||
+ if (event.isCancelled()) {
|
||||
+ teleport(from);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Skip the first time we do this
|
||||
+ if (from.getX() != Double.MAX_VALUE) {
|
||||
+ Location oldTo = to.clone();
|
||||
+ PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||
+ this.server.getPluginManager().callEvent(event);
|
||||
+
|
||||
+ // If a Plugin has changed the To destination then we teleport the Player
|
||||
+ // there to avoid any 'Moved wrongly' or 'Moved too quickly' errors.
|
||||
+ // We only do this if the Event was not cancelled.
|
||||
+ if (!oldTo.equals(event.getTo()) && !event.isCancelled()) {
|
||||
+ this.player.getBukkitEntity().teleport(event.getTo(), PlayerTeleportEvent.TeleportCause.UNKNOWN);
|
||||
+ return;
|
||||
+ }
|
||||
+ // If the event is cancelled we move the player back to their old location.
|
||||
+ if (event.isCancelled()) {
|
||||
+ teleport(from);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // Check to see if the Players Location has some how changed during the call of the event.
|
||||
+ // This can happen due to a plugin teleporting the player instead of using .setTo()
|
||||
+ if (!from.equals(this.getPlayer().getLocation()) && this.justTeleported) {
|
||||
+ this.justTeleported = false;
|
||||
+ return;
|
||||
+ // If a Plugin has changed the To destination then we teleport the Player
|
||||
+ // there to avoid any 'Moved wrongly' or 'Moved too quickly' errors.
|
||||
+ // We only do this if the Event was not cancelled.
|
||||
+ if (!oldTo.equals(event.getTo()) && !event.isCancelled()) {
|
||||
+ this.player.getBukkitEntity().teleport(event.getTo(), PlayerTeleportEvent.TeleportCause.UNKNOWN);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // Check to see if the Players Location has some how changed during the call of the event.
|
||||
+ // This can happen due to a plugin teleporting the player instead of using .setTo()
|
||||
+ if (!from.equals(this.getPlayer().getLocation()) && this.justTeleported) {
|
||||
+ this.justTeleported = false;
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ this.player.setLocation(d4, d5, d6, f, f1); // Copied from above
|
||||
+ // CraftBukkit end
|
||||
+ this.player.setLocation(d4, d5, d6, f, f1); // Copied from above
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
this.B = d12 >= -0.03125D;
|
||||
this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly;
|
||||
this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.cH() && !worldserver.d(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
|
||||
@@ -365,10 +636,68 @@
|
||||
this.B = d12 >= -0.03125D;
|
||||
this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly;
|
||||
this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.cH() && !worldserver.c(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
|
||||
@@ -372,10 +643,68 @@
|
||||
}
|
||||
|
||||
public void a(double d0, double d1, double d2, float f, float f1) {
|
||||
@@ -476,7 +476,7 @@
|
||||
double d3 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X) ? this.player.locX : 0.0D;
|
||||
double d4 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y) ? this.player.locY : 0.0D;
|
||||
double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.locZ : 0.0D;
|
||||
@@ -385,6 +714,14 @@
|
||||
@@ -392,6 +721,14 @@
|
||||
f3 = f1 + this.player.pitch;
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@
|
||||
if (++this.teleportAwait == Integer.MAX_VALUE) {
|
||||
this.teleportAwait = 0;
|
||||
}
|
||||
@@ -396,6 +733,7 @@
|
||||
@@ -403,6 +740,7 @@
|
||||
|
||||
public void a(PacketPlayInBlockDig packetplayinblockdig) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.x());
|
||||
@@ -499,7 +499,7 @@
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
BlockPosition blockposition = packetplayinblockdig.a();
|
||||
|
||||
@@ -405,7 +743,15 @@
|
||||
@@ -412,7 +750,15 @@
|
||||
if (!this.player.isSpectator()) {
|
||||
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
|
||||
|
||||
@@ -516,7 +516,7 @@
|
||||
this.player.a(EnumHand.MAIN_HAND, itemstack);
|
||||
}
|
||||
|
||||
@@ -413,6 +759,21 @@
|
||||
@@ -420,6 +766,21 @@
|
||||
|
||||
case DROP_ITEM:
|
||||
if (!this.player.isSpectator()) {
|
||||
@@ -538,7 +538,7 @@
|
||||
this.player.a(false);
|
||||
}
|
||||
|
||||
@@ -446,7 +807,15 @@
|
||||
@@ -453,7 +814,15 @@
|
||||
if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
|
||||
this.player.playerInteractManager.a(blockposition, packetplayinblockdig.b());
|
||||
} else {
|
||||
@@ -554,7 +554,7 @@
|
||||
}
|
||||
} else {
|
||||
if (packetplayinblockdig.c() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
|
||||
@@ -466,10 +835,12 @@
|
||||
@@ -473,10 +842,12 @@
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid player action");
|
||||
}
|
||||
@@ -567,7 +567,7 @@
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
EnumHand enumhand = packetplayinuseitem.c();
|
||||
ItemStack itemstack = this.player.b(enumhand);
|
||||
@@ -483,6 +854,13 @@
|
||||
@@ -490,6 +861,13 @@
|
||||
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutChat(chatmessage, (byte) 2));
|
||||
} else if (this.teleportPos == null && this.player.d((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && !this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
|
||||
@@ -581,7 +581,7 @@
|
||||
this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, blockposition, enumdirection, packetplayinuseitem.d(), packetplayinuseitem.e(), packetplayinuseitem.f());
|
||||
}
|
||||
|
||||
@@ -492,13 +870,52 @@
|
||||
@@ -499,13 +877,52 @@
|
||||
|
||||
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.x());
|
||||
@@ -635,7 +635,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -509,8 +926,8 @@
|
||||
@@ -516,8 +933,8 @@
|
||||
WorldServer[] aworldserver = this.minecraftServer.worldServer;
|
||||
int i = aworldserver.length;
|
||||
|
||||
@@ -646,7 +646,7 @@
|
||||
|
||||
if (worldserver != null) {
|
||||
entity = packetplayinspectate.a(worldserver);
|
||||
@@ -523,6 +940,8 @@
|
||||
@@ -530,6 +947,8 @@
|
||||
if (entity != null) {
|
||||
this.player.setSpectatorTarget(this.player);
|
||||
this.player.stopRiding();
|
||||
@@ -655,7 +655,7 @@
|
||||
if (entity.world == this.player.world) {
|
||||
this.player.enderTeleportTo(entity.locX, entity.locY, entity.locZ);
|
||||
} else {
|
||||
@@ -548,12 +967,19 @@
|
||||
@@ -555,12 +974,19 @@
|
||||
this.minecraftServer.getPlayerList().b(this.player, worldserver2);
|
||||
this.minecraftServer.getPlayerList().updateClient(this.player);
|
||||
}
|
||||
@@ -676,7 +676,7 @@
|
||||
|
||||
public void a(PacketPlayInBoatMove packetplayinboatmove) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.x());
|
||||
@@ -566,14 +992,29 @@
|
||||
@@ -573,14 +999,29 @@
|
||||
}
|
||||
|
||||
public void a(IChatBaseComponent ichatbasecomponent) {
|
||||
@@ -708,7 +708,7 @@
|
||||
if (this.minecraftServer.R() && this.player.getName().equals(this.minecraftServer.Q())) {
|
||||
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
|
||||
this.minecraftServer.safeShutdown();
|
||||
@@ -595,6 +1036,15 @@
|
||||
@@ -602,6 +1043,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -724,7 +724,7 @@
|
||||
try {
|
||||
this.networkManager.sendPacket(packet);
|
||||
} catch (Throwable throwable) {
|
||||
@@ -616,17 +1066,32 @@
|
||||
@@ -623,17 +1073,32 @@
|
||||
|
||||
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.x());
|
||||
@@ -759,7 +759,7 @@
|
||||
ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]);
|
||||
|
||||
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
|
||||
@@ -639,39 +1104,249 @@
|
||||
@@ -646,39 +1111,249 @@
|
||||
|
||||
for (int i = 0; i < s.length(); ++i) {
|
||||
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
|
||||
@@ -1017,7 +1017,7 @@
|
||||
this.player.resetIdleTimer();
|
||||
IJumpable ijumpable;
|
||||
|
||||
@@ -743,6 +1418,7 @@
|
||||
@@ -750,6 +1425,7 @@
|
||||
|
||||
public void a(PacketPlayInUseEntity packetplayinuseentity) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.x());
|
||||
@@ -1025,7 +1025,7 @@
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
Entity entity = packetplayinuseentity.a((World) worldserver);
|
||||
|
||||
@@ -758,20 +1434,68 @@
|
||||
@@ -765,20 +1441,68 @@
|
||||
if (this.player.h(entity) < d0) {
|
||||
EnumHand enumhand;
|
||||
|
||||
@@ -1095,7 +1095,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -787,7 +1511,8 @@
|
||||
@@ -794,7 +1518,8 @@
|
||||
case PERFORM_RESPAWN:
|
||||
if (this.player.viewingCredits) {
|
||||
this.player.viewingCredits = false;
|
||||
@@ -1105,7 +1105,7 @@
|
||||
} else {
|
||||
if (this.player.getHealth() > 0.0F) {
|
||||
return;
|
||||
@@ -813,14 +1538,20 @@
|
||||
@@ -820,14 +1545,20 @@
|
||||
|
||||
public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x());
|
||||
@@ -1127,7 +1127,7 @@
|
||||
NonNullList nonnulllist = NonNullList.a();
|
||||
|
||||
for (int i = 0; i < this.player.activeContainer.c.size(); ++i) {
|
||||
@@ -829,8 +1560,279 @@
|
||||
@@ -836,8 +1567,279 @@
|
||||
|
||||
this.player.a(this.player.activeContainer, nonnulllist);
|
||||
} else {
|
||||
@@ -1136,10 +1136,10 @@
|
||||
+ if (packetplayinwindowclick.b() < -1 && packetplayinwindowclick.b() != -999) {
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
+
|
||||
+ InventoryView inventory = this.player.activeContainer.getBukkitView();
|
||||
+ SlotType type = CraftInventoryView.getSlotType(inventory, packetplayinwindowclick.b());
|
||||
+
|
||||
|
||||
+ InventoryClickEvent event;
|
||||
+ ClickType click = ClickType.UNKNOWN;
|
||||
+ InventoryAction action = InventoryAction.UNKNOWN;
|
||||
@@ -1408,7 +1408,7 @@
|
||||
if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) {
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true));
|
||||
this.player.f = true;
|
||||
@@ -859,6 +1861,7 @@
|
||||
@@ -866,6 +1868,7 @@
|
||||
|
||||
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.x());
|
||||
@@ -1416,7 +1416,7 @@
|
||||
this.player.resetIdleTimer();
|
||||
if (this.player.activeContainer.windowId == packetplayinenchantitem.a() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
|
||||
this.player.activeContainer.a(this.player, packetplayinenchantitem.b());
|
||||
@@ -892,7 +1895,46 @@
|
||||
@@ -899,7 +1902,46 @@
|
||||
}
|
||||
|
||||
boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45;
|
||||
@@ -1464,7 +1464,7 @@
|
||||
|
||||
if (flag1 && flag2) {
|
||||
if (itemstack.isEmpty()) {
|
||||
@@ -916,6 +1958,7 @@
|
||||
@@ -923,6 +1965,7 @@
|
||||
|
||||
public void a(PacketPlayInTransaction packetplayintransaction) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.x());
|
||||
@@ -1472,7 +1472,7 @@
|
||||
Short oshort = (Short) this.k.get(this.player.activeContainer.windowId);
|
||||
|
||||
if (oshort != null && packetplayintransaction.b() == oshort.shortValue() && this.player.activeContainer.windowId == packetplayintransaction.a() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
|
||||
@@ -926,6 +1969,7 @@
|
||||
@@ -933,6 +1976,7 @@
|
||||
|
||||
public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.x());
|
||||
@@ -1480,7 +1480,7 @@
|
||||
this.player.resetIdleTimer();
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
BlockPosition blockposition = packetplayinupdatesign.a();
|
||||
@@ -942,14 +1986,30 @@
|
||||
@@ -949,14 +1993,30 @@
|
||||
|
||||
if (!tileentitysign.a() || tileentitysign.e() != this.player) {
|
||||
this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign");
|
||||
@@ -1512,7 +1512,7 @@
|
||||
|
||||
tileentitysign.update();
|
||||
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
|
||||
@@ -972,11 +2032,27 @@
|
||||
@@ -979,11 +2039,27 @@
|
||||
|
||||
public void a(PacketPlayInAbilities packetplayinabilities) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x());
|
||||
@@ -1541,7 +1541,7 @@
|
||||
ArrayList arraylist = Lists.newArrayList();
|
||||
Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator();
|
||||
|
||||
@@ -1020,10 +2096,13 @@
|
||||
@@ -1027,10 +2103,13 @@
|
||||
}
|
||||
|
||||
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
|
||||
@@ -1555,7 +1555,7 @@
|
||||
}
|
||||
} else {
|
||||
String s1;
|
||||
@@ -1062,10 +2141,11 @@
|
||||
@@ -1069,10 +2148,11 @@
|
||||
}
|
||||
|
||||
itemstack2.a("pages", (NBTBase) nbttaglist);
|
||||
@@ -1568,7 +1568,7 @@
|
||||
}
|
||||
} else if ("MC|TrSel".equals(s)) {
|
||||
try {
|
||||
@@ -1077,6 +2157,7 @@
|
||||
@@ -1084,6 +2164,7 @@
|
||||
}
|
||||
} catch (Exception exception2) {
|
||||
PlayerConnection.LOGGER.error("Couldn\'t select trade", exception2);
|
||||
@@ -1576,7 +1576,7 @@
|
||||
}
|
||||
} else {
|
||||
TileEntity tileentity;
|
||||
@@ -1126,6 +2207,7 @@
|
||||
@@ -1133,6 +2214,7 @@
|
||||
}
|
||||
} catch (Exception exception3) {
|
||||
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3);
|
||||
@@ -1584,7 +1584,7 @@
|
||||
}
|
||||
} else if ("MC|AutoCmd".equals(s)) {
|
||||
if (!this.minecraftServer.getEnableCommandBlock()) {
|
||||
@@ -1193,6 +2275,7 @@
|
||||
@@ -1200,6 +2282,7 @@
|
||||
}
|
||||
} catch (Exception exception4) {
|
||||
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4);
|
||||
@@ -1592,7 +1592,7 @@
|
||||
}
|
||||
} else {
|
||||
int k;
|
||||
@@ -1216,6 +2299,7 @@
|
||||
@@ -1223,6 +2306,7 @@
|
||||
}
|
||||
} catch (Exception exception5) {
|
||||
PlayerConnection.LOGGER.error("Couldn\'t set beacon", exception5);
|
||||
@@ -1600,7 +1600,7 @@
|
||||
}
|
||||
}
|
||||
} else if ("MC|ItemName".equals(s)) {
|
||||
@@ -1302,6 +2386,7 @@
|
||||
@@ -1309,6 +2393,7 @@
|
||||
}
|
||||
} catch (Exception exception6) {
|
||||
PlayerConnection.LOGGER.error("Couldn\'t set structure block", exception6);
|
||||
@@ -1608,7 +1608,7 @@
|
||||
}
|
||||
} else if ("MC|PickItem".equals(s)) {
|
||||
packetdataserializer = packetplayincustompayload.b();
|
||||
@@ -1316,9 +2401,31 @@
|
||||
@@ -1323,9 +2408,31 @@
|
||||
PlayerConnection.LOGGER.error("Couldn\'t pick item", exception7);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user