Update with more Spigot binary patches

This commit is contained in:
Byteflux 2014-10-02 16:54:57 -05:00 committed by Zach Brown
parent 39fef35e10
commit 2a92d3a54a
6 changed files with 298 additions and 102 deletions

View File

@ -163,7 +163,7 @@ index 35f2bfa..ca1d027 100644
import net.minecraft.server.*;
import net.minecraft.util.com.mojang.authlib.GameProfile;
@@ -1402,6 +1403,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1402,6 +1403,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return java.util.Collections.unmodifiableSet( ret );
}
@ -177,12 +177,11 @@ index 35f2bfa..ca1d027 100644
+ @Override
+ public void sendMessage( BaseComponent... components )
+ {
+ if ( getHandle().playerConnection != null )
+ {
+ PacketPlayOutChat packet = new PacketPlayOutChat();
+ packet.components = components;
+ getHandle().playerConnection.sendPacket( packet );
+ }
+ if ( getHandle().playerConnection == null ) return;
+
+ PacketPlayOutChat packet = new PacketPlayOutChat();
+ packet.components = components;
+ getHandle().playerConnection.sendPacket( packet );
+ }
};

View File

@ -0,0 +1,58 @@
From feaaf50a42e83b918d3a2c9f36e24ef7a4c6d8a7 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Wed, 1 Oct 2014 00:27:39 -0700
Subject: [PATCH] Spigot Update - 20140927a
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index 8dad7ca..78e0965 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -324,6 +324,10 @@ public class EntityTrackerEntry {
if ( tracker instanceof EntityPlayer )
{
entityplayer.playerConnection.sendPacket( PacketPlayOutPlayerInfo.addPlayer( (EntityPlayer) tracker ) );
+
+ if ( entityplayer.playerConnection.networkManager.getVersion() > 28 ) { // Spigot Update - 20140927a
+ entityplayer.playerConnection.sendPacket( PacketPlayOutPlayerInfo.updateDisplayName( (EntityPlayer) this.tracker ) );
+ }
}
// Spigot end
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 0359cb3..86b0343 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -285,11 +285,17 @@ public abstract class PlayerList {
// CraftBukkit start - sendAll above replaced with this loop
PacketPlayOutPlayerInfo packet = PacketPlayOutPlayerInfo.addPlayer( entityplayer ); // Spigot - protocol patch
+ PacketPlayOutPlayerInfo displayPacket = PacketPlayOutPlayerInfo.updateDisplayName( entityplayer ); // Spigot Update - 20140927a
for (int i = 0; i < this.players.size(); ++i) {
EntityPlayer entityplayer1 = (EntityPlayer) this.players.get(i);
if (entityplayer1.getBukkitEntity().canSee(entityplayer.getBukkitEntity())) {
entityplayer1.playerConnection.sendPacket(packet);
+ // Spigot start - Update 20140927a
+ if ( entityplayer1.playerConnection.networkManager.getVersion() > 28 ) {
+ entityplayer1.playerConnection.sendPacket( displayPacket );
+ }
+ // Spigot end
}
}
// CraftBukkit end
@@ -303,6 +309,11 @@ public abstract class PlayerList {
}
// .name -> .listName
entityplayer.playerConnection.sendPacket(PacketPlayOutPlayerInfo.addPlayer( entityplayer1 )); // Spigot - protocol patch
+ // Spigot start - Update 20140927a
+ if ( entityplayer.playerConnection.networkManager.getVersion() > 28 ) {
+ entityplayer.playerConnection.sendPacket( PacketPlayOutPlayerInfo.updateDisplayName( entityplayer1 ) );
+ }
+ // Spigot end
// CraftBukkit end
}
}
--
1.9.4.msysgit.0

View File

@ -0,0 +1,224 @@
From cd9384eed6798cc8638659fa40d161f0ad56b8b6 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 1 Oct 2014 03:00:09 -0700
Subject: [PATCH] Spigot Update - 20141001a
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index 78e0965..886feed 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -325,7 +325,7 @@ public class EntityTrackerEntry {
{
entityplayer.playerConnection.sendPacket( PacketPlayOutPlayerInfo.addPlayer( (EntityPlayer) tracker ) );
- if ( entityplayer.playerConnection.networkManager.getVersion() > 28 ) { // Spigot Update - 20140927a
+ if ( !entityplayer.getName().equals( entityplayer.listName ) && entityplayer.playerConnection.networkManager.getVersion() > 28 ) { // Spigot Update - 20140927a // Spigot Update - 20141001a
entityplayer.playerConnection.sendPacket( PacketPlayOutPlayerInfo.updateDisplayName( (EntityPlayer) this.tracker ) );
}
}
diff --git a/src/main/java/net/minecraft/server/ItemDoor.java b/src/main/java/net/minecraft/server/ItemDoor.java
new file mode 100644
index 0000000..3fa6e11
--- /dev/null
+++ b/src/main/java/net/minecraft/server/ItemDoor.java
@@ -0,0 +1,79 @@
+package net.minecraft.server;
+
+public class ItemDoor extends Item {
+
+ private Material a;
+
+ public ItemDoor(Material material) {
+ this.a = material;
+ this.maxStackSize = 1;
+ this.a(CreativeModeTab.d);
+ }
+
+ public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l, float f, float f1, float f2) {
+ if (l != 1) {
+ return false;
+ } else {
+ ++j;
+ Block block;
+
+ if (this.a == Material.WOOD) {
+ block = Blocks.WOODEN_DOOR;
+ } else {
+ block = Blocks.IRON_DOOR_BLOCK;
+ }
+
+ if (entityhuman.a(i, j, k, l, itemstack) && entityhuman.a(i, j + 1, k, l, itemstack)) {
+ if (!block.canPlace(world, i, j, k)) {
+ return false;
+ } else {
+ int i1 = MathHelper.floor((double) ((entityhuman.yaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
+
+ place(world, i, j, k, i1, block);
+ --itemstack.count;
+ return true;
+ }
+ } else {
+ return false;
+ }
+ }
+ }
+
+ public static void place(World world, int i, int j, int k, int l, Block block) {
+ byte b0 = 0;
+ byte b1 = 0;
+
+ if (l == 0) {
+ b1 = 1;
+ }
+
+ if (l == 1) {
+ b0 = -1;
+ }
+
+ if (l == 2) {
+ b1 = -1;
+ }
+
+ if (l == 3) {
+ b0 = 1;
+ }
+
+ int i1 = (world.getType(i - b0, j, k - b1).r() ? 1 : 0) + (world.getType(i - b0, j + 1, k - b1).r() ? 1 : 0);
+ int j1 = (world.getType(i + b0, j, k + b1).r() ? 1 : 0) + (world.getType(i + b0, j + 1, k + b1).r() ? 1 : 0);
+ boolean flag = world.getType(i - b0, j, k - b1) == block || world.getType(i - b0, j + 1, k - b1) == block;
+ boolean flag1 = world.getType(i + b0, j, k + b1) == block || world.getType(i + b0, j + 1, k + b1) == block;
+ boolean flag2 = false;
+
+ if (flag && !flag1) {
+ flag2 = true;
+ } else if (j1 > i1) {
+ flag2 = true;
+ }
+
+ world.setTypeAndData(i, j, k, block, l, 3); // Spigot Update - 20141001a
+ world.setTypeAndData(i, j + 1, k, block, 8 | (flag2 ? 1 : 0), 3); // Spigot Update - 20141001a
+ //world.applyPhysics(i, j, k, block); // Spigot Update - 20141001a
+ //world.applyPhysics(i, j + 1, k, block); // Spigot Update - 20141001a
+ }
+}
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutChat.java b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
index 27c34f6..05edc52 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutChat.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutChat.java
@@ -10,6 +10,7 @@ public class PacketPlayOutChat extends Packet {
private IChatBaseComponent a;
public BaseComponent[] components; // Spigot - Update 20140909b
private boolean b;
+ private int pos; // Spigot - Update 20141001a
public PacketPlayOutChat() {
this.b = true;
@@ -19,10 +20,19 @@ public class PacketPlayOutChat extends Packet {
this(ichatbasecomponent, true);
}
+ public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent, int pos) {
+ this(ichatbasecomponent, pos, true);
+ }
+
public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent, boolean flag) {
+ this(ichatbasecomponent, 0, flag);
+ }
+
+ public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent, int pos, boolean flag) {
this.b = true;
this.a = ichatbasecomponent;
this.b = flag;
+ this.pos = pos;
}
public void a(PacketDataSerializer packetdataserializer) throws IOException {
@@ -43,7 +53,7 @@ public class PacketPlayOutChat extends Packet {
// Spigot start - protocol patch
if ( packetdataserializer.version >= 16 )
{
- packetdataserializer.writeByte(0);
+ packetdataserializer.writeByte( this.pos );
}
// Spigot end
}
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutPosition.java b/src/main/java/net/minecraft/server/PacketPlayOutPosition.java
index b3c0ccf..7520af8 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutPosition.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutPosition.java
@@ -8,16 +8,22 @@ public class PacketPlayOutPosition extends Packet {
private float d;
private float e;
private boolean f;
+ private byte relativeBitMask; // Spigot Update - 20141001a
public PacketPlayOutPosition() {}
public PacketPlayOutPosition(double d0, double d1, double d2, float f, float f1, boolean flag) {
+ this(d0, d1, d2, f, f1, flag, (byte)0);
+ }
+
+ public PacketPlayOutPosition(double d0, double d1, double d2, float f, float f1, boolean flag, byte relativeBitMask) {
this.a = d0;
this.b = d1;
this.c = d2;
this.d = f;
this.e = f1;
this.f = flag;
+ this.relativeBitMask = relativeBitMask;
}
public void a(PacketDataSerializer packetdataserializer) {
@@ -41,7 +47,7 @@ public class PacketPlayOutPosition extends Packet {
packetdataserializer.writeBoolean( this.f );
} else
{
- packetdataserializer.writeByte( 0 );
+ packetdataserializer.writeByte( this.relativeBitMask );
}
// Spigot end
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 86b0343..bc10c4e 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -291,8 +291,8 @@ public abstract class PlayerList {
if (entityplayer1.getBukkitEntity().canSee(entityplayer.getBukkitEntity())) {
entityplayer1.playerConnection.sendPacket(packet);
- // Spigot start - Update 20140927a
- if ( entityplayer1.playerConnection.networkManager.getVersion() > 28 ) {
+ // Spigot start - Update 20140927a // Update - 20141001a
+ if ( !entityplayer.getName().equals( entityplayer.listName ) && entityplayer1.playerConnection.networkManager.getVersion() > 28 ) {
entityplayer1.playerConnection.sendPacket( displayPacket );
}
// Spigot end
@@ -309,8 +309,8 @@ public abstract class PlayerList {
}
// .name -> .listName
entityplayer.playerConnection.sendPacket(PacketPlayOutPlayerInfo.addPlayer( entityplayer1 )); // Spigot - protocol patch
- // Spigot start - Update 20140927a
- if ( entityplayer.playerConnection.networkManager.getVersion() > 28 ) {
+ // Spigot start - Update 20140927a // Update - 20141001a
+ if ( !entityplayer.getName().equals( entityplayer.listName ) && entityplayer.playerConnection.networkManager.getVersion() > 28 ) {
entityplayer.playerConnection.sendPacket( PacketPlayOutPlayerInfo.updateDisplayName( entityplayer1 ) );
}
// Spigot end
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index d452df7..0d025bc 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -844,6 +844,9 @@ public class CraftEventFactory {
}
public static void handleInventoryCloseEvent(EntityHuman human) {
+ if (human.activeContainer == human.defaultContainer) { // Spigot Update - 20141001a
+ return;
+ }
InventoryCloseEvent event = new InventoryCloseEvent(human.activeContainer.getBukkitView());
human.world.getServer().getPluginManager().callEvent(event);
human.activeContainer.transferTo(human.defaultContainer, human.getBukkitEntity());
--
1.9.4.msysgit.0

View File

@ -1,14 +1,14 @@
From a3bd76b89d96e8f989463ae55b869e7dcb70548a Mon Sep 17 00:00:00 2001
From 6bc5365f98ebcf49bdf6722b3c09e772472d88f1 Mon Sep 17 00:00:00 2001
From: T00thpick1 <t00thpick1dirko@gmail.com>
Date: Mon, 23 Jun 2014 21:37:24 -0500
Subject: [PATCH] Do not remove player in world change
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 75ea5c9..d706a84 100644
index 8adf091..79fc999 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -452,7 +452,7 @@ public abstract class PlayerList {
@@ -463,7 +463,7 @@ public abstract class PlayerList {
entityplayer.r().getTracker().untrackPlayer(entityplayer);
// entityplayer.r().getTracker().untrackEntity(entityplayer); // CraftBukkit
entityplayer.r().getPlayerChunkMap().removePlayer(entityplayer);
@ -17,7 +17,7 @@ index 75ea5c9..d706a84 100644
this.server.getWorldServer(entityplayer.dimension).removeEntity(entityplayer);
ChunkCoordinates chunkcoordinates = entityplayer.getBed();
boolean flag1 = entityplayer.isRespawnForced();
@@ -547,7 +547,7 @@ public abstract class PlayerList {
@@ -558,7 +558,7 @@ public abstract class PlayerList {
if (!entityplayer.playerConnection.isDisconnected()) {
worldserver.getPlayerChunkMap().addPlayer(entityplayer1);
worldserver.addEntity(entityplayer1);

View File

@ -1,4 +1,4 @@
From f77b76bf2e137e47c1c4527cfbfaedb708720557 Mon Sep 17 00:00:00 2001
From e825ea4fb252c3e02b6f32af9b1e08e27c328172 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Sun, 21 Sep 2014 22:02:02 -0500
Subject: [PATCH] Player affects spawning API
@ -106,12 +106,12 @@ index 717be3b..33c228b 100644
for (int i = 0; i < this.players.size(); ++i) {
EntityHuman entityhuman = (EntityHuman) this.players.get(i);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2c8d0a0..c3e411b 100644
index a282b68..096615e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1450,6 +1450,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getHandle().playerConnection.sendPacket( packet );
}
@@ -1449,6 +1449,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
packet.components = components;
getHandle().playerConnection.sendPacket( packet );
}
+
+ // PaperSpigot start - Add affects spawning API

View File

@ -1,4 +1,4 @@
From 2f0886ffb64bbfdcc07654623d6706aed64add98 Mon Sep 17 00:00:00 2001
From e4c00e1960aaddf53787974f4bc7a274aa4798f6 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Sat, 6 Sep 2014 22:05:09 -0500
Subject: [PATCH] mc-dev imports for 1.8 things
@ -208,91 +208,6 @@ index 0000000..c36e7fb
+ public static final BlockStainedGlassPane STAINED_GLASS_PANE = (BlockStainedGlassPane) Block.REGISTRY.get("stained_glass_pane");
+
+}
diff --git a/src/main/java/net/minecraft/server/ItemDoor.java b/src/main/java/net/minecraft/server/ItemDoor.java
new file mode 100644
index 0000000..ee8568b
--- /dev/null
+++ b/src/main/java/net/minecraft/server/ItemDoor.java
@@ -0,0 +1,79 @@
+package net.minecraft.server;
+
+public class ItemDoor extends Item {
+
+ private Material a;
+
+ public ItemDoor(Material material) {
+ this.a = material;
+ this.maxStackSize = 1;
+ this.a(CreativeModeTab.d);
+ }
+
+ public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l, float f, float f1, float f2) {
+ if (l != 1) {
+ return false;
+ } else {
+ ++j;
+ Block block;
+
+ if (this.a == Material.WOOD) {
+ block = Blocks.WOODEN_DOOR;
+ } else {
+ block = Blocks.IRON_DOOR_BLOCK;
+ }
+
+ if (entityhuman.a(i, j, k, l, itemstack) && entityhuman.a(i, j + 1, k, l, itemstack)) {
+ if (!block.canPlace(world, i, j, k)) {
+ return false;
+ } else {
+ int i1 = MathHelper.floor((double) ((entityhuman.yaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
+
+ place(world, i, j, k, i1, block);
+ --itemstack.count;
+ return true;
+ }
+ } else {
+ return false;
+ }
+ }
+ }
+
+ public static void place(World world, int i, int j, int k, int l, Block block) {
+ byte b0 = 0;
+ byte b1 = 0;
+
+ if (l == 0) {
+ b1 = 1;
+ }
+
+ if (l == 1) {
+ b0 = -1;
+ }
+
+ if (l == 2) {
+ b1 = -1;
+ }
+
+ if (l == 3) {
+ b0 = 1;
+ }
+
+ int i1 = (world.getType(i - b0, j, k - b1).r() ? 1 : 0) + (world.getType(i - b0, j + 1, k - b1).r() ? 1 : 0);
+ int j1 = (world.getType(i + b0, j, k + b1).r() ? 1 : 0) + (world.getType(i + b0, j + 1, k + b1).r() ? 1 : 0);
+ boolean flag = world.getType(i - b0, j, k - b1) == block || world.getType(i - b0, j + 1, k - b1) == block;
+ boolean flag1 = world.getType(i + b0, j, k + b1) == block || world.getType(i + b0, j + 1, k + b1) == block;
+ boolean flag2 = false;
+
+ if (flag && !flag1) {
+ flag2 = true;
+ } else if (j1 > i1) {
+ flag2 = true;
+ }
+
+ world.setTypeAndData(i, j, k, block, l, 2);
+ world.setTypeAndData(i, j + 1, k, block, 8 | (flag2 ? 1 : 0), 2);
+ world.applyPhysics(i, j, k, block);
+ world.applyPhysics(i, j + 1, k, block);
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Items.java b/src/main/java/net/minecraft/server/Items.java
new file mode 100644
index 0000000..6834e67