3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 04:20:08 +01:00

Add additional methods sigs for binary compat

Dieser Commit ist enthalten in:
md_5 2017-03-24 15:23:23 +11:00
Ursprung 319013857d
Commit f4822eb93d

Datei anzeigen

@ -415,17 +415,21 @@
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,72 @@
@@ -372,10 +643,76 @@
}
public void a(double d0, double d1, double d2, float f, float f1) {
- this.a(d0, d1, d2, f, f1, Collections.emptySet());
+ // CraftBukkit start - Delegate to teleport(Location)
+ this.a(d0, d1, d2, f, f1, Collections.<PacketPlayOutPosition.EnumPlayerTeleportFlags>emptySet(), PlayerTeleportEvent.TeleportCause.UNKNOWN);
+ this.a(d0, d1, d2, f, f1, Collections.<PacketPlayOutPosition.EnumPlayerTeleportFlags>emptySet());
+ }
+
+ // CraftBukkit start - Delegate to teleport(Location)
+ public void a(double d0, double d1, double d2, float f, float f1, PlayerTeleportEvent.TeleportCause cause) {
+ this.a(d0, d1, d2, f, f1, Collections.<PacketPlayOutPosition.EnumPlayerTeleportFlags>emptySet(), cause);
}
public void a(double d0, double d1, double d2, float f, float f1, Set<PacketPlayOutPosition.EnumPlayerTeleportFlags> set) {
+ this.a(d0, d1, d2, f, f1, Collections.<PacketPlayOutPosition.EnumPlayerTeleportFlags>emptySet(), PlayerTeleportEvent.TeleportCause.UNKNOWN);
+ }
+
+ public void a(double d0, double d1, double d2, float f, float f1, Set<PacketPlayOutPosition.EnumPlayerTeleportFlags> set, PlayerTeleportEvent.TeleportCause cause) {
@ -469,9 +473,8 @@
+ }
+
+ this.internalTeleport(d0, d1, d2, f, f1, set);
}
- public void a(double d0, double d1, double d2, float f, float f1, Set<PacketPlayOutPosition.EnumPlayerTeleportFlags> set) {
+ }
+
+ public void teleport(Location dest) {
+ internalTeleport(dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch(), Collections.<PacketPlayOutPosition.EnumPlayerTeleportFlags>emptySet());
+ }
@ -490,7 +493,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;
@@ -392,6 +725,14 @@
@@ -392,6 +729,14 @@
f3 = f1 + this.player.pitch;
}
@ -505,7 +508,7 @@
if (++this.teleportAwait == Integer.MAX_VALUE) {
this.teleportAwait = 0;
}
@@ -403,6 +744,7 @@
@@ -403,6 +748,7 @@
public void a(PacketPlayInBlockDig packetplayinblockdig) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.x());
@ -513,7 +516,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinblockdig.a();
@@ -412,7 +754,15 @@
@@ -412,7 +758,15 @@
if (!this.player.isSpectator()) {
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
@ -530,7 +533,7 @@
this.player.a(EnumHand.MAIN_HAND, itemstack);
}
@@ -420,6 +770,21 @@
@@ -420,6 +774,21 @@
case DROP_ITEM:
if (!this.player.isSpectator()) {
@ -552,7 +555,7 @@
this.player.a(false);
}
@@ -453,7 +818,15 @@
@@ -453,7 +822,15 @@
if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
this.player.playerInteractManager.a(blockposition, packetplayinblockdig.b());
} else {
@ -568,7 +571,7 @@
}
} else {
if (packetplayinblockdig.c() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
@@ -473,10 +846,12 @@
@@ -473,10 +850,12 @@
default:
throw new IllegalArgumentException("Invalid player action");
}
@ -581,7 +584,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
EnumHand enumhand = packetplayinuseitem.c();
ItemStack itemstack = this.player.b(enumhand);
@@ -490,6 +865,13 @@
@@ -490,6 +869,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)) {
@ -595,7 +598,7 @@
this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, blockposition, enumdirection, packetplayinuseitem.d(), packetplayinuseitem.e(), packetplayinuseitem.f());
}
@@ -499,13 +881,52 @@
@@ -499,13 +885,52 @@
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.x());
@ -649,7 +652,7 @@
}
}
@@ -516,8 +937,8 @@
@@ -516,8 +941,8 @@
WorldServer[] aworldserver = this.minecraftServer.worldServer;
int i = aworldserver.length;
@ -660,7 +663,7 @@
if (worldserver != null) {
entity = packetplayinspectate.a(worldserver);
@@ -530,6 +951,8 @@
@@ -530,6 +955,8 @@
if (entity != null) {
this.player.setSpectatorTarget(this.player);
this.player.stopRiding();
@ -669,7 +672,7 @@
if (entity.world == this.player.world) {
this.player.enderTeleportTo(entity.locX, entity.locY, entity.locZ);
} else {
@@ -555,12 +978,20 @@
@@ -555,12 +982,20 @@
this.minecraftServer.getPlayerList().b(this.player, worldserver2);
this.minecraftServer.getPlayerList().updateClient(this.player);
}
@ -691,7 +694,7 @@
public void a(PacketPlayInBoatMove packetplayinboatmove) {
PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.x());
@@ -573,14 +1004,29 @@
@@ -573,14 +1008,29 @@
}
public void a(IChatBaseComponent ichatbasecomponent) {
@ -723,7 +726,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();
@@ -602,6 +1048,15 @@
@@ -602,6 +1052,15 @@
}
}
@ -739,7 +742,7 @@
try {
this.networkManager.sendPacket(packet);
} catch (Throwable throwable) {
@@ -623,17 +1078,32 @@
@@ -623,17 +1082,32 @@
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.x());
@ -774,7 +777,7 @@
ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]);
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
@@ -646,39 +1116,249 @@
@@ -646,39 +1120,249 @@
for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
@ -1032,7 +1035,7 @@
this.player.resetIdleTimer();
IJumpable ijumpable;
@@ -750,6 +1430,7 @@
@@ -750,6 +1434,7 @@
public void a(PacketPlayInUseEntity packetplayinuseentity) {
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.x());
@ -1040,7 +1043,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
Entity entity = packetplayinuseentity.a((World) worldserver);
@@ -765,20 +1446,68 @@
@@ -765,20 +1450,68 @@
if (this.player.h(entity) < d0) {
EnumHand enumhand;
@ -1110,7 +1113,7 @@
}
}
}
@@ -794,7 +1523,8 @@
@@ -794,7 +1527,8 @@
case PERFORM_RESPAWN:
if (this.player.viewingCredits) {
this.player.viewingCredits = false;
@ -1120,7 +1123,7 @@
} else {
if (this.player.getHealth() > 0.0F) {
return;
@@ -820,14 +1550,20 @@
@@ -820,14 +1554,20 @@
public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x());
@ -1143,7 +1146,7 @@
NonNullList nonnulllist = NonNullList.a();
for (int i = 0; i < this.player.activeContainer.c.size(); ++i) {
@@ -836,8 +1572,274 @@
@@ -836,8 +1576,274 @@
this.player.a(this.player.activeContainer, nonnulllist);
} else {
@ -1419,7 +1422,7 @@
if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) {
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true));
this.player.f = true;
@@ -866,6 +1868,7 @@
@@ -866,6 +1872,7 @@
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.x());
@ -1427,7 +1430,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());
@@ -899,7 +1902,46 @@
@@ -899,7 +1906,46 @@
}
boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45;
@ -1475,7 +1478,7 @@
if (flag1 && flag2) {
if (itemstack.isEmpty()) {
@@ -923,6 +1965,7 @@
@@ -923,6 +1969,7 @@
public void a(PacketPlayInTransaction packetplayintransaction) {
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.x());
@ -1483,7 +1486,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()) {
@@ -933,6 +1976,7 @@
@@ -933,6 +1980,7 @@
public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.x());
@ -1491,7 +1494,7 @@
this.player.resetIdleTimer();
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinupdatesign.a();
@@ -949,14 +1993,30 @@
@@ -949,14 +1997,30 @@
if (!tileentitysign.a() || tileentitysign.e() != this.player) {
this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign");
@ -1523,7 +1526,7 @@
tileentitysign.update();
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
@@ -979,11 +2039,27 @@
@@ -979,11 +2043,27 @@
public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x());
@ -1552,7 +1555,7 @@
ArrayList arraylist = Lists.newArrayList();
Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator();
@@ -1027,10 +2103,13 @@
@@ -1027,10 +2107,13 @@
}
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
@ -1566,7 +1569,7 @@
}
} else {
String s1;
@@ -1069,10 +2148,11 @@
@@ -1069,10 +2152,11 @@
}
itemstack2.a("pages", (NBTBase) nbttaglist);
@ -1579,7 +1582,7 @@
}
} else if ("MC|TrSel".equals(s)) {
try {
@@ -1084,6 +2164,7 @@
@@ -1084,6 +2168,7 @@
}
} catch (Exception exception2) {
PlayerConnection.LOGGER.error("Couldn\'t select trade", exception2);
@ -1587,7 +1590,7 @@
}
} else {
TileEntity tileentity;
@@ -1133,6 +2214,7 @@
@@ -1133,6 +2218,7 @@
}
} catch (Exception exception3) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3);
@ -1595,7 +1598,7 @@
}
} else if ("MC|AutoCmd".equals(s)) {
if (!this.minecraftServer.getEnableCommandBlock()) {
@@ -1200,6 +2282,7 @@
@@ -1200,6 +2286,7 @@
}
} catch (Exception exception4) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4);
@ -1603,7 +1606,7 @@
}
} else {
int k;
@@ -1223,6 +2306,7 @@
@@ -1223,6 +2310,7 @@
}
} catch (Exception exception5) {
PlayerConnection.LOGGER.error("Couldn\'t set beacon", exception5);
@ -1611,7 +1614,7 @@
}
}
} else if ("MC|ItemName".equals(s)) {
@@ -1309,6 +2393,7 @@
@@ -1309,6 +2397,7 @@
}
} catch (Exception exception6) {
PlayerConnection.LOGGER.error("Couldn\'t set structure block", exception6);
@ -1619,7 +1622,7 @@
}
} else if ("MC|PickItem".equals(s)) {
packetdataserializer = packetplayincustompayload.b();
@@ -1323,9 +2408,31 @@
@@ -1323,9 +2412,31 @@
PlayerConnection.LOGGER.error("Couldn\'t pick item", exception7);
}
}