Mappings Update

This commit is contained in:
md_5
2018-12-26 08:00:00 +11:00
parent bd36e200da
commit d05c8b1481
120 changed files with 878 additions and 1619 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/PlayerConnection.java
+++ b/net/minecraft/server/PlayerConnection.java
@@ -17,6 +17,50 @@
@@ -16,6 +16,50 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -51,7 +51,7 @@
public class PlayerConnection implements PacketListenerPlayIn, ITickable {
private static final Logger LOGGER = LogManager.getLogger();
@@ -27,7 +71,10 @@
@@ -26,7 +70,10 @@
private long lastKeepAlive;
private boolean awaitingKeepAlive;
private long h;
@@ -61,9 +61,9 @@
+ private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
+ // CraftBukkit end
private int j;
private final IntHashMap<Short> k = new IntHashMap();
private final IntHashMap<Short> k = new IntHashMap<>();
private double l;
@@ -59,7 +106,33 @@
@@ -58,7 +105,33 @@
networkmanager.setPacketListener(this);
this.player = entityplayer;
entityplayer.playerConnection = this;
@@ -97,7 +97,7 @@
public void tick() {
this.syncPosition();
@@ -105,7 +178,7 @@
@@ -104,7 +177,7 @@
this.minecraftServer.methodProfiler.enter("keepAlive");
long i = SystemUtils.getMonotonicMillis();
@@ -106,7 +106,7 @@
if (this.awaitingKeepAlive) {
this.disconnect(new ChatMessage("disconnect.timeout", new Object[0]));
} else {
@@ -117,15 +190,21 @@
@@ -116,15 +189,21 @@
}
this.minecraftServer.methodProfiler.exit();
@@ -128,7 +128,7 @@
this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0]));
}
@@ -144,16 +223,46 @@
@@ -143,16 +222,46 @@
return this.networkManager;
}
@@ -176,7 +176,7 @@
}
public void a(PacketPlayInSteerVehicle packetplayinsteervehicle) {
@@ -192,7 +301,34 @@
@@ -191,7 +300,34 @@
double d9 = entity.motX * entity.motX + entity.motY * entity.motY + entity.motZ * entity.motZ;
double d10 = d6 * d6 + d7 * d7 + d8 * d8;
@@ -212,7 +212,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;
@@ -222,14 +358,72 @@
@@ -221,14 +357,72 @@
}
entity.setLocation(d3, d4, d5, f, f1);
@@ -285,7 +285,7 @@
this.minecraftServer.getPlayerList().updateChunks(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));
@@ -243,7 +437,7 @@
@@ -242,7 +436,7 @@
public void a(PacketPlayInTeleportAccept packetplayinteleportaccept) {
PlayerConnectionUtils.ensureMainThread(packetplayinteleportaccept, this, this.player.getWorldServer());
@@ -294,7 +294,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;
@@ -253,6 +447,7 @@
@@ -252,6 +446,7 @@
}
this.teleportPos = null;
@@ -302,7 +302,7 @@
}
}
@@ -289,6 +484,12 @@
@@ -288,6 +483,12 @@
public void a(PacketPlayInTabComplete packetplayintabcomplete) {
PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer());
@@ -314,9 +314,9 @@
+ // CraftBukkit end
StringReader stringreader = new StringReader(packetplayintabcomplete.c());
if (stringreader.canRead() && stringreader.peek() == 47) {
@@ -298,7 +499,8 @@
ParseResults parseresults = this.minecraftServer.getCommandDispatcher().a().parse(stringreader, this.player.getCommandListener());
if (stringreader.canRead() && stringreader.peek() == '/') {
@@ -297,7 +498,8 @@
ParseResults<CommandListenerWrapper> parseresults = this.minecraftServer.getCommandDispatcher().a().parse(stringreader, this.player.getCommandListener());
this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
- this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), suggestions));
@@ -325,7 +325,7 @@
});
}
@@ -490,6 +692,15 @@
@@ -489,6 +691,15 @@
}
public void a(PacketPlayInBEdit packetplayinbedit) {
@@ -341,7 +341,7 @@
ItemStack itemstack = packetplayinbedit.b();
if (!itemstack.isEmpty()) {
@@ -514,11 +725,13 @@
@@ -513,11 +724,13 @@
}
itemstack2.a("pages", (NBTBase) nbttaglist);
@@ -357,7 +357,7 @@
}
}
@@ -558,7 +771,7 @@
@@ -557,7 +770,7 @@
} else {
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
@@ -366,7 +366,7 @@
if (this.e == 0) {
this.syncPosition();
}
@@ -568,13 +781,21 @@
@@ -567,13 +780,21 @@
this.A = this.e;
this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
}
@@ -389,7 +389,7 @@
double d0 = this.player.locX;
double d1 = this.player.locY;
double d2 = this.player.locZ;
@@ -599,15 +820,33 @@
@@ -598,15 +819,33 @@
++this.receivedMovePackets;
int i = this.receivedMovePackets - this.processedMovePackets;
@@ -425,7 +425,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;
@@ -653,6 +892,69 @@
@@ -652,6 +891,69 @@
}
}
@@ -495,7 +495,7 @@
this.B = d12 >= -0.03125D;
this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly;
this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.dc() && !worldserver.a(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
@@ -670,10 +972,76 @@
@@ -669,10 +971,76 @@
}
public void a(double d0, double d1, double d2, float f, float f1) {
@@ -573,7 +573,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;
@@ -685,6 +1053,14 @@
@@ -684,6 +1052,14 @@
this.teleportAwait = 0;
}
@@ -588,7 +588,7 @@
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));
@@ -692,6 +1068,7 @@
@@ -691,6 +1067,7 @@
public void a(PacketPlayInBlockDig packetplayinblockdig) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.getWorldServer());
@@ -596,7 +596,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinblockdig.b();
@@ -701,13 +1078,45 @@
@@ -700,13 +1077,45 @@
if (!this.player.isSpectator()) {
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
@@ -644,7 +644,7 @@
this.player.a(false);
}
@@ -738,7 +1147,15 @@
@@ -737,7 +1146,15 @@
if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
this.player.playerInteractManager.a(blockposition, packetplayinblockdig.c());
} else {
@@ -660,7 +660,7 @@
}
} else {
if (packetplayinblockdig.d() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
@@ -757,10 +1174,12 @@
@@ -756,10 +1173,12 @@
default:
throw new IllegalArgumentException("Invalid player action");
}
@@ -673,7 +673,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
EnumHand enumhand = packetplayinuseitem.d();
ItemStack itemstack = this.player.b(enumhand);
@@ -773,6 +1192,13 @@
@@ -772,6 +1191,13 @@
this.player.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, ChatMessageType.GAME_INFO));
} 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)) {
@@ -687,7 +687,7 @@
this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, blockposition, enumdirection, packetplayinuseitem.e(), packetplayinuseitem.f(), packetplayinuseitem.g());
}
@@ -782,13 +1208,52 @@
@@ -781,13 +1207,52 @@
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.getWorldServer());
@@ -741,7 +741,7 @@
}
}
@@ -808,13 +1273,18 @@
@@ -807,13 +1272,18 @@
}
if (entity != null) {
@@ -762,7 +762,7 @@
public void a(PacketPlayInBoatMove packetplayinboatmove) {
PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.getWorldServer());
@@ -827,11 +1297,26 @@
@@ -826,11 +1296,26 @@
}
public void a(IChatBaseComponent ichatbasecomponent) {
@@ -790,7 +790,7 @@
if (this.minecraftServer.H() && this.player.getDisplayName().getString().equals(this.minecraftServer.G())) {
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
this.minecraftServer.safeShutdown();
@@ -857,6 +1342,15 @@
@@ -856,6 +1341,15 @@
}
}
@@ -806,7 +806,7 @@
try {
this.networkManager.sendPacket(packet, genericfuturelistener);
} catch (Throwable throwable) {
@@ -872,17 +1366,37 @@
@@ -871,17 +1365,37 @@
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.getWorldServer());
@@ -846,7 +846,7 @@
this.sendPacket(new PacketPlayOutChat((new ChatMessage("chat.cannotSend", new Object[0])).a(EnumChatFormat.RED)));
} else {
this.player.resetIdleTimer();
@@ -892,39 +1406,249 @@
@@ -891,39 +1405,249 @@
for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
@@ -1103,7 +1103,7 @@
this.player.resetIdleTimer();
IJumpable ijumpable;
@@ -987,6 +1711,7 @@
@@ -986,6 +1710,7 @@
public void a(PacketPlayInUseEntity packetplayinuseentity) {
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.getWorldServer());
@@ -1111,7 +1111,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
Entity entity = packetplayinuseentity.a((World) worldserver);
@@ -1002,20 +1727,73 @@
@@ -1001,20 +1726,73 @@
if (this.player.h(entity) < d0) {
EnumHand enumhand;
@@ -1186,7 +1186,7 @@
}
}
}
@@ -1031,7 +1809,8 @@
@@ -1030,7 +1808,8 @@
case PERFORM_RESPAWN:
if (this.player.viewingCredits) {
this.player.viewingCredits = false;
@@ -1196,7 +1196,7 @@
CriterionTriggers.v.a(this.player, DimensionManager.THE_END, DimensionManager.OVERWORLD);
} else {
if (this.player.getHealth() > 0.0F) {
@@ -1053,14 +1832,20 @@
@@ -1052,14 +1831,20 @@
public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer());
@@ -1216,10 +1216,10 @@
+ if (this.player.activeContainer.windowId == packetplayinwindowclick.b() && this.player.activeContainer.c(this.player) && this.player.activeContainer.canUse(this.player)) { // CraftBukkit
+ boolean cancelled = this.player.isSpectator(); // CraftBukkit - see below if
+ if (false/*this.player.isSpectator()*/) { // CraftBukkit
NonNullList nonnulllist = NonNullList.a();
NonNullList<ItemStack> nonnulllist = NonNullList.a();
for (int i = 0; i < this.player.activeContainer.slots.size(); ++i) {
@@ -1069,8 +1854,274 @@
@@ -1068,8 +1853,274 @@
this.player.a(this.player.activeContainer, nonnulllist);
} else {
@@ -1495,7 +1495,7 @@
if (ItemStack.matches(packetplayinwindowclick.f(), itemstack)) {
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.b(), packetplayinwindowclick.e(), true));
this.player.f = true;
@@ -1113,6 +2164,7 @@
@@ -1112,6 +2163,7 @@
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.getWorldServer());
@@ -1503,7 +1503,7 @@
this.player.resetIdleTimer();
if (this.player.activeContainer.windowId == packetplayinenchantitem.b() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
this.player.activeContainer.a(this.player, packetplayinenchantitem.c());
@@ -1144,6 +2196,43 @@
@@ -1143,6 +2195,43 @@
boolean flag1 = packetplayinsetcreativeslot.b() >= 1 && packetplayinsetcreativeslot.b() <= 45;
boolean flag2 = itemstack.isEmpty() || itemstack.getDamage() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
@@ -1547,7 +1547,7 @@
if (flag1 && flag2) {
if (itemstack.isEmpty()) {
@@ -1167,6 +2256,7 @@
@@ -1166,6 +2255,7 @@
public void a(PacketPlayInTransaction packetplayintransaction) {
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.getWorldServer());
@@ -1555,7 +1555,7 @@
Short oshort = (Short) this.k.get(this.player.activeContainer.windowId);
if (oshort != null && packetplayintransaction.c() == oshort && this.player.activeContainer.windowId == packetplayintransaction.b() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
@@ -1177,6 +2267,7 @@
@@ -1176,6 +2266,7 @@
public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.getWorldServer());
@@ -1563,7 +1563,7 @@
this.player.resetIdleTimer();
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinupdatesign.b();
@@ -1193,14 +2284,30 @@
@@ -1192,14 +2283,30 @@
if (!tileentitysign.d() || tileentitysign.e() != this.player) {
this.minecraftServer.warning("Player " + this.player.getDisplayName().getString() + " just tried to change non-editable sign");
@@ -1595,7 +1595,7 @@
tileentitysign.update();
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
@@ -1209,6 +2316,7 @@
@@ -1208,6 +2315,7 @@
}
public void a(PacketPlayInKeepAlive packetplayinkeepalive) {
@@ -1603,7 +1603,7 @@
if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) {
int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive);
@@ -1222,7 +2330,17 @@
@@ -1221,7 +2329,17 @@
public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.getWorldServer());
@@ -1622,7 +1622,7 @@
}
public void a(PacketPlayInSettings packetplayinsettings) {
@@ -1230,5 +2348,47 @@
@@ -1229,5 +2347,47 @@
this.player.a(packetplayinsettings);
}