@@ -126,7 +126,7 @@
|
||||
this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0]));
|
||||
}
|
||||
|
||||
@@ -149,16 +226,46 @@
|
||||
@@ -150,16 +227,46 @@
|
||||
return this.minecraftServer.b(this.player.getProfile());
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -199,7 +306,34 @@
|
||||
@@ -200,7 +307,34 @@
|
||||
double d9 = entity.getMot().g();
|
||||
double d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8);
|
||||
this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
|
||||
return;
|
||||
@@ -229,14 +363,72 @@
|
||||
@@ -230,14 +364,72 @@
|
||||
}
|
||||
|
||||
entity.setLocation(d3, d4, d5, f, f1);
|
||||
@@ -283,7 +283,7 @@
|
||||
this.player.getWorldServer().getChunkProvider().movePlayer(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.a(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
|
||||
@@ -251,7 +443,7 @@
|
||||
@@ -252,7 +444,7 @@
|
||||
@Override
|
||||
public void a(PacketPlayInTeleportAccept packetplayinteleportaccept) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinteleportaccept, this, this.player.getWorldServer());
|
||||
@@ -292,7 +292,7 @@
|
||||
this.player.setLocation(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
|
||||
this.o = this.teleportPos.x;
|
||||
this.p = this.teleportPos.y;
|
||||
@@ -261,6 +453,7 @@
|
||||
@@ -262,6 +454,7 @@
|
||||
}
|
||||
|
||||
this.teleportPos = null;
|
||||
@@ -300,7 +300,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -269,7 +462,7 @@
|
||||
@@ -270,7 +463,7 @@
|
||||
public void a(PacketPlayInRecipeDisplayed packetplayinrecipedisplayed) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinrecipedisplayed, this, this.player.getWorldServer());
|
||||
if (packetplayinrecipedisplayed.b() == PacketPlayInRecipeDisplayed.Status.SHOWN) {
|
||||
@@ -309,7 +309,7 @@
|
||||
RecipeBookServer recipebookserver = this.player.B();
|
||||
|
||||
optional.ifPresent(recipebookserver::e);
|
||||
@@ -303,6 +496,12 @@
|
||||
@@ -304,6 +497,12 @@
|
||||
@Override
|
||||
public void a(PacketPlayInTabComplete packetplayintabcomplete) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer());
|
||||
@@ -322,7 +322,7 @@
|
||||
StringReader stringreader = new StringReader(packetplayintabcomplete.c());
|
||||
|
||||
if (stringreader.canRead() && stringreader.peek() == '/') {
|
||||
@@ -312,7 +511,8 @@
|
||||
@@ -313,7 +512,8 @@
|
||||
ParseResults<CommandListenerWrapper> parseresults = this.minecraftServer.getCommandDispatcher().a().parse(stringreader, this.player.getCommandListener());
|
||||
|
||||
this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
|
||||
@@ -332,7 +332,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
@@ -517,6 +717,7 @@
|
||||
@@ -518,6 +718,7 @@
|
||||
|
||||
if (container instanceof ContainerMerchant) {
|
||||
ContainerMerchant containermerchant = (ContainerMerchant) container;
|
||||
@@ -340,7 +340,7 @@
|
||||
|
||||
containermerchant.d(i);
|
||||
containermerchant.g(i);
|
||||
@@ -526,6 +727,15 @@
|
||||
@@ -527,6 +728,15 @@
|
||||
|
||||
@Override
|
||||
public void a(PacketPlayInBEdit packetplayinbedit) {
|
||||
@@ -356,7 +356,7 @@
|
||||
ItemStack itemstack = packetplayinbedit.b();
|
||||
|
||||
if (!itemstack.isEmpty()) {
|
||||
@@ -554,9 +764,11 @@
|
||||
@@ -555,9 +765,11 @@
|
||||
}
|
||||
|
||||
itemstack2.a("pages", (NBTBase) nbttaglist);
|
||||
@@ -369,7 +369,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -598,7 +810,7 @@
|
||||
@@ -599,7 +811,7 @@
|
||||
} else {
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
|
||||
@@ -378,7 +378,7 @@
|
||||
if (this.e == 0) {
|
||||
this.syncPosition();
|
||||
}
|
||||
@@ -608,13 +820,21 @@
|
||||
@@ -609,13 +821,21 @@
|
||||
this.A = this.e;
|
||||
this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
|
||||
}
|
||||
@@ -401,7 +401,7 @@
|
||||
double d0 = this.player.locX;
|
||||
double d1 = this.player.locY;
|
||||
double d2 = this.player.locZ;
|
||||
@@ -639,15 +859,33 @@
|
||||
@@ -640,15 +860,33 @@
|
||||
++this.receivedMovePackets;
|
||||
int i = this.receivedMovePackets - this.processedMovePackets;
|
||||
|
||||
@@ -437,7 +437,7 @@
|
||||
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), d7, d8, d9);
|
||||
this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch);
|
||||
return;
|
||||
@@ -693,6 +931,69 @@
|
||||
@@ -694,6 +932,69 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -507,7 +507,7 @@
|
||||
this.B = d12 >= -0.03125D && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR && !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly && !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.isGliding() && !worldserver.a(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
|
||||
this.player.onGround = packetplayinflying.b();
|
||||
this.player.getWorldServer().getChunkProvider().movePlayer(this.player);
|
||||
@@ -712,10 +1013,66 @@
|
||||
@@ -713,10 +1014,66 @@
|
||||
}
|
||||
|
||||
public void a(double d0, double d1, double d2, float f, float f1) {
|
||||
@@ -575,7 +575,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;
|
||||
@@ -727,6 +1084,14 @@
|
||||
@@ -728,6 +1085,14 @@
|
||||
this.teleportAwait = 0;
|
||||
}
|
||||
|
||||
@@ -590,15 +590,15 @@
|
||||
this.A = this.e;
|
||||
this.player.setLocation(d0, d1, d2, f, f1);
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.teleportAwait));
|
||||
@@ -735,6 +1100,7 @@
|
||||
@@ -736,6 +1101,7 @@
|
||||
@Override
|
||||
public void a(PacketPlayInBlockDig packetplayinblockdig) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.getWorldServer());
|
||||
+ if (this.player.isFrozen()) return; // CraftBukkit
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
BlockPosition blockposition = packetplayinblockdig.b();
|
||||
|
||||
@@ -744,13 +1110,45 @@
|
||||
this.player.resetIdleTimer();
|
||||
@@ -746,13 +1112,45 @@
|
||||
if (!this.player.isSpectator()) {
|
||||
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
|
||||
|
||||
@@ -646,29 +646,7 @@
|
||||
this.player.n(false);
|
||||
}
|
||||
|
||||
@@ -781,7 +1179,15 @@
|
||||
if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
|
||||
this.player.playerInteractManager.a(blockposition, packetplayinblockdig.c());
|
||||
} else {
|
||||
+ // CraftBukkit start - fire PlayerInteractEvent
|
||||
+ CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, blockposition, packetplayinblockdig.c(), this.player.inventory.getItemInHand(), EnumHand.MAIN_HAND);
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(worldserver, blockposition));
|
||||
+ // Update any tile entity data for this block
|
||||
+ TileEntity tileentity = worldserver.getTileEntity(blockposition);
|
||||
+ if (tileentity != null) {
|
||||
+ this.player.playerConnection.sendPacket(tileentity.getUpdatePacket());
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
} else {
|
||||
if (packetplayinblockdig.d() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
|
||||
@@ -800,11 +1206,13 @@
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid player action");
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
@@ -779,6 +1177,7 @@
|
||||
@Override
|
||||
public void a(PacketPlayInUseItem packetplayinuseitem) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinuseitem, this, this.player.getWorldServer());
|
||||
@@ -676,10 +654,10 @@
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
EnumHand enumhand = packetplayinuseitem.b();
|
||||
ItemStack itemstack = this.player.b(enumhand);
|
||||
@@ -818,6 +1226,14 @@
|
||||
@@ -792,6 +1191,14 @@
|
||||
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, ChatMessageType.GAME_INFO));
|
||||
} else if (this.teleportPos == null && this.player.e((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)) {
|
||||
} else if (this.teleportPos == null && this.player.e((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.a((EntityHuman) this.player, blockposition)) {
|
||||
+ // CraftBukkit start - Check if we can actually do something over this large a distance
|
||||
+ Location eyeLoc = this.getPlayer().getEyeLocation();
|
||||
+ double reachDistance = NumberConversions.square(eyeLoc.getX() - blockposition.getX()) + NumberConversions.square(eyeLoc.getY() - blockposition.getY()) + NumberConversions.square(eyeLoc.getZ() - blockposition.getZ());
|
||||
@@ -691,7 +669,7 @@
|
||||
this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
|
||||
}
|
||||
|
||||
@@ -828,13 +1244,53 @@
|
||||
@@ -802,13 +1209,53 @@
|
||||
@Override
|
||||
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.getWorldServer());
|
||||
@@ -746,7 +724,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -849,7 +1305,7 @@
|
||||
@@ -823,7 +1270,7 @@
|
||||
Entity entity = packetplayinspectate.a(worldserver);
|
||||
|
||||
if (entity != null) {
|
||||
@@ -755,7 +733,7 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -858,7 +1314,12 @@
|
||||
@@ -832,7 +1279,12 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -769,7 +747,7 @@
|
||||
|
||||
@Override
|
||||
public void a(PacketPlayInBoatMove packetplayinboatmove) {
|
||||
@@ -873,11 +1334,26 @@
|
||||
@@ -847,11 +1299,26 @@
|
||||
|
||||
@Override
|
||||
public void a(IChatBaseComponent ichatbasecomponent) {
|
||||
@@ -797,7 +775,7 @@
|
||||
if (this.isExemptPlayer()) {
|
||||
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
|
||||
this.minecraftServer.safeShutdown(false);
|
||||
@@ -903,6 +1379,15 @@
|
||||
@@ -877,6 +1344,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -813,7 +791,7 @@
|
||||
try {
|
||||
this.networkManager.sendPacket(packet, genericfuturelistener);
|
||||
} catch (Throwable throwable) {
|
||||
@@ -919,18 +1404,38 @@
|
||||
@@ -893,18 +1369,38 @@
|
||||
@Override
|
||||
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.getWorldServer());
|
||||
@@ -854,7 +832,7 @@
|
||||
this.sendPacket(new PacketPlayOutChat((new ChatMessage("chat.cannotSend", new Object[0])).a(EnumChatFormat.RED)));
|
||||
} else {
|
||||
this.player.resetIdleTimer();
|
||||
@@ -940,41 +1445,257 @@
|
||||
@@ -914,41 +1410,257 @@
|
||||
|
||||
for (int i = 0; i < s.length(); ++i) {
|
||||
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
|
||||
@@ -1119,7 +1097,7 @@
|
||||
this.player.resetIdleTimer();
|
||||
IJumpable ijumpable;
|
||||
|
||||
@@ -1038,6 +1759,7 @@
|
||||
@@ -1012,6 +1724,7 @@
|
||||
@Override
|
||||
public void a(PacketPlayInUseEntity packetplayinuseentity) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.getWorldServer());
|
||||
@@ -1127,7 +1105,7 @@
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
Entity entity = packetplayinuseentity.a((World) worldserver);
|
||||
|
||||
@@ -1053,20 +1775,74 @@
|
||||
@@ -1027,20 +1740,74 @@
|
||||
if (this.player.h(entity) < d0) {
|
||||
EnumHand enumhand;
|
||||
|
||||
@@ -1203,7 +1181,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1106,15 +1882,21 @@
|
||||
@@ -1080,15 +1847,21 @@
|
||||
@Override
|
||||
public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer());
|
||||
@@ -1227,7 +1205,7 @@
|
||||
NonNullList<ItemStack> nonnulllist = NonNullList.a();
|
||||
|
||||
for (int i = 0; i < this.player.activeContainer.slots.size(); ++i) {
|
||||
@@ -1123,8 +1905,274 @@
|
||||
@@ -1097,8 +1870,274 @@
|
||||
|
||||
this.player.a(this.player.activeContainer, nonnulllist);
|
||||
} else {
|
||||
@@ -1503,7 +1481,7 @@
|
||||
if (ItemStack.matches(packetplayinwindowclick.f(), itemstack)) {
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.b(), packetplayinwindowclick.e(), true));
|
||||
this.player.e = true;
|
||||
@@ -1164,6 +2212,7 @@
|
||||
@@ -1138,6 +2177,7 @@
|
||||
@Override
|
||||
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.getWorldServer());
|
||||
@@ -1511,7 +1489,7 @@
|
||||
this.player.resetIdleTimer();
|
||||
if (this.player.activeContainer.windowId == packetplayinenchantitem.b() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
|
||||
this.player.activeContainer.a((EntityHuman) this.player, packetplayinenchantitem.c());
|
||||
@@ -1196,6 +2245,43 @@
|
||||
@@ -1170,6 +2210,43 @@
|
||||
|
||||
boolean flag1 = packetplayinsetcreativeslot.b() >= 1 && packetplayinsetcreativeslot.b() <= 45;
|
||||
boolean flag2 = itemstack.isEmpty() || itemstack.getDamage() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
|
||||
@@ -1555,7 +1533,7 @@
|
||||
|
||||
if (flag1 && flag2) {
|
||||
if (itemstack.isEmpty()) {
|
||||
@@ -1221,6 +2307,7 @@
|
||||
@@ -1195,6 +2272,7 @@
|
||||
@Override
|
||||
public void a(PacketPlayInTransaction packetplayintransaction) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.getWorldServer());
|
||||
@@ -1563,7 +1541,7 @@
|
||||
int i = this.player.activeContainer.windowId;
|
||||
|
||||
if (i == packetplayintransaction.b() && this.k.getOrDefault(i, (short) (packetplayintransaction.c() + 1)) == packetplayintransaction.c() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
|
||||
@@ -1232,6 +2319,7 @@
|
||||
@@ -1206,6 +2284,7 @@
|
||||
@Override
|
||||
public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.getWorldServer());
|
||||
@@ -1571,7 +1549,7 @@
|
||||
this.player.resetIdleTimer();
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
BlockPosition blockposition = packetplayinupdatesign.b();
|
||||
@@ -1248,14 +2336,30 @@
|
||||
@@ -1222,14 +2301,30 @@
|
||||
|
||||
if (!tileentitysign.d() || tileentitysign.f() != this.player) {
|
||||
this.minecraftServer.warning("Player " + this.player.getDisplayName().getString() + " just tried to change non-editable sign");
|
||||
@@ -1603,7 +1581,7 @@
|
||||
|
||||
tileentitysign.update();
|
||||
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
|
||||
@@ -1265,6 +2369,7 @@
|
||||
@@ -1239,6 +2334,7 @@
|
||||
|
||||
@Override
|
||||
public void a(PacketPlayInKeepAlive packetplayinkeepalive) {
|
||||
@@ -1611,7 +1589,7 @@
|
||||
if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) {
|
||||
int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive);
|
||||
|
||||
@@ -1279,7 +2384,17 @@
|
||||
@@ -1253,7 +2349,17 @@
|
||||
@Override
|
||||
public void a(PacketPlayInAbilities packetplayinabilities) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.getWorldServer());
|
||||
@@ -1630,7 +1608,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1288,8 +2403,50 @@
|
||||
@@ -1262,8 +2368,50 @@
|
||||
this.player.a(packetplayinsettings);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user