Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Update to mc-dev rename revision 01
Dieser Commit ist enthalten in:
Ursprung
7f079a0cd6
Commit
897551e39e
2
pom.xml
2
pom.xml
@ -52,7 +52,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>minecraft-server</artifactId>
|
<artifactId>minecraft-server</artifactId>
|
||||||
<version>1.0.1</version>
|
<version>1.0.1_01</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -465,7 +465,7 @@ public class Block {
|
|||||||
return vec3d == null ? false : vec3d.a >= this.minX && vec3d.a <= this.maxX && vec3d.b >= this.minY && vec3d.b <= this.maxY;
|
return vec3d == null ? false : vec3d.a >= this.minX && vec3d.a <= this.maxX && vec3d.b >= this.minY && vec3d.b <= this.maxY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a_(World world, int i, int j, int k) {}
|
public void wasExploded(World world, int i, int j, int k) {}
|
||||||
|
|
||||||
public boolean canPlace(World world, int i, int j, int k, int l) {
|
public boolean canPlace(World world, int i, int j, int k, int l) {
|
||||||
return this.canPlace(world, i, j, k);
|
return this.canPlace(world, i, j, k);
|
||||||
@ -568,7 +568,7 @@ public class Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int g() {
|
public int g() {
|
||||||
return this.material.l();
|
return this.material.getPushReaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
@ -145,7 +145,7 @@ public class BlockDispenser extends BlockContainer {
|
|||||||
if (itemstack.id == Item.ARROW.id) {
|
if (itemstack.id == Item.ARROW.id) {
|
||||||
EntityArrow entityarrow = new EntityArrow(world, d0, d1, d2);
|
EntityArrow entityarrow = new EntityArrow(world, d0, d1, d2);
|
||||||
|
|
||||||
entityarrow.a((double) b0, 0.10000000149011612D, (double) b1, 1.1F, 6.0F);
|
entityarrow.shoot((double) b0, 0.10000000149011612D, (double) b1, 1.1F, 6.0F);
|
||||||
entityarrow.fromPlayer = true;
|
entityarrow.fromPlayer = true;
|
||||||
world.addEntity(entityarrow);
|
world.addEntity(entityarrow);
|
||||||
world.f(1002, i, j, k, 0);
|
world.f(1002, i, j, k, 0);
|
||||||
|
@ -80,7 +80,7 @@ public class BlockPressurePlate extends Block {
|
|||||||
List list = null;
|
List list = null;
|
||||||
|
|
||||||
if (this.a == EnumMobType.EVERYTHING) {
|
if (this.a == EnumMobType.EVERYTHING) {
|
||||||
list = world.b((Entity) null, AxisAlignedBB.b((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f)));
|
list = world.getEntities(null, AxisAlignedBB.b((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.a == EnumMobType.MOBS) {
|
if (this.a == EnumMobType.MOBS) {
|
||||||
|
@ -125,8 +125,8 @@ public class BlockStairs extends Block {
|
|||||||
return this.a.interact(world, i, j, k, entityhuman);
|
return this.a.interact(world, i, j, k, entityhuman);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a_(World world, int i, int j, int k) {
|
public void wasExploded(World world, int i, int j, int k) {
|
||||||
this.a.a_(world, i, j, k);
|
this.a.wasExploded(world, i, j, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void postPlace(World world, int i, int j, int k, EntityLiving entityliving) {
|
public void postPlace(World world, int i, int j, int k, EntityLiving entityliving) {
|
||||||
|
@ -254,11 +254,11 @@ public class ChunkProviderServer implements IChunkProvider {
|
|||||||
return !this.world.savingDisabled;
|
return !this.world.savingDisabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List a(EnumCreatureType enumcreaturetype, int i, int j, int k) {
|
public List getMobsFor(EnumCreatureType enumcreaturetype, int i, int j, int k) {
|
||||||
return this.chunkProvider.a(enumcreaturetype, i, j, k);
|
return this.chunkProvider.getMobsFor(enumcreaturetype, i, j, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChunkPosition a(World world, String s, int i, int j, int k) {
|
public ChunkPosition findNearestMapFeature(World world, String s, int i, int j, int k) {
|
||||||
return this.chunkProvider.a(world, s, i, j, k);
|
return this.chunkProvider.findNearestMapFeature(world, s, i, j, k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -358,7 +358,7 @@ public abstract class Entity {
|
|||||||
|
|
||||||
public boolean d(double d0, double d1, double d2) {
|
public boolean d(double d0, double d1, double d2) {
|
||||||
AxisAlignedBB axisalignedbb = this.boundingBox.c(d0, d1, d2);
|
AxisAlignedBB axisalignedbb = this.boundingBox.c(d0, d1, d2);
|
||||||
List list = this.world.getEntities(this, axisalignedbb);
|
List list = this.world.a(this, axisalignedbb);
|
||||||
|
|
||||||
return list.size() > 0 ? false : !this.world.c(axisalignedbb);
|
return list.size() > 0 ? false : !this.world.c(axisalignedbb);
|
||||||
}
|
}
|
||||||
@ -394,7 +394,7 @@ public abstract class Entity {
|
|||||||
if (flag) {
|
if (flag) {
|
||||||
double d8;
|
double d8;
|
||||||
|
|
||||||
for (d8 = 0.05D; d0 != 0.0D && this.world.getEntities(this, this.boundingBox.c(d0, -1.0D, 0.0D)).size() == 0; d5 = d0) {
|
for (d8 = 0.05D; d0 != 0.0D && this.world.a(this, this.boundingBox.c(d0, -1.0D, 0.0D)).size() == 0; d5 = d0) {
|
||||||
if (d0 < d8 && d0 >= -d8) {
|
if (d0 < d8 && d0 >= -d8) {
|
||||||
d0 = 0.0D;
|
d0 = 0.0D;
|
||||||
} else if (d0 > 0.0D) {
|
} else if (d0 > 0.0D) {
|
||||||
@ -404,7 +404,7 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; d2 != 0.0D && this.world.getEntities(this, this.boundingBox.c(0.0D, -1.0D, d2)).size() == 0; d7 = d2) {
|
for (; d2 != 0.0D && this.world.a(this, this.boundingBox.c(0.0D, -1.0D, d2)).size() == 0; d7 = d2) {
|
||||||
if (d2 < d8 && d2 >= -d8) {
|
if (d2 < d8 && d2 >= -d8) {
|
||||||
d2 = 0.0D;
|
d2 = 0.0D;
|
||||||
} else if (d2 > 0.0D) {
|
} else if (d2 > 0.0D) {
|
||||||
@ -415,7 +415,7 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List list = this.world.getEntities(this, this.boundingBox.a(d0, d1, d2));
|
List list = this.world.a(this, this.boundingBox.a(d0, d1, d2));
|
||||||
|
|
||||||
for (int i = 0; i < list.size(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
d1 = ((AxisAlignedBB) list.get(i)).b(this.boundingBox, d1);
|
d1 = ((AxisAlignedBB) list.get(i)).b(this.boundingBox, d1);
|
||||||
@ -469,7 +469,7 @@ public abstract class Entity {
|
|||||||
AxisAlignedBB axisalignedbb1 = this.boundingBox.clone();
|
AxisAlignedBB axisalignedbb1 = this.boundingBox.clone();
|
||||||
|
|
||||||
this.boundingBox.b(axisalignedbb);
|
this.boundingBox.b(axisalignedbb);
|
||||||
list = this.world.getEntities(this, this.boundingBox.a(d5, d1, d7));
|
list = this.world.a(this, this.boundingBox.a(d5, d1, d7));
|
||||||
|
|
||||||
for (k = 0; k < list.size(); ++k) {
|
for (k = 0; k < list.size(); ++k) {
|
||||||
d1 = ((AxisAlignedBB) list.get(k)).b(this.boundingBox, d1);
|
d1 = ((AxisAlignedBB) list.get(k)).b(this.boundingBox, d1);
|
||||||
@ -717,7 +717,7 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean i_() {
|
public boolean i_() {
|
||||||
return this.world.a(this.boundingBox.b(0.0D, -0.4000000059604645D, 0.0D).shrink(0.0010D, 0.0010D, 0.0010D), Material.WATER, this);
|
return this.world.a(this.boundingBox.grow(0.0D, -0.4000000059604645D, 0.0D).shrink(0.0010D, 0.0010D, 0.0010D), Material.WATER, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean a(Material material) {
|
public boolean a(Material material) {
|
||||||
@ -742,7 +742,7 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean aA() {
|
public boolean aA() {
|
||||||
return this.world.a(this.boundingBox.b(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.LAVA);
|
return this.world.a(this.boundingBox.grow(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.LAVA);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(float f, float f1, float f2) {
|
public void a(float f, float f1, float f2) {
|
||||||
|
@ -52,12 +52,12 @@ public class EntityArrow extends Entity {
|
|||||||
this.motX = (double) (-MathHelper.sin(this.yaw / 180.0F * 3.1415927F) * MathHelper.cos(this.pitch / 180.0F * 3.1415927F));
|
this.motX = (double) (-MathHelper.sin(this.yaw / 180.0F * 3.1415927F) * MathHelper.cos(this.pitch / 180.0F * 3.1415927F));
|
||||||
this.motZ = (double) (MathHelper.cos(this.yaw / 180.0F * 3.1415927F) * MathHelper.cos(this.pitch / 180.0F * 3.1415927F));
|
this.motZ = (double) (MathHelper.cos(this.yaw / 180.0F * 3.1415927F) * MathHelper.cos(this.pitch / 180.0F * 3.1415927F));
|
||||||
this.motY = (double) (-MathHelper.sin(this.pitch / 180.0F * 3.1415927F));
|
this.motY = (double) (-MathHelper.sin(this.pitch / 180.0F * 3.1415927F));
|
||||||
this.a(this.motX, this.motY, this.motZ, f * 1.5F, 1.0F);
|
this.shoot(this.motX, this.motY, this.motZ, f * 1.5F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void b() {}
|
protected void b() {}
|
||||||
|
|
||||||
public void a(double d0, double d1, double d2, float f, float f1) {
|
public void shoot(double d0, double d1, double d2, float f, float f1) {
|
||||||
float f2 = MathHelper.a(d0 * d0 + d1 * d1 + d2 * d2);
|
float f2 = MathHelper.a(d0 * d0 + d1 * d1 + d2 * d2);
|
||||||
|
|
||||||
d0 /= (double) f2;
|
d0 /= (double) f2;
|
||||||
@ -133,7 +133,7 @@ public class EntityArrow extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Entity entity = null;
|
Entity entity = null;
|
||||||
List list = this.world.b((Entity) this, this.boundingBox.a(this.motX, this.motY, this.motZ).b(1.0D, 1.0D, 1.0D));
|
List list = this.world.getEntities(this, this.boundingBox.a(this.motX, this.motY, this.motZ).grow(1.0D, 1.0D, 1.0D));
|
||||||
double d0 = 0.0D;
|
double d0 = 0.0D;
|
||||||
|
|
||||||
int k;
|
int k;
|
||||||
@ -144,7 +144,7 @@ public class EntityArrow extends Entity {
|
|||||||
|
|
||||||
if (entity1.e_() && (entity1 != this.shooter || this.l >= 5)) {
|
if (entity1.e_() && (entity1 != this.shooter || this.l >= 5)) {
|
||||||
f1 = 0.3F;
|
f1 = 0.3F;
|
||||||
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.b((double) f1, (double) f1, (double) f1);
|
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.grow((double) f1, (double) f1, (double) f1);
|
||||||
MovingObjectPosition movingobjectposition1 = axisalignedbb1.a(vec3d, vec3d1);
|
MovingObjectPosition movingobjectposition1 = axisalignedbb1.a(vec3d, vec3d1);
|
||||||
|
|
||||||
if (movingobjectposition1 != null) {
|
if (movingobjectposition1 != null) {
|
||||||
|
@ -372,7 +372,7 @@ public class EntityBoat extends Entity {
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
List list = this.world.b((Entity) this, this.boundingBox.b(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
List list = this.world.getEntities(this, this.boundingBox.grow(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
||||||
int l;
|
int l;
|
||||||
|
|
||||||
if (list != null && list.size() > 0) {
|
if (list != null && list.size() > 0) {
|
||||||
|
@ -20,7 +20,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
public double c;
|
public double c;
|
||||||
public double[][] d = new double[64][3];
|
public double[][] d = new double[64][3];
|
||||||
public int e = -1;
|
public int e = -1;
|
||||||
public EntityComplexPart[] f;
|
public EntityComplexPart[] children;
|
||||||
public EntityComplexPart g;
|
public EntityComplexPart g;
|
||||||
public EntityComplexPart h;
|
public EntityComplexPart h;
|
||||||
public EntityComplexPart i;
|
public EntityComplexPart i;
|
||||||
@ -38,7 +38,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
|
|
||||||
public EntityEnderDragon(World world) {
|
public EntityEnderDragon(World world) {
|
||||||
super(world);
|
super(world);
|
||||||
this.f = new EntityComplexPart[] { this.g = new EntityComplexPart(this, "head", 6.0F, 6.0F), this.h = new EntityComplexPart(this, "body", 8.0F, 8.0F), this.i = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.j = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.k = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.l = new EntityComplexPart(this, "wing", 4.0F, 4.0F), this.m = new EntityComplexPart(this, "wing", 4.0F, 4.0F)};
|
this.children = new EntityComplexPart[] { this.g = new EntityComplexPart(this, "head", 6.0F, 6.0F), this.h = new EntityComplexPart(this, "body", 8.0F, 8.0F), this.i = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.j = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.k = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.l = new EntityComplexPart(this, "wing", 4.0F, 4.0F), this.m = new EntityComplexPart(this, "wing", 4.0F, 4.0F)};
|
||||||
this.t = 200;
|
this.t = 200;
|
||||||
this.setHealth(this.t);
|
this.setHealth(this.t);
|
||||||
this.texture = "/mob/enderdragon/ender.png";
|
this.texture = "/mob/enderdragon/ender.png";
|
||||||
@ -286,9 +286,9 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.world.isStatic && this.as == 0) {
|
if (!this.world.isStatic && this.as == 0) {
|
||||||
this.a(this.world.b((Entity) this, this.l.boundingBox.b(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D)));
|
this.a(this.world.getEntities(this, this.l.boundingBox.grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D)));
|
||||||
this.a(this.world.b((Entity) this, this.m.boundingBox.b(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D)));
|
this.a(this.world.getEntities(this, this.m.boundingBox.grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D)));
|
||||||
this.b(this.world.b((Entity) this, this.g.boundingBox.b(1.0D, 1.0D, 1.0D)));
|
this.b(this.world.getEntities(this, this.g.boundingBox.grow(1.0D, 1.0D, 1.0D)));
|
||||||
}
|
}
|
||||||
|
|
||||||
double[] adouble = this.a(5, 1.0F);
|
double[] adouble = this.a(5, 1.0F);
|
||||||
@ -347,7 +347,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
|
|
||||||
if (this.random.nextInt(10) == 0) {
|
if (this.random.nextInt(10) == 0) {
|
||||||
float f = 32.0F;
|
float f = 32.0F;
|
||||||
List list = this.world.a(EntityEnderCrystal.class, this.boundingBox.b((double) f, (double) f, (double) f));
|
List list = this.world.a(EntityEnderCrystal.class, this.boundingBox.grow((double) f, (double) f, (double) f));
|
||||||
EntityEnderCrystal entityendercrystal = null;
|
EntityEnderCrystal entityendercrystal = null;
|
||||||
double d0 = Double.MAX_VALUE;
|
double d0 = Double.MAX_VALUE;
|
||||||
Iterator iterator = list.iterator();
|
Iterator iterator = list.iterator();
|
||||||
@ -624,7 +624,7 @@ public class EntityEnderDragon extends EntityComplex {
|
|||||||
protected void ak() {}
|
protected void ak() {}
|
||||||
|
|
||||||
public Entity[] aG() {
|
public Entity[] aG() {
|
||||||
return this.f;
|
return this.children;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean e_() {
|
public boolean e_() {
|
||||||
|
@ -230,7 +230,7 @@ public class EntityEnderman extends EntityMonster {
|
|||||||
|
|
||||||
if (flag1) {
|
if (flag1) {
|
||||||
this.setPosition(this.locX, this.locY, this.locZ);
|
this.setPosition(this.locX, this.locY, this.locZ);
|
||||||
if (this.world.getEntities(this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox)) {
|
if (this.world.a(this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox)) {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ public class EntityFireball extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Entity entity = null;
|
Entity entity = null;
|
||||||
List list = this.world.b((Entity) this, this.boundingBox.a(this.motX, this.motY, this.motZ).b(1.0D, 1.0D, 1.0D));
|
List list = this.world.getEntities(this, this.boundingBox.a(this.motX, this.motY, this.motZ).grow(1.0D, 1.0D, 1.0D));
|
||||||
double d0 = 0.0D;
|
double d0 = 0.0D;
|
||||||
|
|
||||||
for (int j = 0; j < list.size(); ++j) {
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
@ -109,7 +109,7 @@ public class EntityFireball extends Entity {
|
|||||||
|
|
||||||
if (entity1.e_() && (!entity1.a((Entity) this.shooter) || this.k >= 25)) {
|
if (entity1.e_() && (!entity1.a((Entity) this.shooter) || this.k >= 25)) {
|
||||||
float f = 0.3F;
|
float f = 0.3F;
|
||||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f);
|
||||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
||||||
|
|
||||||
if (movingobjectposition1 != null) {
|
if (movingobjectposition1 != null) {
|
||||||
|
@ -161,7 +161,7 @@ public class EntityFishingHook extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Entity entity = null;
|
Entity entity = null;
|
||||||
List list = this.world.b((Entity) this, this.boundingBox.a(this.motX, this.motY, this.motZ).b(1.0D, 1.0D, 1.0D));
|
List list = this.world.getEntities(this, this.boundingBox.a(this.motX, this.motY, this.motZ).grow(1.0D, 1.0D, 1.0D));
|
||||||
double d4 = 0.0D;
|
double d4 = 0.0D;
|
||||||
|
|
||||||
double d5;
|
double d5;
|
||||||
@ -171,7 +171,7 @@ public class EntityFishingHook extends Entity {
|
|||||||
|
|
||||||
if (entity1.e_() && (entity1 != this.owner || this.j >= 5)) {
|
if (entity1.e_() && (entity1 != this.owner || this.j >= 5)) {
|
||||||
float f = 0.3F;
|
float f = 0.3F;
|
||||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f);
|
||||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
||||||
|
|
||||||
if (movingobjectposition1 != null) {
|
if (movingobjectposition1 != null) {
|
||||||
|
@ -174,7 +174,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
|||||||
|
|
||||||
for (int i = 1; (double) i < d3; ++i) {
|
for (int i = 1; (double) i < d3; ++i) {
|
||||||
axisalignedbb.d(d4, d5, d6);
|
axisalignedbb.d(d4, d5, d6);
|
||||||
if (this.world.getEntities(this, axisalignedbb).size() > 0) {
|
if (this.world.a(this, axisalignedbb).size() > 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
this.s += (f - this.s) * 0.4F;
|
this.s += (f - this.s) * 0.4F;
|
||||||
this.ax += (f1 - this.ax) * 0.8F;
|
this.ax += (f1 - this.ax) * 0.8F;
|
||||||
if (this.getHealth() > 0) {
|
if (this.getHealth() > 0) {
|
||||||
List list = this.world.b((Entity) this, this.boundingBox.b(1.0D, 0.0D, 1.0D));
|
List list = this.world.getEntities(this, this.boundingBox.grow(1.0D, 0.0D, 1.0D));
|
||||||
|
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
for (int i = 0; i < list.size(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
@ -653,7 +653,7 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(entityliving instanceof EntityHuman) || this.y()) {
|
if (!(entityliving instanceof EntityHuman) || this.y()) {
|
||||||
List list = this.world.a(EntityWolf.class, AxisAlignedBB.b(this.locX, this.locY, this.locZ, this.locX + 1.0D, this.locY + 1.0D, this.locZ + 1.0D).b(16.0D, 4.0D, 16.0D));
|
List list = this.world.a(EntityWolf.class, AxisAlignedBB.b(this.locX, this.locY, this.locZ, this.locX + 1.0D, this.locY + 1.0D, this.locZ + 1.0D).grow(16.0D, 4.0D, 16.0D));
|
||||||
Iterator iterator = list.iterator();
|
Iterator iterator = list.iterator();
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
|
@ -56,7 +56,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
public float aC;
|
public float aC;
|
||||||
public float aD;
|
public float aD;
|
||||||
public float aE;
|
public float aE;
|
||||||
public EntityHuman aF = null; // CraftBukkit - prot to pub - "killer"
|
public EntityHuman killer = null; // CraftBukkit - prot to pub
|
||||||
protected int aG = 0;
|
protected int aG = 0;
|
||||||
public int aH = 0;
|
public int aH = 0;
|
||||||
public int aI = 0;
|
public int aI = 0;
|
||||||
@ -200,7 +200,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
if (this.aG > 0) {
|
if (this.aG > 0) {
|
||||||
--this.aG;
|
--this.aG;
|
||||||
} else {
|
} else {
|
||||||
this.aF = null;
|
this.killer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.aq();
|
this.aq();
|
||||||
@ -213,7 +213,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
public int getExpReward() {
|
public int getExpReward() {
|
||||||
int exp = a(this.aF);
|
int exp = a(this.killer);
|
||||||
|
|
||||||
if (!this.world.isStatic && (this.aG > 0 || this.ac()) && !this.l()) {
|
if (!this.world.isStatic && (this.aG > 0 || this.ac()) && !this.l()) {
|
||||||
return exp;
|
return exp;
|
||||||
@ -464,13 +464,13 @@ public abstract class EntityLiving extends Entity {
|
|||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
if (entity instanceof EntityHuman) {
|
if (entity instanceof EntityHuman) {
|
||||||
this.aG = 60;
|
this.aG = 60;
|
||||||
this.aF = (EntityHuman) entity;
|
this.killer = (EntityHuman) entity;
|
||||||
} else if (entity instanceof EntityWolf) {
|
} else if (entity instanceof EntityWolf) {
|
||||||
EntityWolf entitywolf = (EntityWolf) entity;
|
EntityWolf entitywolf = (EntityWolf) entity;
|
||||||
|
|
||||||
if (entitywolf.isTamed()) {
|
if (entitywolf.isTamed()) {
|
||||||
this.aG = 60;
|
this.aG = 60;
|
||||||
this.aF = null;
|
this.killer = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -859,7 +859,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
--this.aK;
|
--this.aK;
|
||||||
this.setPosition(d0, d1, d2);
|
this.setPosition(d0, d1, d2);
|
||||||
this.c(this.yaw, this.pitch);
|
this.c(this.yaw, this.pitch);
|
||||||
List list = this.world.getEntities(this, this.boundingBox.shrink(0.03125D, 0.0D, 0.03125D));
|
List list = this.world.a(this, this.boundingBox.shrink(0.03125D, 0.0D, 0.03125D));
|
||||||
|
|
||||||
if (list.size() > 0) {
|
if (list.size() > 0) {
|
||||||
double d4 = 0.0D;
|
double d4 = 0.0D;
|
||||||
@ -913,7 +913,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
this.a(this.aT, this.aU);
|
this.a(this.aT, this.aU);
|
||||||
this.ak = f;
|
this.ak = f;
|
||||||
// MethodProfiler.a("push"); // CraftBukkit - not in production code
|
// MethodProfiler.a("push"); // CraftBukkit - not in production code
|
||||||
List list1 = this.world.b((Entity) this, this.boundingBox.b(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
List list1 = this.world.getEntities(this, this.boundingBox.grow(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
||||||
|
|
||||||
if (list1 != null && list1.size() > 0) {
|
if (list1 != null && list1.size() > 0) {
|
||||||
for (int j = 0; j < list1.size(); ++j) {
|
for (int j = 0; j < list1.size(); ++j) {
|
||||||
@ -1076,7 +1076,7 @@ public abstract class EntityLiving extends Entity {
|
|||||||
public void an() {}
|
public void an() {}
|
||||||
|
|
||||||
public boolean g() {
|
public boolean g() {
|
||||||
return this.world.containsEntity(this.boundingBox) && this.world.getEntities(this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox);
|
return this.world.containsEntity(this.boundingBox) && this.world.a(this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void ao() {
|
protected void ao() {
|
||||||
|
@ -10,7 +10,7 @@ public class EntityMagmaCube extends EntitySlime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean g() {
|
public boolean g() {
|
||||||
return this.world.difficulty > 0 && this.world.containsEntity(this.boundingBox) && this.world.getEntities(this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox);
|
return this.world.difficulty > 0 && this.world.containsEntity(this.boundingBox) && this.world.a(this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int O() {
|
protected int O() {
|
||||||
|
@ -567,7 +567,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
List list = this.world.b((Entity) this, this.boundingBox.b(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
List list = this.world.getEntities(this, this.boundingBox.grow(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
||||||
|
|
||||||
if (list != null && list.size() > 0) {
|
if (list != null && list.size() > 0) {
|
||||||
for (int l1 = 0; l1 < list.size(); ++l1) {
|
for (int l1 = 0; l1 < list.size(); ++l1) {
|
||||||
|
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Painting;
|
import org.bukkit.entity.Painting;
|
||||||
import org.bukkit.event.painting.PaintingBreakByEntityEvent;
|
import org.bukkit.event.painting.PaintingBreakByEntityEvent;
|
||||||
import org.bukkit.event.painting.PaintingBreakEvent.RemoveCause;
|
import org.bukkit.event.painting.PaintingBreakEvent.RemoveCause;
|
||||||
@ -14,26 +13,26 @@ import org.bukkit.event.painting.PaintingBreakEvent;
|
|||||||
public class EntityPainting extends Entity {
|
public class EntityPainting extends Entity {
|
||||||
|
|
||||||
private int f;
|
private int f;
|
||||||
public int a;
|
public int direction;
|
||||||
public int b;
|
public int x;
|
||||||
public int c;
|
public int y;
|
||||||
public int d;
|
public int z;
|
||||||
public EnumArt e;
|
public EnumArt art;
|
||||||
|
|
||||||
public EntityPainting(World world) {
|
public EntityPainting(World world) {
|
||||||
super(world);
|
super(world);
|
||||||
this.f = 0;
|
this.f = 0;
|
||||||
this.a = 0;
|
this.direction = 0;
|
||||||
this.height = 0.0F;
|
this.height = 0.0F;
|
||||||
this.b(0.5F, 0.5F);
|
this.b(0.5F, 0.5F);
|
||||||
this.e = EnumArt.values()[this.random.nextInt(EnumArt.values().length)]; // CraftBukkit - generate a non-null painting
|
this.art = EnumArt.values()[this.random.nextInt(EnumArt.values().length)]; // CraftBukkit - generate a non-null painting
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityPainting(World world, int i, int j, int k, int l) {
|
public EntityPainting(World world, int i, int j, int k, int l) {
|
||||||
this(world);
|
this(world);
|
||||||
this.b = i;
|
this.x = i;
|
||||||
this.c = j;
|
this.y = j;
|
||||||
this.d = k;
|
this.z = k;
|
||||||
ArrayList arraylist = new ArrayList();
|
ArrayList arraylist = new ArrayList();
|
||||||
EnumArt[] aenumart = EnumArt.values();
|
EnumArt[] aenumart = EnumArt.values();
|
||||||
int i1 = aenumart.length;
|
int i1 = aenumart.length;
|
||||||
@ -41,28 +40,28 @@ public class EntityPainting extends Entity {
|
|||||||
for (int j1 = 0; j1 < i1; ++j1) {
|
for (int j1 = 0; j1 < i1; ++j1) {
|
||||||
EnumArt enumart = aenumart[j1];
|
EnumArt enumart = aenumart[j1];
|
||||||
|
|
||||||
this.e = enumart;
|
this.art = enumart;
|
||||||
this.b(l);
|
this.setDirection(l);
|
||||||
if (this.j()) {
|
if (this.survives()) {
|
||||||
arraylist.add(enumart);
|
arraylist.add(enumart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arraylist.size() > 0) {
|
if (arraylist.size() > 0) {
|
||||||
this.e = (EnumArt) arraylist.get(this.random.nextInt(arraylist.size()));
|
this.art = (EnumArt) arraylist.get(this.random.nextInt(arraylist.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.b(l);
|
this.setDirection(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void b() {}
|
protected void b() {}
|
||||||
|
|
||||||
public void b(int i) {
|
public void setDirection(int i) {
|
||||||
this.a = i;
|
this.direction = i;
|
||||||
this.lastYaw = this.yaw = (float) (i * 90);
|
this.lastYaw = this.yaw = (float) (i * 90);
|
||||||
float f = (float) this.e.B;
|
float f = (float) this.art.B;
|
||||||
float f1 = (float) this.e.C;
|
float f1 = (float) this.art.C;
|
||||||
float f2 = (float) this.e.B;
|
float f2 = (float) this.art.B;
|
||||||
|
|
||||||
if (i != 0 && i != 2) {
|
if (i != 0 && i != 2) {
|
||||||
f = 0.5F;
|
f = 0.5F;
|
||||||
@ -73,9 +72,9 @@ public class EntityPainting extends Entity {
|
|||||||
f /= 32.0F;
|
f /= 32.0F;
|
||||||
f1 /= 32.0F;
|
f1 /= 32.0F;
|
||||||
f2 /= 32.0F;
|
f2 /= 32.0F;
|
||||||
float f3 = (float) this.b + 0.5F;
|
float f3 = (float) this.x + 0.5F;
|
||||||
float f4 = (float) this.c + 0.5F;
|
float f4 = (float) this.y + 0.5F;
|
||||||
float f5 = (float) this.d + 0.5F;
|
float f5 = (float) this.z + 0.5F;
|
||||||
float f6 = 0.5625F;
|
float f6 = 0.5625F;
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
@ -95,22 +94,22 @@ public class EntityPainting extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
f3 -= this.c(this.e.B);
|
f3 -= this.c(this.art.B);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
f5 += this.c(this.e.B);
|
f5 += this.c(this.art.B);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 2) {
|
if (i == 2) {
|
||||||
f3 += this.c(this.e.B);
|
f3 += this.c(this.art.B);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 3) {
|
if (i == 3) {
|
||||||
f5 -= this.c(this.e.B);
|
f5 -= this.c(this.art.B);
|
||||||
}
|
}
|
||||||
|
|
||||||
f4 += this.c(this.e.C);
|
f4 += this.c(this.art.C);
|
||||||
this.setPosition((double) f3, (double) f4, (double) f5);
|
this.setPosition((double) f3, (double) f4, (double) f5);
|
||||||
float f7 = -0.00625F;
|
float f7 = -0.00625F;
|
||||||
|
|
||||||
@ -124,7 +123,7 @@ public class EntityPainting extends Entity {
|
|||||||
public void w_() {
|
public void w_() {
|
||||||
if (this.f++ == 100 && !this.world.isStatic) {
|
if (this.f++ == 100 && !this.world.isStatic) {
|
||||||
this.f = 0;
|
this.f = 0;
|
||||||
if (!this.j()) {
|
if (!this.survives()) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
Material material = this.world.getMaterial((int)this.locX, (int)this.locY, (int)this.locZ);
|
Material material = this.world.getMaterial((int)this.locX, (int)this.locY, (int)this.locZ);
|
||||||
RemoveCause cause;
|
RemoveCause cause;
|
||||||
@ -152,33 +151,33 @@ public class EntityPainting extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean j() {
|
public boolean survives() {
|
||||||
if (this.world.getEntities(this, this.boundingBox).size() > 0) {
|
if (this.world.a(this, this.boundingBox).size() > 0) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
int i = this.e.B / 16;
|
int i = this.art.B / 16;
|
||||||
int j = this.e.C / 16;
|
int j = this.art.C / 16;
|
||||||
int k = this.b;
|
int k = this.x;
|
||||||
int l = this.c;
|
int l = this.y;
|
||||||
int i1 = this.d;
|
int i1 = this.z;
|
||||||
|
|
||||||
if (this.a == 0) {
|
if (this.direction == 0) {
|
||||||
k = MathHelper.floor(this.locX - (double) ((float) this.e.B / 32.0F));
|
k = MathHelper.floor(this.locX - (double) ((float) this.art.B / 32.0F));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.a == 1) {
|
if (this.direction == 1) {
|
||||||
i1 = MathHelper.floor(this.locZ - (double) ((float) this.e.B / 32.0F));
|
i1 = MathHelper.floor(this.locZ - (double) ((float) this.art.B / 32.0F));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.a == 2) {
|
if (this.direction == 2) {
|
||||||
k = MathHelper.floor(this.locX - (double) ((float) this.e.B / 32.0F));
|
k = MathHelper.floor(this.locX - (double) ((float) this.art.B / 32.0F));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.a == 3) {
|
if (this.direction == 3) {
|
||||||
i1 = MathHelper.floor(this.locZ - (double) ((float) this.e.B / 32.0F));
|
i1 = MathHelper.floor(this.locZ - (double) ((float) this.art.B / 32.0F));
|
||||||
}
|
}
|
||||||
|
|
||||||
l = MathHelper.floor(this.locY - (double) ((float) this.e.C / 32.0F));
|
l = MathHelper.floor(this.locY - (double) ((float) this.art.C / 32.0F));
|
||||||
|
|
||||||
int j1;
|
int j1;
|
||||||
|
|
||||||
@ -186,10 +185,10 @@ public class EntityPainting extends Entity {
|
|||||||
for (j1 = 0; j1 < j; ++j1) {
|
for (j1 = 0; j1 < j; ++j1) {
|
||||||
Material material;
|
Material material;
|
||||||
|
|
||||||
if (this.a != 0 && this.a != 2) {
|
if (this.direction != 0 && this.direction != 2) {
|
||||||
material = this.world.getMaterial(this.b, l + j1, i1 + k1);
|
material = this.world.getMaterial(this.x, l + j1, i1 + k1);
|
||||||
} else {
|
} else {
|
||||||
material = this.world.getMaterial(k + k1, l + j1, this.d);
|
material = this.world.getMaterial(k + k1, l + j1, this.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!material.isBuildable()) {
|
if (!material.isBuildable()) {
|
||||||
@ -198,7 +197,7 @@ public class EntityPainting extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List list = this.world.b((Entity) this, this.boundingBox);
|
List list = this.world.getEntities(this, this.boundingBox);
|
||||||
|
|
||||||
for (j1 = 0; j1 < list.size(); ++j1) {
|
for (j1 = 0; j1 < list.size(); ++j1) {
|
||||||
if (list.get(j1) instanceof EntityPainting) {
|
if (list.get(j1) instanceof EntityPainting) {
|
||||||
@ -246,18 +245,18 @@ public class EntityPainting extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void b(NBTTagCompound nbttagcompound) {
|
public void b(NBTTagCompound nbttagcompound) {
|
||||||
nbttagcompound.setByte("Dir", (byte) this.a);
|
nbttagcompound.setByte("Dir", (byte) this.direction);
|
||||||
nbttagcompound.setString("Motive", this.e.A);
|
nbttagcompound.setString("Motive", this.art.A);
|
||||||
nbttagcompound.setInt("TileX", this.b);
|
nbttagcompound.setInt("TileX", this.x);
|
||||||
nbttagcompound.setInt("TileY", this.c);
|
nbttagcompound.setInt("TileY", this.y);
|
||||||
nbttagcompound.setInt("TileZ", this.d);
|
nbttagcompound.setInt("TileZ", this.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(NBTTagCompound nbttagcompound) {
|
public void a(NBTTagCompound nbttagcompound) {
|
||||||
this.a = nbttagcompound.getByte("Dir");
|
this.direction = nbttagcompound.getByte("Dir");
|
||||||
this.b = nbttagcompound.getInt("TileX");
|
this.x = nbttagcompound.getInt("TileX");
|
||||||
this.c = nbttagcompound.getInt("TileY");
|
this.y = nbttagcompound.getInt("TileY");
|
||||||
this.d = nbttagcompound.getInt("TileZ");
|
this.z = nbttagcompound.getInt("TileZ");
|
||||||
String s = nbttagcompound.getString("Motive");
|
String s = nbttagcompound.getString("Motive");
|
||||||
EnumArt[] aenumart = EnumArt.values();
|
EnumArt[] aenumart = EnumArt.values();
|
||||||
int i = aenumart.length;
|
int i = aenumart.length;
|
||||||
@ -266,15 +265,15 @@ public class EntityPainting extends Entity {
|
|||||||
EnumArt enumart = aenumart[j];
|
EnumArt enumart = aenumart[j];
|
||||||
|
|
||||||
if (enumart.A.equals(s)) {
|
if (enumart.A.equals(s)) {
|
||||||
this.e = enumart;
|
this.art = enumart;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.e == null) {
|
if (this.art == null) {
|
||||||
this.e = EnumArt.KEBAB;
|
this.art = EnumArt.KEBAB;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.b(this.a);
|
this.setDirection(this.direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void move(double d0, double d1, double d2) {
|
public void move(double d0, double d1, double d2) {
|
||||||
|
@ -33,7 +33,7 @@ public class EntityPigZombie extends EntityZombie {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean g() {
|
public boolean g() {
|
||||||
return this.world.difficulty > 0 && this.world.containsEntity(this.boundingBox) && this.world.getEntities(this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox);
|
return this.world.difficulty > 0 && this.world.containsEntity(this.boundingBox) && this.world.a(this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void b(NBTTagCompound nbttagcompound) {
|
public void b(NBTTagCompound nbttagcompound) {
|
||||||
@ -58,7 +58,7 @@ public class EntityPigZombie extends EntityZombie {
|
|||||||
Entity entity = damagesource.getEntity();
|
Entity entity = damagesource.getEntity();
|
||||||
|
|
||||||
if (entity instanceof EntityHuman) {
|
if (entity instanceof EntityHuman) {
|
||||||
List list = this.world.b((Entity) this, this.boundingBox.b(32.0D, 32.0D, 32.0D));
|
List list = this.world.getEntities(this, this.boundingBox.grow(32.0D, 32.0D, 32.0D));
|
||||||
|
|
||||||
for (int j = 0; j < list.size(); ++j) {
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
Entity entity1 = (Entity) list.get(j);
|
Entity entity1 = (Entity) list.get(j);
|
||||||
|
@ -27,12 +27,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
private int cc = -99999999;
|
private int cc = -99999999;
|
||||||
private int cd = -99999999;
|
private int cd = -99999999;
|
||||||
private boolean ce = true;
|
private boolean ce = true;
|
||||||
public int cf = -99999999; // CraftBukkit - priv to pub - "lastSentExp"
|
public int lastSentExp = -99999999; // CraftBukkit - priv to pub
|
||||||
public int cg = 60; // CraftBukkit - private to public; temporary until we get an API out
|
public int cg = 60; // CraftBukkit - private to public; temporary until we get an API out
|
||||||
private ItemStack[] ch = new ItemStack[] { null, null, null, null, null};
|
private ItemStack[] ch = new ItemStack[] { null, null, null, null, null};
|
||||||
private int ci = 0;
|
private int ci = 0;
|
||||||
public boolean h;
|
public boolean h;
|
||||||
public int i;
|
public int ping;
|
||||||
public boolean j = false;
|
public boolean j = false;
|
||||||
|
|
||||||
public EntityPlayer(MinecraftServer minecraftserver, World world, String s, ItemInWorldManager iteminworldmanager) {
|
public EntityPlayer(MinecraftServer minecraftserver, World world, String s, ItemInWorldManager iteminworldmanager) {
|
||||||
@ -70,14 +70,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
public void a(NBTTagCompound nbttagcompound) {
|
public void a(NBTTagCompound nbttagcompound) {
|
||||||
super.a(nbttagcompound);
|
super.a(nbttagcompound);
|
||||||
if (nbttagcompound.hasKey("playerGameType")) {
|
if (nbttagcompound.hasKey("playerGameType")) {
|
||||||
this.itemInWorldManager.a(nbttagcompound.getInt("playerGameType"));
|
this.itemInWorldManager.setGameMode(nbttagcompound.getInt("playerGameType"));
|
||||||
}
|
}
|
||||||
getPlayer().readExtraData(nbttagcompound); // CraftBukkit
|
getPlayer().readExtraData(nbttagcompound); // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
public void b(NBTTagCompound nbttagcompound) {
|
public void b(NBTTagCompound nbttagcompound) {
|
||||||
super.b(nbttagcompound);
|
super.b(nbttagcompound);
|
||||||
nbttagcompound.setInt("playerGameType", this.itemInWorldManager.a());
|
nbttagcompound.setInt("playerGameType", this.itemInWorldManager.getGameMode());
|
||||||
getPlayer().setExtraData(nbttagcompound); // CraftBukkit
|
getPlayer().setExtraData(nbttagcompound); // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,16 +102,16 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
this.setPosition(position.x + 0.5, position.y, position.z + 0.5);
|
this.setPosition(position.x + 0.5, position.y, position.z + 0.5);
|
||||||
}
|
}
|
||||||
this.dimension = ((WorldServer) this.world).dimension;
|
this.dimension = ((WorldServer) this.world).dimension;
|
||||||
int oldMode = itemInWorldManager.a();
|
int oldMode = itemInWorldManager.getGameMode();
|
||||||
this.itemInWorldManager = new ItemInWorldManager((WorldServer) world);
|
this.itemInWorldManager = new ItemInWorldManager((WorldServer) world);
|
||||||
this.itemInWorldManager.player = this;
|
this.itemInWorldManager.player = this;
|
||||||
this.itemInWorldManager.a(oldMode);
|
this.itemInWorldManager.setGameMode(oldMode);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
public void levelDown(int i) {
|
public void levelDown(int i) {
|
||||||
super.levelDown(i);
|
super.levelDown(i);
|
||||||
this.cf = -1;
|
this.lastSentExp = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void syncInventory() {
|
public void syncInventory() {
|
||||||
@ -281,7 +281,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.b.serverConfigurationManager.changeDimension(this, b0);
|
this.b.serverConfigurationManager.changeDimension(this, b0);
|
||||||
this.cf = -1;
|
this.lastSentExp = -1;
|
||||||
this.cc = -1;
|
this.cc = -1;
|
||||||
this.cd = -1;
|
this.cd = -1;
|
||||||
this.a((Statistic) AchievementList.x);
|
this.a((Statistic) AchievementList.x);
|
||||||
@ -311,8 +311,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
this.ce = this.foodData.c() == 0.0F;
|
this.ce = this.foodData.c() == 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.expTotal != this.cf) {
|
if (this.expTotal != this.lastSentExp) {
|
||||||
this.cf = this.expTotal;
|
this.lastSentExp = this.expTotal;
|
||||||
this.netServerHandler.sendPacket(new Packet43SetExperience(this.exp, this.expTotal, this.expLevel));
|
this.netServerHandler.sendPacket(new Packet43SetExperience(this.exp, this.expTotal, this.expLevel));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -334,7 +334,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
// CraftBukkit end */
|
// CraftBukkit end */
|
||||||
|
|
||||||
this.b.serverConfigurationManager.changeDimension(this, 1);
|
this.b.serverConfigurationManager.changeDimension(this, 1);
|
||||||
this.cf = -1;
|
this.lastSentExp = -1;
|
||||||
this.cc = -1;
|
this.cc = -1;
|
||||||
this.cd = -1;
|
this.cd = -1;
|
||||||
}
|
}
|
||||||
@ -646,7 +646,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
this.deathTicks = 0;
|
this.deathTicks = 0;
|
||||||
effects.clear();
|
effects.clear();
|
||||||
this.activeContainer = this.defaultContainer;
|
this.activeContainer = this.defaultContainer;
|
||||||
this.cf = -1; // lastSentExp. Find line: "if (this.expTotal != this.XXXX) {"
|
this.lastSentExp = -1; // lastSentExp. Find line: "if (this.expTotal != this.XXXX) {"
|
||||||
this.giveExp(this.newExp);
|
this.giveExp(this.newExp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public class EntityPotion extends EntityProjectile {
|
|||||||
List list = Item.POTION.b(this.d);
|
List list = Item.POTION.b(this.d);
|
||||||
|
|
||||||
if (list != null && !list.isEmpty()) {
|
if (list != null && !list.isEmpty()) {
|
||||||
AxisAlignedBB axisalignedbb = this.boundingBox.b(4.0D, 2.0D, 4.0D);
|
AxisAlignedBB axisalignedbb = this.boundingBox.grow(4.0D, 2.0D, 4.0D);
|
||||||
List list1 = this.world.a(EntityLiving.class, axisalignedbb);
|
List list1 = this.world.a(EntityLiving.class, axisalignedbb);
|
||||||
|
|
||||||
if (list1 != null && !list1.isEmpty()) {
|
if (list1 != null && !list1.isEmpty()) {
|
||||||
|
@ -125,7 +125,7 @@ public abstract class EntityProjectile extends Entity {
|
|||||||
|
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
Entity entity = null;
|
Entity entity = null;
|
||||||
List list = this.world.b((Entity) this, this.boundingBox.a(this.motX, this.motY, this.motZ).b(1.0D, 1.0D, 1.0D));
|
List list = this.world.getEntities(this, this.boundingBox.a(this.motX, this.motY, this.motZ).grow(1.0D, 1.0D, 1.0D));
|
||||||
double d0 = 0.0D;
|
double d0 = 0.0D;
|
||||||
|
|
||||||
for (int j = 0; j < list.size(); ++j) {
|
for (int j = 0; j < list.size(); ++j) {
|
||||||
@ -133,7 +133,7 @@ public abstract class EntityProjectile extends Entity {
|
|||||||
|
|
||||||
if (entity1.e_() && (entity1 != this.shooter || this.i >= 5)) {
|
if (entity1.e_() && (entity1 != this.shooter || this.i >= 5)) {
|
||||||
float f = 0.3F;
|
float f = 0.3F;
|
||||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
|
AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f);
|
||||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
||||||
|
|
||||||
if (movingobjectposition1 != null) {
|
if (movingobjectposition1 != null) {
|
||||||
|
@ -78,7 +78,7 @@ public class EntitySkeleton extends EntityMonster {
|
|||||||
|
|
||||||
this.world.makeSound(this, "random.bow", 1.0F, 1.0F / (this.random.nextFloat() * 0.4F + 0.8F));
|
this.world.makeSound(this, "random.bow", 1.0F, 1.0F / (this.random.nextFloat() * 0.4F + 0.8F));
|
||||||
this.world.addEntity(entityarrow);
|
this.world.addEntity(entityarrow);
|
||||||
entityarrow.a(d0, d2 + (double) f1, d1, 1.6F, 12.0F);
|
entityarrow.shoot(d0, d2 + (double) f1, d1, 1.6F, 12.0F);
|
||||||
this.attackTicks = 60;
|
this.attackTicks = 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ public class EntitySnowman extends EntityGolem {
|
|||||||
public void d() {
|
public void d() {
|
||||||
super.d();
|
super.d();
|
||||||
if (this.target == null && !this.D() && this.world.random.nextInt(100) == 0) {
|
if (this.target == null && !this.D() && this.world.random.nextInt(100) == 0) {
|
||||||
List list = this.world.a(EntityMonster.class, AxisAlignedBB.b(this.locX, this.locY, this.locZ, this.locX + 1.0D, this.locY + 1.0D, this.locZ + 1.0D).b(16.0D, 4.0D, 16.0D));
|
List list = this.world.a(EntityMonster.class, AxisAlignedBB.b(this.locX, this.locY, this.locZ, this.locX + 1.0D, this.locY + 1.0D, this.locZ + 1.0D).grow(16.0D, 4.0D, 16.0D));
|
||||||
|
|
||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
this.setTarget((Entity) list.get(this.world.random.nextInt(list.size())));
|
this.setTarget((Entity) list.get(this.world.random.nextInt(list.size())));
|
||||||
|
@ -76,7 +76,7 @@ public class EntitySquid extends EntityWaterAnimal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean az() {
|
public boolean az() {
|
||||||
return this.world.a(this.boundingBox.b(0.0D, -0.6000000238418579D, 0.0D), Material.WATER, this);
|
return this.world.a(this.boundingBox.grow(0.0D, -0.6000000238418579D, 0.0D), Material.WATER, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void d() {
|
public void d() {
|
||||||
|
@ -110,7 +110,7 @@ public class EntityWeatherLighting extends EntityWeather {
|
|||||||
|
|
||||||
if (this.lifeTicks >= 0 && !this.isEffect) { // CraftBukkit
|
if (this.lifeTicks >= 0 && !this.isEffect) { // CraftBukkit
|
||||||
double d0 = 3.0D;
|
double d0 = 3.0D;
|
||||||
List list = this.world.b((Entity) this, AxisAlignedBB.b(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + 6.0D + d0, this.locZ + d0));
|
List list = this.world.getEntities(this, AxisAlignedBB.b(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + 6.0D + d0, this.locZ + d0));
|
||||||
|
|
||||||
for (int l = 0; l < list.size(); ++l) {
|
for (int l = 0; l < list.size(); ++l) {
|
||||||
Entity entity = (Entity) list.get(l);
|
Entity entity = (Entity) list.get(l);
|
||||||
|
@ -107,7 +107,7 @@ public class EntityWolf extends EntityAnimal {
|
|||||||
this.setSitting(true);
|
this.setSitting(true);
|
||||||
}
|
}
|
||||||
} else if (this.target == null && !this.D() && !this.isTamed() && this.world.random.nextInt(100) == 0) {
|
} else if (this.target == null && !this.D() && !this.isTamed() && this.world.random.nextInt(100) == 0) {
|
||||||
List list = this.world.a(EntitySheep.class, AxisAlignedBB.b(this.locX, this.locY, this.locZ, this.locX + 1.0D, this.locY + 1.0D, this.locZ + 1.0D).b(16.0D, 4.0D, 16.0D));
|
List list = this.world.a(EntitySheep.class, AxisAlignedBB.b(this.locX, this.locY, this.locZ, this.locX + 1.0D, this.locY + 1.0D, this.locZ + 1.0D).grow(16.0D, 4.0D, 16.0D));
|
||||||
|
|
||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@ -275,7 +275,7 @@ public class EntityWolf extends EntityAnimal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (entity instanceof EntityLiving) {
|
if (entity instanceof EntityLiving) {
|
||||||
List list = this.world.a(EntityWolf.class, AxisAlignedBB.b(this.locX, this.locY, this.locZ, this.locX + 1.0D, this.locY + 1.0D, this.locZ + 1.0D).b(16.0D, 4.0D, 16.0D));
|
List list = this.world.a(EntityWolf.class, AxisAlignedBB.b(this.locX, this.locY, this.locZ, this.locX + 1.0D, this.locY + 1.0D, this.locZ + 1.0D).grow(16.0D, 4.0D, 16.0D));
|
||||||
Iterator iterator = list.iterator();
|
Iterator iterator = list.iterator();
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
|
@ -98,7 +98,7 @@ public class Explosion {
|
|||||||
int l1 = MathHelper.floor(this.posY + (double) this.size + 1.0D);
|
int l1 = MathHelper.floor(this.posY + (double) this.size + 1.0D);
|
||||||
int i2 = MathHelper.floor(this.posZ - (double) this.size - 1.0D);
|
int i2 = MathHelper.floor(this.posZ - (double) this.size - 1.0D);
|
||||||
int j2 = MathHelper.floor(this.posZ + (double) this.size + 1.0D);
|
int j2 = MathHelper.floor(this.posZ + (double) this.size + 1.0D);
|
||||||
List list = this.world.b(this.source, AxisAlignedBB.b((double) i, (double) k, (double) i2, (double) j, (double) l1, (double) j2));
|
List list = this.world.getEntities(this.source, AxisAlignedBB.b((double) i, (double) k, (double) i2, (double) j, (double) l1, (double) j2));
|
||||||
Vec3D vec3d = Vec3D.create(this.posX, this.posY, this.posZ);
|
Vec3D vec3d = Vec3D.create(this.posX, this.posY, this.posZ);
|
||||||
|
|
||||||
for (int k2 = 0; k2 < list.size(); ++k2) {
|
for (int k2 = 0; k2 < list.size(); ++k2) {
|
||||||
@ -243,7 +243,7 @@ public class Explosion {
|
|||||||
// CraftBukkit
|
// CraftBukkit
|
||||||
Block.byId[i1].dropNaturally(this.world, j, k, l, this.world.getData(j, k, l), event.getYield(), 0);
|
Block.byId[i1].dropNaturally(this.world, j, k, l, this.world.getData(j, k, l), event.getYield(), 0);
|
||||||
this.world.setTypeId(j, k, l, 0);
|
this.world.setTypeId(j, k, l, 0);
|
||||||
Block.byId[i1].a_(this.world, j, k, l);
|
Block.byId[i1].wasExploded(this.world, j, k, l);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,14 +39,14 @@ public class ItemBoat extends Item {
|
|||||||
Vec3D vec3d2 = entityhuman.d(f);
|
Vec3D vec3d2 = entityhuman.d(f);
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
float f9 = 1.0F;
|
float f9 = 1.0F;
|
||||||
List list = world.b((Entity) entityhuman, entityhuman.boundingBox.a(vec3d2.a * d3, vec3d2.b * d3, vec3d2.c * d3).b((double) f9, (double) f9, (double) f9));
|
List list = world.getEntities(entityhuman, entityhuman.boundingBox.a(vec3d2.a * d3, vec3d2.b * d3, vec3d2.c * d3).grow((double) f9, (double) f9, (double) f9));
|
||||||
|
|
||||||
for (int i = 0; i < list.size(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
Entity entity = (Entity) list.get(i);
|
Entity entity = (Entity) list.get(i);
|
||||||
|
|
||||||
if (entity.e_()) {
|
if (entity.e_()) {
|
||||||
float f10 = entity.j_();
|
float f10 = entity.j_();
|
||||||
AxisAlignedBB axisalignedbb = entity.boundingBox.b((double) f10, (double) f10, (double) f10);
|
AxisAlignedBB axisalignedbb = entity.boundingBox.grow((double) f10, (double) f10, (double) f10);
|
||||||
|
|
||||||
if (axisalignedbb.a(vec3d)) {
|
if (axisalignedbb.a(vec3d)) {
|
||||||
flag = true;
|
flag = true;
|
||||||
|
@ -36,7 +36,7 @@ public class ItemInWorldManager {
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
public void a(int i) {
|
public void setGameMode(int i) {
|
||||||
this.c = i;
|
this.c = i;
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
this.player.abilities.canFly = false;
|
this.player.abilities.canFly = false;
|
||||||
@ -50,7 +50,7 @@ public class ItemInWorldManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int a() {
|
public int getGameMode() {
|
||||||
return this.c;
|
return this.c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ public class ItemInWorldManager {
|
|||||||
this.c = i;
|
this.c = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.a(this.c);
|
this.setGameMode(this.c);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void c() {
|
public void c() {
|
||||||
|
@ -37,7 +37,7 @@ public class ItemPainting extends Item {
|
|||||||
} else {
|
} else {
|
||||||
EntityPainting entitypainting = new EntityPainting(world, i, j, k, b0);
|
EntityPainting entitypainting = new EntityPainting(world, i, j, k, b0);
|
||||||
|
|
||||||
if (entitypainting.j()) {
|
if (entitypainting.survives()) {
|
||||||
if (!world.isStatic) {
|
if (!world.isStatic) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
Player who = (entityhuman == null) ? null : (Player) entityhuman.getBukkitEntity();
|
Player who = (entityhuman == null) ? null : (Player) entityhuman.getBukkitEntity();
|
||||||
|
@ -12,7 +12,7 @@ public class ItemWorldMap extends ItemWorldMapBase {
|
|||||||
this.e(1);
|
this.e(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldMap a(ItemStack itemstack, World world) {
|
public WorldMap getSavedMap(ItemStack itemstack, World world) {
|
||||||
|
|
||||||
WorldMap worldmap = (WorldMap) world.a(WorldMap.class, "map_" + itemstack.getData());
|
WorldMap worldmap = (WorldMap) world.a(WorldMap.class, "map_" + itemstack.getData());
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ public class ItemWorldMap extends ItemWorldMapBase {
|
|||||||
|
|
||||||
public void a(ItemStack itemstack, World world, Entity entity, int i, boolean flag) {
|
public void a(ItemStack itemstack, World world, Entity entity, int i, boolean flag) {
|
||||||
if (!world.isStatic) {
|
if (!world.isStatic) {
|
||||||
WorldMap worldmap = this.a(itemstack, world);
|
WorldMap worldmap = this.getSavedMap(itemstack, world);
|
||||||
|
|
||||||
if (entity instanceof EntityHuman) {
|
if (entity instanceof EntityHuman) {
|
||||||
EntityHuman entityhuman = (EntityHuman) entity;
|
EntityHuman entityhuman = (EntityHuman) entity;
|
||||||
@ -238,7 +238,7 @@ public class ItemWorldMap extends ItemWorldMapBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Packet c(ItemStack itemstack, World world, EntityHuman entityhuman) {
|
public Packet c(ItemStack itemstack, World world, EntityHuman entityhuman) {
|
||||||
byte[] abyte = this.a(itemstack, world).getUpdatePacket(itemstack, world, entityhuman);
|
byte[] abyte = this.getSavedMap(itemstack, world).getUpdatePacket(itemstack, world, entityhuman);
|
||||||
|
|
||||||
return abyte == null ? null : new Packet131ItemData((short) Item.MAP.id, (short) itemstack.getData(), abyte);
|
return abyte == null ? null : new Packet131ItemData((short) Item.MAP.id, (short) itemstack.getData(), abyte);
|
||||||
}
|
}
|
||||||
|
@ -699,15 +699,15 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
|
|||||||
public void o() {}
|
public void o() {}
|
||||||
|
|
||||||
public String d(String s) {
|
public String d(String s) {
|
||||||
RemoteControlCommandListener.a.a();
|
RemoteControlCommandListener.instance.a();
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
ServerCommandEvent event = new ServerCommandEvent(Event.Type.REMOTE_COMMAND, this.remoteConsole, s);
|
ServerCommandEvent event = new ServerCommandEvent(Event.Type.REMOTE_COMMAND, this.remoteConsole, s);
|
||||||
this.server.getPluginManager().callEvent(event);
|
this.server.getPluginManager().callEvent(event);
|
||||||
ServerCommand servercommand = new ServerCommand(event.getCommand(), RemoteControlCommandListener.a);
|
ServerCommand servercommand = new ServerCommand(event.getCommand(), RemoteControlCommandListener.instance);
|
||||||
// this.consoleCommandHandler.handle(new ServerCommand(s, RemoteControlCommandListener.a)); // CraftBukkit - removed
|
// this.consoleCommandHandler.handle(new ServerCommand(s, RemoteControlCommandListener.instance)); // CraftBukkit - removed
|
||||||
this.server.dispatchCommand(this.remoteConsole, servercommand); // CraftBukkit
|
this.server.dispatchCommand(this.remoteConsole, servercommand); // CraftBukkit
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
return RemoteControlCommandListener.a.b();
|
return RemoteControlCommandListener.instance.b();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDebugging() {
|
public boolean isDebugging() {
|
||||||
|
@ -104,7 +104,7 @@ public class NetLoginHandler extends NetHandler {
|
|||||||
if (maxPlayers > 60) {
|
if (maxPlayers > 60) {
|
||||||
maxPlayers = 60;
|
maxPlayers = 60;
|
||||||
}
|
}
|
||||||
netserverhandler.sendPacket(new Packet1Login("", entityplayer.id, worldserver.getSeed(), entityplayer.itemInWorldManager.a(), (byte) worldserver.worldProvider.dimension, (byte) worldserver.difficulty, (byte) worldserver.height, (byte) maxPlayers));
|
netserverhandler.sendPacket(new Packet1Login("", entityplayer.id, worldserver.getSeed(), entityplayer.itemInWorldManager.getGameMode(), (byte) worldserver.worldProvider.dimension, (byte) worldserver.difficulty, (byte) worldserver.height, (byte) maxPlayers));
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
netserverhandler.sendPacket(new Packet6SpawnPosition(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z));
|
netserverhandler.sendPacket(new Packet6SpawnPosition(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z));
|
||||||
|
@ -323,7 +323,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float f4 = 0.0625F;
|
float f4 = 0.0625F;
|
||||||
boolean flag = worldserver.getEntities(this.player, this.player.boundingBox.clone().shrink((double) f4, (double) f4, (double) f4)).size() == 0;
|
boolean flag = worldserver.a(this.player, this.player.boundingBox.clone().shrink((double) f4, (double) f4, (double) f4)).size() == 0;
|
||||||
|
|
||||||
if (this.player.onGround && !packet10flying.g && d6 > 0.0D) {
|
if (this.player.onGround && !packet10flying.g && d6 > 0.0D) {
|
||||||
this.player.c(0.2F);
|
this.player.c(0.2F);
|
||||||
@ -352,14 +352,14 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.player.setLocation(d1, d2, d3, f2, f3);
|
this.player.setLocation(d1, d2, d3, f2, f3);
|
||||||
boolean flag2 = worldserver.getEntities(this.player, this.player.boundingBox.clone().shrink((double) f4, (double) f4, (double) f4)).size() == 0;
|
boolean flag2 = worldserver.a(this.player, this.player.boundingBox.clone().shrink((double) f4, (double) f4, (double) f4)).size() == 0;
|
||||||
|
|
||||||
if (flag && (flag1 || !flag2) && !this.player.isSleeping()) {
|
if (flag && (flag1 || !flag2) && !this.player.isSleeping()) {
|
||||||
this.a(this.x, this.y, this.z, f2, f3);
|
this.a(this.x, this.y, this.z, f2, f3);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AxisAlignedBB axisalignedbb = this.player.boundingBox.clone().b((double) f4, (double) f4, (double) f4).a(0.0D, -0.55D, 0.0D);
|
AxisAlignedBB axisalignedbb = this.player.boundingBox.clone().grow((double) f4, (double) f4, (double) f4).a(0.0D, -0.55D, 0.0D);
|
||||||
|
|
||||||
if (!this.minecraftServer.allowFlight && !this.player.itemInWorldManager.b() && !worldserver.b(axisalignedbb)) {
|
if (!this.minecraftServer.allowFlight && !this.player.itemInWorldManager.b() && !worldserver.b(axisalignedbb)) {
|
||||||
if (d9 >= -0.03125D) {
|
if (d9 >= -0.03125D) {
|
||||||
@ -1086,7 +1086,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
|||||||
if (packet0keepalive.a == this.i) {
|
if (packet0keepalive.a == this.i) {
|
||||||
int i = (int) (System.nanoTime() / 1000000L - this.j);
|
int i = (int) (System.nanoTime() / 1000000L - this.j);
|
||||||
|
|
||||||
this.player.i = (this.player.i * 3 + i) / 4;
|
this.player.ping = (this.player.ping * 3 + i) / 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ public class Packet51MapChunk extends Packet {
|
|||||||
public int d;
|
public int d;
|
||||||
public int e;
|
public int e;
|
||||||
public int f;
|
public int f;
|
||||||
public byte[] g;
|
public byte[] buffer;
|
||||||
public int h; // CraftBukkit - private -> public
|
public int size; // CraftBukkit - private -> public
|
||||||
public byte[] rawData; // CraftBukkit
|
public byte[] rawData; // CraftBukkit
|
||||||
|
|
||||||
public Packet51MapChunk() {
|
public Packet51MapChunk() {
|
||||||
@ -59,17 +59,17 @@ public class Packet51MapChunk extends Packet {
|
|||||||
this.d = datainputstream.read() + 1;
|
this.d = datainputstream.read() + 1;
|
||||||
this.e = datainputstream.read() + 1;
|
this.e = datainputstream.read() + 1;
|
||||||
this.f = datainputstream.read() + 1;
|
this.f = datainputstream.read() + 1;
|
||||||
this.h = datainputstream.readInt();
|
this.size = datainputstream.readInt();
|
||||||
byte[] abyte = new byte[this.h];
|
byte[] abyte = new byte[this.size];
|
||||||
|
|
||||||
datainputstream.readFully(abyte);
|
datainputstream.readFully(abyte);
|
||||||
this.g = new byte[this.d * this.e * this.f * 5 / 2];
|
this.buffer = new byte[this.d * this.e * this.f * 5 / 2];
|
||||||
Inflater inflater = new Inflater();
|
Inflater inflater = new Inflater();
|
||||||
|
|
||||||
inflater.setInput(abyte);
|
inflater.setInput(abyte);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
inflater.inflate(this.g);
|
inflater.inflate(this.buffer);
|
||||||
} catch (DataFormatException dataformatexception) {
|
} catch (DataFormatException dataformatexception) {
|
||||||
throw new IOException("Bad compressed data format");
|
throw new IOException("Bad compressed data format");
|
||||||
} finally {
|
} finally {
|
||||||
@ -84,8 +84,8 @@ public class Packet51MapChunk extends Packet {
|
|||||||
dataoutputstream.write(this.d - 1);
|
dataoutputstream.write(this.d - 1);
|
||||||
dataoutputstream.write(this.e - 1);
|
dataoutputstream.write(this.e - 1);
|
||||||
dataoutputstream.write(this.f - 1);
|
dataoutputstream.write(this.f - 1);
|
||||||
dataoutputstream.writeInt(this.h);
|
dataoutputstream.writeInt(this.size);
|
||||||
dataoutputstream.write(this.g, 0, this.h);
|
dataoutputstream.write(this.buffer, 0, this.size);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(NetHandler nethandler) {
|
public void a(NetHandler nethandler) {
|
||||||
@ -93,6 +93,6 @@ public class Packet51MapChunk extends Packet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int a() {
|
public int a() {
|
||||||
return 17 + this.h;
|
return 17 + this.size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ public class ServerConfigurationManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void b(EntityPlayer entityplayer) {
|
public void b(EntityPlayer entityplayer) {
|
||||||
this.playerFileData.b(entityplayer);
|
this.playerFileData.load(entityplayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void c(EntityPlayer entityplayer) {
|
public void c(EntityPlayer entityplayer) {
|
||||||
@ -120,7 +120,7 @@ public class ServerConfigurationManager {
|
|||||||
|
|
||||||
worldserver.chunkProviderServer.getChunkAt((int) entityplayer.locX >> 4, (int) entityplayer.locZ >> 4);
|
worldserver.chunkProviderServer.getChunkAt((int) entityplayer.locX >> 4, (int) entityplayer.locZ >> 4);
|
||||||
|
|
||||||
while (worldserver.getEntities(entityplayer, entityplayer.boundingBox).size() != 0) {
|
while (worldserver.a(entityplayer, entityplayer.boundingBox).size() != 0) {
|
||||||
entityplayer.setPosition(entityplayer.locX, entityplayer.locY + 1.0D, entityplayer.locZ);
|
entityplayer.setPosition(entityplayer.locX, entityplayer.locY + 1.0D, entityplayer.locZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ public class ServerConfigurationManager {
|
|||||||
EntityPlayer entityplayer1 = (EntityPlayer) this.players.get(i);
|
EntityPlayer entityplayer1 = (EntityPlayer) this.players.get(i);
|
||||||
|
|
||||||
// CraftBukkit start - .name -> .listName
|
// CraftBukkit start - .name -> .listName
|
||||||
entityplayer.netServerHandler.sendPacket(new Packet201PlayerInfo(entityplayer1.listName, true, entityplayer1.i));
|
entityplayer.netServerHandler.sendPacket(new Packet201PlayerInfo(entityplayer1.listName, true, entityplayer1.ping));
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -161,7 +161,7 @@ public class ServerConfigurationManager {
|
|||||||
this.cserver.getPluginManager().callEvent(playerQuitEvent);
|
this.cserver.getPluginManager().callEvent(playerQuitEvent);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
this.playerFileData.a(entityplayer);
|
this.playerFileData.save(entityplayer);
|
||||||
this.server.getWorldServer(entityplayer.dimension).kill(entityplayer);
|
this.server.getWorldServer(entityplayer.dimension).kill(entityplayer);
|
||||||
this.players.remove(entityplayer);
|
this.players.remove(entityplayer);
|
||||||
this.getPlayerManager(entityplayer.dimension).removePlayer(entityplayer);
|
this.getPlayerManager(entityplayer.dimension).removePlayer(entityplayer);
|
||||||
@ -272,13 +272,13 @@ public class ServerConfigurationManager {
|
|||||||
|
|
||||||
worldserver.chunkProviderServer.getChunkAt((int) entityplayer1.locX >> 4, (int) entityplayer1.locZ >> 4);
|
worldserver.chunkProviderServer.getChunkAt((int) entityplayer1.locX >> 4, (int) entityplayer1.locZ >> 4);
|
||||||
|
|
||||||
while (worldserver.getEntities(entityplayer1, entityplayer1.boundingBox).size() != 0) {
|
while (worldserver.a(entityplayer1, entityplayer1.boundingBox).size() != 0) {
|
||||||
entityplayer1.setPosition(entityplayer1.locX, entityplayer1.locY + 1.0D, entityplayer1.locZ);
|
entityplayer1.setPosition(entityplayer1.locX, entityplayer1.locY + 1.0D, entityplayer1.locZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
byte actualDimension = (byte) (worldserver.getWorld().getEnvironment().getId());
|
byte actualDimension = (byte) (worldserver.getWorld().getEnvironment().getId());
|
||||||
entityplayer1.netServerHandler.sendPacket(new Packet9Respawn(actualDimension, (byte) worldserver.difficulty, worldserver.getSeed(), worldserver.height, entityplayer1.itemInWorldManager.a()));
|
entityplayer1.netServerHandler.sendPacket(new Packet9Respawn(actualDimension, (byte) worldserver.difficulty, worldserver.getSeed(), worldserver.height, entityplayer1.itemInWorldManager.getGameMode()));
|
||||||
entityplayer1.spawnIn(worldserver);
|
entityplayer1.spawnIn(worldserver);
|
||||||
entityplayer1.dead = false;
|
entityplayer1.dead = false;
|
||||||
entityplayer1.netServerHandler.teleport(new Location(worldserver.getWorld(), entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch));
|
entityplayer1.netServerHandler.teleport(new Location(worldserver.getWorld(), entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch));
|
||||||
@ -671,7 +671,7 @@ public class ServerConfigurationManager {
|
|||||||
|
|
||||||
public void savePlayers() {
|
public void savePlayers() {
|
||||||
for (int i = 0; i < this.players.size(); ++i) {
|
for (int i = 0; i < this.players.size(); ++i) {
|
||||||
this.playerFileData.a((EntityHuman) this.players.get(i));
|
this.playerFileData.save((EntityHuman) this.players.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -705,7 +705,7 @@ public class ServerConfigurationManager {
|
|||||||
public void updateClient(EntityPlayer entityplayer) {
|
public void updateClient(EntityPlayer entityplayer) {
|
||||||
entityplayer.updateInventory(entityplayer.defaultContainer);
|
entityplayer.updateInventory(entityplayer.defaultContainer);
|
||||||
entityplayer.s_();
|
entityplayer.s_();
|
||||||
entityplayer.cf = -1; // CraftBukkit
|
entityplayer.lastSentExp = -1; // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getPlayerCount() {
|
public int getPlayerCount() {
|
||||||
|
@ -197,7 +197,7 @@ public final class SpawnerCreature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void a(World world, BiomeBase biomebase, int i, int j, int k, int l, Random random) {
|
public static void a(World world, BiomeBase biomebase, int i, int j, int k, int l, Random random) {
|
||||||
List list = biomebase.a(EnumCreatureType.CREATURE);
|
List list = biomebase.getMobs(EnumCreatureType.CREATURE);
|
||||||
|
|
||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
while (random.nextFloat() < biomebase.d()) {
|
while (random.nextFloat() < biomebase.d()) {
|
||||||
|
@ -63,7 +63,7 @@ public class TileEntityMobSpawner extends TileEntity {
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
int j = this.world.a(entityliving.getClass(), AxisAlignedBB.b((double) this.x, (double) this.y, (double) this.z, (double) (this.x + 1), (double) (this.y + 1), (double) (this.z + 1)).b(8.0D, 4.0D, 8.0D)).size();
|
int j = this.world.a(entityliving.getClass(), AxisAlignedBB.b((double) this.x, (double) this.y, (double) this.z, (double) (this.x + 1), (double) (this.y + 1), (double) (this.z + 1)).grow(8.0D, 4.0D, 8.0D)).size();
|
||||||
|
|
||||||
if (j >= 6) {
|
if (j >= 6) {
|
||||||
this.e();
|
this.e();
|
||||||
|
@ -59,7 +59,7 @@ public class TileEntityPiston extends TileEntity {
|
|||||||
AxisAlignedBB axisalignedbb = Block.PISTON_MOVING.b(this.world, this.x, this.y, this.z, this.a, f, this.c);
|
AxisAlignedBB axisalignedbb = Block.PISTON_MOVING.b(this.world, this.x, this.y, this.z, this.a, f, this.c);
|
||||||
|
|
||||||
if (axisalignedbb != null) {
|
if (axisalignedbb != null) {
|
||||||
List list = this.world.b((Entity) null, axisalignedbb);
|
List list = this.world.getEntities(null, axisalignedbb);
|
||||||
|
|
||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
h.addAll(list);
|
h.addAll(list);
|
||||||
|
@ -960,7 +960,7 @@ public class World implements IBlockAccess {
|
|||||||
this.z.add(iworldaccess);
|
this.z.add(iworldaccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List getEntities(Entity entity, AxisAlignedBB axisalignedbb) {
|
public List a(Entity entity, AxisAlignedBB axisalignedbb) {
|
||||||
this.R.clear();
|
this.R.clear();
|
||||||
int i = MathHelper.floor(axisalignedbb.a);
|
int i = MathHelper.floor(axisalignedbb.a);
|
||||||
int j = MathHelper.floor(axisalignedbb.d + 1.0D);
|
int j = MathHelper.floor(axisalignedbb.d + 1.0D);
|
||||||
@ -984,7 +984,7 @@ public class World implements IBlockAccess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
double d0 = 0.25D;
|
double d0 = 0.25D;
|
||||||
List list = this.b(entity, axisalignedbb.b(d0, d0, d0));
|
List list = this.getEntities(entity, axisalignedbb.grow(d0, d0, d0));
|
||||||
|
|
||||||
for (int j2 = 0; j2 < list.size(); ++j2) {
|
for (int j2 = 0; j2 < list.size(); ++j2) {
|
||||||
AxisAlignedBB axisalignedbb1 = ((Entity) list.get(j2)).h_();
|
AxisAlignedBB axisalignedbb1 = ((Entity) list.get(j2)).h_();
|
||||||
@ -1305,7 +1305,7 @@ public class World implements IBlockAccess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean containsEntity(AxisAlignedBB axisalignedbb) {
|
public boolean containsEntity(AxisAlignedBB axisalignedbb) {
|
||||||
List list = this.b((Entity) null, axisalignedbb);
|
List list = this.getEntities(null, axisalignedbb);
|
||||||
|
|
||||||
for (int i = 0; i < list.size(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
Entity entity = (Entity) list.get(i);
|
Entity entity = (Entity) list.get(i);
|
||||||
@ -2356,7 +2356,7 @@ public class World implements IBlockAccess {
|
|||||||
return arraylist;
|
return arraylist;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List b(Entity entity, AxisAlignedBB axisalignedbb) {
|
public List getEntities(Entity entity, AxisAlignedBB axisalignedbb) {
|
||||||
this.V.clear();
|
this.V.clear();
|
||||||
int i = MathHelper.floor((axisalignedbb.a - 2.0D) / 16.0D);
|
int i = MathHelper.floor((axisalignedbb.a - 2.0D) / 16.0D);
|
||||||
int j = MathHelper.floor((axisalignedbb.d + 2.0D) / 16.0D);
|
int j = MathHelper.floor((axisalignedbb.d + 2.0D) / 16.0D);
|
||||||
@ -2802,7 +2802,7 @@ public class World implements IBlockAccess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public WorldMapBase a(Class oclass, String s) {
|
public WorldMapBase a(Class oclass, String s) {
|
||||||
return this.worldMaps.a(oclass, s);
|
return this.worldMaps.get(oclass, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int b(String s) {
|
public int b(String s) {
|
||||||
@ -2833,13 +2833,13 @@ public class World implements IBlockAccess {
|
|||||||
public void a(EnumSkyBlock enumskyblock, int i, int j, int k, int l, int i1, int j1) {}
|
public void a(EnumSkyBlock enumskyblock, int i, int j, int k, int l, int i1, int j1) {}
|
||||||
|
|
||||||
public BiomeMeta a(EnumCreatureType enumcreaturetype, int i, int j, int k) {
|
public BiomeMeta a(EnumCreatureType enumcreaturetype, int i, int j, int k) {
|
||||||
List list = this.p().a(enumcreaturetype, i, j, k);
|
List list = this.p().getMobsFor(enumcreaturetype, i, j, k);
|
||||||
|
|
||||||
return list != null && !list.isEmpty() ? (BiomeMeta) WeightedRandom.a(this.random, (Collection) list) : null;
|
return list != null && !list.isEmpty() ? (BiomeMeta) WeightedRandom.a(this.random, (Collection) list) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChunkPosition b(String s, int i, int j, int k) {
|
public ChunkPosition b(String s, int i, int j, int k) {
|
||||||
return this.p().a(this, s, i, j, k);
|
return this.p().findNearestMapFeature(this, s, i, j, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
|
@ -180,7 +180,7 @@ public class WorldNBTStorage implements PlayerFileData, IDataManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(EntityHuman entityhuman) {
|
public void save(EntityHuman entityhuman) {
|
||||||
try {
|
try {
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ public class WorldNBTStorage implements PlayerFileData, IDataManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void b(EntityHuman entityhuman) {
|
public void load(EntityHuman entityhuman) {
|
||||||
NBTTagCompound nbttagcompound = this.getPlayerData(entityhuman.name);
|
NBTTagCompound nbttagcompound = this.getPlayerData(entityhuman.name);
|
||||||
|
|
||||||
if (nbttagcompound != null) {
|
if (nbttagcompound != null) {
|
||||||
|
@ -57,7 +57,7 @@ public final class ChunkCompressionThread implements Runnable {
|
|||||||
Packet51MapChunk packet = (Packet51MapChunk) queuedPacket.packet;
|
Packet51MapChunk packet = (Packet51MapChunk) queuedPacket.packet;
|
||||||
|
|
||||||
// If 'packet.g' is set then this packet has already been compressed.
|
// If 'packet.g' is set then this packet has already been compressed.
|
||||||
if (packet.g != null) {
|
if (packet.buffer != null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,9 +76,9 @@ public final class ChunkCompressionThread implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// copy compressed data to packet
|
// copy compressed data to packet
|
||||||
packet.g = new byte[size];
|
packet.buffer = new byte[size];
|
||||||
packet.h = size;
|
packet.size = size;
|
||||||
System.arraycopy(deflateBuffer, 0, packet.g, 0, size);
|
System.arraycopy(deflateBuffer, 0, packet.buffer, 0, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendToNetworkQueue(QueuedPacket queuedPacket) {
|
private void sendToNetworkQueue(QueuedPacket queuedPacket) {
|
||||||
|
@ -148,7 +148,7 @@ public class CraftChunk implements Chunk {
|
|||||||
|
|
||||||
if (includeBiome) {
|
if (includeBiome) {
|
||||||
biome = new BiomeBase[256];
|
biome = new BiomeBase[256];
|
||||||
wcm.a(biome, x << 4, z << 4, 16, 16);
|
wcm.getBiomeBlock(biome, x << 4, z << 4, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (includeBiomeTempRain) {
|
if (includeBiomeTempRain) {
|
||||||
@ -205,7 +205,7 @@ public class CraftChunk implements Chunk {
|
|||||||
|
|
||||||
if (includeBiome) {
|
if (includeBiome) {
|
||||||
biome = new BiomeBase[256];
|
biome = new BiomeBase[256];
|
||||||
wcm.a(biome, x << 4, z << 4, 16, 16);
|
wcm.getBiomeBlock(biome, x << 4, z << 4, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (includeBiomeTempRain) {
|
if (includeBiomeTempRain) {
|
||||||
|
@ -783,7 +783,7 @@ public final class CraftServer implements Server {
|
|||||||
|
|
||||||
public CraftMapView getMap(short id) {
|
public CraftMapView getMap(short id) {
|
||||||
WorldMapCollection collection = console.worlds.get(0).worldMaps;
|
WorldMapCollection collection = console.worlds.get(0).worldMaps;
|
||||||
WorldMap worldmap = (WorldMap) collection.a(WorldMap.class, "map_" + id);
|
WorldMap worldmap = (WorldMap) collection.get(WorldMap.class, "map_" + id);
|
||||||
if (worldmap == null) {
|
if (worldmap == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -792,7 +792,7 @@ public final class CraftServer implements Server {
|
|||||||
|
|
||||||
public CraftMapView createMap(World world) {
|
public CraftMapView createMap(World world) {
|
||||||
ItemStack stack = new ItemStack(Item.MAP, 1, -1);
|
ItemStack stack = new ItemStack(Item.MAP, 1, -1);
|
||||||
WorldMap worldmap = Item.MAP.a(stack, ((CraftWorld) world).getHandle());
|
WorldMap worldmap = Item.MAP.getSavedMap(stack, ((CraftWorld) world).getHandle());
|
||||||
return worldmap.mapView;
|
return worldmap.mapView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ public class CraftWorld implements World {
|
|||||||
EntityArrow arrow = new EntityArrow(world);
|
EntityArrow arrow = new EntityArrow(world);
|
||||||
arrow.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), 0, 0);
|
arrow.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), 0, 0);
|
||||||
world.addEntity(arrow);
|
world.addEntity(arrow);
|
||||||
arrow.a(velocity.getX(), velocity.getY(), velocity.getZ(), speed, spread);
|
arrow.shoot(velocity.getX(), velocity.getY(), velocity.getZ(), speed, spread);
|
||||||
return (Arrow) arrow.getBukkitEntity();
|
return (Arrow) arrow.getBukkitEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -802,7 +802,7 @@ public class CraftWorld implements World {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
entity = new EntityPainting(world, (int) x, (int) y, (int) z, dir);
|
entity = new EntityPainting(world, (int) x, (int) y, (int) z, dir);
|
||||||
if (!((EntityPainting) entity).j()) {
|
if (!((EntityPainting) entity).survives()) {
|
||||||
entity = null;
|
entity = null;
|
||||||
}
|
}
|
||||||
} else if (TNTPrimed.class.isAssignableFrom(clazz)) {
|
} else if (TNTPrimed.class.isAssignableFrom(clazz)) {
|
||||||
@ -917,6 +917,6 @@ public class CraftWorld implements World {
|
|||||||
block.setType(org.bukkit.Material.AIR);
|
block.setType(org.bukkit.Material.AIR);
|
||||||
// not sure what this does, seems to have something to do with the 'base' material of a block.
|
// not sure what this does, seems to have something to do with the 'base' material of a block.
|
||||||
// For example, WOODEN_STAIRS does something with WOOD in this method
|
// For example, WOODEN_STAIRS does something with WOOD in this method
|
||||||
net.minecraft.server.Block.byId[blockId].a_(this.world, blockX, blockY, blockZ);
|
net.minecraft.server.Block.byId[blockId].wasExploded(this.world, blockX, blockY, blockZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -325,7 +325,7 @@ public class CraftBlock implements Block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PistonMoveReaction getPistonMoveReaction() {
|
public PistonMoveReaction getPistonMoveReaction() {
|
||||||
return PistonMoveReaction.getById(net.minecraft.server.Block.byId[this.getTypeId()].material.l());
|
return PistonMoveReaction.getById(net.minecraft.server.Block.byId[this.getTypeId()].material.getPushReaction());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,14 +21,14 @@ public class CraftJukebox extends CraftBlockState implements Jukebox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Material getPlaying() {
|
public Material getPlaying() {
|
||||||
return Material.getMaterial(jukebox.a);
|
return Material.getMaterial(jukebox.record);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPlaying(Material record) {
|
public void setPlaying(Material record) {
|
||||||
if (record == null) {
|
if (record == null) {
|
||||||
record = Material.AIR;
|
record = Material.AIR;
|
||||||
}
|
}
|
||||||
jukebox.a = record.getId();
|
jukebox.record = record.getId();
|
||||||
jukebox.update();
|
jukebox.update();
|
||||||
if (record == Material.AIR) {
|
if (record == Material.AIR) {
|
||||||
world.getHandle().setData(getX(), getY(), getZ(), 0);
|
world.getHandle().setData(getX(), getY(), getZ(), 0);
|
||||||
@ -44,7 +44,7 @@ public class CraftJukebox extends CraftBlockState implements Jukebox {
|
|||||||
|
|
||||||
public boolean eject() {
|
public boolean eject() {
|
||||||
boolean result = isPlaying();
|
boolean result = isPlaying();
|
||||||
((BlockJukeBox)net.minecraft.server.Block.JUKEBOX).c_(world.getHandle(), getX(), getY(), getZ());
|
((BlockJukeBox)net.minecraft.server.Block.JUKEBOX).dropRecord(world.getHandle(), getX(), getY(), getZ());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ public class CraftRemoteConsoleCommandSender extends ServerCommandSender impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void sendMessage(String message) {
|
public void sendMessage(String message) {
|
||||||
RemoteControlCommandListener.a.sendMessage(message + "\n"); // Send a newline after each message, to preserve formatting.
|
RemoteControlCommandListener.instance.sendMessage(message + "\n"); // Send a newline after each message, to preserve formatting.
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package org.bukkit.craftbukkit.entity;
|
package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
import net.minecraft.server.Entity;
|
|
||||||
import net.minecraft.server.EntityComplexPart;
|
import net.minecraft.server.EntityComplexPart;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.entity.ComplexEntityPart;
|
import org.bukkit.entity.ComplexEntityPart;
|
||||||
@ -12,7 +11,7 @@ public class CraftComplexPart extends CraftEntity implements ComplexEntityPart {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ComplexLivingEntity getParent() {
|
public ComplexLivingEntity getParent() {
|
||||||
return (ComplexLivingEntity) getHandle().a.getBukkitEntity();
|
return (ComplexLivingEntity) getHandle().owner.getBukkitEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -5,7 +5,6 @@ import com.google.common.collect.ImmutableSet.Builder;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import net.minecraft.server.EntityComplexPart;
|
import net.minecraft.server.EntityComplexPart;
|
||||||
import net.minecraft.server.EntityEnderDragon;
|
import net.minecraft.server.EntityEnderDragon;
|
||||||
import net.minecraft.server.EntityLiving;
|
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.entity.ComplexEntityPart;
|
import org.bukkit.entity.ComplexEntityPart;
|
||||||
import org.bukkit.entity.EnderDragon;
|
import org.bukkit.entity.EnderDragon;
|
||||||
@ -18,7 +17,7 @@ public class CraftEnderDragon extends CraftComplexLivingEntity implements EnderD
|
|||||||
public Set<ComplexEntityPart> getParts() {
|
public Set<ComplexEntityPart> getParts() {
|
||||||
Builder<ComplexEntityPart> builder = ImmutableSet.builder();
|
Builder<ComplexEntityPart> builder = ImmutableSet.builder();
|
||||||
|
|
||||||
for (EntityComplexPart part : getHandle().f) {
|
for (EntityComplexPart part : getHandle().children) {
|
||||||
builder.add((ComplexEntityPart) part.getBukkitEntity());
|
builder.add((ComplexEntityPart) part.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|||||||
}
|
}
|
||||||
else if (entity instanceof EntityComplexPart) {
|
else if (entity instanceof EntityComplexPart) {
|
||||||
EntityComplexPart part = (EntityComplexPart) entity;
|
EntityComplexPart part = (EntityComplexPart) entity;
|
||||||
if (part.a instanceof EntityEnderDragon) { return new CraftEnderDragonPart(server, (EntityComplexPart) entity); }
|
if (part.owner instanceof EntityEnderDragon) { return new CraftEnderDragonPart(server, (EntityComplexPart) entity); }
|
||||||
else { return new CraftComplexPart(server, (EntityComplexPart) entity); }
|
else { return new CraftComplexPart(server, (EntityComplexPart) entity); }
|
||||||
}
|
}
|
||||||
else if (entity instanceof EntityExperienceOrb) { return new CraftExperienceOrb(server, (EntityExperienceOrb) entity); }
|
else if (entity instanceof EntityExperienceOrb) { return new CraftExperienceOrb(server, (EntityExperienceOrb) entity); }
|
||||||
@ -173,7 +173,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|||||||
|
|
||||||
public List<org.bukkit.entity.Entity> getNearbyEntities(double x, double y, double z) {
|
public List<org.bukkit.entity.Entity> getNearbyEntities(double x, double y, double z) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<Entity> notchEntityList = entity.world.b(entity, entity.boundingBox.b(x, y, z));
|
List<Entity> notchEntityList = entity.world.getEntities(entity, entity.boundingBox.grow(x, y, z));
|
||||||
List<org.bukkit.entity.Entity> bukkitEntityList = new java.util.ArrayList<org.bukkit.entity.Entity>(notchEntityList.size());
|
List<org.bukkit.entity.Entity> bukkitEntityList = new java.util.ArrayList<org.bukkit.entity.Entity>(notchEntityList.size());
|
||||||
|
|
||||||
for (Entity e: notchEntityList) {
|
for (Entity e: notchEntityList) {
|
||||||
|
@ -25,7 +25,6 @@ import java.util.HashSet;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import net.minecraft.server.DamageSource;
|
import net.minecraft.server.DamageSource;
|
||||||
import net.minecraft.server.EntityHuman;
|
|
||||||
import org.bukkit.entity.HumanEntity;
|
import org.bukkit.entity.HumanEntity;
|
||||||
|
|
||||||
public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||||
@ -227,6 +226,6 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Player getKiller() {
|
public Player getKiller() {
|
||||||
return getHandle().aF == null ? null : (Player)getHandle().aF.getBukkitEntity();
|
return getHandle().killer == null ? null : (Player)getHandle().killer.getBukkitEntity();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ public class CraftPainting extends CraftEntity implements Painting {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Art getArt() {
|
public Art getArt() {
|
||||||
EnumArt art = getHandle().e;
|
EnumArt art = getHandle().art;
|
||||||
return CraftArt.NotchToBukkit(art);
|
return CraftArt.NotchToBukkit(art);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,14 +31,14 @@ public class CraftPainting extends CraftEntity implements Painting {
|
|||||||
|
|
||||||
public boolean setArt(Art art, boolean force) {
|
public boolean setArt(Art art, boolean force) {
|
||||||
EntityPainting painting = this.getHandle();
|
EntityPainting painting = this.getHandle();
|
||||||
EnumArt oldArt = painting.e;
|
EnumArt oldArt = painting.art;
|
||||||
EnumArt newArt = CraftArt.BukkitToNotch(art);
|
EnumArt newArt = CraftArt.BukkitToNotch(art);
|
||||||
painting.e = newArt;
|
painting.art = newArt;
|
||||||
painting.b(painting.a);
|
painting.setDirection(painting.direction);
|
||||||
if (!force && !painting.j()) {
|
if (!force && !painting.survives()) {
|
||||||
// Revert painting since it doesn't fit
|
// Revert painting since it doesn't fit
|
||||||
painting.e = oldArt;
|
painting.art = oldArt;
|
||||||
painting.b(painting.a);
|
painting.setDirection(painting.direction);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.update();
|
this.update();
|
||||||
@ -56,31 +56,31 @@ public class CraftPainting extends CraftEntity implements Painting {
|
|||||||
public boolean setFacingDirection(BlockFace face, boolean force) {
|
public boolean setFacingDirection(BlockFace face, boolean force) {
|
||||||
Block block = getLocation().getBlock().getRelative(getAttachedFace()).getRelative(face.getOppositeFace()).getRelative(getFacing());
|
Block block = getLocation().getBlock().getRelative(getAttachedFace()).getRelative(face.getOppositeFace()).getRelative(getFacing());
|
||||||
EntityPainting painting = getHandle();
|
EntityPainting painting = getHandle();
|
||||||
int x = painting.b, y = painting.c, z = painting.d, dir = painting.a;
|
int x = painting.x, y = painting.y, z = painting.z, dir = painting.direction;
|
||||||
painting.b = block.getX();
|
painting.x = block.getX();
|
||||||
painting.c = block.getY();
|
painting.y = block.getY();
|
||||||
painting.d = block.getZ();
|
painting.z = block.getZ();
|
||||||
switch (face) {
|
switch (face) {
|
||||||
case EAST:
|
case EAST:
|
||||||
default:
|
default:
|
||||||
getHandle().b(0);
|
getHandle().setDirection(0);
|
||||||
break;
|
break;
|
||||||
case NORTH:
|
case NORTH:
|
||||||
getHandle().b(1);
|
getHandle().setDirection(1);
|
||||||
break;
|
break;
|
||||||
case WEST:
|
case WEST:
|
||||||
getHandle().b(2);
|
getHandle().setDirection(2);
|
||||||
break;
|
break;
|
||||||
case SOUTH:
|
case SOUTH:
|
||||||
getHandle().b(3);
|
getHandle().setDirection(3);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!force && !painting.j()) {
|
if (!force && !painting.survives()) {
|
||||||
// Revert painting since it doesn't fit
|
// Revert painting since it doesn't fit
|
||||||
painting.b = x;
|
painting.x = x;
|
||||||
painting.c = y;
|
painting.y = y;
|
||||||
painting.d = z;
|
painting.z = z;
|
||||||
painting.b(dir);
|
painting.setDirection(dir);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.update();
|
this.update();
|
||||||
@ -88,7 +88,7 @@ public class CraftPainting extends CraftEntity implements Painting {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BlockFace getFacing() {
|
public BlockFace getFacing() {
|
||||||
switch (this.getHandle().a) {
|
switch (this.getHandle().direction) {
|
||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
return BlockFace.EAST;
|
return BlockFace.EAST;
|
||||||
@ -104,11 +104,11 @@ public class CraftPainting extends CraftEntity implements Painting {
|
|||||||
private void update() {
|
private void update() {
|
||||||
WorldServer world = ((CraftWorld)getWorld()).getHandle();
|
WorldServer world = ((CraftWorld)getWorld()).getHandle();
|
||||||
EntityPainting painting = new EntityPainting(world);
|
EntityPainting painting = new EntityPainting(world);
|
||||||
painting.b = getHandle().b;
|
painting.x = getHandle().x;
|
||||||
painting.c = getHandle().c;
|
painting.y = getHandle().y;
|
||||||
painting.d = getHandle().d;
|
painting.z = getHandle().z;
|
||||||
painting.e = getHandle().e;
|
painting.art = getHandle().art;
|
||||||
painting.b(getHandle().a);
|
painting.setDirection(getHandle().direction);
|
||||||
getHandle().die();
|
getHandle().die();
|
||||||
getHandle().velocityChanged = true; // because this occurs when the painting is broken, so it might be important
|
getHandle().velocityChanged = true; // because this occurs when the painting is broken, so it might be important
|
||||||
world.addEntity(painting);
|
world.addEntity(painting);
|
||||||
|
@ -161,7 +161,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
|
|
||||||
// Change the name on the client side
|
// Change the name on the client side
|
||||||
server.getHandle().sendAll(new Packet201PlayerInfo(oldName, false, 9999));
|
server.getHandle().sendAll(new Packet201PlayerInfo(oldName, false, 9999));
|
||||||
server.getHandle().sendAll(new Packet201PlayerInfo(name, true, getHandle().i));
|
server.getHandle().sendAll(new Packet201PlayerInfo(name, true, getHandle().ping));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -335,11 +335,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void loadData() {
|
public void loadData() {
|
||||||
server.getHandle().playerFileData.b(getHandle());
|
server.getHandle().playerFileData.load(getHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveData() {
|
public void saveData() {
|
||||||
server.getHandle().playerFileData.a(getHandle());
|
server.getHandle().playerFileData.save(getHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateInventory() {
|
public void updateInventory() {
|
||||||
@ -459,14 +459,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getHandle().itemInWorldManager.a(mode.getValue());
|
getHandle().itemInWorldManager.setGameMode(mode.getValue());
|
||||||
getHandle().netServerHandler.sendPacket(new Packet70Bed(3, mode.getValue()));
|
getHandle().netServerHandler.sendPacket(new Packet70Bed(3, mode.getValue()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GameMode getGameMode() {
|
public GameMode getGameMode() {
|
||||||
return GameMode.getByValue(getHandle().itemInWorldManager.a());
|
return GameMode.getByValue(getHandle().itemInWorldManager.getGameMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void giveExp(int exp) {
|
public void giveExp(int exp) {
|
||||||
@ -497,7 +497,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
|
|
||||||
public void setLevel(int level) {
|
public void setLevel(int level) {
|
||||||
getHandle().expLevel = level;
|
getHandle().expLevel = level;
|
||||||
getHandle().cf = -1;
|
getHandle().lastSentExp = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTotalExperience() {
|
public int getTotalExperience() {
|
||||||
@ -506,7 +506,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
|
|
||||||
public void setTotalExperience(int exp) {
|
public void setTotalExperience(int exp) {
|
||||||
getHandle().expTotal = exp;
|
getHandle().expTotal = exp;
|
||||||
getHandle().cf = -1;
|
getHandle().lastSentExp = -1;
|
||||||
|
|
||||||
if (getTotalExperience() > getExperience()) {
|
if (getTotalExperience() > getExperience()) {
|
||||||
getHandle().expTotal = getTotalExperience();
|
getHandle().expTotal = getTotalExperience();
|
||||||
|
@ -78,19 +78,19 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
|
|||||||
return generator.getDefaultPopulators(world);
|
return generator.getDefaultPopulators(world);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List a(EnumCreatureType type, int x, int y, int z) {
|
public List getMobsFor(EnumCreatureType type, int x, int y, int z) {
|
||||||
WorldChunkManager worldchunkmanager = world.getWorldChunkManager();
|
WorldChunkManager worldchunkmanager = world.getWorldChunkManager();
|
||||||
|
|
||||||
if (worldchunkmanager == null) {
|
if (worldchunkmanager == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
BiomeBase biomebase = worldchunkmanager.a(new ChunkCoordIntPair(x >> 4, z >> 4));
|
BiomeBase biomebase = worldchunkmanager.getBiome(new ChunkCoordIntPair(x >> 4, z >> 4));
|
||||||
|
|
||||||
return biomebase == null ? null : biomebase.a(type);
|
return biomebase == null ? null : biomebase.getMobs(type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChunkPosition a(World world, String type, int x, int y, int z) {
|
public ChunkPosition findNearestMapFeature(World world, String type, int x, int y, int z) {
|
||||||
return "Stronghold".equals(type) && this.strongholdGen != null ? this.strongholdGen.a(world, x, y, z) : null;
|
return "Stronghold".equals(type) && this.strongholdGen != null ? this.strongholdGen.getNearestGeneratedFeature(world, x, y, z) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,11 +59,11 @@ public class NormalChunkGenerator extends InternalChunkGenerator {
|
|||||||
return provider.canSave();
|
return provider.canSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List a(EnumCreatureType ect, int i, int i1, int i2) {
|
public List getMobsFor(EnumCreatureType ect, int i, int i1, int i2) {
|
||||||
return provider.a(ect, i, i1, i2);
|
return provider.getMobsFor(ect, i, i1, i2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChunkPosition a(World world, String string, int i, int i1, int i2) {
|
public ChunkPosition findNearestMapFeature(World world, String string, int i, int i1, int i2) {
|
||||||
return provider.a(world, string, i, i1, i2);
|
return provider.findNearestMapFeature(world, string, i, i1, i2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public final class CraftMapView implements MapView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public short getId() {
|
public short getId() {
|
||||||
String text = worldMap.a;
|
String text = worldMap.id;
|
||||||
if (text.startsWith("map_")) {
|
if (text.startsWith("map_")) {
|
||||||
try {
|
try {
|
||||||
return Short.parseShort(text.substring("map_".length()));
|
return Short.parseShort(text.substring("map_".length()));
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren