mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 12:13:54 -07:00
Update to Minecraft 1.3 beta
This commit is contained in:
@@ -9,6 +9,7 @@ public class PlayerManager {
|
||||
private PlayerList b = new PlayerList();
|
||||
private List c = new ArrayList();
|
||||
private MinecraftServer d;
|
||||
private final int[][] e = new int[][] { { 1, 0}, { 0, 1}, { -1, 0}, { 0, -1}};
|
||||
public WorldServer world; // Craftbukkit
|
||||
|
||||
// Craftbukkit - change of method signature
|
||||
@@ -26,8 +27,7 @@ public class PlayerManager {
|
||||
this.c.clear();
|
||||
}
|
||||
|
||||
// Craftbukkit - method signature changed!
|
||||
private PlayerInstance a(int i, int j, boolean flag, WorldServer world) {
|
||||
private PlayerInstance a(int i, int j, boolean flag) {
|
||||
long k = (long) i + 2147483647L | (long) j + 2147483647L << 32;
|
||||
PlayerInstance playerinstance = (PlayerInstance) this.b.a(k);
|
||||
|
||||
@@ -39,63 +39,50 @@ public class PlayerManager {
|
||||
return playerinstance;
|
||||
}
|
||||
|
||||
// Craftbukkit - method signature changed!
|
||||
public void a(int i, int j, int k, WorldServer world) {
|
||||
public void a(int i, int j, int k) {
|
||||
int l = i >> 4;
|
||||
int i1 = k >> 4;
|
||||
PlayerInstance playerinstance = this.a(l, i1, false, world);
|
||||
PlayerInstance playerinstance = this.a(l, i1, false);
|
||||
|
||||
if (playerinstance != null) {
|
||||
playerinstance.a(i & 15, j, k & 15);
|
||||
}
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
private final int[][] direction = new int[][] {
|
||||
{ 1, 0 },
|
||||
{ 0, 1 },
|
||||
{ -1, 0 },
|
||||
{ 0, -1 },
|
||||
};
|
||||
// CraftBukkit end
|
||||
|
||||
public void a(EntityPlayer entityplayer) {
|
||||
int i = (int) entityplayer.locX >> 4;
|
||||
int j = (int) entityplayer.locZ >> 4;
|
||||
|
||||
entityplayer.d = entityplayer.locX;
|
||||
entityplayer.e = entityplayer.locZ;
|
||||
int k = 0;
|
||||
byte b0 = 10;
|
||||
int l = 0;
|
||||
int i1 = 0;
|
||||
|
||||
// CraftBukkit start
|
||||
int facing = 0;
|
||||
int size = 10;
|
||||
int dx = 0;
|
||||
int dz = 0;
|
||||
this.a(i, j, true).a(entityplayer);
|
||||
|
||||
// Origin
|
||||
this.a(i, j, true, ((WorldServer)entityplayer.world)).a(entityplayer);
|
||||
int j1;
|
||||
|
||||
// All but the last leg
|
||||
for (int legSize = 1; legSize <= size * 2; legSize++) {
|
||||
for (int leg = 0; leg < 2; leg++) {
|
||||
int[] dir = direction[ facing++ % 4 ];
|
||||
for (j1 = 1; j1 <= b0 * 2; ++j1) {
|
||||
for (int k1 = 0; k1 < 2; ++k1) {
|
||||
int[] aint = this.e[k++ % 4];
|
||||
|
||||
for (int k = 0; k < legSize; k++ ) {
|
||||
dx += dir[0];
|
||||
dz += dir[1];
|
||||
this.a(i + dx, j + dz, true, ((WorldServer)entityplayer.world)).a(entityplayer); // Craftbukkit
|
||||
for (int l1 = 0; l1 < j1; ++l1) {
|
||||
l += aint[0];
|
||||
i1 += aint[1];
|
||||
this.a(i + l, j + i1, true).a(entityplayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Final leg
|
||||
facing %= 4;
|
||||
for (int k = 0; k < size * 2; k++) {
|
||||
dx += direction[facing][0];
|
||||
dz += direction[facing][1];
|
||||
this.a(i + dx, j + dz, true, ((WorldServer)entityplayer.world)).a(entityplayer);
|
||||
k %= 4;
|
||||
|
||||
for (j1 = 0; j1 < b0 * 2; ++j1) {
|
||||
l += this.e[k][0];
|
||||
i1 += this.e[k][1];
|
||||
this.a(i + l, j + i1, true).a(entityplayer);
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
this.a.add(entityplayer);
|
||||
}
|
||||
@@ -106,7 +93,7 @@ public class PlayerManager {
|
||||
|
||||
for (int k = i - 10; k <= i + 10; ++k) {
|
||||
for (int l = j - 10; l <= j + 10; ++l) {
|
||||
PlayerInstance playerinstance = this.a(k, l, false, ((WorldServer)entityplayer.world)); // Craftbukkit
|
||||
PlayerInstance playerinstance = this.a(k, l, false);
|
||||
|
||||
if (playerinstance != null) {
|
||||
playerinstance.b(entityplayer);
|
||||
@@ -141,11 +128,11 @@ public class PlayerManager {
|
||||
for (int k1 = i - 10; k1 <= i + 10; ++k1) {
|
||||
for (int l1 = j - 10; l1 <= j + 10; ++l1) {
|
||||
if (!this.a(k1, l1, k, l)) {
|
||||
this.a(k1, l1, true, ((WorldServer)entityplayer.world)).a(entityplayer); // Craftbukkit
|
||||
this.a(k1, l1, true).a(entityplayer);
|
||||
}
|
||||
|
||||
if (!this.a(k1 - i1, l1 - j1, i, j)) {
|
||||
PlayerInstance playerinstance = this.a(k1 - i1, l1 - j1, false, ((WorldServer)entityplayer.world)); // Craftbukkit
|
||||
PlayerInstance playerinstance = this.a(k1 - i1, l1 - j1, false);
|
||||
|
||||
if (playerinstance != null) {
|
||||
playerinstance.b(entityplayer);
|
||||
|
Reference in New Issue
Block a user