mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 13:36:16 +01:00
Packet handling improvements.
This commit is contained in:
parent
aa66851119
commit
d53a155e4c
@ -463,7 +463,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.player.itemInWorldManager.b()) {
|
if (this.player.itemInWorldManager.b()) {
|
||||||
flag1 = false;
|
flag1 = true; // CraftBukkit - false -> true
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = packet14blockdig.a;
|
int i = packet14blockdig.a;
|
||||||
@ -681,10 +681,11 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void a(Packet16BlockItemSwitch packet16blockitemswitch) {
|
public void a(Packet16BlockItemSwitch packet16blockitemswitch) {
|
||||||
if (this.player.dead) return; // CraftBukkit
|
|
||||||
|
|
||||||
if (packet16blockitemswitch.itemInHandIndex >= 0 && packet16blockitemswitch.itemInHandIndex <= InventoryPlayer.g()) {
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
|
if (this.player.dead) return;
|
||||||
|
|
||||||
|
// Changed <= to <
|
||||||
|
if (packet16blockitemswitch.itemInHandIndex >= 0 && packet16blockitemswitch.itemInHandIndex < InventoryPlayer.g()) {
|
||||||
PlayerItemHeldEvent event = new PlayerItemHeldEvent(this.getPlayer(), this.player.inventory.itemInHandIndex, packet16blockitemswitch.itemInHandIndex);
|
PlayerItemHeldEvent event = new PlayerItemHeldEvent(this.getPlayer(), this.player.inventory.itemInHandIndex, packet16blockitemswitch.itemInHandIndex);
|
||||||
this.server.getPluginManager().callEvent(event);
|
this.server.getPluginManager().callEvent(event);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@ -763,7 +764,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
/* CraftBukkit start - No longer neaded av we have already handled it server.dispatchCommand above.
|
/* CraftBukkit start - No longer neaded as we have already handled it in server.dispatchCommand above.
|
||||||
if (s.toLowerCase().startsWith("/me ")) {
|
if (s.toLowerCase().startsWith("/me ")) {
|
||||||
s = "* " + this.player.name + " " + s.substring(s.indexOf(" ")).trim();
|
s = "* " + this.player.name + " " + s.substring(s.indexOf(" ")).trim();
|
||||||
a.info(s);
|
a.info(s);
|
||||||
|
Loading…
Reference in New Issue
Block a user