summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityPlayer.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/EntityPlayer.patch')
-rw-r--r--nms-patches/EntityPlayer.patch73
1 files changed, 23 insertions, 50 deletions
diff --git a/nms-patches/EntityPlayer.patch b/nms-patches/EntityPlayer.patch
index 679fb6be..fa7e23bc 100644
--- a/nms-patches/EntityPlayer.patch
+++ b/nms-patches/EntityPlayer.patch
@@ -1,5 +1,5 @@
---- ../work/decompile-8eb82bde//net/minecraft/server/EntityPlayer.java 2014-12-28 16:04:32.820373755 +0000
-+++ src/main/java/net/minecraft/server/EntityPlayer.java 2014-12-28 16:04:32.820373755 +0000
+--- ../work/decompile-8eb82bde/net/minecraft/server/EntityPlayer.java 2015-01-09 16:51:30.962362579 +1100
++++ src/main/java/net/minecraft/server/EntityPlayer.java 2015-01-09 16:51:30.962362579 +1100
@@ -13,6 +13,17 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -50,7 +50,7 @@
}
public void a(NBTTagCompound nbttagcompound) {
-@@ -81,13 +108,39 @@
+@@ -81,14 +108,40 @@
this.playerInteractManager.setGameMode(EnumGamemode.getById(nbttagcompound.getInt("playerGameType")));
}
}
@@ -62,8 +62,8 @@
super.b(nbttagcompound);
nbttagcompound.setInt("playerGameType", this.playerInteractManager.getGameMode().getId());
+ this.getBukkitEntity().setExtraData(nbttagcompound); // CraftBukkit
-+ }
-+
+ }
+
+ // CraftBukkit start - World fallback code, either respawn location or global spawn
+ public void spawnIn(World world) {
+ super.spawnIn(world);
@@ -86,11 +86,12 @@
+ }
+ this.dimension = ((WorldServer) this.world).dimension;
+ this.playerInteractManager.a((WorldServer) world);
- }
++ }
+ // CraftBukkit end
-
++
public void levelDown(int i) {
super.levelDown(i);
+ this.lastSentExp = -1;
@@ -114,6 +167,11 @@
}
@@ -288,35 +289,7 @@
if (this.isSleeping()) {
this.u().getTracker().sendPacketToEntity(this, new PacketPlayOutAnimation(this, 2));
}
-@@ -454,14 +566,23 @@
- }
-
- public void mount(Entity entity) {
-- Entity entity1 = this.vehicle;
-+ // CraftBukkit start
-+ this.setPassengerOf(entity);
-+ }
-+
-+ public void setPassengerOf(Entity entity) {
-+ // mount(null) doesn't really fly for overloaded methods,
-+ // so this method is needed
-+ Entity currentVehicle = this.vehicle;
-
-- super.mount(entity);
-- if (entity != entity1) {
-+ super.setPassengerOf(entity);
-+
-+ // Check if the vehicle actually changed.
-+ if (currentVehicle != this.vehicle) {
- this.playerConnection.sendPacket(new PacketPlayOutAttachEntity(0, this, this.vehicle));
- this.playerConnection.a(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
- }
--
-+ // CraftBukkit end
- }
-
- protected void a(double d0, boolean flag, Block block, BlockPosition blockposition) {}
-@@ -490,19 +611,46 @@
+@@ -490,19 +602,46 @@
this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition()));
}
@@ -365,7 +338,7 @@
if (this.activeContainer != this.defaultContainer) {
this.closeInventory();
}
-@@ -510,9 +658,11 @@
+@@ -510,9 +649,11 @@
if (iinventory instanceof ITileInventory) {
ITileInventory itileinventory = (ITileInventory) iinventory;
@@ -378,7 +351,7 @@
return;
}
}
-@@ -520,10 +670,10 @@
+@@ -520,10 +661,10 @@
this.nextContainerCounter();
if (iinventory instanceof ITileEntityContainer) {
this.playerConnection.sendPacket(new PacketPlayOutOpenWindow(this.containerCounter, ((ITileEntityContainer) iinventory).getContainerName(), iinventory.getScoreboardDisplayName(), iinventory.getSize()));
@@ -391,7 +364,7 @@
}
this.activeContainer.windowId = this.containerCounter;
-@@ -531,8 +681,14 @@
+@@ -531,8 +672,14 @@
}
public void openTrade(IMerchant imerchant) {
@@ -407,7 +380,7 @@
this.activeContainer.windowId = this.containerCounter;
this.activeContainer.addSlotListener(this);
InventoryMerchant inventorymerchant = ((ContainerMerchant) this.activeContainer).e();
-@@ -552,13 +708,20 @@
+@@ -552,13 +699,20 @@
}
public void openHorseInventory(EntityHorse entityhorse, IInventory iinventory) {
@@ -429,7 +402,7 @@
this.activeContainer.windowId = this.containerCounter;
this.activeContainer.addSlotListener(this);
}
-@@ -587,6 +750,11 @@
+@@ -587,6 +741,11 @@
public void a(Container container, List list) {
this.playerConnection.sendPacket(new PacketPlayOutWindowItems(container.windowId, list));
this.playerConnection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.inventory.getCarried()));
@@ -441,7 +414,7 @@
}
public void setContainerData(Container container, int i, int j) {
-@@ -601,6 +769,7 @@
+@@ -601,6 +760,7 @@
}
public void closeInventory() {
@@ -449,24 +422,24 @@
this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId));
this.p();
}
-@@ -681,7 +850,16 @@
+@@ -681,7 +841,16 @@
public void triggerHealthUpdate() {
this.bK = -1.0E8F;
+ this.lastSentExp = -1; // CraftBukkit - Added to reset
- }
++ }
+
+ // CraftBukkit start - Support multi-line messages
+ public void sendMessage(IChatBaseComponent[] ichatbasecomponent) {
+ for (IChatBaseComponent component : ichatbasecomponent) {
+ this.sendMessage(component);
+ }
-+ }
+ }
+ // CraftBukkit end
public void b(IChatBaseComponent ichatbasecomponent) {
this.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent));
-@@ -747,6 +925,8 @@
+@@ -747,6 +916,8 @@
}
public void a(EnumGamemode enumgamemode) {
@@ -475,7 +448,7 @@
this.playerInteractManager.setGameMode(enumgamemode);
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, (float) enumgamemode.getId()));
if (enumgamemode == EnumGamemode.SPECTATOR) {
-@@ -757,6 +937,7 @@
+@@ -757,6 +928,7 @@
this.updateAbilities();
this.bO();
@@ -483,7 +456,7 @@
}
public boolean v() {
-@@ -768,6 +949,7 @@
+@@ -768,6 +940,7 @@
}
public boolean a(int i, String s) {
@@ -491,7 +464,7 @@
if ("seed".equals(s) && !this.server.ad()) {
return true;
} else if (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) && !"trigger".equals(s)) {
-@@ -781,6 +963,9 @@
+@@ -781,6 +954,9 @@
} else {
return true;
}
@@ -501,7 +474,7 @@
}
public String w() {
-@@ -867,6 +1052,129 @@
+@@ -867,6 +1043,129 @@
}
public IChatBaseComponent getPlayerListName() {