Update to Minecraft 1.12-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2017-05-19 21:00:13 +10:00
parent 5284eb89a3
commit 530fe41851
47 changed files with 222 additions and 283 deletions

View File

@@ -170,15 +170,6 @@
}
public void a(PacketPlayInSteerVehicle packetplayinsteervehicle) {
@@ -158,7 +258,7 @@
}
private static boolean b(PacketPlayInFlying packetplayinflying) {
- return Doubles.isFinite(packetplayinflying.a(0.0D)) && Doubles.isFinite(packetplayinflying.b(0.0D)) && Doubles.isFinite(packetplayinflying.c(0.0D)) && Floats.isFinite(packetplayinflying.b(0.0F)) && Floats.isFinite(packetplayinflying.a(0.0F)) ? false : Math.abs(packetplayinflying.a(0.0D)) <= 3.0E7D && Math.abs(packetplayinflying.c(0.0D)) <= 3.0E7D;
+ return !Doubles.isFinite(packetplayinflying.a(0.0D)) || !Doubles.isFinite(packetplayinflying.b(0.0D)) || !Doubles.isFinite(packetplayinflying.c(0.0D)) || !Floats.isFinite(packetplayinflying.b(0.0F)) || !Floats.isFinite(packetplayinflying.a(0.0F)) || Math.abs(packetplayinflying.a(0.0D)) >= 3.0E7D || Math.abs(packetplayinflying.b(0.0D)) >= 3.0E7D || Math.abs(packetplayinflying.c(0.0D)) >= 3.0E7D;
}
private static boolean b(PacketPlayInVehicleMove packetplayinvehiclemove) {
@@ -188,7 +288,34 @@
double d9 = entity.motX * entity.motX + entity.motY * entity.motY + entity.motZ * entity.motZ;
double d10 = d6 * d6 + d7 * d7 + d8 * d8;
@@ -278,7 +269,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.c(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
@@ -271,7 +454,7 @@
@@ -284,7 +467,7 @@
} else {
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
@@ -287,7 +278,7 @@
if (this.e == 0) {
this.syncPosition();
}
@@ -281,13 +464,21 @@
@@ -294,13 +477,21 @@
this.A = this.e;
this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
}
@@ -310,7 +301,7 @@
double d0 = this.player.locX;
double d1 = this.player.locY;
double d2 = this.player.locZ;
@@ -312,15 +503,33 @@
@@ -325,15 +516,33 @@
++this.receivedMovePackets;
int i = this.receivedMovePackets - this.processedMovePackets;
@@ -346,7 +337,7 @@
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", 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;
@@ -366,6 +575,69 @@
@@ -379,6 +588,69 @@
}
}
@@ -416,7 +407,7 @@
this.B = d12 >= -0.03125D;
this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly;
this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.cN() && !worldserver.c(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
@@ -383,10 +655,76 @@
@@ -396,10 +668,76 @@
}
public void a(double d0, double d1, double d2, float f, float f1) {
@@ -494,7 +485,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;
@@ -403,6 +741,14 @@
@@ -416,6 +754,14 @@
f3 = f1 + this.player.pitch;
}
@@ -509,7 +500,7 @@
if (++this.teleportAwait == Integer.MAX_VALUE) {
this.teleportAwait = 0;
}
@@ -414,6 +760,7 @@
@@ -427,6 +773,7 @@
public void a(PacketPlayInBlockDig packetplayinblockdig) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.x());
@@ -517,7 +508,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinblockdig.a();
@@ -423,7 +770,15 @@
@@ -436,7 +783,15 @@
if (!this.player.isSpectator()) {
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
@@ -534,7 +525,7 @@
this.player.a(EnumHand.MAIN_HAND, itemstack);
}
@@ -431,6 +786,21 @@
@@ -444,6 +799,21 @@
case DROP_ITEM:
if (!this.player.isSpectator()) {
@@ -556,7 +547,7 @@
this.player.a(false);
}
@@ -464,7 +834,15 @@
@@ -477,7 +847,15 @@
if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
this.player.playerInteractManager.a(blockposition, packetplayinblockdig.b());
} else {
@@ -572,7 +563,7 @@
}
} else {
if (packetplayinblockdig.c() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
@@ -484,10 +862,12 @@
@@ -497,10 +875,12 @@
default:
throw new IllegalArgumentException("Invalid player action");
}
@@ -585,7 +576,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
EnumHand enumhand = packetplayinuseitem.c();
ItemStack itemstack = this.player.b(enumhand);
@@ -501,6 +881,13 @@
@@ -514,6 +894,13 @@
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
this.player.playerConnection.sendPacket(new PacketPlayOutChat(chatmessage, 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)) {
@@ -599,7 +590,7 @@
this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, blockposition, enumdirection, packetplayinuseitem.d(), packetplayinuseitem.e(), packetplayinuseitem.f());
}
@@ -510,13 +897,52 @@
@@ -523,13 +910,52 @@
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.x());
@@ -653,7 +644,7 @@
}
}
@@ -527,8 +953,8 @@
@@ -540,8 +966,8 @@
WorldServer[] aworldserver = this.minecraftServer.worldServer;
int i = aworldserver.length;
@@ -664,7 +655,7 @@
if (worldserver != null) {
entity = packetplayinspectate.a(worldserver);
@@ -541,6 +967,8 @@
@@ -554,6 +980,8 @@
if (entity != null) {
this.player.setSpectatorTarget(this.player);
this.player.stopRiding();
@@ -673,7 +664,7 @@
if (entity.world == this.player.world) {
this.player.enderTeleportTo(entity.locX, entity.locY, entity.locZ);
} else {
@@ -566,12 +994,20 @@
@@ -579,12 +1007,20 @@
this.minecraftServer.getPlayerList().b(this.player, worldserver2);
this.minecraftServer.getPlayerList().updateClient(this.player);
}
@@ -695,7 +686,7 @@
public void a(PacketPlayInBoatMove packetplayinboatmove) {
PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.x());
@@ -584,14 +1020,29 @@
@@ -597,14 +1033,29 @@
}
public void a(IChatBaseComponent ichatbasecomponent) {
@@ -727,7 +718,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();
@@ -613,6 +1064,15 @@
@@ -626,6 +1077,15 @@
}
}
@@ -743,7 +734,7 @@
try {
this.networkManager.sendPacket(packet);
} catch (Throwable throwable) {
@@ -634,17 +1094,32 @@
@@ -647,17 +1107,32 @@
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.x());
@@ -778,7 +769,7 @@
ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]);
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
@@ -657,39 +1132,249 @@
@@ -670,39 +1145,249 @@
for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
@@ -946,7 +937,7 @@
+ // CraftBukkit end
+
private void handleCommand(String s) {
- this.minecraftServer.getCommandHandler().b(this.player, s);
- this.minecraftServer.getCommandHandler().a(this.player, s);
+ // CraftBukkit start - whole method
+ this.LOGGER.info(this.player.getName() + " issued server command: " + s);
+
@@ -968,7 +959,7 @@
+ java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ return;
+ }
+ // this.minecraftServer.getCommandHandler().b(this.player, s);
+ // this.minecraftServer.getCommandHandler().a(this.player, s);
+ // CraftBukkit end
}
@@ -1035,7 +1026,7 @@
this.player.resetIdleTimer();
IJumpable ijumpable;
@@ -761,6 +1446,7 @@
@@ -774,6 +1459,7 @@
public void a(PacketPlayInUseEntity packetplayinuseentity) {
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.x());
@@ -1043,7 +1034,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
Entity entity = packetplayinuseentity.a((World) worldserver);
@@ -776,20 +1462,68 @@
@@ -789,20 +1475,68 @@
if (this.player.h(entity) < d0) {
EnumHand enumhand;
@@ -1113,17 +1104,17 @@
}
}
}
@@ -805,7 +1539,8 @@
@@ -818,7 +1552,8 @@
case PERFORM_RESPAWN:
if (this.player.viewingCredits) {
this.player.viewingCredits = false;
- this.player = this.minecraftServer.getPlayerList().moveToWorld(this.player, 0, true);
+ // this.player = this.minecraftServer.getPlayerList().moveToWorld(this.player, 0, true);
+ this.minecraftServer.getPlayerList().changeDimension(this.player, 0, PlayerTeleportEvent.TeleportCause.END_PORTAL); // CraftBukkit - reroute logic through custom portal management
CriterionTriggers.u.a(this.player, DimensionManager.THE_END, DimensionManager.OVERWORLD);
} else {
if (this.player.getHealth() > 0.0F) {
return;
@@ -827,14 +1562,20 @@
@@ -841,14 +1576,20 @@
public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x());
@@ -1146,7 +1137,7 @@
NonNullList nonnulllist = NonNullList.a();
for (int i = 0; i < this.player.activeContainer.c.size(); ++i) {
@@ -843,8 +1584,274 @@
@@ -857,8 +1598,274 @@
this.player.a(this.player.activeContainer, nonnulllist);
} else {
@@ -1422,7 +1413,7 @@
if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) {
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true));
this.player.f = true;
@@ -946,6 +1953,7 @@
@@ -960,6 +1967,7 @@
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.x());
@@ -1430,7 +1421,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());
@@ -979,7 +1987,46 @@
@@ -993,7 +2001,46 @@
}
boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45;
@@ -1478,7 +1469,7 @@
if (flag1 && flag2) {
if (itemstack.isEmpty()) {
@@ -1003,6 +2050,7 @@
@@ -1017,6 +2064,7 @@
public void a(PacketPlayInTransaction packetplayintransaction) {
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.x());
@@ -1486,7 +1477,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()) {
@@ -1013,6 +2061,7 @@
@@ -1027,6 +2075,7 @@
public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.x());
@@ -1494,7 +1485,7 @@
this.player.resetIdleTimer();
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinupdatesign.a();
@@ -1029,14 +2078,30 @@
@@ -1043,14 +2092,30 @@
if (!tileentitysign.a() || tileentitysign.e() != this.player) {
this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign");
@@ -1526,7 +1517,7 @@
tileentitysign.update();
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
@@ -1059,11 +2124,27 @@
@@ -1073,11 +2138,27 @@
public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x());
@@ -1555,7 +1546,7 @@
ArrayList arraylist = Lists.newArrayList();
Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator();
@@ -1089,6 +2170,13 @@
@@ -1103,6 +2184,13 @@
ItemStack itemstack1;
if ("MC|BEdit".equals(s)) {
@@ -1569,7 +1560,7 @@
packetdataserializer = packetplayincustompayload.b();
try {
@@ -1107,15 +2195,25 @@
@@ -1121,15 +2209,25 @@
}
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
@@ -1595,7 +1586,7 @@
packetdataserializer = packetplayincustompayload.b();
try {
@@ -1149,10 +2247,11 @@
@@ -1163,10 +2261,11 @@
}
itemstack2.a("pages", (NBTBase) nbttaglist);
@@ -1608,7 +1599,7 @@
}
} else if ("MC|TrSel".equals(s)) {
try {
@@ -1164,6 +2263,7 @@
@@ -1178,6 +2277,7 @@
}
} catch (Exception exception2) {
PlayerConnection.LOGGER.error("Couldn\'t select trade", exception2);
@@ -1616,7 +1607,7 @@
}
} else {
TileEntity tileentity;
@@ -1213,6 +2313,7 @@
@@ -1227,6 +2327,7 @@
}
} catch (Exception exception3) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3);
@@ -1624,7 +1615,7 @@
}
} else if ("MC|AutoCmd".equals(s)) {
if (!this.minecraftServer.getEnableCommandBlock()) {
@@ -1280,6 +2381,7 @@
@@ -1294,6 +2395,7 @@
}
} catch (Exception exception4) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4);
@@ -1632,7 +1623,7 @@
}
} else {
int k;
@@ -1303,6 +2405,7 @@
@@ -1317,6 +2419,7 @@
}
} catch (Exception exception5) {
PlayerConnection.LOGGER.error("Couldn\'t set beacon", exception5);
@@ -1640,7 +1631,7 @@
}
}
} else if ("MC|ItemName".equals(s)) {
@@ -1389,6 +2492,7 @@
@@ -1403,6 +2506,7 @@
}
} catch (Exception exception6) {
PlayerConnection.LOGGER.error("Couldn\'t set structure block", exception6);
@@ -1648,7 +1639,7 @@
}
} else if ("MC|PickItem".equals(s)) {
packetdataserializer = packetplayincustompayload.b();
@@ -1401,11 +2505,49 @@
@@ -1415,11 +2519,49 @@
this.player.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(this.player.inventory.itemInHandIndex));
} catch (Exception exception7) {
PlayerConnection.LOGGER.error("Couldn\'t pick item", exception7);