mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 10:12:06 -07:00
Updated to Minecraft version 1.4
This commit is contained in:
@@ -248,7 +248,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
double d8 = d4 * d4 + d6 * d6 + d7 * d7;
|
||||
boolean flag1 = false;
|
||||
|
||||
if (d8 > 0.0625D && !this.e.E()) {
|
||||
if (d8 > 0.0625D && !this.e.F()) {
|
||||
flag1 = true;
|
||||
a.warning(this.e.name + " moved wrongly!");
|
||||
System.out.println("Got position " + d1 + ", " + d2 + ", " + d3);
|
||||
@@ -259,7 +259,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
// CraftBukkit
|
||||
boolean flag2 = this.e.world.a(this.e, this.e.boundingBox.b().e((double) f4, (double) f4, (double) f4)).size() == 0;
|
||||
|
||||
if (flag && (flag1 || !flag2) && !this.e.E()) {
|
||||
if (flag && (flag1 || !flag2) && !this.e.F()) {
|
||||
this.a(this.i, this.j, this.k, f2, f3);
|
||||
return;
|
||||
}
|
||||
@@ -311,7 +311,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
|
||||
public void a(Packet14BlockDig packet14blockdig) {
|
||||
if (packet14blockdig.e == 4) {
|
||||
this.e.y();
|
||||
this.e.z();
|
||||
} else {
|
||||
// CraftBukkit
|
||||
boolean flag = ((WorldServer) this.e.world).v = this.d.f.h(this.e.name);
|
||||
@@ -341,7 +341,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
}
|
||||
|
||||
// CraftBukkit
|
||||
ChunkCoordinates chunkcoordinates = this.e.world.l();
|
||||
ChunkCoordinates chunkcoordinates = this.e.world.m();
|
||||
int l = (int) MathHelper.e((float) (i - chunkcoordinates.a));
|
||||
int i1 = (int) MathHelper.e((float) (k - chunkcoordinates.c));
|
||||
|
||||
@@ -429,7 +429,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
int l = packet15place.d;
|
||||
|
||||
// CraftBukkit
|
||||
ChunkCoordinates chunkcoordinates = this.e.world.l();
|
||||
ChunkCoordinates chunkcoordinates = this.e.world.m();
|
||||
int i1 = (int) MathHelper.e((float) (i - chunkcoordinates.a));
|
||||
int j1 = (int) MathHelper.e((float) (k - chunkcoordinates.c));
|
||||
|
||||
@@ -525,17 +525,6 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
|
||||
public void a(Packet16BlockItemSwitch packet16blockitemswitch) {
|
||||
// CraftBukkit start
|
||||
if (packet16blockitemswitch.a < 0 || packet16blockitemswitch.a > 8) {
|
||||
server.getLogger().severe(
|
||||
"Player " + getPlayer().getName() + "/" + getPlayer().getAddress().toString() +
|
||||
" just sent an invalid ItemInHandIndex: " + packet16blockitemswitch.a +
|
||||
" - very likely a crashing exploit attempt. Recommend ban, and sending a package of joy their way."
|
||||
);
|
||||
this.b(new Packet1Login("", "", 0, 0, (byte)0));
|
||||
this.a("Exploits.");
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerItemHeldEvent event = new PlayerItemHeldEvent(getPlayer(), e.inventory.c, packet16blockitemswitch.a);
|
||||
server.getPluginManager().callEvent(event);
|
||||
// CraftBukkit end
|
||||
@@ -639,7 +628,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
if (this.d.f.h(this.e.name)) {
|
||||
s1 = s.substring(1);
|
||||
a.info(this.e.name + " issued server command: " + s1);
|
||||
this.d.a(s1, (ICommandListener) this);
|
||||
this.d.a(s1, this);
|
||||
} else {
|
||||
s1 = s.substring(1);
|
||||
a.info(this.e.name + " tried command: " + s1);
|
||||
@@ -678,7 +667,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
server.getPluginManager().callEvent(event);
|
||||
// CraftBukkit end
|
||||
|
||||
this.e.r();
|
||||
this.e.m_();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -695,11 +684,11 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
// CraftBukkit: Set Sneaking
|
||||
|
||||
if (packet19entityaction.b == 1) {
|
||||
this.e.b(true);
|
||||
this.e.e(true);
|
||||
} else if (packet19entityaction.b == 2) {
|
||||
this.e.b(false);
|
||||
this.e.e(false);
|
||||
} else if (packet19entityaction.b == 3) {
|
||||
this.e.a(false, true);
|
||||
this.e.a(false, true, true);
|
||||
this.l = false;
|
||||
}
|
||||
}
|
||||
@@ -745,7 +734,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
}
|
||||
|
||||
public void a(Packet101CloseWindow packet101closewindow) {
|
||||
this.e.v();
|
||||
this.e.w();
|
||||
}
|
||||
|
||||
public void a(Packet102WindowClick packet102windowclick) {
|
||||
@@ -756,7 +745,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
this.e.a.b((Packet) (new Packet106Transaction(packet102windowclick.a, packet102windowclick.d, true)));
|
||||
this.e.h = true;
|
||||
this.e.activeContainer.a();
|
||||
this.e.u();
|
||||
this.e.v();
|
||||
this.e.h = false;
|
||||
} else {
|
||||
this.m.put(Integer.valueOf(this.e.activeContainer.f), Short.valueOf(packet102windowclick.d));
|
||||
@@ -765,7 +754,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
ArrayList arraylist = new ArrayList();
|
||||
|
||||
for (int i = 0; i < this.e.activeContainer.e.size(); ++i) {
|
||||
arraylist.add(((Slot) this.e.activeContainer.e.get(i)).b());
|
||||
arraylist.add(((Slot) this.e.activeContainer.e.get(i)).a());
|
||||
}
|
||||
|
||||
this.e.a(this.e.activeContainer, arraylist);
|
||||
@@ -786,15 +775,9 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
if (this.e.world.f(packet130updatesign.a, packet130updatesign.b, packet130updatesign.c)) {
|
||||
TileEntity tileentity = this.e.world.getTileEntity(packet130updatesign.a, packet130updatesign.b, packet130updatesign.c);
|
||||
if (tileentity instanceof TileEntitySign) {
|
||||
TileEntitySign sign = (TileEntitySign)tileentity;
|
||||
if (!sign.fresh) {
|
||||
int x = packet130updatesign.a;
|
||||
int y = packet130updatesign.b;
|
||||
int z = packet130updatesign.c;
|
||||
server.getLogger().severe("Player " + getPlayer().getName() + "/" + getPlayer().getAddress().toString() + " just tried to change the sign text at " +
|
||||
x + "," + y + "," + z + " - very likely an exploit attempt. Recommend ban, and sending a package of joy their way.");
|
||||
this.b(new Packet1Login("", "", 0, 0, (byte)0));
|
||||
this.a("Exploits.");
|
||||
TileEntitySign tileentitysign = (TileEntitySign)tileentity;
|
||||
if (!tileentitysign.a()) {
|
||||
this.d.c("Player " + this.e.name + " just tried to change non-editable sign");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -803,34 +786,34 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
int i;
|
||||
int j;
|
||||
|
||||
for (i = 0; i < 4; ++i) {
|
||||
for (j = 0; j < 4; ++j) {
|
||||
boolean flag = true;
|
||||
|
||||
if (packet130updatesign.d[i].length() > 15) {
|
||||
if (packet130updatesign.d[j].length() > 15) {
|
||||
flag = false;
|
||||
} else {
|
||||
for (j = 0; j < packet130updatesign.d[i].length(); ++j) {
|
||||
if (FontAllowedCharacters.a.indexOf(packet130updatesign.d[i].charAt(j)) < 0) {
|
||||
for (i = 0; i < packet130updatesign.d[j].length(); ++i) {
|
||||
if (FontAllowedCharacters.a.indexOf(packet130updatesign.d[j].charAt(i)) < 0) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!flag) {
|
||||
packet130updatesign.d[i] = "!?";
|
||||
packet130updatesign.d[j] = "!?";
|
||||
}
|
||||
}
|
||||
|
||||
if (tileentity instanceof TileEntitySign) {
|
||||
i = packet130updatesign.a;
|
||||
j = packet130updatesign.a;
|
||||
int k = packet130updatesign.b;
|
||||
|
||||
j = packet130updatesign.c;
|
||||
TileEntitySign tileentitysign = (TileEntitySign) tileentity;
|
||||
i = packet130updatesign.c;
|
||||
TileEntitySign tileentitysign1 = (TileEntitySign) tileentity;
|
||||
|
||||
// CraftBukkit start - SIGN_CHANGE hook
|
||||
Player player = server.getPlayer(this.e);
|
||||
SignChangeEvent event = new SignChangeEvent((CraftBlock) player.getWorld().getBlockAt(i, k, j), server.getPlayer(this.e), packet130updatesign.d);
|
||||
SignChangeEvent event = new SignChangeEvent((CraftBlock) player.getWorld().getBlockAt(j, k, j), server.getPlayer(this.e), packet130updatesign.d);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@@ -839,19 +822,17 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
for (int l = 0; l < 4; ++l) {
|
||||
event.setLine(l, "");
|
||||
}
|
||||
} else {
|
||||
tileentitysign.fresh = false;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
for (int l = 0; l < 4; ++l) {
|
||||
tileentitysign.a[l] = event.getLine(l);
|
||||
tileentitysign1.a[l] = event.getLine(l);
|
||||
// CraftBukkit
|
||||
}
|
||||
|
||||
tileentitysign.h();
|
||||
tileentitysign1.i();
|
||||
// CraftBukkit
|
||||
this.e.world.g(i, k, j);
|
||||
this.e.world.g(j, k, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user