Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 20:40:07 +01:00
Update CraftBukkit to Minecraft 1.4.4.
Dieser Commit ist enthalten in:
Ursprung
a0c3b4f9d1
Commit
7f7192f8fd
6
pom.xml
6
pom.xml
@ -4,7 +4,7 @@
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.4.2-R0.3-SNAPSHOT</version>
|
||||
<version>1.4.4-R0.1-SNAPSHOT</version>
|
||||
<name>CraftBukkit</name>
|
||||
<url>http://www.bukkit.org</url>
|
||||
|
||||
@ -51,14 +51,14 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.4.2-R0.3-SNAPSHOT</version>
|
||||
<version>1.4.4-R0.1-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>minecraft-server</artifactId>
|
||||
<version>1.4.2</version>
|
||||
<version>1.4.4</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
@ -377,14 +377,14 @@ public class Block {
|
||||
int l1 = this.getDropType(l, world.random, i1);
|
||||
|
||||
if (l1 > 0) {
|
||||
this.a(world, i, j, k, new ItemStack(l1, 1, this.getDropData(l)));
|
||||
this.b(world, i, j, k, new ItemStack(l1, 1, this.getDropData(l)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void a(World world, int i, int j, int k, ItemStack itemstack) {
|
||||
protected void b(World world, int i, int j, int k, ItemStack itemstack) {
|
||||
if (!world.isStatic && world.getGameRules().getBoolean("doTileDrops")) {
|
||||
float f = 0.7F;
|
||||
double d0 = (double) (world.random.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
|
||||
@ -540,7 +540,9 @@ public class Block {
|
||||
|
||||
public void b(World world, int i, int j, int k, Entity entity) {}
|
||||
|
||||
public void postPlace(World world, int i, int j, int k, int l, float f, float f1, float f2) {}
|
||||
public int getPlacedData(World world, int i, int j, int k, int l, float f, float f1, float f2, int i1) {
|
||||
return i1;
|
||||
}
|
||||
|
||||
public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {}
|
||||
|
||||
@ -595,7 +597,7 @@ public class Block {
|
||||
ItemStack itemstack = this.f_(l);
|
||||
|
||||
if (itemstack != null) {
|
||||
this.a(world, i, j, k, itemstack);
|
||||
this.b(world, i, j, k, itemstack);
|
||||
}
|
||||
} else {
|
||||
int i1 = EnchantmentManager.getBonusBlockLootEnchantmentLevel(entityhuman);
|
||||
@ -628,6 +630,8 @@ public class Block {
|
||||
|
||||
public void postPlace(World world, int i, int j, int k, EntityLiving entityliving) {}
|
||||
|
||||
public void postPlace(World world, int i, int j, int k, int l) {}
|
||||
|
||||
public Block b(String s) {
|
||||
this.name = "tile." + s;
|
||||
return this;
|
||||
@ -669,7 +673,7 @@ public class Block {
|
||||
|
||||
public void a(World world, int i, int j, int k, int l, EntityHuman entityhuman) {}
|
||||
|
||||
public void g(World world, int i, int j, int k, int l) {}
|
||||
public void h(World world, int i, int j, int k, int l) {}
|
||||
|
||||
public void f(World world, int i, int j, int k) {}
|
||||
|
||||
@ -677,6 +681,10 @@ public class Block {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean a(Explosion explosion) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static {
|
||||
Item.byId[WOOL.id] = (new ItemCloth(WOOL.id - 256)).b("cloth");
|
||||
Item.byId[LOG.id] = (new ItemMultiTexture(LOG.id - 256, LOG, BlockLog.a)).b("log");
|
||||
|
@ -33,35 +33,35 @@ public class BlockButton extends Block {
|
||||
}
|
||||
|
||||
public boolean canPlace(World world, int i, int j, int k, int l) {
|
||||
return l == 2 && world.s(i, j, k + 1) ? true : (l == 3 && world.s(i, j, k - 1) ? true : (l == 4 && world.s(i + 1, j, k) ? true : l == 5 && world.s(i - 1, j, k)));
|
||||
return l == 2 && world.t(i, j, k + 1) ? true : (l == 3 && world.t(i, j, k - 1) ? true : (l == 4 && world.t(i + 1, j, k) ? true : l == 5 && world.t(i - 1, j, k)));
|
||||
}
|
||||
|
||||
public boolean canPlace(World world, int i, int j, int k) {
|
||||
return world.s(i - 1, j, k) ? true : (world.s(i + 1, j, k) ? true : (world.s(i, j, k - 1) ? true : world.s(i, j, k + 1)));
|
||||
return world.t(i - 1, j, k) ? true : (world.t(i + 1, j, k) ? true : (world.t(i, j, k - 1) ? true : world.t(i, j, k + 1)));
|
||||
}
|
||||
|
||||
public void postPlace(World world, int i, int j, int k, int l, float f, float f1, float f2) {
|
||||
int i1 = world.getData(i, j, k);
|
||||
int j1 = i1 & 8;
|
||||
public int getPlacedData(World world, int i, int j, int k, int l, float f, float f1, float f2, int i1) {
|
||||
int j1 = world.getData(i, j, k);
|
||||
int k1 = j1 & 8;
|
||||
|
||||
i1 &= 7;
|
||||
if (l == 2 && world.s(i, j, k + 1)) {
|
||||
i1 = 4;
|
||||
} else if (l == 3 && world.s(i, j, k - 1)) {
|
||||
i1 = 3;
|
||||
} else if (l == 4 && world.s(i + 1, j, k)) {
|
||||
i1 = 2;
|
||||
} else if (l == 5 && world.s(i - 1, j, k)) {
|
||||
i1 = 1;
|
||||
j1 &= 7;
|
||||
if (l == 2 && world.t(i, j, k + 1)) {
|
||||
j1 = 4;
|
||||
} else if (l == 3 && world.t(i, j, k - 1)) {
|
||||
j1 = 3;
|
||||
} else if (l == 4 && world.t(i + 1, j, k)) {
|
||||
j1 = 2;
|
||||
} else if (l == 5 && world.t(i - 1, j, k)) {
|
||||
j1 = 1;
|
||||
} else {
|
||||
i1 = this.l(world, i, j, k);
|
||||
j1 = this.l(world, i, j, k);
|
||||
}
|
||||
|
||||
world.setData(i, j, k, i1 + j1);
|
||||
return j1 + k1;
|
||||
}
|
||||
|
||||
private int l(World world, int i, int j, int k) {
|
||||
return world.s(i - 1, j, k) ? 1 : (world.s(i + 1, j, k) ? 2 : (world.s(i, j, k - 1) ? 3 : (world.s(i, j, k + 1) ? 4 : 1)));
|
||||
return world.t(i - 1, j, k) ? 1 : (world.t(i + 1, j, k) ? 2 : (world.t(i, j, k - 1) ? 3 : (world.t(i, j, k + 1) ? 4 : 1)));
|
||||
}
|
||||
|
||||
public void doPhysics(World world, int i, int j, int k, int l) {
|
||||
@ -69,19 +69,19 @@ public class BlockButton extends Block {
|
||||
int i1 = world.getData(i, j, k) & 7;
|
||||
boolean flag = false;
|
||||
|
||||
if (!world.s(i - 1, j, k) && i1 == 1) {
|
||||
if (!world.t(i - 1, j, k) && i1 == 1) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.s(i + 1, j, k) && i1 == 2) {
|
||||
if (!world.t(i + 1, j, k) && i1 == 2) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.s(i, j, k - 1) && i1 == 3) {
|
||||
if (!world.t(i, j, k - 1) && i1 == 3) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.s(i, j, k + 1) && i1 == 4) {
|
||||
if (!world.t(i, j, k + 1) && i1 == 4) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
||||
|
||||
public class BlockCommand extends BlockContainer {
|
||||
@ -28,17 +30,24 @@ public class BlockCommand extends BlockContainer {
|
||||
// CraftBukkit end
|
||||
|
||||
if (eventRedstone.getNewCurrent() > 0 && !(eventRedstone.getOldCurrent() > 0)) { // CraftBukkit
|
||||
world.setRawData(i, j, k, i1 | 1);
|
||||
world.a(i, j, k, this.id, this.r_());
|
||||
} else if (!(eventRedstone.getNewCurrent() > 0) && eventRedstone.getOldCurrent() > 0) { // CraftBukkit
|
||||
world.setRawData(i, j, k, i1 & -2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void b(World world, int i, int j, int k, Random random) {
|
||||
TileEntity tileentity = world.getTileEntity(i, j, k);
|
||||
|
||||
if (tileentity != null && tileentity instanceof TileEntityCommand) {
|
||||
((TileEntityCommand) tileentity).a(world);
|
||||
}
|
||||
}
|
||||
|
||||
world.setRawData(i, j, k, i1 | 1);
|
||||
} else if (!(eventRedstone.getNewCurrent() > 0) && eventRedstone.getOldCurrent() > 0) { // CraftBukkit
|
||||
world.setRawData(i, j, k, i1 & -2);
|
||||
}
|
||||
}
|
||||
public int r_() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
|
||||
|
@ -110,7 +110,7 @@ public class BlockCrops extends BlockFlower {
|
||||
|
||||
for (int k1 = 0; k1 < j1; ++k1) {
|
||||
if (world.random.nextInt(15) <= l) {
|
||||
this.a(world, i, j, k, new ItemStack(this.h(), 1, 0));
|
||||
this.b(world, i, j, k, new ItemStack(this.h(), 1, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ public class BlockDoor extends Block {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.t(i, j - 1, k)) {
|
||||
if (!world.v(i, j - 1, k)) {
|
||||
world.setTypeId(i, j, k, 0);
|
||||
flag = true;
|
||||
if (world.getTypeId(i, j + 1, k) == this.id) {
|
||||
@ -210,7 +210,7 @@ public class BlockDoor extends Block {
|
||||
}
|
||||
|
||||
public boolean canPlace(World world, int i, int j, int k) {
|
||||
return j >= 255 ? false : world.t(i, j - 1, k) && super.canPlace(world, i, j, k) && super.canPlace(world, i, j + 1, k);
|
||||
return j >= 255 ? false : world.v(i, j - 1, k) && super.canPlace(world, i, j, k) && super.canPlace(world, i, j + 1, k);
|
||||
}
|
||||
|
||||
public int q_() {
|
||||
@ -235,4 +235,10 @@ public class BlockDoor extends Block {
|
||||
|
||||
return i1 & 7 | (flag ? 8 : 0) | (flag1 ? 16 : 0);
|
||||
}
|
||||
|
||||
public void a(World world, int i, int j, int k, int l, EntityHuman entityhuman) {
|
||||
if (entityhuman.abilities.canInstantlyBuild && (l & 8) != 0 && world.getTypeId(i, j - 1, k) == this.id) {
|
||||
world.setTypeId(i, j - 1, k, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,6 @@ public class BlockDragonEgg extends Block {
|
||||
|
||||
private void n(World world, int i, int j, int k) {
|
||||
if (world.getTypeId(i, j, k) == this.id) {
|
||||
if (!world.isStatic) {
|
||||
for (int l = 0; l < 1000; ++l) {
|
||||
int i1 = i + world.random.nextInt(16) - world.random.nextInt(16);
|
||||
int j1 = j + world.random.nextInt(8) - world.random.nextInt(8);
|
||||
@ -78,8 +77,10 @@ public class BlockDragonEgg extends Block {
|
||||
k1 = event.getToBlock().getZ();
|
||||
// CraftBukkit end
|
||||
|
||||
if (!world.isStatic) {
|
||||
world.setTypeIdAndData(i1, j1, k1, this.id, world.getData(i, j, k));
|
||||
world.setTypeId(i, j, k, 0);
|
||||
} else {
|
||||
short short1 = 128;
|
||||
|
||||
for (int l1 = 0; l1 < short1; ++l1) {
|
||||
@ -93,16 +94,16 @@ public class BlockDragonEgg extends Block {
|
||||
|
||||
world.addParticle("portal", d1, d2, d3, (double) f, (double) f1, (double) f2);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int r_() {
|
||||
return 3;
|
||||
return 5;
|
||||
}
|
||||
|
||||
public boolean c() {
|
||||
|
@ -77,7 +77,7 @@ public class BlockFire extends Block {
|
||||
fireExtinguished(world, i, j, k); // CraftBukkit - invalid place location
|
||||
}
|
||||
|
||||
if (!flag && world.M() && (world.B(i, j, k) || world.B(i - 1, j, k) || world.B(i + 1, j, k) || world.B(i, j, k - 1) || world.B(i, j, k + 1))) {
|
||||
if (!flag && world.N() && (world.D(i, j, k) || world.D(i - 1, j, k) || world.D(i + 1, j, k) || world.D(i, j, k - 1) || world.D(i, j, k + 1))) {
|
||||
fireExtinguished(world, i, j, k); // CraftBukkit - extinguished by rain
|
||||
} else {
|
||||
int l = world.getData(i, j, k);
|
||||
@ -88,13 +88,13 @@ public class BlockFire extends Block {
|
||||
|
||||
world.a(i, j, k, this.id, this.r_() + random.nextInt(10));
|
||||
if (!flag && !this.l(world, i, j, k)) {
|
||||
if (!world.t(i, j - 1, k) || l > 3) {
|
||||
if (!world.v(i, j - 1, k) || l > 3) {
|
||||
world.setTypeId(i, j, k, 0);
|
||||
}
|
||||
} else if (!flag && !this.d((IBlockAccess) world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0) {
|
||||
fireExtinguished(world, i, j, k); // CraftBukkit - burn out
|
||||
} else {
|
||||
boolean flag1 = world.C(i, j, k);
|
||||
boolean flag1 = world.E(i, j, k);
|
||||
byte b0 = 0;
|
||||
|
||||
if (flag1) {
|
||||
@ -135,7 +135,7 @@ public class BlockFire extends Block {
|
||||
j2 /= 2;
|
||||
}
|
||||
|
||||
if (j2 > 0 && random.nextInt(l1) <= j2 && (!world.M() || !world.B(i1, k1, j1)) && !world.B(i1 - 1, k1, k) && !world.B(i1 + 1, k1, j1) && !world.B(i1, k1, j1 - 1) && !world.B(i1, k1, j1 + 1)) {
|
||||
if (j2 > 0 && random.nextInt(l1) <= j2 && (!world.N() || !world.D(i1, k1, j1)) && !world.D(i1 - 1, k1, k) && !world.D(i1 + 1, k1, j1) && !world.D(i1, k1, j1 - 1) && !world.D(i1, k1, j1 + 1)) {
|
||||
int k2 = l + random.nextInt(5) / 4;
|
||||
|
||||
if (k2 > 15) {
|
||||
@ -197,7 +197,7 @@ public class BlockFire extends Block {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (random.nextInt(i1 + 10) < 5 && !world.B(i, j, k)) {
|
||||
if (random.nextInt(i1 + 10) < 5 && !world.D(i, j, k)) {
|
||||
int k1 = i1 + random.nextInt(5) / 4;
|
||||
|
||||
if (k1 > 15) {
|
||||
@ -251,18 +251,18 @@ public class BlockFire extends Block {
|
||||
}
|
||||
|
||||
public boolean canPlace(World world, int i, int j, int k) {
|
||||
return world.t(i, j - 1, k) || this.l(world, i, j, k);
|
||||
return world.v(i, j - 1, k) || this.l(world, i, j, k);
|
||||
}
|
||||
|
||||
public void doPhysics(World world, int i, int j, int k, int l) {
|
||||
if (!world.t(i, j - 1, k) && !this.l(world, i, j, k)) {
|
||||
if (!world.v(i, j - 1, k) && !this.l(world, i, j, k)) {
|
||||
fireExtinguished(world, i, j, k); // CraftBukkit - fuel block gone
|
||||
}
|
||||
}
|
||||
|
||||
public void onPlace(World world, int i, int j, int k) {
|
||||
if (world.worldProvider.dimension > 0 || world.getTypeId(i, j - 1, k) != Block.OBSIDIAN.id || !Block.PORTAL.i_(world, i, j, k)) {
|
||||
if (!world.t(i, j - 1, k) && !this.l(world, i, j, k)) {
|
||||
if (!world.v(i, j - 1, k) && !this.l(world, i, j, k)) {
|
||||
fireExtinguished(world, i, j, k); // CraftBukkit - fuel block broke
|
||||
} else {
|
||||
world.a(i, j, k, this.id, this.r_() + world.random.nextInt(10));
|
||||
|
@ -18,7 +18,7 @@ public class BlockIce extends BlockHalfTransparant {
|
||||
ItemStack itemstack = this.f_(l);
|
||||
|
||||
if (itemstack != null) {
|
||||
this.a(world, i, j, k, itemstack);
|
||||
this.b(world, i, j, k, itemstack);
|
||||
}
|
||||
} else {
|
||||
if (world.worldProvider.e) {
|
||||
|
@ -153,19 +153,19 @@ public class BlockLeaves extends BlockTransparant {
|
||||
if (world.random.nextInt(b0) == 0) {
|
||||
int j1 = this.getDropType(l, world.random, i1);
|
||||
|
||||
this.a(world, i, j, k, new ItemStack(j1, 1, this.getDropData(l)));
|
||||
this.b(world, i, j, k, new ItemStack(j1, 1, this.getDropData(l)));
|
||||
}
|
||||
|
||||
if ((l & 3) == 0 && world.random.nextInt(200) == 0) {
|
||||
this.a(world, i, j, k, new ItemStack(Item.APPLE, 1, 0));
|
||||
this.b(world, i, j, k, new ItemStack(Item.APPLE, 1, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
if (!world.isStatic && entityhuman.bP() != null && entityhuman.bP().id == Item.SHEARS.id) {
|
||||
if (!world.isStatic && entityhuman.bT() != null && entityhuman.bT().id == Item.SHEARS.id) {
|
||||
entityhuman.a(StatisticList.C[this.id], 1);
|
||||
this.a(world, i, j, k, new ItemStack(Block.LEAVES.id, 1, l & 3));
|
||||
this.b(world, i, j, k, new ItemStack(Block.LEAVES.id, 1, l & 3));
|
||||
} else {
|
||||
super.a(world, entityhuman, i, j, k, l);
|
||||
}
|
||||
|
@ -26,49 +26,43 @@ public class BlockLever extends Block {
|
||||
}
|
||||
|
||||
public boolean canPlace(World world, int i, int j, int k, int l) {
|
||||
return l == 0 && world.s(i, j + 1, k) ? true : (l == 1 && world.t(i, j - 1, k) ? true : (l == 2 && world.s(i, j, k + 1) ? true : (l == 3 && world.s(i, j, k - 1) ? true : (l == 4 && world.s(i + 1, j, k) ? true : l == 5 && world.s(i - 1, j, k)))));
|
||||
return l == 0 && world.t(i, j + 1, k) ? true : (l == 1 && world.v(i, j - 1, k) ? true : (l == 2 && world.t(i, j, k + 1) ? true : (l == 3 && world.t(i, j, k - 1) ? true : (l == 4 && world.t(i + 1, j, k) ? true : l == 5 && world.t(i - 1, j, k)))));
|
||||
}
|
||||
|
||||
public boolean canPlace(World world, int i, int j, int k) {
|
||||
return world.s(i - 1, j, k) ? true : (world.s(i + 1, j, k) ? true : (world.s(i, j, k - 1) ? true : (world.s(i, j, k + 1) ? true : (world.t(i, j - 1, k) ? true : world.s(i, j + 1, k)))));
|
||||
return world.t(i - 1, j, k) ? true : (world.t(i + 1, j, k) ? true : (world.t(i, j, k - 1) ? true : (world.t(i, j, k + 1) ? true : (world.v(i, j - 1, k) ? true : world.t(i, j + 1, k)))));
|
||||
}
|
||||
|
||||
public void postPlace(World world, int i, int j, int k, int l, float f, float f1, float f2) {
|
||||
int i1 = world.getData(i, j, k);
|
||||
public int getPlacedData(World world, int i, int j, int k, int l, float f, float f1, float f2, int i1) {
|
||||
int j1 = i1 & 8;
|
||||
int k1 = i1 & 7;
|
||||
|
||||
i1 &= 7;
|
||||
i1 = -1;
|
||||
if (l == 0 && world.s(i, j + 1, k)) {
|
||||
i1 = world.random.nextBoolean() ? 0 : 7;
|
||||
k1 = -1;
|
||||
if (l == 0 && world.t(i, j + 1, k)) {
|
||||
k1 = world.random.nextBoolean() ? 0 : 7;
|
||||
}
|
||||
|
||||
if (l == 1 && world.t(i, j - 1, k)) {
|
||||
i1 = 5 + world.random.nextInt(2);
|
||||
if (l == 1 && world.v(i, j - 1, k)) {
|
||||
k1 = 5 + world.random.nextInt(2);
|
||||
}
|
||||
|
||||
if (l == 2 && world.s(i, j, k + 1)) {
|
||||
i1 = 4;
|
||||
if (l == 2 && world.t(i, j, k + 1)) {
|
||||
k1 = 4;
|
||||
}
|
||||
|
||||
if (l == 3 && world.s(i, j, k - 1)) {
|
||||
i1 = 3;
|
||||
if (l == 3 && world.t(i, j, k - 1)) {
|
||||
k1 = 3;
|
||||
}
|
||||
|
||||
if (l == 4 && world.s(i + 1, j, k)) {
|
||||
i1 = 2;
|
||||
if (l == 4 && world.t(i + 1, j, k)) {
|
||||
k1 = 2;
|
||||
}
|
||||
|
||||
if (l == 5 && world.s(i - 1, j, k)) {
|
||||
i1 = 1;
|
||||
if (l == 5 && world.t(i - 1, j, k)) {
|
||||
k1 = 1;
|
||||
}
|
||||
|
||||
if (i1 == -1) {
|
||||
this.c(world, i, j, k, world.getData(i, j, k), 0);
|
||||
world.setTypeId(i, j, k, 0);
|
||||
} else {
|
||||
world.setData(i, j, k, i1 + j1);
|
||||
}
|
||||
return k1 + j1;
|
||||
}
|
||||
|
||||
public static int d(int i) {
|
||||
@ -101,35 +95,35 @@ public class BlockLever extends Block {
|
||||
int i1 = world.getData(i, j, k) & 7;
|
||||
boolean flag = false;
|
||||
|
||||
if (!world.s(i - 1, j, k) && i1 == 1) {
|
||||
if (!world.t(i - 1, j, k) && i1 == 1) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.s(i + 1, j, k) && i1 == 2) {
|
||||
if (!world.t(i + 1, j, k) && i1 == 2) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.s(i, j, k - 1) && i1 == 3) {
|
||||
if (!world.t(i, j, k - 1) && i1 == 3) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.s(i, j, k + 1) && i1 == 4) {
|
||||
if (!world.t(i, j, k + 1) && i1 == 4) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.t(i, j - 1, k) && i1 == 5) {
|
||||
if (!world.v(i, j - 1, k) && i1 == 5) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.t(i, j - 1, k) && i1 == 6) {
|
||||
if (!world.v(i, j - 1, k) && i1 == 6) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.s(i, j + 1, k) && i1 == 0) {
|
||||
if (!world.t(i, j + 1, k) && i1 == 0) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.s(i, j + 1, k) && i1 == 7) {
|
||||
if (!world.t(i, j + 1, k) && i1 == 7) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ public class BlockMushroom extends BlockFlower {
|
||||
if (j >= 0 && j < 256) {
|
||||
int l = world.getTypeId(i, j - 1, k);
|
||||
|
||||
return l == Block.MYCEL.id || world.k(i, j, k) < 13 && this.d_(l);
|
||||
return l == Block.MYCEL.id || world.l(i, j, k) < 13 && this.d_(l);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class BlockNetherWart extends BlockFlower {
|
||||
}
|
||||
|
||||
for (int k1 = 0; k1 < j1; ++k1) {
|
||||
this.a(world, i, j, k, new ItemStack(Item.NETHER_STALK));
|
||||
this.b(world, i, j, k, new ItemStack(Item.NETHER_STALK));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ public class BlockPiston extends Block {
|
||||
|
||||
if (flag && !f(l)) {
|
||||
// CraftBukkit start
|
||||
int length = h(world, i, j, k, i1);
|
||||
int length = i(world, i, j, k, i1);
|
||||
if (length >= 0) {
|
||||
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
|
||||
BlockPistonExtendEvent event = new BlockPistonExtendEvent(block, length, CraftBlock.notchToBlockFace(i1));
|
||||
@ -109,7 +109,7 @@ public class BlockPiston extends Block {
|
||||
}
|
||||
|
||||
if (l == 0) {
|
||||
if (this.i(world, i, j, k, i1)) {
|
||||
if (this.j(world, i, j, k, i1)) {
|
||||
world.setData(i, j, k, i1 | 8);
|
||||
world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "tile.piston.out", 0.5F, world.random.nextFloat() * 0.25F + 0.6F);
|
||||
} else {
|
||||
@ -268,7 +268,7 @@ public class BlockPiston extends Block {
|
||||
}
|
||||
|
||||
// CraftBukkit - boolean -> int return
|
||||
private static int h(World world, int i, int j, int k, int l) {
|
||||
private static int i(World world, int i, int j, int k, int l) {
|
||||
int i1 = i + Facing.b[l];
|
||||
int j1 = j + Facing.c[l];
|
||||
int k1 = k + Facing.d[l];
|
||||
@ -305,7 +305,7 @@ public class BlockPiston extends Block {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean i(World world, int i, int j, int k, int l) {
|
||||
private boolean j(World world, int i, int j, int k, int l) {
|
||||
int i1 = i + Facing.b[l];
|
||||
int j1 = j + Facing.c[l];
|
||||
int k1 = k + Facing.d[l];
|
||||
|
@ -19,15 +19,15 @@ public class BlockPortal extends BlockHalfTransparant {
|
||||
if (world.worldProvider.d() && random.nextInt(2000) < world.difficulty) {
|
||||
int l;
|
||||
|
||||
for (l = j; !world.t(i, l, k) && l > 0; --l) {
|
||||
for (l = j; !world.v(i, l, k) && l > 0; --l) {
|
||||
;
|
||||
}
|
||||
|
||||
if (l > 0 && !world.s(i, l + 1, k)) {
|
||||
if (l > 0 && !world.t(i, l + 1, k)) {
|
||||
Entity entity = ItemMonsterEgg.a(world, 57, (double) i + 0.5D, (double) l + 1.1D, (double) k + 0.5D);
|
||||
|
||||
if (entity != null) {
|
||||
entity.an = entity.ab();
|
||||
entity.portalCooldown = entity.ab();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,13 +44,13 @@ public class BlockPressurePlate extends Block {
|
||||
}
|
||||
|
||||
public boolean canPlace(World world, int i, int j, int k) {
|
||||
return world.t(i, j - 1, k) || BlockFence.c(world.getTypeId(i, j - 1, k));
|
||||
return world.v(i, j - 1, k) || BlockFence.c(world.getTypeId(i, j - 1, k));
|
||||
}
|
||||
|
||||
public void doPhysics(World world, int i, int j, int k, int l) {
|
||||
boolean flag = false;
|
||||
|
||||
if (!world.t(i, j - 1, k) && !BlockFence.c(world.getTypeId(i, j - 1, k))) {
|
||||
if (!world.v(i, j - 1, k) && !BlockFence.c(world.getTypeId(i, j - 1, k))) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ public class BlockPumpkin extends BlockDirectional {
|
||||
public boolean canPlace(World world, int i, int j, int k) {
|
||||
int l = world.getTypeId(i, j, k);
|
||||
|
||||
return (l == 0 || Block.byId[l].material.isReplaceable()) && world.t(i, j - 1, k);
|
||||
return (l == 0 || Block.byId[l].material.isReplaceable()) && world.v(i, j - 1, k);
|
||||
}
|
||||
|
||||
public void postPlace(World world, int i, int j, int k, EntityLiving entityliving) {
|
||||
|
@ -105,27 +105,27 @@ public class BlockRedstoneOre extends Block {
|
||||
double d2 = (double) ((float) j + random.nextFloat());
|
||||
double d3 = (double) ((float) k + random.nextFloat());
|
||||
|
||||
if (l == 0 && !world.r(i, j + 1, k)) {
|
||||
if (l == 0 && !world.s(i, j + 1, k)) {
|
||||
d2 = (double) (j + 1) + d0;
|
||||
}
|
||||
|
||||
if (l == 1 && !world.r(i, j - 1, k)) {
|
||||
if (l == 1 && !world.s(i, j - 1, k)) {
|
||||
d2 = (double) (j + 0) - d0;
|
||||
}
|
||||
|
||||
if (l == 2 && !world.r(i, j, k + 1)) {
|
||||
if (l == 2 && !world.s(i, j, k + 1)) {
|
||||
d3 = (double) (k + 1) + d0;
|
||||
}
|
||||
|
||||
if (l == 3 && !world.r(i, j, k - 1)) {
|
||||
if (l == 3 && !world.s(i, j, k - 1)) {
|
||||
d3 = (double) (k + 0) - d0;
|
||||
}
|
||||
|
||||
if (l == 4 && !world.r(i + 1, j, k)) {
|
||||
if (l == 4 && !world.s(i + 1, j, k)) {
|
||||
d1 = (double) (i + 1) + d0;
|
||||
}
|
||||
|
||||
if (l == 5 && !world.r(i - 1, j, k)) {
|
||||
if (l == 5 && !world.s(i - 1, j, k)) {
|
||||
d1 = (double) (i + 0) - d0;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,6 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
@ -23,15 +22,16 @@ public class BlockRedstoneTorch extends BlockTorch {
|
||||
b.put(world, new ArrayList());
|
||||
}
|
||||
|
||||
List list = (List) b.get(world);
|
||||
|
||||
if (flag) {
|
||||
((List) b.get(world)).add(new RedstoneUpdateInfo(i, j, k, world.getTime()));
|
||||
list.add(new RedstoneUpdateInfo(i, j, k, world.getTime()));
|
||||
}
|
||||
|
||||
int l = 0;
|
||||
Iterator iterator = ((List) b.get(world)).iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
RedstoneUpdateInfo redstoneupdateinfo = (RedstoneUpdateInfo) iterator.next();
|
||||
for (int i1 = 0; i1 < list.size(); ++i1) {
|
||||
RedstoneUpdateInfo redstoneupdateinfo = (RedstoneUpdateInfo) list.get(i1);
|
||||
|
||||
if (redstoneupdateinfo.a == i && redstoneupdateinfo.b == j && redstoneupdateinfo.c == k) {
|
||||
++l;
|
||||
|
@ -2,7 +2,6 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
@ -39,7 +38,7 @@ public class BlockRedstoneWire extends Block {
|
||||
}
|
||||
|
||||
public boolean canPlace(World world, int i, int j, int k) {
|
||||
return world.t(i, j - 1, k) || world.getTypeId(i, j - 1, k) == Block.GLOWSTONE.id;
|
||||
return world.v(i, j - 1, k) || world.getTypeId(i, j - 1, k) == Block.GLOWSTONE.id;
|
||||
}
|
||||
|
||||
private void l(World world, int i, int j, int k) {
|
||||
@ -47,10 +46,9 @@ public class BlockRedstoneWire extends Block {
|
||||
ArrayList arraylist = new ArrayList(this.b);
|
||||
|
||||
this.b.clear();
|
||||
Iterator iterator = arraylist.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
ChunkPosition chunkposition = (ChunkPosition) iterator.next();
|
||||
for (int l = 0; l < arraylist.size(); ++l) {
|
||||
ChunkPosition chunkposition = (ChunkPosition) arraylist.get(l);
|
||||
|
||||
world.applyPhysics(chunkposition.x, chunkposition.y, chunkposition.z, this.id);
|
||||
}
|
||||
@ -94,11 +92,11 @@ public class BlockRedstoneWire extends Block {
|
||||
l1 = this.getPower(world, j2, j, k2, l1);
|
||||
}
|
||||
|
||||
if (world.s(j2, j, k2) && !world.s(i, j + 1, k)) {
|
||||
if (world.t(j2, j, k2) && !world.t(i, j + 1, k)) {
|
||||
if (j2 != l || j + 1 != i1 || k2 != j1) {
|
||||
l1 = this.getPower(world, j2, j + 1, k2, l1);
|
||||
}
|
||||
} else if (!world.s(j2, j, k2) && (j2 != l || j - 1 != i1 || k2 != j1)) {
|
||||
} else if (!world.t(j2, j, k2) && (j2 != l || j - 1 != i1 || k2 != j1)) {
|
||||
l1 = this.getPower(world, j2, j - 1, k2, l1);
|
||||
}
|
||||
}
|
||||
@ -146,7 +144,7 @@ public class BlockRedstoneWire extends Block {
|
||||
++k2;
|
||||
}
|
||||
|
||||
if (world.s(j2, j, k2)) {
|
||||
if (world.t(j2, j, k2)) {
|
||||
l2 += 2;
|
||||
}
|
||||
|
||||
@ -208,25 +206,25 @@ public class BlockRedstoneWire extends Block {
|
||||
this.n(world, i + 1, j, k);
|
||||
this.n(world, i, j, k - 1);
|
||||
this.n(world, i, j, k + 1);
|
||||
if (world.s(i - 1, j, k)) {
|
||||
if (world.t(i - 1, j, k)) {
|
||||
this.n(world, i - 1, j + 1, k);
|
||||
} else {
|
||||
this.n(world, i - 1, j - 1, k);
|
||||
}
|
||||
|
||||
if (world.s(i + 1, j, k)) {
|
||||
if (world.t(i + 1, j, k)) {
|
||||
this.n(world, i + 1, j + 1, k);
|
||||
} else {
|
||||
this.n(world, i + 1, j - 1, k);
|
||||
}
|
||||
|
||||
if (world.s(i, j, k - 1)) {
|
||||
if (world.t(i, j, k - 1)) {
|
||||
this.n(world, i, j + 1, k - 1);
|
||||
} else {
|
||||
this.n(world, i, j - 1, k - 1);
|
||||
}
|
||||
|
||||
if (world.s(i, j, k + 1)) {
|
||||
if (world.t(i, j, k + 1)) {
|
||||
this.n(world, i, j + 1, k + 1);
|
||||
} else {
|
||||
this.n(world, i, j - 1, k + 1);
|
||||
@ -248,25 +246,25 @@ public class BlockRedstoneWire extends Block {
|
||||
this.n(world, i + 1, j, k);
|
||||
this.n(world, i, j, k - 1);
|
||||
this.n(world, i, j, k + 1);
|
||||
if (world.s(i - 1, j, k)) {
|
||||
if (world.t(i - 1, j, k)) {
|
||||
this.n(world, i - 1, j + 1, k);
|
||||
} else {
|
||||
this.n(world, i - 1, j - 1, k);
|
||||
}
|
||||
|
||||
if (world.s(i + 1, j, k)) {
|
||||
if (world.t(i + 1, j, k)) {
|
||||
this.n(world, i + 1, j + 1, k);
|
||||
} else {
|
||||
this.n(world, i + 1, j - 1, k);
|
||||
}
|
||||
|
||||
if (world.s(i, j, k - 1)) {
|
||||
if (world.t(i, j, k - 1)) {
|
||||
this.n(world, i, j + 1, k - 1);
|
||||
} else {
|
||||
this.n(world, i, j - 1, k - 1);
|
||||
}
|
||||
|
||||
if (world.s(i, j, k + 1)) {
|
||||
if (world.t(i, j, k + 1)) {
|
||||
this.n(world, i, j + 1, k + 1);
|
||||
} else {
|
||||
this.n(world, i, j - 1, k + 1);
|
||||
@ -317,25 +315,25 @@ public class BlockRedstoneWire extends Block {
|
||||
} else if (l == 1) {
|
||||
return true;
|
||||
} else {
|
||||
boolean flag = g(iblockaccess, i - 1, j, k, 1) || !iblockaccess.s(i - 1, j, k) && g(iblockaccess, i - 1, j - 1, k, -1);
|
||||
boolean flag1 = g(iblockaccess, i + 1, j, k, 3) || !iblockaccess.s(i + 1, j, k) && g(iblockaccess, i + 1, j - 1, k, -1);
|
||||
boolean flag2 = g(iblockaccess, i, j, k - 1, 2) || !iblockaccess.s(i, j, k - 1) && g(iblockaccess, i, j - 1, k - 1, -1);
|
||||
boolean flag3 = g(iblockaccess, i, j, k + 1, 0) || !iblockaccess.s(i, j, k + 1) && g(iblockaccess, i, j - 1, k + 1, -1);
|
||||
boolean flag = g(iblockaccess, i - 1, j, k, 1) || !iblockaccess.t(i - 1, j, k) && g(iblockaccess, i - 1, j - 1, k, -1);
|
||||
boolean flag1 = g(iblockaccess, i + 1, j, k, 3) || !iblockaccess.t(i + 1, j, k) && g(iblockaccess, i + 1, j - 1, k, -1);
|
||||
boolean flag2 = g(iblockaccess, i, j, k - 1, 2) || !iblockaccess.t(i, j, k - 1) && g(iblockaccess, i, j - 1, k - 1, -1);
|
||||
boolean flag3 = g(iblockaccess, i, j, k + 1, 0) || !iblockaccess.t(i, j, k + 1) && g(iblockaccess, i, j - 1, k + 1, -1);
|
||||
|
||||
if (!iblockaccess.s(i, j + 1, k)) {
|
||||
if (iblockaccess.s(i - 1, j, k) && g(iblockaccess, i - 1, j + 1, k, -1)) {
|
||||
if (!iblockaccess.t(i, j + 1, k)) {
|
||||
if (iblockaccess.t(i - 1, j, k) && g(iblockaccess, i - 1, j + 1, k, -1)) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (iblockaccess.s(i + 1, j, k) && g(iblockaccess, i + 1, j + 1, k, -1)) {
|
||||
if (iblockaccess.t(i + 1, j, k) && g(iblockaccess, i + 1, j + 1, k, -1)) {
|
||||
flag1 = true;
|
||||
}
|
||||
|
||||
if (iblockaccess.s(i, j, k - 1) && g(iblockaccess, i, j + 1, k - 1, -1)) {
|
||||
if (iblockaccess.t(i, j, k - 1) && g(iblockaccess, i, j + 1, k - 1, -1)) {
|
||||
flag2 = true;
|
||||
}
|
||||
|
||||
if (iblockaccess.s(i, j, k + 1) && g(iblockaccess, i, j + 1, k + 1, -1)) {
|
||||
if (iblockaccess.t(i, j, k + 1) && g(iblockaccess, i, j + 1, k + 1, -1)) {
|
||||
flag3 = true;
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public class BlockSand extends Block {
|
||||
protected void a(EntityFallingBlock entityfallingblock) {}
|
||||
|
||||
public int r_() {
|
||||
return 3;
|
||||
return 5;
|
||||
}
|
||||
|
||||
public static boolean canFall(World world, int i, int j, int k) {
|
||||
|
@ -71,7 +71,7 @@ public class BlockSkull extends BlockContainer {
|
||||
public int getDropData(World world, int i, int j, int k) {
|
||||
TileEntity tileentity = world.getTileEntity(i, j, k);
|
||||
|
||||
return tileentity != null && tileentity instanceof TileEntitySkull ? ((TileEntitySkull) tileentity).a() : super.getDropData(world, i, j, k);
|
||||
return tileentity != null && tileentity instanceof TileEntitySkull ? ((TileEntitySkull) tileentity).getSkullType() : super.getDropData(world, i, j, k);
|
||||
}
|
||||
|
||||
public int getDropData(int i) {
|
||||
@ -94,7 +94,15 @@ public class BlockSkull extends BlockContainer {
|
||||
if (!world.isStatic) {
|
||||
/* CraftBukkit start - don't special code dropping the item
|
||||
if ((i1 & 8) == 0) {
|
||||
this.a(world, i, j, k, new ItemStack(Item.SKULL.id, 1, this.getDropData(world, i, j, k)));
|
||||
ItemStack itemstack = new ItemStack(Item.SKULL.id, 1, this.getDropData(world, i, j, k));
|
||||
TileEntitySkull tileentityskull = (TileEntitySkull) world.getTileEntity(i, j, k);
|
||||
|
||||
if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0) {
|
||||
itemstack.setTag(new NBTTagCompound());
|
||||
itemstack.getTag().setString("SkullOwner", tileentityskull.getExtraType());
|
||||
}
|
||||
|
||||
this.b(world, i, j, k, itemstack);
|
||||
}
|
||||
// CraftBukkit end */
|
||||
|
||||
@ -107,7 +115,7 @@ public class BlockSkull extends BlockContainer {
|
||||
}
|
||||
|
||||
public void a(World world, int i, int j, int k, TileEntitySkull tileentityskull) {
|
||||
if (tileentityskull.a() == 1 && j >= 2) {
|
||||
if (tileentityskull.getSkullType() == 1 && j >= 2 && world.difficulty > 0) {
|
||||
int l = Block.SOUL_SAND.id;
|
||||
|
||||
int i1;
|
||||
@ -195,7 +203,7 @@ public class BlockSkull extends BlockContainer {
|
||||
} else {
|
||||
TileEntity tileentity = world.getTileEntity(i, j, k);
|
||||
|
||||
return tileentity != null && tileentity instanceof TileEntitySkull ? ((TileEntitySkull) tileentity).a() == l : false;
|
||||
return tileentity != null && tileentity instanceof TileEntitySkull ? ((TileEntitySkull) tileentity).getSkullType() == l : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class BlockSnow extends Block {
|
||||
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
int i1 = Item.SNOW_BALL.id;
|
||||
|
||||
this.a(world, i, j, k, new ItemStack(i1, 1, 0));
|
||||
this.b(world, i, j, k, new ItemStack(i1, 1, 0));
|
||||
world.setTypeId(i, j, k, 0);
|
||||
entityhuman.a(StatisticList.C[this.id], 1);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class BlockSoil extends Block {
|
||||
}
|
||||
|
||||
public void b(World world, int i, int j, int k, Random random) {
|
||||
if (!this.n(world, i, j, k) && !world.B(i, j + 1, k)) {
|
||||
if (!this.n(world, i, j, k) && !world.D(i, j + 1, k)) {
|
||||
int l = world.getData(i, j, k);
|
||||
|
||||
if (l > 0) {
|
||||
@ -71,7 +71,7 @@ public class BlockSoil extends Block {
|
||||
for (int i1 = k - b0; i1 <= k + b0; ++i1) {
|
||||
int j1 = world.getTypeId(l, j + 1, i1);
|
||||
|
||||
if (j1 == Block.CROPS.id || j1 == Block.MELON_STEM.id || j1 == Block.PUMPKIN_STEM.id) {
|
||||
if (j1 == Block.CROPS.id || j1 == Block.MELON_STEM.id || j1 == Block.PUMPKIN_STEM.id || j1 == Block.POTATOES.id || j1 == Block.CARROTS.id) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ public class BlockStem extends BlockFlower {
|
||||
|
||||
for (int j1 = 0; j1 < 3; ++j1) {
|
||||
if (world.random.nextInt(15) <= l) {
|
||||
this.a(world, i, j, k, new ItemStack(item));
|
||||
this.b(world, i, j, k, new ItemStack(item));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public class BlockTNT extends Block {
|
||||
}
|
||||
|
||||
public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
|
||||
if (entityhuman.bP() != null && entityhuman.bP().id == Item.FLINT_AND_STEEL.id) {
|
||||
if (entityhuman.bT() != null && entityhuman.bT().id == Item.FLINT_AND_STEEL.id) {
|
||||
this.postBreak(world, i, j, k, 1);
|
||||
world.setTypeId(i, j, k, 0);
|
||||
return true;
|
||||
@ -72,4 +72,8 @@ public class BlockTNT extends Block {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean a(Explosion explosion) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -152,33 +152,30 @@ public class BlockTrapdoor extends Block {
|
||||
return super.a(world, i, j, k, vec3d, vec3d1);
|
||||
}
|
||||
|
||||
public void postPlace(World world, int i, int j, int k, int l, float f, float f1, float f2) {
|
||||
int i1 = 0;
|
||||
public int getPlacedData(World world, int i, int j, int k, int l, float f, float f1, float f2, int i1) {
|
||||
int j1 = 0;
|
||||
|
||||
if (l == 2) {
|
||||
i1 = 0;
|
||||
j1 = 0;
|
||||
}
|
||||
|
||||
if (l == 3) {
|
||||
i1 = 1;
|
||||
j1 = 1;
|
||||
}
|
||||
|
||||
if (l == 4) {
|
||||
i1 = 2;
|
||||
j1 = 2;
|
||||
}
|
||||
|
||||
if (l == 5) {
|
||||
i1 = 3;
|
||||
j1 = 3;
|
||||
}
|
||||
|
||||
int j1 = Block.TRAP_DOOR.id;
|
||||
|
||||
if (l != 1 && l != 0 && f1 > 0.5F) {
|
||||
i1 |= 8;
|
||||
j1 |= 8;
|
||||
}
|
||||
|
||||
world.setTypeIdAndData(i, j, k, j1, i1);
|
||||
doPhysics(world, i, j, k, Block.REDSTONE_WIRE.id); // CraftBukkit
|
||||
return j1;
|
||||
}
|
||||
|
||||
public boolean canPlace(World world, int i, int j, int k, int l) {
|
||||
@ -217,7 +214,7 @@ public class BlockTrapdoor extends Block {
|
||||
} else {
|
||||
Block block = Block.byId[i];
|
||||
|
||||
return block != null && block.material.k() && block.b() || block == Block.GLOWSTONE;
|
||||
return block != null && block.material.k() && block.b() || block == Block.GLOWSTONE || block instanceof BlockStepAbstract || block instanceof BlockStairs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class BlockTripwire extends Block {
|
||||
public void doPhysics(World world, int i, int j, int k, int l) {
|
||||
int i1 = world.getData(i, j, k);
|
||||
boolean flag = (i1 & 2) == 2;
|
||||
boolean flag1 = !world.t(i, j - 1, k);
|
||||
boolean flag1 = !world.v(i, j - 1, k);
|
||||
|
||||
if (flag != flag1) {
|
||||
this.c(world, i, j, k, i1, 0);
|
||||
@ -64,7 +64,7 @@ public class BlockTripwire extends Block {
|
||||
}
|
||||
|
||||
public void onPlace(World world, int i, int j, int k) {
|
||||
int l = world.t(i, j - 1, k) ? 0 : 2;
|
||||
int l = world.v(i, j - 1, k) ? 0 : 2;
|
||||
|
||||
world.setData(i, j, k, l);
|
||||
this.d(world, i, j, k, l);
|
||||
@ -76,7 +76,7 @@ public class BlockTripwire extends Block {
|
||||
|
||||
public void a(World world, int i, int j, int k, int l, EntityHuman entityhuman) {
|
||||
if (!world.isStatic) {
|
||||
if (entityhuman.bP() != null && entityhuman.bP().id == Item.SHEARS.id) {
|
||||
if (entityhuman.bT() != null && entityhuman.bT().id == Item.SHEARS.id) {
|
||||
world.setData(i, j, k, l | 8);
|
||||
}
|
||||
}
|
||||
|
@ -33,14 +33,14 @@ public class BlockTripwireHook extends Block {
|
||||
}
|
||||
|
||||
public boolean canPlace(World world, int i, int j, int k, int l) {
|
||||
return l == 2 && world.s(i, j, k + 1) ? true : (l == 3 && world.s(i, j, k - 1) ? true : (l == 4 && world.s(i + 1, j, k) ? true : l == 5 && world.s(i - 1, j, k)));
|
||||
return l == 2 && world.t(i, j, k + 1) ? true : (l == 3 && world.t(i, j, k - 1) ? true : (l == 4 && world.t(i + 1, j, k) ? true : l == 5 && world.t(i - 1, j, k)));
|
||||
}
|
||||
|
||||
public boolean canPlace(World world, int i, int j, int k) {
|
||||
return world.s(i - 1, j, k) ? true : (world.s(i + 1, j, k) ? true : (world.s(i, j, k - 1) ? true : world.s(i, j, k + 1)));
|
||||
return world.t(i - 1, j, k) ? true : (world.t(i + 1, j, k) ? true : (world.t(i, j, k - 1) ? true : world.t(i, j, k + 1)));
|
||||
}
|
||||
|
||||
public void postPlace(World world, int i, int j, int k, int l, float f, float f1, float f2) {
|
||||
public int getPlacedData(World world, int i, int j, int k, int l, float f, float f1, float f2, int i1) {
|
||||
byte b0 = 0;
|
||||
|
||||
if (l == 2 && world.b(i, j, k + 1, true)) {
|
||||
@ -59,7 +59,11 @@ public class BlockTripwireHook extends Block {
|
||||
b0 = 3;
|
||||
}
|
||||
|
||||
this.a(world, i, j, k, this.id, b0, false, -1, 0);
|
||||
return b0;
|
||||
}
|
||||
|
||||
public void postPlace(World world, int i, int j, int k, int l) {
|
||||
this.a(world, i, j, k, this.id, l, false, -1, 0);
|
||||
}
|
||||
|
||||
public void doPhysics(World world, int i, int j, int k, int l) {
|
||||
@ -69,19 +73,19 @@ public class BlockTripwireHook extends Block {
|
||||
int j1 = i1 & 3;
|
||||
boolean flag = false;
|
||||
|
||||
if (!world.s(i - 1, j, k) && j1 == 3) {
|
||||
if (!world.t(i - 1, j, k) && j1 == 3) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.s(i + 1, j, k) && j1 == 1) {
|
||||
if (!world.t(i + 1, j, k) && j1 == 1) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.s(i, j, k - 1) && j1 == 0) {
|
||||
if (!world.t(i, j, k - 1) && j1 == 0) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!world.s(i, j, k + 1) && j1 == 2) {
|
||||
if (!world.t(i, j, k + 1) && j1 == 2) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
@ -99,7 +103,7 @@ public class BlockTripwireHook extends Block {
|
||||
boolean flag2 = (i1 & 8) == 8;
|
||||
boolean flag3 = l == Block.TRIPWIRE_SOURCE.id;
|
||||
boolean flag4 = false;
|
||||
boolean flag5 = !world.t(i, j - 1, k);
|
||||
boolean flag5 = !world.v(i, j - 1, k);
|
||||
int i2 = Direction.a[l1];
|
||||
int j2 = Direction.b[l1];
|
||||
int k2 = 0;
|
||||
|
@ -159,7 +159,7 @@ public class Chunk {
|
||||
|
||||
if (chunksection != null) {
|
||||
chunksection.c(j, i1 & 15, k, l);
|
||||
this.world.n((this.x << 4) + j, i1, (this.z << 4) + k);
|
||||
this.world.o((this.x << 4) + j, i1, (this.z << 4) + k);
|
||||
}
|
||||
}
|
||||
|
||||
@ -277,7 +277,7 @@ public class Chunk {
|
||||
chunksection = this.sections[l1 >> 4];
|
||||
if (chunksection != null) {
|
||||
chunksection.c(i, l1 & 15, k, 15);
|
||||
this.world.n((this.x << 4) + i, l1, (this.z << 4) + k);
|
||||
this.world.o((this.x << 4) + i, l1, (this.z << 4) + k);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -285,7 +285,7 @@ public class Chunk {
|
||||
chunksection = this.sections[l1 >> 4];
|
||||
if (chunksection != null) {
|
||||
chunksection.c(i, l1 & 15, k, 0);
|
||||
this.world.n((this.x << 4) + i, l1, (this.z << 4) + k);
|
||||
this.world.o((this.x << 4) + i, l1, (this.z << 4) + k);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -395,7 +395,7 @@ public class Chunk {
|
||||
int k2 = this.z * 16 + k;
|
||||
|
||||
if (l1 != 0 && !this.world.isStatic) {
|
||||
Block.byId[l1].g(this.world, j2, j, k2, i2);
|
||||
Block.byId[l1].h(this.world, j2, j, k2, i2);
|
||||
}
|
||||
|
||||
chunksection.a(i, j & 15, k, l);
|
||||
@ -403,7 +403,7 @@ public class Chunk {
|
||||
if (!this.world.isStatic) {
|
||||
Block.byId[l1].remove(this.world, j2, j, k2, l1, i2);
|
||||
} else if (Block.byId[l1] instanceof BlockContainer && l1 != l) {
|
||||
this.world.q(j2, j, k2);
|
||||
this.world.r(j2, j, k2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -659,13 +659,9 @@ public class Chunk {
|
||||
public void addEntities() {
|
||||
this.d = true;
|
||||
this.world.a(this.tileEntities.values());
|
||||
List[] alist = this.entitySlices;
|
||||
int i = alist.length;
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
List list = alist[j];
|
||||
|
||||
this.world.a(list);
|
||||
for (int i = 0; i < this.entitySlices.length; ++i) {
|
||||
this.world.a(this.entitySlices[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -679,12 +675,9 @@ public class Chunk {
|
||||
this.world.a(tileentity);
|
||||
}
|
||||
|
||||
List[] alist = this.entitySlices;
|
||||
int i = alist.length;
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
for (int i = 0; i < this.entitySlices.length; ++i) {
|
||||
// CraftBukkit start
|
||||
java.util.Iterator<Object> iter = this.entitySlices[j].iterator();
|
||||
java.util.Iterator<Object> iter = this.entitySlices[i].iterator();
|
||||
while (iter.hasNext()) {
|
||||
Entity entity = (Entity) iter.next();
|
||||
int cx = Location.locToBlock(entity.locX) >> 4;
|
||||
@ -698,9 +691,7 @@ public class Chunk {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
List list = alist[j];
|
||||
|
||||
this.world.b(list);
|
||||
this.world.b(this.entitySlices[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -722,18 +713,17 @@ public class Chunk {
|
||||
|
||||
for (int k = i; k <= j; ++k) {
|
||||
List list1 = this.entitySlices[k];
|
||||
Iterator iterator = list1.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity1 = (Entity) iterator.next();
|
||||
for (int l = 0; l < list1.size(); ++l) {
|
||||
Entity entity1 = (Entity) list1.get(l);
|
||||
|
||||
if (entity1 != entity && entity1.boundingBox.a(axisalignedbb)) {
|
||||
list.add(entity1);
|
||||
Entity[] aentity = entity1.ao();
|
||||
|
||||
if (aentity != null) {
|
||||
for (int l = 0; l < aentity.length; ++l) {
|
||||
entity1 = aentity[l];
|
||||
for (int i1 = 0; i1 < aentity.length; ++i1) {
|
||||
entity1 = aentity[i1];
|
||||
if (entity1 != entity && entity1.boundingBox.a(axisalignedbb)) {
|
||||
list.add(entity1);
|
||||
}
|
||||
@ -762,10 +752,9 @@ public class Chunk {
|
||||
|
||||
for (int k = i; k <= j; ++k) {
|
||||
List list1 = this.entitySlices[k];
|
||||
Iterator iterator = list1.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
for (int l = 0; l < list1.size(); ++l) {
|
||||
Entity entity = (Entity) list1.get(l);
|
||||
|
||||
if (oclass.isAssignableFrom(entity.getClass()) && entity.boundingBox.a(axisalignedbb) && (ientityselector == null || ientityselector.a(entity))) {
|
||||
list.add(entity);
|
||||
@ -916,30 +905,30 @@ public class Chunk {
|
||||
|
||||
if (this.sections[j] == null && (k1 == 0 || k1 == 15 || k == 0 || k == 15 || l == 0 || l == 15) || this.sections[j] != null && this.sections[j].a(k, k1, l) == 0) {
|
||||
if (Block.lightEmission[this.world.getTypeId(i1, l1 - 1, j1)] > 0) {
|
||||
this.world.x(i1, l1 - 1, j1);
|
||||
this.world.z(i1, l1 - 1, j1);
|
||||
}
|
||||
|
||||
if (Block.lightEmission[this.world.getTypeId(i1, l1 + 1, j1)] > 0) {
|
||||
this.world.x(i1, l1 + 1, j1);
|
||||
this.world.z(i1, l1 + 1, j1);
|
||||
}
|
||||
|
||||
if (Block.lightEmission[this.world.getTypeId(i1 - 1, l1, j1)] > 0) {
|
||||
this.world.x(i1 - 1, l1, j1);
|
||||
this.world.z(i1 - 1, l1, j1);
|
||||
}
|
||||
|
||||
if (Block.lightEmission[this.world.getTypeId(i1 + 1, l1, j1)] > 0) {
|
||||
this.world.x(i1 + 1, l1, j1);
|
||||
this.world.z(i1 + 1, l1, j1);
|
||||
}
|
||||
|
||||
if (Block.lightEmission[this.world.getTypeId(i1, l1, j1 - 1)] > 0) {
|
||||
this.world.x(i1, l1, j1 - 1);
|
||||
this.world.z(i1, l1, j1 - 1);
|
||||
}
|
||||
|
||||
if (Block.lightEmission[this.world.getTypeId(i1, l1, j1 + 1)] > 0) {
|
||||
this.world.x(i1, l1, j1 + 1);
|
||||
this.world.z(i1, l1, j1 + 1);
|
||||
}
|
||||
|
||||
this.world.x(i1, l1, j1);
|
||||
this.world.z(i1, l1, j1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +92,17 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
if (this.chunkProvider == null) {
|
||||
chunk = this.emptyChunk;
|
||||
} else {
|
||||
try {
|
||||
chunk = this.chunkProvider.getOrCreateChunk(i, j);
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Exception generating new chunk");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Chunk to be generated");
|
||||
|
||||
crashreportsystemdetails.a("Location", String.format("%d,%d", new Object[] { Integer.valueOf(i), Integer.valueOf(j)}));
|
||||
crashreportsystemdetails.a("Position hash", Long.valueOf(LongHash.toLong(i, j)));
|
||||
crashreportsystemdetails.a("Generator", this.chunkProvider.getName());
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
}
|
||||
newChunk = true; // CraftBukkit
|
||||
}
|
||||
@ -218,10 +228,12 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
|
||||
public boolean saveChunks(boolean flag, IProgressUpdate iprogressupdate) {
|
||||
int i = 0;
|
||||
Iterator iterator = this.chunks.values().iterator(); // CraftBukkit
|
||||
// CraftBukkit start
|
||||
Iterator iterator = this.chunks.values().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Chunk chunk = (Chunk) iterator.next();
|
||||
// CraftBukkit end
|
||||
|
||||
if (flag) {
|
||||
this.saveChunkNOP(chunk);
|
||||
|
@ -29,13 +29,9 @@ public class ChunkRegionLoader implements IAsyncChunkSaver, IChunkLoader {
|
||||
|
||||
synchronized (this.c) {
|
||||
if (this.b.contains(chunkcoordintpair)) {
|
||||
Iterator iterator = this.a.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
PendingChunkToSave pendingchunktosave = (PendingChunkToSave) iterator.next();
|
||||
|
||||
if (pendingchunktosave.a.equals(chunkcoordintpair)) {
|
||||
nbttagcompound = pendingchunktosave.b;
|
||||
for (int k = 0; k < this.a.size(); ++k) {
|
||||
if (((PendingChunkToSave) this.a.get(k)).a.equals(chunkcoordintpair)) {
|
||||
nbttagcompound = ((PendingChunkToSave) this.a.get(k)).b;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -79,7 +75,7 @@ public class ChunkRegionLoader implements IAsyncChunkSaver, IChunkLoader {
|
||||
public void a(World world, Chunk chunk) {
|
||||
// CraftBukkit start - "handle" exception
|
||||
try {
|
||||
world.C();
|
||||
world.D();
|
||||
} catch (ExceptionWorldConflict ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@ -13,10 +12,10 @@ import org.bukkit.inventory.InventoryView;
|
||||
|
||||
public abstract class Container {
|
||||
|
||||
public List a = new ArrayList();
|
||||
public List b = new ArrayList();
|
||||
public List c = new ArrayList();
|
||||
public int windowId = 0;
|
||||
private short e = 0;
|
||||
private short a = 0;
|
||||
protected List listeners = new ArrayList();
|
||||
private Set f = new HashSet();
|
||||
|
||||
@ -35,9 +34,9 @@ public abstract class Container {
|
||||
public Container() {}
|
||||
|
||||
protected Slot a(Slot slot) {
|
||||
slot.g = this.b.size();
|
||||
this.b.add(slot);
|
||||
this.a.add(null);
|
||||
slot.g = this.c.size();
|
||||
this.c.add(slot);
|
||||
this.b.add(null);
|
||||
return slot;
|
||||
}
|
||||
|
||||
@ -53,31 +52,25 @@ public abstract class Container {
|
||||
|
||||
public List a() {
|
||||
ArrayList arraylist = new ArrayList();
|
||||
Iterator iterator = this.b.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Slot slot = (Slot) iterator.next();
|
||||
|
||||
arraylist.add(slot.getItem());
|
||||
for (int i = 0; i < this.c.size(); ++i) {
|
||||
arraylist.add(((Slot) this.c.get(i)).getItem());
|
||||
}
|
||||
|
||||
return arraylist;
|
||||
}
|
||||
|
||||
public void b() {
|
||||
for (int i = 0; i < this.b.size(); ++i) {
|
||||
ItemStack itemstack = ((Slot) this.b.get(i)).getItem();
|
||||
ItemStack itemstack1 = (ItemStack) this.a.get(i);
|
||||
for (int i = 0; i < this.c.size(); ++i) {
|
||||
ItemStack itemstack = ((Slot) this.c.get(i)).getItem();
|
||||
ItemStack itemstack1 = (ItemStack) this.b.get(i);
|
||||
|
||||
if (!ItemStack.matches(itemstack1, itemstack)) {
|
||||
itemstack1 = itemstack == null ? null : itemstack.cloneItemStack();
|
||||
this.a.set(i, itemstack1);
|
||||
Iterator iterator = this.listeners.iterator();
|
||||
this.b.set(i, itemstack1);
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
ICrafting icrafting = (ICrafting) iterator.next();
|
||||
|
||||
icrafting.a(this, i, itemstack1);
|
||||
for (int j = 0; j < this.listeners.size(); ++j) {
|
||||
((ICrafting) this.listeners.get(j)).a(this, i, itemstack1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -88,27 +81,23 @@ public abstract class Container {
|
||||
}
|
||||
|
||||
public Slot a(IInventory iinventory, int i) {
|
||||
Iterator iterator = this.b.iterator();
|
||||
for (int j = 0; j < this.c.size(); ++j) {
|
||||
Slot slot = (Slot) this.c.get(j);
|
||||
|
||||
Slot slot;
|
||||
if (slot.a(iinventory, i)) {
|
||||
return slot;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if (!iterator.hasNext()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot = (Slot) iterator.next();
|
||||
} while (!slot.a(iinventory, i));
|
||||
|
||||
return slot;
|
||||
}
|
||||
|
||||
public Slot getSlot(int i) {
|
||||
return (Slot) this.b.get(i);
|
||||
return (Slot) this.c.get(i);
|
||||
}
|
||||
|
||||
public ItemStack b(EntityHuman entityhuman, int i) {
|
||||
Slot slot = (Slot) this.b.get(i);
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
return slot != null ? slot.getItem() : null;
|
||||
}
|
||||
@ -143,7 +132,7 @@ public abstract class Container {
|
||||
}
|
||||
}
|
||||
} else if (k == 1) {
|
||||
slot = (Slot) this.b.get(i);
|
||||
slot = (Slot) this.c.get(i);
|
||||
if (slot != null && slot.a(entityhuman)) {
|
||||
itemstack1 = this.b(entityhuman, i);
|
||||
if (itemstack1 != null) {
|
||||
@ -160,7 +149,7 @@ public abstract class Container {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot = (Slot) this.b.get(i);
|
||||
slot = (Slot) this.c.get(i);
|
||||
if (slot != null) {
|
||||
itemstack1 = slot.getItem();
|
||||
ItemStack itemstack3 = playerinventory.getCarried();
|
||||
@ -235,7 +224,7 @@ public abstract class Container {
|
||||
}
|
||||
}
|
||||
} else if (k == 2 && j >= 0 && j < 9) {
|
||||
slot = (Slot) this.b.get(i);
|
||||
slot = (Slot) this.c.get(i);
|
||||
if (slot.a(entityhuman)) {
|
||||
itemstack1 = playerinventory.getItem(j);
|
||||
boolean flag = itemstack1 == null || slot.inventory == playerinventory && slot.isAllowed(itemstack1);
|
||||
@ -264,8 +253,8 @@ public abstract class Container {
|
||||
slot.set(itemstack1);
|
||||
}
|
||||
}
|
||||
} else if (k == 3 && entityhuman.abilities.canInstantlyBuild && playerinventory.getCarried() == null && i > 0) {
|
||||
slot = (Slot) this.b.get(i);
|
||||
} else if (k == 3 && entityhuman.abilities.canInstantlyBuild && playerinventory.getCarried() == null && i >= 0) {
|
||||
slot = (Slot) this.c.get(i);
|
||||
if (slot != null && slot.d()) {
|
||||
itemstack1 = slot.getItem().cloneItemStack();
|
||||
itemstack1.count = itemstack1.getMaxStackSize();
|
||||
@ -280,7 +269,7 @@ public abstract class Container {
|
||||
this.clickItem(i, j, 1, entityhuman);
|
||||
}
|
||||
|
||||
public void a(EntityHuman entityhuman) {
|
||||
public void b(EntityHuman entityhuman) {
|
||||
PlayerInventory playerinventory = entityhuman.inventory;
|
||||
|
||||
if (playerinventory.getCarried() != null) {
|
||||
@ -297,7 +286,7 @@ public abstract class Container {
|
||||
this.getSlot(i).set(itemstack);
|
||||
}
|
||||
|
||||
public boolean b(EntityHuman entityhuman) {
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
return !this.f.contains(entityhuman);
|
||||
}
|
||||
|
||||
@ -309,7 +298,7 @@ public abstract class Container {
|
||||
}
|
||||
}
|
||||
|
||||
public abstract boolean c(EntityHuman entityhuman);
|
||||
public abstract boolean a(EntityHuman entityhuman);
|
||||
|
||||
protected boolean a(ItemStack itemstack, int i, int j, boolean flag) {
|
||||
boolean flag1 = false;
|
||||
@ -324,7 +313,7 @@ public abstract class Container {
|
||||
|
||||
if (itemstack.isStackable()) {
|
||||
while (itemstack.count > 0 && (!flag && k < j || flag && k >= i)) {
|
||||
slot = (Slot) this.b.get(k);
|
||||
slot = (Slot) this.c.get(k);
|
||||
itemstack1 = slot.getItem();
|
||||
if (itemstack1 != null && itemstack1.id == itemstack.id && (!itemstack.usesData() || itemstack.getData() == itemstack1.getData()) && ItemStack.equals(itemstack, itemstack1)) {
|
||||
int l = itemstack1.count + itemstack.count;
|
||||
@ -358,7 +347,7 @@ public abstract class Container {
|
||||
}
|
||||
|
||||
while (!flag && k < j || flag && k >= i) {
|
||||
slot = (Slot) this.b.get(k);
|
||||
slot = (Slot) this.c.get(k);
|
||||
itemstack1 = slot.getItem();
|
||||
if (itemstack1 == null) {
|
||||
slot.set(itemstack.cloneItemStack());
|
||||
|
@ -17,7 +17,7 @@ public class ContainerAnvil extends Container {
|
||||
private int i;
|
||||
private int j;
|
||||
private int k;
|
||||
public int e = 0;
|
||||
public int a = 0;
|
||||
private int l = 0;
|
||||
private String m;
|
||||
private final EntityHuman n;
|
||||
@ -60,14 +60,14 @@ public class ContainerAnvil extends Container {
|
||||
public void d() {
|
||||
ItemStack itemstack = this.g.getItem(0);
|
||||
|
||||
this.e = 0;
|
||||
this.a = 0;
|
||||
int i = 0;
|
||||
byte b0 = 0;
|
||||
int j = 0;
|
||||
|
||||
if (itemstack == null) {
|
||||
this.f.setItem(0, (ItemStack) null);
|
||||
this.e = 0;
|
||||
this.a = 0;
|
||||
} else {
|
||||
ItemStack itemstack1 = itemstack.cloneItemStack();
|
||||
ItemStack itemstack2 = this.g.getItem(1);
|
||||
@ -87,7 +87,7 @@ public class ContainerAnvil extends Container {
|
||||
l = Math.min(itemstack1.i(), itemstack1.k() / 4);
|
||||
if (l <= 0) {
|
||||
this.f.setItem(0, (ItemStack) null);
|
||||
this.e = 0;
|
||||
this.a = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ public class ContainerAnvil extends Container {
|
||||
} else {
|
||||
if (itemstack1.id != itemstack2.id || !itemstack1.f()) {
|
||||
this.f.setItem(0, (ItemStack) null);
|
||||
this.e = 0;
|
||||
this.a = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -240,17 +240,17 @@ public class ContainerAnvil extends Container {
|
||||
}
|
||||
}
|
||||
|
||||
this.e = k + i;
|
||||
this.a = k + i;
|
||||
if (i <= 0) {
|
||||
itemstack1 = null;
|
||||
}
|
||||
|
||||
if (j == i && j > 0 && this.e >= 40) {
|
||||
if (j == i && j > 0 && this.a >= 40) {
|
||||
//System.out.println("Naming an item only, cost too high; giving discount to cap cost to 39 levels"); // CraftBukkit -remove debug
|
||||
this.e = 39;
|
||||
this.a = 39;
|
||||
}
|
||||
|
||||
if (this.e >= 40 && !this.n.abilities.canInstantlyBuild) {
|
||||
if (this.a >= 40 && !this.n.abilities.canInstantlyBuild) {
|
||||
itemstack1 = null;
|
||||
}
|
||||
|
||||
@ -261,7 +261,7 @@ public class ContainerAnvil extends Container {
|
||||
}
|
||||
|
||||
if (itemstack1.s()) {
|
||||
i1 -= 5;
|
||||
i1 -= 9;
|
||||
}
|
||||
|
||||
if (i1 < 0) {
|
||||
@ -280,11 +280,11 @@ public class ContainerAnvil extends Container {
|
||||
|
||||
public void addSlotListener(ICrafting icrafting) {
|
||||
super.addSlotListener(icrafting);
|
||||
icrafting.setContainerData(this, 0, this.e);
|
||||
icrafting.setContainerData(this, 0, this.a);
|
||||
}
|
||||
|
||||
public void a(EntityHuman entityhuman) {
|
||||
super.a(entityhuman);
|
||||
public void b(EntityHuman entityhuman) {
|
||||
super.b(entityhuman);
|
||||
if (!this.h.isStatic) {
|
||||
for (int i = 0; i < this.g.getSize(); ++i) {
|
||||
ItemStack itemstack = this.g.splitWithoutUpdate(i);
|
||||
@ -296,14 +296,14 @@ public class ContainerAnvil extends Container {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
if (!this.checkReachable) return true; // CraftBukkit
|
||||
return this.h.getTypeId(this.i, this.j, this.k) != Block.ANVIL.id ? false : entityhuman.e((double) this.i + 0.5D, (double) this.j + 0.5D, (double) this.k + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
public ItemStack b(EntityHuman entityhuman, int i) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.b.get(i);
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
||||
|
||||
public class ContainerBeacon extends Container {
|
||||
|
||||
private TileEntityBeacon e;
|
||||
private TileEntityBeacon a;
|
||||
private final SlotBeacon f;
|
||||
private int g;
|
||||
private int h;
|
||||
@ -20,7 +20,7 @@ public class ContainerBeacon extends Container {
|
||||
|
||||
public ContainerBeacon(PlayerInventory playerinventory, TileEntityBeacon tileentitybeacon) {
|
||||
player = playerinventory; // CraftBukkit
|
||||
this.e = tileentitybeacon;
|
||||
this.a = tileentitybeacon;
|
||||
this.a(this.f = new SlotBeacon(this, tileentitybeacon, 0, 136, 110));
|
||||
byte b0 = 36;
|
||||
short short1 = 137;
|
||||
@ -54,17 +54,17 @@ public class ContainerBeacon extends Container {
|
||||
}
|
||||
|
||||
public TileEntityBeacon d() {
|
||||
return this.e;
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
if (!this.checkReachable) return true; // CraftBukkit
|
||||
return this.e.a(entityhuman);
|
||||
return this.a.a_(entityhuman);
|
||||
}
|
||||
|
||||
public ItemStack b(EntityHuman entityhuman, int i) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.b.get(i);
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
@ -114,7 +114,7 @@ public class ContainerBeacon extends Container {
|
||||
return bukkitEntity;
|
||||
}
|
||||
|
||||
CraftInventory inventory = new CraftInventoryBeacon(this.e);
|
||||
CraftInventory inventory = new CraftInventoryBeacon(this.a);
|
||||
bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
|
||||
return bukkitEntity;
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
||||
@ -45,10 +43,9 @@ public class ContainerBrewingStand extends Container {
|
||||
|
||||
public void b() {
|
||||
super.b();
|
||||
Iterator iterator = this.listeners.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
ICrafting icrafting = (ICrafting) iterator.next();
|
||||
for (int i = 0; i < this.listeners.size(); ++i) {
|
||||
ICrafting icrafting = (ICrafting) this.listeners.get(i);
|
||||
|
||||
if (this.g != this.brewingStand.x_()) {
|
||||
icrafting.setContainerData(this, 0, this.brewingStand.x_());
|
||||
@ -58,14 +55,14 @@ public class ContainerBrewingStand extends Container {
|
||||
this.g = this.brewingStand.x_();
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
if (!this.checkReachable) return true; // CraftBukkit
|
||||
return this.brewingStand.a(entityhuman);
|
||||
return this.brewingStand.a_(entityhuman);
|
||||
}
|
||||
|
||||
public ItemStack b(EntityHuman entityhuman, int i) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.b.get(i);
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
@ -62,21 +62,21 @@ public class ContainerChest extends Container {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
if (!this.checkReachable) return true; // CraftBukkit
|
||||
return this.container.a(entityhuman);
|
||||
return this.container.a_(entityhuman);
|
||||
}
|
||||
|
||||
public ItemStack b(EntityHuman entityhuman, int i) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.b.get(i);
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
if (i < this.f * 9) {
|
||||
if (!this.a(itemstack1, this.f * 9, this.b.size(), true)) {
|
||||
if (!this.a(itemstack1, this.f * 9, this.c.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else if (!this.a(itemstack1, 0, this.f * 9, false)) {
|
||||
@ -93,8 +93,12 @@ public class ContainerChest extends Container {
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
public void a(EntityHuman entityhuman) {
|
||||
super.a(entityhuman);
|
||||
public void b(EntityHuman entityhuman) {
|
||||
super.b(entityhuman);
|
||||
this.container.f();
|
||||
}
|
||||
|
||||
public IInventory d() {
|
||||
return this.container;
|
||||
}
|
||||
}
|
||||
|
@ -40,14 +40,14 @@ public class ContainerDispenser extends Container {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
if (!this.checkReachable) return true; // CraftBukkit
|
||||
return this.items.a(entityhuman);
|
||||
return this.items.a_(entityhuman);
|
||||
}
|
||||
|
||||
public ItemStack b(EntityHuman entityhuman, int i) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.b.get(i);
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
@ -65,10 +65,9 @@ public class ContainerEnchantTable extends Container {
|
||||
|
||||
public void b() {
|
||||
super.b();
|
||||
Iterator iterator = this.listeners.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
ICrafting icrafting = (ICrafting) iterator.next();
|
||||
for (int i = 0; i < this.listeners.size(); ++i) {
|
||||
ICrafting icrafting = (ICrafting) this.listeners.get(i);
|
||||
|
||||
icrafting.setContainerData(this, 0, this.costs[0]);
|
||||
icrafting.setContainerData(this, 1, this.costs[1]);
|
||||
@ -191,8 +190,8 @@ public class ContainerEnchantTable extends Container {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(EntityHuman entityhuman) {
|
||||
super.a(entityhuman);
|
||||
public void b(EntityHuman entityhuman) {
|
||||
super.b(entityhuman);
|
||||
if (!this.world.isStatic) {
|
||||
ItemStack itemstack = this.enchantSlots.splitWithoutUpdate(0);
|
||||
|
||||
@ -202,14 +201,14 @@ public class ContainerEnchantTable extends Container {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
if (!this.checkReachable) return true; // CraftBukkit
|
||||
return this.world.getTypeId(this.x, this.y, this.z) != Block.ENCHANTMENT_TABLE.id ? false : entityhuman.e((double) this.x + 0.5D, (double) this.y + 0.5D, (double) this.z + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
public ItemStack b(EntityHuman entityhuman, int i) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.b.get(i);
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
@ -220,15 +219,15 @@ public class ContainerEnchantTable extends Container {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if (((Slot) this.b.get(0)).d() || !((Slot) this.b.get(0)).isAllowed(itemstack1)) {
|
||||
if (((Slot) this.c.get(0)).d() || !((Slot) this.c.get(0)).isAllowed(itemstack1)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemstack1.hasTag() && itemstack1.count == 1) {
|
||||
((Slot) this.b.get(0)).set(itemstack1.cloneItemStack());
|
||||
((Slot) this.c.get(0)).set(itemstack1.cloneItemStack());
|
||||
itemstack1.count = 0;
|
||||
} else if (itemstack1.count >= 1) {
|
||||
((Slot) this.b.get(0)).set(new ItemStack(itemstack1.id, 1, itemstack1.getData()));
|
||||
((Slot) this.c.get(0)).set(new ItemStack(itemstack1.id, 1, itemstack1.getData()));
|
||||
--itemstack1.count;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
||||
@ -58,10 +56,9 @@ public class ContainerFurnace extends Container {
|
||||
|
||||
public void b() {
|
||||
super.b();
|
||||
Iterator iterator = this.listeners.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
ICrafting icrafting = (ICrafting) iterator.next();
|
||||
for (int i = 0; i < this.listeners.size(); ++i) {
|
||||
ICrafting icrafting = (ICrafting) this.listeners.get(i);
|
||||
|
||||
if (this.f != this.furnace.cookTime) {
|
||||
icrafting.setContainerData(this, 0, this.furnace.cookTime);
|
||||
@ -81,14 +78,14 @@ public class ContainerFurnace extends Container {
|
||||
this.h = this.furnace.ticksForCurrentFuel;
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
if (!this.checkReachable) return true; // CraftBukkit
|
||||
return this.furnace.a(entityhuman);
|
||||
return this.furnace.a_(entityhuman);
|
||||
}
|
||||
|
||||
public ItemStack b(EntityHuman entityhuman, int i) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.b.get(i);
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
@ -64,13 +64,13 @@ public class ContainerMerchant extends Container {
|
||||
this.f.c(i);
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
return this.merchant.m_() == entityhuman;
|
||||
}
|
||||
|
||||
public ItemStack b(EntityHuman entityhuman, int i) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.b.get(i);
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
@ -110,10 +110,10 @@ public class ContainerMerchant extends Container {
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
public void a(EntityHuman entityhuman) {
|
||||
super.a(entityhuman);
|
||||
this.merchant.a_((EntityHuman) null);
|
||||
super.a(entityhuman);
|
||||
public void b(EntityHuman entityhuman) {
|
||||
super.b(entityhuman);
|
||||
this.merchant.b_((EntityHuman) null);
|
||||
super.b(entityhuman);
|
||||
if (!this.g.isStatic) {
|
||||
ItemStack itemstack = this.f.splitWithoutUpdate(0);
|
||||
|
||||
|
@ -65,8 +65,8 @@ public class ContainerPlayer extends Container {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public void a(EntityHuman entityhuman) {
|
||||
super.a(entityhuman);
|
||||
public void b(EntityHuman entityhuman) {
|
||||
super.b(entityhuman);
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
ItemStack itemstack = this.craftInventory.splitWithoutUpdate(i);
|
||||
@ -79,13 +79,13 @@ public class ContainerPlayer extends Container {
|
||||
this.resultInventory.setItem(0, (ItemStack) null);
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemStack b(EntityHuman entityhuman, int i) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.b.get(i);
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
@ -105,7 +105,7 @@ public class ContainerPlayer extends Container {
|
||||
if (!this.a(itemstack1, 9, 45, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (itemstack.getItem() instanceof ItemArmor && !((Slot) this.b.get(5 + ((ItemArmor) itemstack.getItem()).a)).d()) {
|
||||
} else if (itemstack.getItem() instanceof ItemArmor && !((Slot) this.c.get(5 + ((ItemArmor) itemstack.getItem()).a)).d()) {
|
||||
int j = 5 + ((ItemArmor) itemstack.getItem()).a;
|
||||
|
||||
if (!this.a(itemstack1, j, j + 1, false)) {
|
||||
|
@ -67,8 +67,8 @@ public class ContainerWorkbench extends Container {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public void a(EntityHuman entityhuman) {
|
||||
super.a(entityhuman);
|
||||
public void b(EntityHuman entityhuman) {
|
||||
super.b(entityhuman);
|
||||
if (!this.g.isStatic) {
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
ItemStack itemstack = this.craftInventory.splitWithoutUpdate(i);
|
||||
@ -80,14 +80,14 @@ public class ContainerWorkbench extends Container {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
if (!this.checkReachable) return true; // CraftBukkit
|
||||
return this.g.getTypeId(this.h, this.i, this.j) != Block.WORKBENCH.id ? false : entityhuman.e((double) this.h + 0.5D, (double) this.i + 0.5D, (double) this.j + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
public ItemStack b(EntityHuman entityhuman, int i) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.b.get(i);
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.d()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
@ -47,7 +47,7 @@ public class ControllerMove {
|
||||
float f = (float) (org.bukkit.craftbukkit.TrigMath.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||
|
||||
this.a.yaw = this.a(this.a.yaw, f, 30.0F);
|
||||
this.a.e(this.e * this.a.by());
|
||||
this.a.e(this.e * this.a.bB());
|
||||
if (d2 > 0.0D && d0 * d0 + d1 * d1 < 1.0D) {
|
||||
this.a.getControllerJump().a();
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package net.minecraft.server;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
@ -142,16 +141,12 @@ public class CraftingManager {
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int k = 0;
|
||||
int l;
|
||||
|
||||
if (aobject[i] instanceof String[]) {
|
||||
String[] astring = (String[]) ((String[]) aobject[i++]);
|
||||
String[] astring1 = astring;
|
||||
|
||||
l = astring.length;
|
||||
|
||||
for (int i1 = 0; i1 < l; ++i1) {
|
||||
String s1 = astring1[i1];
|
||||
for (int l = 0; l < astring.length; ++l) {
|
||||
String s1 = astring[l];
|
||||
|
||||
++k;
|
||||
j = s1.length();
|
||||
@ -186,13 +181,13 @@ public class CraftingManager {
|
||||
|
||||
ItemStack[] aitemstack = new ItemStack[j * k];
|
||||
|
||||
for (l = 0; l < j * k; ++l) {
|
||||
char c0 = s.charAt(l);
|
||||
for (int i1 = 0; i1 < j * k; ++i1) {
|
||||
char c0 = s.charAt(i1);
|
||||
|
||||
if (hashmap.containsKey(Character.valueOf(c0))) {
|
||||
aitemstack[l] = ((ItemStack) hashmap.get(Character.valueOf(c0))).cloneItemStack();
|
||||
aitemstack[i1] = ((ItemStack) hashmap.get(Character.valueOf(c0))).cloneItemStack();
|
||||
} else {
|
||||
aitemstack[l] = null;
|
||||
aitemstack[i1] = null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -229,7 +224,9 @@ public class CraftingManager {
|
||||
ItemStack itemstack = null;
|
||||
ItemStack itemstack1 = null;
|
||||
|
||||
for (int j = 0; j < inventorycrafting.getSize(); ++j) {
|
||||
int j;
|
||||
|
||||
for (j = 0; j < inventorycrafting.getSize(); ++j) {
|
||||
ItemStack itemstack2 = inventorycrafting.getItem(j);
|
||||
|
||||
if (itemstack2 != null) {
|
||||
@ -267,18 +264,10 @@ public class CraftingManager {
|
||||
return result;
|
||||
// CraftBukkit end
|
||||
} else {
|
||||
Iterator iterator = this.recipes.iterator();
|
||||
|
||||
IRecipe irecipe;
|
||||
|
||||
do {
|
||||
if (!iterator.hasNext()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
irecipe = (IRecipe) iterator.next();
|
||||
} while (!irecipe.a(inventorycrafting, world));
|
||||
for (j = 0; j < this.recipes.size(); ++j) {
|
||||
IRecipe irecipe = (IRecipe) this.recipes.get(j);
|
||||
|
||||
if (irecipe.a(inventorycrafting, world)) {
|
||||
// CraftBukkit start - INVENTORY_PRE_CRAFT event
|
||||
inventorycrafting.currentRecipe = irecipe;
|
||||
ItemStack result = irecipe.a(inventorycrafting);
|
||||
@ -287,6 +276,10 @@ public class CraftingManager {
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public List getRecipes() {
|
||||
return this.recipes;
|
||||
}
|
||||
|
@ -6,11 +6,10 @@ import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
@ -19,40 +18,29 @@ public class CrashReport {
|
||||
|
||||
private final String a;
|
||||
private final Throwable b;
|
||||
private final Map c = new LinkedHashMap();
|
||||
private File d = null;
|
||||
private final CrashReportSystemDetails c = new CrashReportSystemDetails(this, "System Details");
|
||||
private final List d = new ArrayList();
|
||||
private File e = null;
|
||||
private boolean f = true;
|
||||
private StackTraceElement[] g = new StackTraceElement[0];
|
||||
|
||||
public CrashReport(String s, Throwable throwable) {
|
||||
this.a = s;
|
||||
this.b = throwable;
|
||||
this.g();
|
||||
this.h();
|
||||
}
|
||||
|
||||
private void g() {
|
||||
this.a("Minecraft Version", (Callable) (new CrashReportVersion(this)));
|
||||
this.a("Operating System", (Callable) (new CrashReportOperatingSystem(this)));
|
||||
this.a("Java Version", (Callable) (new CrashReportJavaVersion(this)));
|
||||
this.a("Java VM Version", (Callable) (new CrashReportJavaVMVersion(this)));
|
||||
this.a("Memory", (Callable) (new CrashReportMemory(this)));
|
||||
this.a("JVM Flags", (Callable) (new CrashReportJVMFlags(this)));
|
||||
this.a("AABB Pool Size", (Callable) (new CrashReportAABBPoolSize(this)));
|
||||
this.a("CraftBukkit Information", (Callable) (new org.bukkit.craftbukkit.CraftCrashReport())); // CraftBukkit
|
||||
}
|
||||
|
||||
public void a(String s, Callable callable) {
|
||||
try {
|
||||
this.a(s, callable.call());
|
||||
} catch (Throwable throwable) {
|
||||
this.a(s, throwable);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(String s, Object object) {
|
||||
this.c.put(s, object == null ? "null" : object.toString());
|
||||
}
|
||||
|
||||
public void a(String s, Throwable throwable) {
|
||||
this.a(s, ("~ERROR~ " + throwable.getClass().getSimpleName() + ": " + throwable.getMessage()));
|
||||
private void h() {
|
||||
this.c.a("Minecraft Version", (Callable) (new CrashReportVersion(this)));
|
||||
this.c.a("Operating System", (Callable) (new CrashReportOperatingSystem(this)));
|
||||
this.c.a("Java Version", (Callable) (new CrashReportJavaVersion(this)));
|
||||
this.c.a("Java VM Version", (Callable) (new CrashReportJavaVMVersion(this)));
|
||||
this.c.a("Memory", (Callable) (new CrashReportMemory(this)));
|
||||
this.c.a("JVM Flags", (Callable) (new CrashReportJVMFlags(this)));
|
||||
this.c.a("AABB Pool Size", (Callable) (new CrashReportAABBPoolSize(this)));
|
||||
this.c.a("Suspicious classes", (Callable) (new CrashReportSuspiciousClasses(this)));
|
||||
this.c.a("IntCache", (Callable) (new CrashReportIntCacheSize(this)));
|
||||
this.c.a("CraftBukkit Information", (Callable) (new org.bukkit.craftbukkit.CraftCrashReport())); // CraftBukkit
|
||||
}
|
||||
|
||||
public String a() {
|
||||
@ -64,20 +52,32 @@ public class CrashReport {
|
||||
}
|
||||
|
||||
public void a(StringBuilder stringbuilder) {
|
||||
boolean flag = true;
|
||||
if (this.g != null && this.g.length > 0) {
|
||||
stringbuilder.append("-- Head --\n");
|
||||
stringbuilder.append("Stacktrace:\n");
|
||||
StackTraceElement[] astacktraceelement = this.g;
|
||||
int i = astacktraceelement.length;
|
||||
|
||||
for (Iterator iterator = this.c.entrySet().iterator(); iterator.hasNext(); flag = false) {
|
||||
Entry entry = (Entry) iterator.next();
|
||||
for (int j = 0; j < i; ++j) {
|
||||
StackTraceElement stacktraceelement = astacktraceelement[j];
|
||||
|
||||
if (!flag) {
|
||||
stringbuilder.append("\t").append("at ").append(stacktraceelement.toString());
|
||||
stringbuilder.append("\n");
|
||||
}
|
||||
|
||||
stringbuilder.append("- ");
|
||||
stringbuilder.append((String) entry.getKey());
|
||||
stringbuilder.append(": ");
|
||||
stringbuilder.append((String) entry.getValue());
|
||||
stringbuilder.append("\n");
|
||||
}
|
||||
|
||||
Iterator iterator = this.d.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
CrashReportSystemDetails crashreportsystemdetails = (CrashReportSystemDetails) iterator.next();
|
||||
|
||||
crashreportsystemdetails.a(stringbuilder);
|
||||
stringbuilder.append("\n\n");
|
||||
}
|
||||
|
||||
this.c.a(stringbuilder);
|
||||
}
|
||||
|
||||
public String d() {
|
||||
@ -112,7 +112,7 @@ public class CrashReport {
|
||||
|
||||
stringbuilder.append("---- Minecraft Crash Report ----\n");
|
||||
stringbuilder.append("// ");
|
||||
stringbuilder.append(h());
|
||||
stringbuilder.append(i());
|
||||
stringbuilder.append("\n\n");
|
||||
stringbuilder.append("Time: ");
|
||||
stringbuilder.append((new SimpleDateFormat()).format(new Date()));
|
||||
@ -121,15 +121,19 @@ public class CrashReport {
|
||||
stringbuilder.append(this.a);
|
||||
stringbuilder.append("\n\n");
|
||||
stringbuilder.append(this.d());
|
||||
stringbuilder.append("\n");
|
||||
stringbuilder.append("Relevant Details:");
|
||||
stringbuilder.append("\n");
|
||||
stringbuilder.append("\n\nA detailed walkthrough of the error, its code path and all known details is as follows:\n");
|
||||
|
||||
for (int i = 0; i < 87; ++i) {
|
||||
stringbuilder.append("-");
|
||||
}
|
||||
|
||||
stringbuilder.append("\n\n");
|
||||
this.a(stringbuilder);
|
||||
return stringbuilder.toString();
|
||||
}
|
||||
|
||||
public boolean a(File file1) {
|
||||
if (this.d != null) {
|
||||
if (this.e != null) {
|
||||
return false;
|
||||
} else {
|
||||
if (file1.getParentFile() != null) {
|
||||
@ -141,7 +145,7 @@ public class CrashReport {
|
||||
|
||||
filewriter.write(this.e());
|
||||
filewriter.close();
|
||||
this.d = file1;
|
||||
this.e = file1;
|
||||
return true;
|
||||
} catch (Throwable throwable) {
|
||||
Logger.getLogger("Minecraft").log(Level.SEVERE, "Could not save crash report to " + file1, throwable);
|
||||
@ -150,8 +154,49 @@ public class CrashReport {
|
||||
}
|
||||
}
|
||||
|
||||
private static String h() {
|
||||
String[] astring = new String[] { "Who set us up the TNT?", "Everything\'s going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I\'m sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don\'t be sad. I\'ll do better next time, I promise!", "Don\'t be sad, have a hug! <3", "I just don\'t know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn\'t worry myself about that.", "I bet Cylons wouldn\'t have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I\'m Minecraft, and I\'m a crashaholic.", "Ooh. Shiny.", "This doesn\'t make any sense!", "Why is it breaking :("};
|
||||
public CrashReportSystemDetails g() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public CrashReportSystemDetails a(String s) {
|
||||
return this.a(s, 1);
|
||||
}
|
||||
|
||||
public CrashReportSystemDetails a(String s, int i) {
|
||||
CrashReportSystemDetails crashreportsystemdetails = new CrashReportSystemDetails(this, s);
|
||||
|
||||
if (this.f) {
|
||||
int j = crashreportsystemdetails.a(i);
|
||||
StackTraceElement[] astacktraceelement = this.b.getStackTrace();
|
||||
StackTraceElement stacktraceelement = null;
|
||||
StackTraceElement stacktraceelement1 = null;
|
||||
|
||||
if (astacktraceelement != null && astacktraceelement.length - j < astacktraceelement.length) {
|
||||
stacktraceelement = astacktraceelement[astacktraceelement.length - j];
|
||||
if (astacktraceelement.length + 1 - j < astacktraceelement.length) {
|
||||
stacktraceelement1 = astacktraceelement[astacktraceelement.length + 1 - j];
|
||||
}
|
||||
}
|
||||
|
||||
this.f = crashreportsystemdetails.a(stacktraceelement, stacktraceelement1);
|
||||
if (j > 0 && !this.d.isEmpty()) {
|
||||
CrashReportSystemDetails crashreportsystemdetails1 = (CrashReportSystemDetails) this.d.get(this.d.size() - 1);
|
||||
|
||||
crashreportsystemdetails1.b(j);
|
||||
} else if (astacktraceelement != null && astacktraceelement.length >= j) {
|
||||
this.g = new StackTraceElement[astacktraceelement.length - j];
|
||||
System.arraycopy(astacktraceelement, 0, this.g, 0, this.g.length);
|
||||
} else {
|
||||
this.f = false;
|
||||
}
|
||||
}
|
||||
|
||||
this.d.add(crashreportsystemdetails);
|
||||
return crashreportsystemdetails;
|
||||
}
|
||||
|
||||
private static String i() {
|
||||
String[] astring = new String[] { "Who set us up the TNT?", "Everything\'s going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I\'m sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don\'t be sad. I\'ll do better next time, I promise!", "Don\'t be sad, have a hug! <3", "I just don\'t know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn\'t worry myself about that.", "I bet Cylons wouldn\'t have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I\'m Minecraft, and I\'m a crashaholic.", "Ooh. Shiny.", "This doesn\'t make any sense!", "Why is it breaking :(", "Don\'t do that.", "Ouch. That hurt :(", "You\'re mean.", "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]", "There are four lights!"};
|
||||
|
||||
try {
|
||||
return astring[(int) (System.nanoTime() % (long) astring.length)];
|
||||
@ -159,4 +204,16 @@ public class CrashReport {
|
||||
return "Witty comment unavailable :(";
|
||||
}
|
||||
}
|
||||
|
||||
public static CrashReport a(Throwable throwable, String s) {
|
||||
CrashReport crashreport;
|
||||
|
||||
if (throwable instanceof ReportedException) {
|
||||
crashreport = ((ReportedException) throwable).a();
|
||||
} else {
|
||||
crashreport = new CrashReport(s, throwable);
|
||||
}
|
||||
|
||||
return crashreport;
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
System.setErr(new PrintStream(new LoggerOutputStream(log, Level.SEVERE), true));
|
||||
// CraftBukkit end
|
||||
|
||||
log.info("Starting minecraft server version 1.4.2");
|
||||
log.info("Starting minecraft server version 1.4.4");
|
||||
if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
|
||||
log.warning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
|
||||
}
|
||||
@ -67,6 +67,12 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
this.setAllowFlight(this.propertyManager.getBoolean("allow-flight", false));
|
||||
this.setTexturePack(this.propertyManager.getString("texture-pack", ""));
|
||||
this.setMotd(this.propertyManager.getString("motd", "A Minecraft Server"));
|
||||
if (this.propertyManager.getInt("difficulty", 1) < 0) {
|
||||
this.propertyManager.a("difficulty", Integer.valueOf(0));
|
||||
} else if (this.propertyManager.getInt("difficulty", 1) > 3) {
|
||||
this.propertyManager.a("difficulty", Integer.valueOf(3));
|
||||
}
|
||||
|
||||
this.generateStructures = this.propertyManager.getBoolean("generate-structures", true);
|
||||
int i = this.propertyManager.getInt("gamemode", EnumGamemode.SURVIVAL.a());
|
||||
|
||||
@ -203,7 +209,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
|
||||
public CrashReport b(CrashReport crashreport) {
|
||||
crashreport = super.b(crashreport);
|
||||
crashreport.a("Type", (Callable) (new CrashReportType(this)));
|
||||
crashreport.g().a("Is Modded", (Callable) (new CrashReportModded(this)));
|
||||
crashreport.g().a("Type", (Callable) (new CrashReportType(this)));
|
||||
return crashreport;
|
||||
}
|
||||
|
||||
|
@ -27,9 +27,9 @@ public class DedicatedServerConnectionThread extends Thread {
|
||||
public DedicatedServerConnectionThread(ServerConnection serverconnection, InetAddress inetaddress, int i) throws IOException { // CraftBukkit - added throws
|
||||
super("Listen thread");
|
||||
this.f = serverconnection;
|
||||
this.g = inetaddress;
|
||||
this.h = i;
|
||||
this.e = new ServerSocket(i, 0, inetaddress);
|
||||
this.g = inetaddress == null ? this.e.getInetAddress() : inetaddress;
|
||||
this.e.setPerformancePreferences(0, 2, 1);
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ public class DedicatedServerConnectionThread extends Thread {
|
||||
netloginhandler.c();
|
||||
} catch (Exception exception) {
|
||||
netloginhandler.disconnect("Internal server error");
|
||||
a.log(Level.WARNING, "Failed to handle packet: " + exception, exception);
|
||||
a.log(Level.WARNING, "Failed to handle packet for " + netloginhandler.getName() + ": " + exception, exception);
|
||||
}
|
||||
|
||||
if (netloginhandler.c) {
|
||||
|
@ -79,4 +79,14 @@ public abstract class Enchantment {
|
||||
this.name = s;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String a() {
|
||||
return "enchantment." + this.name;
|
||||
}
|
||||
|
||||
public String c(int i) {
|
||||
String s = LocaleI18n.get(this.a());
|
||||
|
||||
return s + " " + LocaleI18n.get("enchantment.level." + i);
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
// CraftBukkit start
|
||||
import java.util.UUID;
|
||||
@ -90,11 +90,12 @@ public abstract class Entity {
|
||||
public int ak;
|
||||
public boolean al;
|
||||
public boolean am;
|
||||
public int an;
|
||||
public int portalCooldown;
|
||||
protected boolean ao;
|
||||
private int h;
|
||||
public int dimension;
|
||||
protected int aq;
|
||||
private boolean invulnerable;
|
||||
public EnumEntitySize ar;
|
||||
public UUID uniqueId = UUID.randomUUID(); // CraftBukkit
|
||||
public boolean valid = false; // CraftBukkit
|
||||
@ -132,6 +133,7 @@ public abstract class Entity {
|
||||
this.datawatcher = new DataWatcher();
|
||||
this.ah = false;
|
||||
this.aq = 0;
|
||||
this.invulnerable = false;
|
||||
this.ar = EnumEntitySize.SIZE_2;
|
||||
this.world = world;
|
||||
this.setPosition(0.0D, 0.0D, 0.0D);
|
||||
@ -244,14 +246,15 @@ public abstract class Entity {
|
||||
int i;
|
||||
|
||||
if (!this.world.isStatic && this.world instanceof WorldServer) {
|
||||
this.world.methodProfiler.a("portal");
|
||||
MinecraftServer minecraftserver = ((WorldServer) this.world).getMinecraftServer();
|
||||
|
||||
i = this.z();
|
||||
if (this.ao) {
|
||||
if (minecraftserver.getAllowNether()) {
|
||||
if (true || minecraftserver.getAllowNether()) { // CraftBukkit
|
||||
if (this.vehicle == null && this.h++ >= i) {
|
||||
this.h = i;
|
||||
this.an = this.ab();
|
||||
this.portalCooldown = this.ab();
|
||||
byte b0;
|
||||
|
||||
if (this.world.worldProvider.dimension == -1) {
|
||||
@ -275,59 +278,26 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.an > 0) {
|
||||
--this.an;
|
||||
}
|
||||
if (this.portalCooldown > 0) {
|
||||
--this.portalCooldown;
|
||||
}
|
||||
|
||||
int j;
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
|
||||
if (this.isSprinting() && !this.H()) {
|
||||
int k = MathHelper.floor(this.locX);
|
||||
int j = MathHelper.floor(this.locX);
|
||||
|
||||
i = MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height);
|
||||
j = MathHelper.floor(this.locZ);
|
||||
int l = this.world.getTypeId(k, i, j);
|
||||
int k = MathHelper.floor(this.locZ);
|
||||
int l = this.world.getTypeId(j, i, k);
|
||||
|
||||
if (l > 0) {
|
||||
this.world.addParticle("tilecrack_" + l, this.locX + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, this.boundingBox.b + 0.1D, this.locZ + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, -this.motX * 4.0D, 1.5D, -this.motZ * 4.0D);
|
||||
this.world.addParticle("tilecrack_" + l + "_" + this.world.getData(j, i, k), this.locX + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, this.boundingBox.b + 0.1D, this.locZ + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, -this.motX * 4.0D, 1.5D, -this.motZ * 4.0D);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.I()) {
|
||||
if (!this.ad && !this.justCreated) {
|
||||
float f = MathHelper.sqrt(this.motX * this.motX * 0.20000000298023224D + this.motY * this.motY + this.motZ * this.motZ * 0.20000000298023224D) * 0.2F;
|
||||
|
||||
if (f > 1.0F) {
|
||||
f = 1.0F;
|
||||
}
|
||||
|
||||
this.world.makeSound(this, "liquid.splash", f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
float f1 = (float) MathHelper.floor(this.boundingBox.b);
|
||||
|
||||
float f2;
|
||||
float f3;
|
||||
|
||||
for (j = 0; (float) j < 1.0F + this.width * 20.0F; ++j) {
|
||||
f3 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width;
|
||||
f2 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width;
|
||||
this.world.addParticle("bubble", this.locX + (double) f3, (double) (f1 + 1.0F), this.locZ + (double) f2, this.motX, this.motY - (double) (this.random.nextFloat() * 0.2F), this.motZ);
|
||||
}
|
||||
|
||||
for (j = 0; (float) j < 1.0F + this.width * 20.0F; ++j) {
|
||||
f3 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width;
|
||||
f2 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width;
|
||||
this.world.addParticle("splash", this.locX + (double) f3, (double) (f1 + 1.0F), this.locZ + (double) f2, this.motX, this.motY, this.motZ);
|
||||
}
|
||||
}
|
||||
|
||||
this.fallDistance = 0.0F;
|
||||
this.ad = true;
|
||||
this.fireTicks = 0;
|
||||
} else {
|
||||
this.ad = false;
|
||||
}
|
||||
|
||||
this.I();
|
||||
if (this.world.isStatic) {
|
||||
this.fireTicks = 0;
|
||||
} else if (this.fireTicks > 0) {
|
||||
@ -517,10 +487,8 @@ public abstract class Entity {
|
||||
|
||||
List list = this.world.getCubes(this, this.boundingBox.a(d0, d1, d2));
|
||||
|
||||
AxisAlignedBB axisalignedbb1;
|
||||
|
||||
for (Iterator iterator = list.iterator(); iterator.hasNext(); d1 = axisalignedbb1.b(this.boundingBox, d1)) {
|
||||
axisalignedbb1 = (AxisAlignedBB) iterator.next();
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
d1 = ((AxisAlignedBB) list.get(i)).b(this.boundingBox, d1);
|
||||
}
|
||||
|
||||
this.boundingBox.d(0.0D, d1, 0.0D);
|
||||
@ -532,11 +500,10 @@ public abstract class Entity {
|
||||
|
||||
boolean flag1 = this.onGround || d7 != d1 && d7 < 0.0D;
|
||||
|
||||
AxisAlignedBB axisalignedbb2;
|
||||
Iterator iterator1;
|
||||
int j;
|
||||
|
||||
for (iterator1 = list.iterator(); iterator1.hasNext(); d0 = axisalignedbb2.a(this.boundingBox, d0)) {
|
||||
axisalignedbb2 = (AxisAlignedBB) iterator1.next();
|
||||
for (j = 0; j < list.size(); ++j) {
|
||||
d0 = ((AxisAlignedBB) list.get(j)).a(this.boundingBox, d0);
|
||||
}
|
||||
|
||||
this.boundingBox.d(d0, 0.0D, 0.0D);
|
||||
@ -546,8 +513,8 @@ public abstract class Entity {
|
||||
d0 = 0.0D;
|
||||
}
|
||||
|
||||
for (iterator1 = list.iterator(); iterator1.hasNext(); d2 = axisalignedbb2.c(this.boundingBox, d2)) {
|
||||
axisalignedbb2 = (AxisAlignedBB) iterator1.next();
|
||||
for (j = 0; j < list.size(); ++j) {
|
||||
d2 = ((AxisAlignedBB) list.get(j)).c(this.boundingBox, d2);
|
||||
}
|
||||
|
||||
this.boundingBox.d(0.0D, 0.0D, d2);
|
||||
@ -560,6 +527,7 @@ public abstract class Entity {
|
||||
double d10;
|
||||
double d11;
|
||||
double d12;
|
||||
int k;
|
||||
|
||||
if (this.X > 0.0F && flag1 && (flag || this.W < 0.05F) && (d6 != d0 || d8 != d2)) {
|
||||
d10 = d0;
|
||||
@ -568,16 +536,13 @@ public abstract class Entity {
|
||||
d0 = d6;
|
||||
d1 = (double) this.X;
|
||||
d2 = d8;
|
||||
AxisAlignedBB axisalignedbb3 = this.boundingBox.clone();
|
||||
AxisAlignedBB axisalignedbb1 = this.boundingBox.clone();
|
||||
|
||||
this.boundingBox.c(axisalignedbb);
|
||||
list = this.world.getCubes(this, this.boundingBox.a(d6, d1, d8));
|
||||
|
||||
Iterator iterator2;
|
||||
AxisAlignedBB axisalignedbb4;
|
||||
|
||||
for (iterator2 = list.iterator(); iterator2.hasNext(); d1 = axisalignedbb4.b(this.boundingBox, d1)) {
|
||||
axisalignedbb4 = (AxisAlignedBB) iterator2.next();
|
||||
for (k = 0; k < list.size(); ++k) {
|
||||
d1 = ((AxisAlignedBB) list.get(k)).b(this.boundingBox, d1);
|
||||
}
|
||||
|
||||
this.boundingBox.d(0.0D, d1, 0.0D);
|
||||
@ -587,8 +552,8 @@ public abstract class Entity {
|
||||
d0 = 0.0D;
|
||||
}
|
||||
|
||||
for (iterator2 = list.iterator(); iterator2.hasNext(); d0 = axisalignedbb4.a(this.boundingBox, d0)) {
|
||||
axisalignedbb4 = (AxisAlignedBB) iterator2.next();
|
||||
for (k = 0; k < list.size(); ++k) {
|
||||
d0 = ((AxisAlignedBB) list.get(k)).a(this.boundingBox, d0);
|
||||
}
|
||||
|
||||
this.boundingBox.d(d0, 0.0D, 0.0D);
|
||||
@ -598,8 +563,8 @@ public abstract class Entity {
|
||||
d0 = 0.0D;
|
||||
}
|
||||
|
||||
for (iterator2 = list.iterator(); iterator2.hasNext(); d2 = axisalignedbb4.c(this.boundingBox, d2)) {
|
||||
axisalignedbb4 = (AxisAlignedBB) iterator2.next();
|
||||
for (k = 0; k < list.size(); ++k) {
|
||||
d2 = ((AxisAlignedBB) list.get(k)).c(this.boundingBox, d2);
|
||||
}
|
||||
|
||||
this.boundingBox.d(0.0D, 0.0D, d2);
|
||||
@ -616,8 +581,8 @@ public abstract class Entity {
|
||||
} else {
|
||||
d1 = (double) (-this.X);
|
||||
|
||||
for (iterator2 = list.iterator(); iterator2.hasNext(); d1 = axisalignedbb4.b(this.boundingBox, d1)) {
|
||||
axisalignedbb4 = (AxisAlignedBB) iterator2.next();
|
||||
for (k = 0; k < list.size(); ++k) {
|
||||
d1 = ((AxisAlignedBB) list.get(k)).b(this.boundingBox, d1);
|
||||
}
|
||||
|
||||
this.boundingBox.d(0.0D, d1, 0.0D);
|
||||
@ -627,7 +592,7 @@ public abstract class Entity {
|
||||
d0 = d10;
|
||||
d1 = d11;
|
||||
d2 = d12;
|
||||
this.boundingBox.c(axisalignedbb3);
|
||||
this.boundingBox.c(axisalignedbb1);
|
||||
} else {
|
||||
double d13 = this.boundingBox.b - (double) ((int) this.boundingBox.b);
|
||||
|
||||
@ -684,22 +649,27 @@ public abstract class Entity {
|
||||
// CraftBukkit end
|
||||
|
||||
if (this.f_() && !flag && this.vehicle == null) {
|
||||
int i = MathHelper.floor(this.locX);
|
||||
int j = MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height);
|
||||
int k = MathHelper.floor(this.locZ);
|
||||
int l = this.world.getTypeId(i, j, k);
|
||||
int l = MathHelper.floor(this.locX);
|
||||
|
||||
if (l == 0 && this.world.getTypeId(i, j - 1, k) == Block.FENCE.id) {
|
||||
l = this.world.getTypeId(i, j - 1, k);
|
||||
k = MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height);
|
||||
int i1 = MathHelper.floor(this.locZ);
|
||||
int j1 = this.world.getTypeId(l, k, i1);
|
||||
|
||||
if (j1 == 0) {
|
||||
int k1 = this.world.e(l, k - 1, i1);
|
||||
|
||||
if (k1 == 11 || k1 == 32 || k1 == 21) {
|
||||
j1 = this.world.getTypeId(l, k - 1, i1);
|
||||
}
|
||||
}
|
||||
|
||||
if (l != Block.LADDER.id) {
|
||||
if (j1 != Block.LADDER.id) {
|
||||
d11 = 0.0D;
|
||||
}
|
||||
|
||||
this.Q = (float) ((double) this.Q + (double) MathHelper.sqrt(d10 * d10 + d12 * d12) * 0.6D);
|
||||
this.R = (float) ((double) this.R + (double) MathHelper.sqrt(d10 * d10 + d11 * d11 + d12 * d12) * 0.6D);
|
||||
if (this.R > (float) this.c && l > 0) {
|
||||
if (this.R > (float) this.c && j1 > 0) {
|
||||
this.c = (int) this.R + 1;
|
||||
if (this.H()) {
|
||||
float f = MathHelper.sqrt(this.motX * this.motX * 0.20000000298023224D + this.motY * this.motY + this.motZ * this.motZ * 0.20000000298023224D) * 0.35F;
|
||||
@ -708,11 +678,11 @@ public abstract class Entity {
|
||||
f = 1.0F;
|
||||
}
|
||||
|
||||
this.world.makeSound(this, "liquid.swim", f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
this.makeSound("liquid.swim", f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
}
|
||||
|
||||
this.a(i, j, k, l);
|
||||
Block.byId[l].b(this.world, i, j, k, this);
|
||||
this.a(l, k, i1, j1);
|
||||
Block.byId[j1].b(this.world, l, k, i1, this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -741,7 +711,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
if (flag2 && this.fireTicks > 0) {
|
||||
this.world.makeSound(this, "random.fizz", 0.7F, 1.6F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
this.makeSound("random.fizz", 0.7F, 1.6F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
this.fireTicks = -this.maxFireTicks;
|
||||
}
|
||||
|
||||
@ -777,12 +747,16 @@ public abstract class Entity {
|
||||
|
||||
if (this.world.getTypeId(i, j + 1, k) == Block.SNOW.id) {
|
||||
stepsound = Block.SNOW.stepSound;
|
||||
this.world.makeSound(this, stepsound.getName(), stepsound.getVolume1() * 0.15F, stepsound.getVolume2());
|
||||
this.makeSound(stepsound.getStepSound(), stepsound.getVolume1() * 0.15F, stepsound.getVolume2());
|
||||
} else if (!Block.byId[l].material.isLiquid()) {
|
||||
this.world.makeSound(this, stepsound.getName(), stepsound.getVolume1() * 0.15F, stepsound.getVolume2());
|
||||
this.makeSound(stepsound.getStepSound(), stepsound.getVolume1() * 0.15F, stepsound.getVolume2());
|
||||
}
|
||||
}
|
||||
|
||||
protected void makeSound(String s, float f, float f1) {
|
||||
this.world.makeSound(this, s, f, f1);
|
||||
}
|
||||
|
||||
protected boolean f_() {
|
||||
return true;
|
||||
}
|
||||
@ -833,7 +807,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public boolean G() {
|
||||
return this.ad || this.world.B(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||
return this.ad || this.world.D(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) || this.world.D(MathHelper.floor(this.locX), MathHelper.floor(this.locY + (double) this.length), MathHelper.floor(this.locZ));
|
||||
}
|
||||
|
||||
public boolean H() {
|
||||
@ -841,7 +815,42 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public boolean I() {
|
||||
return this.world.a(this.boundingBox.grow(0.0D, -0.4000000059604645D, 0.0D).shrink(0.001D, 0.001D, 0.001D), Material.WATER, this);
|
||||
if (this.world.a(this.boundingBox.grow(0.0D, -0.4000000059604645D, 0.0D).shrink(0.001D, 0.001D, 0.001D), Material.WATER, this)) {
|
||||
if (!this.ad && !this.justCreated) {
|
||||
float f = MathHelper.sqrt(this.motX * this.motX * 0.20000000298023224D + this.motY * this.motY + this.motZ * this.motZ * 0.20000000298023224D) * 0.2F;
|
||||
|
||||
if (f > 1.0F) {
|
||||
f = 1.0F;
|
||||
}
|
||||
|
||||
this.makeSound("liquid.splash", f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
float f1 = (float) MathHelper.floor(this.boundingBox.b);
|
||||
|
||||
int i;
|
||||
float f2;
|
||||
float f3;
|
||||
|
||||
for (i = 0; (float) i < 1.0F + this.width * 20.0F; ++i) {
|
||||
f2 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width;
|
||||
f3 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width;
|
||||
this.world.addParticle("bubble", this.locX + (double) f2, (double) (f1 + 1.0F), this.locZ + (double) f3, this.motX, this.motY - (double) (this.random.nextFloat() * 0.2F), this.motZ);
|
||||
}
|
||||
|
||||
for (i = 0; (float) i < 1.0F + this.width * 20.0F; ++i) {
|
||||
f2 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width;
|
||||
f3 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width;
|
||||
this.world.addParticle("splash", this.locX + (double) f2, (double) (f1 + 1.0F), this.locZ + (double) f3, this.motX, this.motY, this.motZ);
|
||||
}
|
||||
}
|
||||
|
||||
this.fallDistance = 0.0F;
|
||||
this.ad = true;
|
||||
this.fireTicks = 0;
|
||||
} else {
|
||||
this.ad = false;
|
||||
}
|
||||
|
||||
return this.ad;
|
||||
}
|
||||
|
||||
public boolean a(Material material) {
|
||||
@ -897,7 +906,7 @@ public abstract class Entity {
|
||||
double d0 = (this.boundingBox.e - this.boundingBox.b) * 0.66D;
|
||||
int k = MathHelper.floor(this.locY - (double) this.height + d0);
|
||||
|
||||
return this.world.o(i, k, j);
|
||||
return this.world.p(i, k, j);
|
||||
} else {
|
||||
return 0.0F;
|
||||
}
|
||||
@ -977,7 +986,7 @@ public abstract class Entity {
|
||||
return d0 * d0 + d1 * d1 + d2 * d2;
|
||||
}
|
||||
|
||||
public void b_(EntityHuman entityhuman) {}
|
||||
public void c_(EntityHuman entityhuman) {}
|
||||
|
||||
public void collide(Entity entity) {
|
||||
if (entity.passenger != this && entity.vehicle != this) {
|
||||
@ -1019,9 +1028,13 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
this.K();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean L() {
|
||||
return false;
|
||||
@ -1046,6 +1059,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public void d(NBTTagCompound nbttagcompound) {
|
||||
try {
|
||||
nbttagcompound.set("Pos", this.a(new double[] { this.locX, this.locY + (double) this.W, this.locZ}));
|
||||
nbttagcompound.set("Motion", this.a(new double[] { this.motX, this.motY, this.motZ}));
|
||||
|
||||
@ -1066,6 +1080,8 @@ public abstract class Entity {
|
||||
nbttagcompound.setShort("Air", (short) this.getAirTicks());
|
||||
nbttagcompound.setBoolean("OnGround", this.onGround);
|
||||
nbttagcompound.setInt("Dimension", this.dimension);
|
||||
nbttagcompound.setBoolean("Invulnerable", this.invulnerable);
|
||||
nbttagcompound.setInt("PortalCooldown", this.portalCooldown);
|
||||
// CraftBukkit start
|
||||
nbttagcompound.setLong("WorldUUIDLeast", this.world.getDataManager().getUUID().getLeastSignificantBits());
|
||||
nbttagcompound.setLong("WorldUUIDMost", this.world.getDataManager().getUUID().getMostSignificantBits());
|
||||
@ -1073,9 +1089,17 @@ public abstract class Entity {
|
||||
nbttagcompound.setLong("UUIDMost", this.uniqueId.getMostSignificantBits());
|
||||
// CraftBukkit end
|
||||
this.b(nbttagcompound);
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Saving entity NBT");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being saved");
|
||||
|
||||
this.a(crashreportsystemdetails);
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
}
|
||||
|
||||
public void e(NBTTagCompound nbttagcompound) {
|
||||
try {
|
||||
NBTTagList nbttaglist = nbttagcompound.getList("Pos");
|
||||
NBTTagList nbttaglist1 = nbttagcompound.getList("Motion");
|
||||
NBTTagList nbttaglist2 = nbttagcompound.getList("Rotation");
|
||||
@ -1107,6 +1131,8 @@ public abstract class Entity {
|
||||
this.setAirTicks(nbttagcompound.getShort("Air"));
|
||||
this.onGround = nbttagcompound.getBoolean("OnGround");
|
||||
this.dimension = nbttagcompound.getInt("Dimension");
|
||||
this.invulnerable = nbttagcompound.getBoolean("Invulnerable");
|
||||
this.portalCooldown = nbttagcompound.getInt("PortalCooldown");
|
||||
this.setPosition(this.locX, this.locY, this.locZ);
|
||||
|
||||
// CraftBukkit start
|
||||
@ -1160,6 +1186,13 @@ public abstract class Entity {
|
||||
this.spawnIn(bworld == null ? null : ((CraftWorld) bworld).getHandle());
|
||||
}
|
||||
// CraftBukkit end
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
|
||||
|
||||
this.a(crashreportsystemdetails);
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
}
|
||||
|
||||
protected final String Q() {
|
||||
@ -1227,7 +1260,7 @@ public abstract class Entity {
|
||||
int k = MathHelper.floor(this.locY + (double) this.getHeadHeight() + (double) f1);
|
||||
int l = MathHelper.floor(this.locZ + (double) f2);
|
||||
|
||||
if (this.world.s(j, k, l)) {
|
||||
if (this.world.t(j, k, l)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1235,7 +1268,7 @@ public abstract class Entity {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1300,7 +1333,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public void V() {
|
||||
if (!(this.passenger instanceof EntityHuman) || !((EntityHuman) this.passenger).bS()) {
|
||||
if (!(this.passenger instanceof EntityHuman) || !((EntityHuman) this.passenger).bW()) {
|
||||
this.passenger.T = this.T;
|
||||
this.passenger.U = this.U + this.X() + this.passenger.W();
|
||||
this.passenger.V = this.V;
|
||||
@ -1403,12 +1436,12 @@ public abstract class Entity {
|
||||
AxisAlignedBB axisalignedbb = this.boundingBox.c(d3, 1.0D, d4);
|
||||
|
||||
if (this.world.a(axisalignedbb).isEmpty()) {
|
||||
if (this.world.t(i, (int) this.locY, j)) {
|
||||
if (this.world.v(i, (int) this.locY, j)) {
|
||||
this.setPositionRotation(this.locX + d3, this.locY + 1.0D, this.locZ + d4, this.yaw, this.pitch);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.world.t(i, (int) this.locY - 1, j) || this.world.getMaterial(i, (int) this.locY - 1, j) == Material.WATER) {
|
||||
if (this.world.v(i, (int) this.locY - 1, j) || this.world.getMaterial(i, (int) this.locY - 1, j) == Material.WATER) {
|
||||
d0 = this.locX + d3;
|
||||
d1 = this.locY + 1.0D;
|
||||
d2 = this.locZ + d4;
|
||||
@ -1430,8 +1463,8 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public void aa() {
|
||||
if (this.an > 0) {
|
||||
this.an = this.ab();
|
||||
if (this.portalCooldown > 0) {
|
||||
this.portalCooldown = this.ab();
|
||||
} else {
|
||||
double d0 = this.lastX - this.locX;
|
||||
double d1 = this.lastZ - this.locZ;
|
||||
@ -1445,7 +1478,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public int ab() {
|
||||
return 500;
|
||||
return 900;
|
||||
}
|
||||
|
||||
public ItemStack[] getEquipment() {
|
||||
@ -1559,15 +1592,18 @@ public abstract class Entity {
|
||||
double d3 = d0 - (double) i;
|
||||
double d4 = d1 - (double) j;
|
||||
double d5 = d2 - (double) k;
|
||||
List list = this.world.a(this.boundingBox);
|
||||
|
||||
if (this.world.s(i, j, k)) {
|
||||
boolean flag = !this.world.s(i - 1, j, k);
|
||||
boolean flag1 = !this.world.s(i + 1, j, k);
|
||||
boolean flag2 = !this.world.s(i, j - 1, k);
|
||||
boolean flag3 = !this.world.s(i, j + 1, k);
|
||||
boolean flag4 = !this.world.s(i, j, k - 1);
|
||||
boolean flag5 = !this.world.s(i, j, k + 1);
|
||||
byte b0 = -1;
|
||||
if (list.isEmpty() && !this.world.u(i, j, k)) {
|
||||
return false;
|
||||
} else {
|
||||
boolean flag = !this.world.u(i - 1, j, k);
|
||||
boolean flag1 = !this.world.u(i + 1, j, k);
|
||||
boolean flag2 = !this.world.u(i, j - 1, k);
|
||||
boolean flag3 = !this.world.u(i, j + 1, k);
|
||||
boolean flag4 = !this.world.u(i, j, k - 1);
|
||||
boolean flag5 = !this.world.u(i, j, k + 1);
|
||||
byte b0 = 3;
|
||||
double d6 = 9999.0D;
|
||||
|
||||
if (flag && d3 < d6) {
|
||||
@ -1580,11 +1616,6 @@ public abstract class Entity {
|
||||
b0 = 1;
|
||||
}
|
||||
|
||||
if (flag2 && d4 < d6) {
|
||||
d6 = d4;
|
||||
b0 = 2;
|
||||
}
|
||||
|
||||
if (flag3 && 1.0D - d4 < d6) {
|
||||
d6 = 1.0D - d4;
|
||||
b0 = 3;
|
||||
@ -1627,8 +1658,6 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1663,11 +1692,19 @@ public abstract class Entity {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean j(Entity entity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return String.format("%s[\'%s\'/%d, l=\'%s\', x=%.2f, y=%.2f, z=%.2f]", new Object[] { this.getClass().getSimpleName(), this.getLocalizedName(), Integer.valueOf(this.id), this.world == null ? "~NULL~" : this.world.getWorldData().getName(), Double.valueOf(this.locX), Double.valueOf(this.locY), Double.valueOf(this.locZ)});
|
||||
}
|
||||
|
||||
public void j(Entity entity) {
|
||||
public boolean isInvulnerable() {
|
||||
return this.invulnerable;
|
||||
}
|
||||
|
||||
public void k(Entity entity) {
|
||||
this.setPositionRotation(entity.locX, entity.locY, entity.locZ, entity.yaw, entity.pitch);
|
||||
}
|
||||
|
||||
@ -1676,12 +1713,13 @@ public abstract class Entity {
|
||||
|
||||
entity.d(nbttagcompound);
|
||||
this.e(nbttagcompound);
|
||||
this.an = entity.an;
|
||||
this.portalCooldown = entity.portalCooldown;
|
||||
this.aq = entity.aq;
|
||||
}
|
||||
|
||||
public void b(int i) {
|
||||
if (false && !this.world.isStatic && !this.dead) { // CraftBukkit - disable entity portal support for now.
|
||||
this.world.methodProfiler.a("changeDimension");
|
||||
MinecraftServer minecraftserver = MinecraftServer.getServer();
|
||||
int j = this.dimension;
|
||||
WorldServer worldserver = minecraftserver.getWorldServer(j);
|
||||
@ -1690,7 +1728,9 @@ public abstract class Entity {
|
||||
this.dimension = i;
|
||||
this.world.kill(this);
|
||||
this.dead = false;
|
||||
this.world.methodProfiler.a("reposition");
|
||||
minecraftserver.getServerConfigurationManager().a(this, j, worldserver, worldserver1);
|
||||
this.world.methodProfiler.c("reloading");
|
||||
Entity entity = EntityTypes.createEntityByName(EntityTypes.b(this), worldserver1);
|
||||
|
||||
if (entity != null) {
|
||||
@ -1699,8 +1739,10 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.dead = true;
|
||||
this.world.methodProfiler.b();
|
||||
worldserver.i();
|
||||
worldserver1.i();
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1719,4 +1761,13 @@ public abstract class Entity {
|
||||
public boolean au() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void a(CrashReportSystemDetails crashreportsystemdetails) {
|
||||
crashreportsystemdetails.a("Entity Type", (Callable) (new CrashReportEntityType(this)));
|
||||
crashreportsystemdetails.a("Entity ID", Integer.valueOf(this.id));
|
||||
crashreportsystemdetails.a("Name", this.getLocalizedName());
|
||||
crashreportsystemdetails.a("Exact location", String.format("%.2f, %.2f, %.2f", new Object[] { Double.valueOf(this.locX), Double.valueOf(this.locY), Double.valueOf(this.locZ)}));
|
||||
crashreportsystemdetails.a("Block location", CrashReportSystemDetails.a(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)));
|
||||
crashreportsystemdetails.a("Momentum", String.format("%.2f, %.2f, %.2f", new Object[] { Double.valueOf(this.motX), Double.valueOf(this.motY), Double.valueOf(this.motZ)}));
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,28 @@ public abstract class EntityAgeable extends EntityCreature {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public abstract EntityAgeable createChild(EntityAgeable entityageable);
|
||||
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
if (itemstack != null && itemstack.id == Item.MONSTER_EGG.id && !this.world.isStatic) {
|
||||
Class oclass = EntityTypes.a(itemstack.getData());
|
||||
|
||||
if (oclass != null && oclass.isAssignableFrom(this.getClass())) {
|
||||
EntityAgeable entityageable = this.createChild(this);
|
||||
|
||||
if (entityageable != null) {
|
||||
entityageable.setAge(-24000);
|
||||
entityageable.setPositionRotation(this.locX, this.locY, this.locZ, 0.0F, 0.0F);
|
||||
this.world.addEntity(entityageable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return super.a(entityhuman);
|
||||
}
|
||||
|
||||
protected void a() {
|
||||
super.a();
|
||||
this.datawatcher.a(12, new Integer(0));
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
// CraftBukkit start
|
||||
@ -167,12 +166,12 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
Entity entity = null;
|
||||
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;
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
int l;
|
||||
float f1;
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity1 = (Entity) iterator.next();
|
||||
for (l = 0; l < list.size(); ++l) {
|
||||
Entity entity1 = (Entity) list.get(l);
|
||||
|
||||
if (entity1.L() && (entity1 != this.shooter || this.as >= 5)) {
|
||||
f1 = 0.3F;
|
||||
@ -204,10 +203,10 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
// CraftBukkit end
|
||||
if (movingobjectposition.entity != null) {
|
||||
f2 = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ);
|
||||
int l = MathHelper.f((double) f2 * this.damage);
|
||||
int i1 = MathHelper.f((double) f2 * this.damage);
|
||||
|
||||
if (this.d()) {
|
||||
l += this.random.nextInt(l / 2 + 2);
|
||||
i1 += this.random.nextInt(i1 / 2 + 2);
|
||||
}
|
||||
|
||||
DamageSource damagesource = null;
|
||||
@ -219,7 +218,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
}
|
||||
|
||||
// CraftBukkit start - moved damage call
|
||||
if (movingobjectposition.entity.damageEntity(damagesource, l)) {
|
||||
if (movingobjectposition.entity.damageEntity(damagesource, i1)) {
|
||||
if (this.isBurning() && (!(movingobjectposition.entity instanceof EntityPlayer) || this.world.pvpMode)) { // CraftBukkit - abide by pvp setting if destination is a player.
|
||||
EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 5);
|
||||
org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent);
|
||||
@ -230,9 +229,14 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
// if (movingobjectposition.entity.damageEntity(damagesource, l)) { // CraftBukkit - moved up
|
||||
// if (movingobjectposition.entity.damageEntity(damagesource, i1)) { // CraftBukkit - moved up
|
||||
if (movingobjectposition.entity instanceof EntityLiving) {
|
||||
++((EntityLiving) movingobjectposition.entity).bk;
|
||||
if (!this.world.isStatic) {
|
||||
EntityLiving entityliving = (EntityLiving) movingobjectposition.entity;
|
||||
|
||||
entityliving.r(entityliving.bJ() + 1);
|
||||
}
|
||||
|
||||
if (this.au > 0) {
|
||||
float f3 = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
|
||||
|
||||
@ -242,7 +246,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
}
|
||||
}
|
||||
|
||||
this.world.makeSound(this, "random.bowhit", 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
|
||||
this.makeSound("random.bowhit", 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
|
||||
this.die();
|
||||
} else {
|
||||
this.motX *= -0.10000000149011612D;
|
||||
@ -265,16 +269,19 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
this.locX -= this.motX / (double) f2 * 0.05000000074505806D;
|
||||
this.locY -= this.motY / (double) f2 * 0.05000000074505806D;
|
||||
this.locZ -= this.motZ / (double) f2 * 0.05000000074505806D;
|
||||
this.world.makeSound(this, "random.bowhit", 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
|
||||
this.makeSound("random.bowhit", 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
|
||||
this.inGround = true;
|
||||
this.shake = 7;
|
||||
this.e(false);
|
||||
if (this.g != 0) {
|
||||
Block.byId[this.g].a(this.world, this.d, this.e, this.f, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.d()) {
|
||||
for (int i1 = 0; i1 < 4; ++i1) {
|
||||
this.world.addParticle("crit", this.locX + this.motX * (double) i1 / 4.0D, this.locY + this.motY * (double) i1 / 4.0D, this.locZ + this.motZ * (double) i1 / 4.0D, -this.motX, -this.motY + 0.2D, -this.motZ);
|
||||
for (l = 0; l < 4; ++l) {
|
||||
this.world.addParticle("crit", this.locX + this.motX * (double) l / 4.0D, this.locY + this.motY * (double) l / 4.0D, this.locZ + this.motZ * (double) l / 4.0D, -this.motX, -this.motY + 0.2D, -this.motZ);
|
||||
}
|
||||
}
|
||||
|
||||
@ -355,7 +362,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
}
|
||||
}
|
||||
|
||||
public void b_(EntityHuman entityhuman) {
|
||||
public void c_(EntityHuman entityhuman) {
|
||||
if (!this.world.isStatic && this.inGround && this.shake <= 0) {
|
||||
// CraftBukkit start
|
||||
ItemStack itemstack = new ItemStack(Item.ARROW);
|
||||
@ -378,7 +385,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
this.world.makeSound(this, "random.pop", 0.2F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
this.makeSound("random.pop", 0.2F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
entityhuman.receive(this, 1);
|
||||
this.die();
|
||||
}
|
||||
|
@ -22,15 +22,15 @@ public class EntityBlaze extends EntityMonster {
|
||||
this.datawatcher.a(16, new Byte((byte) 0));
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return "mob.blaze.breathe";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.blaze.hit";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.blaze.death";
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ public class EntityBlaze extends EntityMonster {
|
||||
protected void a(Entity entity, float f) {
|
||||
if (this.attackTicks <= 0 && f < 2.0F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) {
|
||||
this.attackTicks = 20;
|
||||
this.l(entity);
|
||||
this.m(entity);
|
||||
} else if (f < 30.0F) {
|
||||
double d0 = entity.locX - this.locX;
|
||||
double d1 = entity.boundingBox.b + (double) (entity.length / 2.0F) - (this.locY + (double) (this.length / 2.0F));
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
// CraftBukkit start
|
||||
@ -93,7 +92,9 @@ public class EntityBoat extends Entity {
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (!this.world.isStatic && !this.dead) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else if (!this.world.isStatic && !this.dead) {
|
||||
// CraftBukkit start
|
||||
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||
org.bukkit.entity.Entity attacker = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity();
|
||||
@ -356,12 +357,11 @@ public class EntityBoat extends Entity {
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
List list = this.world.getEntities(this, this.boundingBox.grow(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
||||
int l;
|
||||
|
||||
if (list != null && !list.isEmpty()) {
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
for (l = 0; l < list.size(); ++l) {
|
||||
Entity entity = (Entity) list.get(l);
|
||||
|
||||
if (entity != this.passenger && entity.M() && entity instanceof EntityBoat) {
|
||||
entity.collide(this);
|
||||
@ -369,7 +369,7 @@ public class EntityBoat extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
for (int l = 0; l < 4; ++l) {
|
||||
for (l = 0; l < 4; ++l) {
|
||||
int i1 = MathHelper.floor(this.locX + ((double) (l % 2) - 0.5D) * 0.8D);
|
||||
int j1 = MathHelper.floor(this.locZ + ((double) (l / 2) - 0.5D) * 0.8D);
|
||||
|
||||
@ -408,7 +408,7 @@ public class EntityBoat extends Entity {
|
||||
|
||||
protected void a(NBTTagCompound nbttagcompound) {}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
if (this.passenger != null && this.passenger instanceof EntityHuman && this.passenger != entityhuman) {
|
||||
return true;
|
||||
} else {
|
||||
|
@ -27,7 +27,7 @@ public class EntityChicken extends EntityAnimal {
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||
}
|
||||
|
||||
public boolean bb() {
|
||||
public boolean be() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ public class EntityChicken extends EntityAnimal {
|
||||
|
||||
this.e += this.i * 2.0F;
|
||||
if (!this.isBaby() && !this.world.isStatic && --this.j <= 0) {
|
||||
this.world.makeSound(this, "mob.chicken.plop", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
this.makeSound("mob.chicken.plop", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
this.b(Item.EGG.id, 1);
|
||||
this.j = this.random.nextInt(6000) + 6000;
|
||||
}
|
||||
@ -67,20 +67,20 @@ public class EntityChicken extends EntityAnimal {
|
||||
|
||||
protected void a(float f) {}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return "mob.chicken.say";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.chicken.hurt";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.chicken.hurt";
|
||||
}
|
||||
|
||||
protected void a(int i, int j, int k, int l) {
|
||||
this.world.makeSound(this, "mob.chicken.step", 0.15F, 1.0F);
|
||||
this.makeSound("mob.chicken.step", 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
protected int getLootId() {
|
||||
@ -106,11 +106,15 @@ public class EntityChicken extends EntityAnimal {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public EntityAnimal createChild(EntityAnimal entityanimal) {
|
||||
public EntityChicken b(EntityAgeable entityageable) {
|
||||
return new EntityChicken(this.world);
|
||||
}
|
||||
|
||||
public boolean c(ItemStack itemstack) {
|
||||
return itemstack != null && itemstack.getItem() instanceof ItemSeeds;
|
||||
}
|
||||
|
||||
public EntityAgeable createChild(EntityAgeable entityageable) {
|
||||
return this.b(entityageable);
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ public class EntityCow extends EntityAnimal {
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||
}
|
||||
|
||||
public boolean bb() {
|
||||
public boolean be() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -30,23 +30,23 @@ public class EntityCow extends EntityAnimal {
|
||||
return 10;
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return "mob.cow.say";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.cow.hurt";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.cow.hurt";
|
||||
}
|
||||
|
||||
protected void a(int i, int j, int k, int l) {
|
||||
this.world.makeSound(this, "mob.cow.step", 0.15F, 1.0F);
|
||||
this.makeSound("mob.cow.step", 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
protected float aV() {
|
||||
protected float aX() {
|
||||
return 0.4F;
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ public class EntityCow extends EntityAnimal {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
if (itemstack != null && itemstack.id == Item.BUCKET.id) {
|
||||
@ -96,11 +96,15 @@ public class EntityCow extends EntityAnimal {
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return super.c(entityhuman);
|
||||
return super.a(entityhuman);
|
||||
}
|
||||
}
|
||||
|
||||
public EntityAnimal createChild(EntityAnimal entityanimal) {
|
||||
public EntityCow b(EntityAgeable entityageable) {
|
||||
return new EntityCow(this.world);
|
||||
}
|
||||
|
||||
public EntityAgeable createChild(EntityAgeable entityageable) {
|
||||
return this.b(entityageable);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void bk() {
|
||||
protected void bn() {
|
||||
this.world.methodProfiler.a("ai");
|
||||
if (this.c > 0) {
|
||||
--this.c;
|
||||
@ -52,7 +52,7 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
} else if (this.target.isAlive()) {
|
||||
float f1 = this.target.d((Entity) this);
|
||||
|
||||
if (this.m(this.target)) {
|
||||
if (this.n(this.target)) {
|
||||
this.a(this.target, f1);
|
||||
}
|
||||
} else {
|
||||
@ -73,7 +73,7 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
this.world.methodProfiler.b();
|
||||
if (!this.b && this.target != null && (this.pathEntity == null || this.random.nextInt(20) == 0)) {
|
||||
this.pathEntity = this.world.findPath(this, this.target, f, true, false, false, true);
|
||||
} else if (!this.b && (this.pathEntity == null && this.random.nextInt(180) == 0 || this.random.nextInt(120) == 0 || this.c > 0) && this.bC < 100) {
|
||||
} else if (!this.b && (this.pathEntity == null && this.random.nextInt(180) == 0 || this.random.nextInt(120) == 0 || this.c > 0) && this.bA < 100) {
|
||||
this.i();
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
this.bG = false;
|
||||
this.bE = false;
|
||||
if (vec3d != null) {
|
||||
double d1 = vec3d.c - this.locX;
|
||||
double d2 = vec3d.e - this.locZ;
|
||||
@ -106,7 +106,7 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
float f2 = (float) (org.bukkit.craftbukkit.TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||
float f3 = MathHelper.g(f2 - this.yaw);
|
||||
|
||||
this.bE = this.bI;
|
||||
this.bC = this.bG;
|
||||
if (f3 > 30.0F) {
|
||||
f3 = 30.0F;
|
||||
}
|
||||
@ -123,12 +123,12 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
|
||||
this.yaw = (float) (Math.atan2(d5, d4) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||
f3 = (f4 - this.yaw + 90.0F) * 3.1415927F / 180.0F;
|
||||
this.bD = -MathHelper.sin(f3) * this.bE * 1.0F;
|
||||
this.bE = MathHelper.cos(f3) * this.bE * 1.0F;
|
||||
this.bB = -MathHelper.sin(f3) * this.bC * 1.0F;
|
||||
this.bC = MathHelper.cos(f3) * this.bC * 1.0F;
|
||||
}
|
||||
|
||||
if (d3 > 0.0D) {
|
||||
this.bG = true;
|
||||
this.bE = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -137,16 +137,16 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
}
|
||||
|
||||
if (this.positionChanged && !this.k()) {
|
||||
this.bG = true;
|
||||
this.bE = true;
|
||||
}
|
||||
|
||||
if (this.random.nextFloat() < 0.8F && (flag || flag1)) {
|
||||
this.bG = true;
|
||||
this.bE = true;
|
||||
}
|
||||
|
||||
this.world.methodProfiler.b();
|
||||
} else {
|
||||
super.bk();
|
||||
super.bn();
|
||||
this.pathEntity = null;
|
||||
}
|
||||
}
|
||||
@ -215,10 +215,10 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
this.target = entity;
|
||||
}
|
||||
|
||||
public float by() {
|
||||
float f = super.by();
|
||||
public float bB() {
|
||||
float f = super.bB();
|
||||
|
||||
if (this.c > 0 && !this.bb()) {
|
||||
if (this.c > 0 && !this.be()) {
|
||||
f *= 2.0F;
|
||||
}
|
||||
|
||||
|
@ -27,12 +27,12 @@ public class EntityCreeper extends EntityMonster {
|
||||
this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, false));
|
||||
}
|
||||
|
||||
public boolean bb() {
|
||||
public boolean be() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int as() {
|
||||
return this.aF() == null ? 3 : 3 + (this.health - 1);
|
||||
return this.aG() == null ? 3 : 3 + (this.health - 1);
|
||||
}
|
||||
|
||||
protected void a(float f) {
|
||||
@ -81,7 +81,7 @@ public class EntityCreeper extends EntityMonster {
|
||||
int i = this.o();
|
||||
|
||||
if (i > 0 && this.fuseTicks == 0) {
|
||||
this.world.makeSound(this, "random.fuse", 1.0F, 0.5F);
|
||||
this.makeSound("random.fuse", 1.0F, 0.5F);
|
||||
}
|
||||
|
||||
this.fuseTicks += i;
|
||||
@ -112,19 +112,21 @@ public class EntityCreeper extends EntityMonster {
|
||||
super.j_();
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.creeper.say";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.creeper.death";
|
||||
}
|
||||
|
||||
public void die(DamageSource damagesource) {
|
||||
// CraftBukkit start - rearranged the method (super call to end, drop to dropDeathLoot)
|
||||
if (damagesource.getEntity() instanceof EntitySkeleton) {
|
||||
// this.b(Item.RECORD_1.id + this.random.nextInt(10), 1); // CraftBukkit
|
||||
this.record = Item.RECORD_1.id + this.random.nextInt(10);
|
||||
int i = Item.RECORD_1.id + this.random.nextInt(Item.RECORD_12.id - Item.RECORD_1.id + 1);
|
||||
|
||||
// this.b(i, 1); // CraftBukkit
|
||||
this.record = i;
|
||||
}
|
||||
|
||||
super.die(damagesource);
|
||||
@ -159,7 +161,7 @@ public class EntityCreeper extends EntityMonster {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
public boolean l(Entity entity) {
|
||||
public boolean m(Entity entity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -18,13 +18,12 @@ public class EntityDamageSourceIndirect extends EntityDamageSource {
|
||||
}
|
||||
|
||||
public String getLocalizedDeathMessage(EntityHuman entityhuman) {
|
||||
// CraftBukkit start
|
||||
String source = (this.owner == null) ? "Herobrine" : this.owner.getLocalizedName();
|
||||
return LocaleI18n.get("death." + this.translationIndex, new Object[] { entityhuman.name, source});
|
||||
return LocaleI18n.get("death." + this.translationIndex, new Object[] { entityhuman.name, this.owner == null ? this.r.getLocalizedName() : this.owner.getLocalizedName()});
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
public Entity getProximateDamageSource() {
|
||||
return super.getEntity();
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class EntityEgg extends EntityProjectile {
|
||||
|
||||
protected void a(MovingObjectPosition movingobjectposition) {
|
||||
if (movingobjectposition.entity != null) {
|
||||
movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.shooter), 0);
|
||||
movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.getShooter()), 0);
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
@ -35,8 +35,9 @@ public class EntityEgg extends EntityProjectile {
|
||||
|
||||
EntityType hatchingType = EntityType.CHICKEN;
|
||||
|
||||
if (this.shooter instanceof EntityPlayer) {
|
||||
Player player = (this.shooter == null) ? null : (Player) this.shooter.getBukkitEntity();
|
||||
Entity shooter = this.getShooter();
|
||||
if (shooter instanceof EntityPlayer) {
|
||||
Player player = (shooter == null) ? null : (Player) shooter.getBukkitEntity();
|
||||
|
||||
PlayerEggThrowEvent event = new PlayerEggThrowEvent(player, (org.bukkit.entity.Egg) this.getBukkitEntity(), hatching, (byte) numHatching, hatchingType);
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
@ -46,6 +46,9 @@ public class EntityEnderCrystal extends Entity {
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
if (!this.dead && !this.world.isStatic) {
|
||||
// CraftBukkit start - All non-living entities need this
|
||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, i)) {
|
||||
@ -65,3 +68,4 @@ public class EntityEnderCrystal extends Entity {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,20 +25,20 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
public EntityComplexPart h;
|
||||
public EntityComplexPart i;
|
||||
public EntityComplexPart j;
|
||||
public EntityComplexPart bI;
|
||||
public EntityComplexPart bJ;
|
||||
public EntityComplexPart bK;
|
||||
public EntityComplexPart bL;
|
||||
public EntityComplexPart bM;
|
||||
public float bN = 0.0F;
|
||||
public float bO = 0.0F;
|
||||
public boolean bP = false;
|
||||
public boolean bQ = false;
|
||||
private Entity bT;
|
||||
public int bR = 0;
|
||||
public EntityEnderCrystal bS = null;
|
||||
public float bL = 0.0F;
|
||||
public float bM = 0.0F;
|
||||
public boolean bN = false;
|
||||
public boolean bO = false;
|
||||
private Entity bR;
|
||||
public int bP = 0;
|
||||
public EntityEnderCrystal bQ = null;
|
||||
|
||||
public EntityEnderDragon(World world) {
|
||||
super(world);
|
||||
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.bK = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bL = new EntityComplexPart(this, "wing", 4.0F, 4.0F), this.bM = 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.bI = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bJ = new EntityComplexPart(this, "wing", 4.0F, 4.0F), this.bK = new EntityComplexPart(this, "wing", 4.0F, 4.0F)};
|
||||
this.setHealth(this.getMaxHealth());
|
||||
this.texture = "/mob/enderdragon/ender.png";
|
||||
this.a(16.0F, 8.0F);
|
||||
@ -84,14 +84,14 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
if (!this.world.isStatic) {
|
||||
this.datawatcher.watch(16, Integer.valueOf(this.health));
|
||||
} else {
|
||||
f = MathHelper.cos(this.bO * 3.1415927F * 2.0F);
|
||||
f1 = MathHelper.cos(this.bN * 3.1415927F * 2.0F);
|
||||
f = MathHelper.cos(this.bM * 3.1415927F * 2.0F);
|
||||
f1 = MathHelper.cos(this.bL * 3.1415927F * 2.0F);
|
||||
if (f1 <= -0.3F && f >= -0.3F) {
|
||||
this.world.b(this.locX, this.locY, this.locZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.random.nextFloat() * 0.3F);
|
||||
}
|
||||
}
|
||||
|
||||
this.bN = this.bO;
|
||||
this.bL = this.bM;
|
||||
float f2;
|
||||
|
||||
if (this.health <= 0) {
|
||||
@ -103,10 +103,10 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
this.h();
|
||||
f = 0.2F / (MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 10.0F + 1.0F);
|
||||
f *= (float) Math.pow(2.0D, this.motY);
|
||||
if (this.bQ) {
|
||||
this.bO += f * 0.5F;
|
||||
if (this.bO) {
|
||||
this.bM += f * 0.5F;
|
||||
} else {
|
||||
this.bO += f;
|
||||
this.bM += f;
|
||||
}
|
||||
|
||||
this.yaw = MathHelper.g(this.yaw);
|
||||
@ -130,14 +130,14 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
float f3;
|
||||
|
||||
if (this.world.isStatic) {
|
||||
if (this.bu > 0) {
|
||||
d0 = this.locX + (this.bv - this.locX) / (double) this.bu;
|
||||
d1 = this.locY + (this.bw - this.locY) / (double) this.bu;
|
||||
d2 = this.locZ + (this.bx - this.locZ) / (double) this.bu;
|
||||
d3 = MathHelper.g(this.by - (double) this.yaw);
|
||||
this.yaw = (float) ((double) this.yaw + d3 / (double) this.bu);
|
||||
this.pitch = (float) ((double) this.pitch + (this.bz - (double) this.pitch) / (double) this.bu);
|
||||
--this.bu;
|
||||
if (this.bs > 0) {
|
||||
d0 = this.locX + (this.bt - this.locX) / (double) this.bs;
|
||||
d1 = this.locY + (this.bu - this.locY) / (double) this.bs;
|
||||
d2 = this.locZ + (this.bv - this.locZ) / (double) this.bs;
|
||||
d3 = MathHelper.g(this.bw - (double) this.yaw);
|
||||
this.yaw = (float) ((double) this.yaw + d3 / (double) this.bs);
|
||||
this.pitch = (float) ((double) this.pitch + (this.bx - (double) this.pitch) / (double) this.bs);
|
||||
--this.bs;
|
||||
this.setPosition(d0, d1, d2);
|
||||
this.b(this.yaw, this.pitch);
|
||||
}
|
||||
@ -146,9 +146,9 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
d1 = this.b - this.locY;
|
||||
d2 = this.c - this.locZ;
|
||||
d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
if (this.bT != null) {
|
||||
this.a = this.bT.locX;
|
||||
this.c = this.bT.locZ;
|
||||
if (this.bR != null) {
|
||||
this.a = this.bR.locX;
|
||||
this.c = this.bR.locZ;
|
||||
double d4 = this.a - this.locX;
|
||||
double d5 = this.c - this.locZ;
|
||||
double d6 = Math.sqrt(d4 * d4 + d5 * d5);
|
||||
@ -158,13 +158,13 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
d7 = 10.0D;
|
||||
}
|
||||
|
||||
this.b = this.bT.boundingBox.b + d7;
|
||||
this.b = this.bR.boundingBox.b + d7;
|
||||
} else {
|
||||
this.a += this.random.nextGaussian() * 2.0D;
|
||||
this.c += this.random.nextGaussian() * 2.0D;
|
||||
}
|
||||
|
||||
if (this.bP || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.G) {
|
||||
if (this.bN || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.G) {
|
||||
this.i();
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
f4 = 0.0F;
|
||||
}
|
||||
|
||||
this.bF *= 0.8F;
|
||||
this.bD *= 0.8F;
|
||||
float f5 = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 1.0F + 1.0F;
|
||||
double d10 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 1.0D + 1.0D;
|
||||
|
||||
@ -207,13 +207,13 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
d10 = 40.0D;
|
||||
}
|
||||
|
||||
this.bF = (float) ((double) this.bF + d9 * (0.699999988079071D / d10 / (double) f5));
|
||||
this.yaw += this.bF * 0.1F;
|
||||
this.bD = (float) ((double) this.bD + d9 * (0.699999988079071D / d10 / (double) f5));
|
||||
this.yaw += this.bD * 0.1F;
|
||||
float f6 = (float) (2.0D / (d10 + 1.0D));
|
||||
float f7 = 0.06F;
|
||||
|
||||
this.a(0.0F, -1.0F, f7 * (f4 * f6 + (1.0F - f6)));
|
||||
if (this.bQ) {
|
||||
if (this.bO) {
|
||||
this.move(this.motX * 0.800000011920929D, this.motY * 0.800000011920929D, this.motZ * 0.800000011920929D);
|
||||
} else {
|
||||
this.move(this.motX, this.motY, this.motZ);
|
||||
@ -232,13 +232,13 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
this.g.width = this.g.length = 3.0F;
|
||||
this.i.width = this.i.length = 2.0F;
|
||||
this.j.width = this.j.length = 2.0F;
|
||||
this.bK.width = this.bK.length = 2.0F;
|
||||
this.bI.width = this.bI.length = 2.0F;
|
||||
this.h.length = 3.0F;
|
||||
this.h.width = 5.0F;
|
||||
this.bL.length = 2.0F;
|
||||
this.bL.width = 4.0F;
|
||||
this.bM.length = 3.0F;
|
||||
this.bM.width = 4.0F;
|
||||
this.bJ.length = 2.0F;
|
||||
this.bJ.width = 4.0F;
|
||||
this.bK.length = 3.0F;
|
||||
this.bK.width = 4.0F;
|
||||
f1 = (float) (this.a(5, 1.0F)[1] - this.a(10, 1.0F)[1]) * 10.0F / 180.0F * 3.1415927F;
|
||||
f2 = MathHelper.cos(f1);
|
||||
float f9 = -MathHelper.sin(f1);
|
||||
@ -248,21 +248,21 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
|
||||
this.h.j_();
|
||||
this.h.setPositionRotation(this.locX + (double) (f11 * 0.5F), this.locY, this.locZ - (double) (f12 * 0.5F), 0.0F, 0.0F);
|
||||
this.bL.j_();
|
||||
this.bL.setPositionRotation(this.locX + (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ + (double) (f11 * 4.5F), 0.0F, 0.0F);
|
||||
this.bM.j_();
|
||||
this.bM.setPositionRotation(this.locX - (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ - (double) (f11 * 4.5F), 0.0F, 0.0F);
|
||||
this.bJ.j_();
|
||||
this.bJ.setPositionRotation(this.locX + (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ + (double) (f11 * 4.5F), 0.0F, 0.0F);
|
||||
this.bK.j_();
|
||||
this.bK.setPositionRotation(this.locX - (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ - (double) (f11 * 4.5F), 0.0F, 0.0F);
|
||||
if (!this.world.isStatic && this.hurtTicks == 0) {
|
||||
this.a(this.world.getEntities(this, this.bL.boundingBox.grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D)));
|
||||
this.a(this.world.getEntities(this, this.bM.boundingBox.grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D)));
|
||||
this.a(this.world.getEntities(this, this.bJ.boundingBox.grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D)));
|
||||
this.a(this.world.getEntities(this, this.bK.boundingBox.grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.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[] adouble1 = this.a(0, 1.0F);
|
||||
|
||||
f3 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F - this.bF * 0.01F);
|
||||
float f13 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F - this.bF * 0.01F);
|
||||
f3 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F - this.bD * 0.01F);
|
||||
float f13 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F - this.bD * 0.01F);
|
||||
|
||||
this.g.j_();
|
||||
this.g.setPositionRotation(this.locX + (double) (f3 * 5.5F * f2), this.locY + (adouble1[1] - adouble[1]) * 1.0D + (double) (f9 * 5.5F), this.locZ - (double) (f13 * 5.5F * f2), 0.0F, 0.0F);
|
||||
@ -279,7 +279,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
}
|
||||
|
||||
if (j == 2) {
|
||||
entitycomplexpart = this.bK;
|
||||
entitycomplexpart = this.bI;
|
||||
}
|
||||
|
||||
double[] adouble2 = this.a(12 + j * 2, 1.0F);
|
||||
@ -294,19 +294,19 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
}
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
this.bQ = this.a(this.g.boundingBox) | this.a(this.h.boundingBox);
|
||||
this.bO = this.a(this.g.boundingBox) | this.a(this.h.boundingBox);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void h() {
|
||||
if (this.bS != null) {
|
||||
if (this.bS.dead) {
|
||||
if (this.bQ != null) {
|
||||
if (this.bQ.dead) {
|
||||
if (!this.world.isStatic) {
|
||||
this.a(this.g, DamageSource.EXPLOSION, 10);
|
||||
}
|
||||
|
||||
this.bS = null;
|
||||
this.bQ = null;
|
||||
} else if (this.ticksLived % 10 == 0 && this.health < this.getMaxHealth()) {
|
||||
// CraftBukkit start
|
||||
EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), 1, EntityRegainHealthEvent.RegainReason.ENDER_CRYSTAL);
|
||||
@ -336,7 +336,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
}
|
||||
}
|
||||
|
||||
this.bS = entityendercrystal;
|
||||
this.bQ = entityendercrystal;
|
||||
}
|
||||
}
|
||||
|
||||
@ -359,10 +359,8 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
}
|
||||
|
||||
private void b(List list) {
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
Entity entity = (Entity) list.get(i);
|
||||
|
||||
if (entity instanceof EntityLiving) {
|
||||
// CraftBukkit start - throw damage events when the dragon attacks
|
||||
@ -384,9 +382,9 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
}
|
||||
|
||||
private void i() {
|
||||
this.bP = false;
|
||||
this.bN = false;
|
||||
if (this.random.nextInt(2) == 0 && !this.world.players.isEmpty()) {
|
||||
this.bT = (Entity) this.world.players.get(this.random.nextInt(this.world.players.size()));
|
||||
this.bR = (Entity) this.world.players.get(this.random.nextInt(this.world.players.size()));
|
||||
} else {
|
||||
boolean flag = false;
|
||||
|
||||
@ -403,7 +401,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
flag = d0 * d0 + d1 * d1 + d2 * d2 > 100.0D;
|
||||
} while (!flag);
|
||||
|
||||
this.bT = null;
|
||||
this.bR = null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -484,7 +482,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
this.a = this.locX + (double) (f1 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F);
|
||||
this.b = this.locY + (double) (this.random.nextFloat() * 3.0F) + 1.0D;
|
||||
this.c = this.locZ - (double) (f2 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F);
|
||||
this.bT = null;
|
||||
this.bR = null;
|
||||
if (damagesource.getEntity() instanceof EntityHuman || damagesource == DamageSource.EXPLOSION) {
|
||||
this.dealDamage(damagesource, i);
|
||||
}
|
||||
@ -500,9 +498,9 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
return super.damageEntity(damagesource, i);
|
||||
}
|
||||
|
||||
protected void aO() {
|
||||
++this.bR;
|
||||
if (this.bR >= 180 && this.bR <= 200) {
|
||||
protected void aP() {
|
||||
++this.bP;
|
||||
if (this.bP >= 180 && this.bP <= 200) {
|
||||
float f = (this.random.nextFloat() - 0.5F) * 8.0F;
|
||||
float f1 = (this.random.nextFloat() - 0.5F) * 4.0F;
|
||||
float f2 = (this.random.nextFloat() - 0.5F) * 8.0F;
|
||||
@ -514,7 +512,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
int j;
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
if (this.bR > 150 && this.bR % 5 == 0) {
|
||||
if (this.bP > 150 && this.bP % 5 == 0) {
|
||||
i = expToDrop / 12; // CraftBukkit - drop experience as dragon falls from sky. use experience drop from death event. This is now set in getExpReward()
|
||||
|
||||
while (i > 0) {
|
||||
@ -524,14 +522,14 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.bR == 1) {
|
||||
if (this.bP == 1) {
|
||||
this.world.e(1018, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
||||
}
|
||||
}
|
||||
|
||||
this.move(0.0D, 0.10000000149011612D, 0.0D);
|
||||
this.aw = this.yaw += 20.0F;
|
||||
if (this.bR == 200 && !this.world.isStatic) {
|
||||
if (this.bP == 200 && !this.world.isStatic) {
|
||||
i = expToDrop - 10 * (expToDrop / 12); // CraftBukkit - drop the remaining experience
|
||||
|
||||
while (i > 0) {
|
||||
@ -611,7 +609,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
BlockEnderPortal.a = false;
|
||||
}
|
||||
|
||||
protected void bh() {}
|
||||
protected void bk() {}
|
||||
|
||||
public Entity[] ao() {
|
||||
return this.children;
|
||||
@ -625,15 +623,15 @@ public class EntityEnderDragon extends EntityLiving implements IComplex {
|
||||
return this.world;
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return "mob.enderdragon.growl";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.enderdragon.hit";
|
||||
}
|
||||
|
||||
protected float aV() {
|
||||
protected float aX() {
|
||||
return 5.0F;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ public class EntityEnderPearl extends EntityProjectile {
|
||||
|
||||
protected void a(MovingObjectPosition movingobjectposition) {
|
||||
if (movingobjectposition.entity != null) {
|
||||
movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.shooter), 0);
|
||||
movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.getShooter()), 0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 32; ++i) {
|
||||
@ -26,8 +26,8 @@ public class EntityEnderPearl extends EntityProjectile {
|
||||
}
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
if (this.shooter != null && this.shooter instanceof EntityPlayer) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) this.shooter;
|
||||
if (this.getShooter() != null && this.getShooter() instanceof EntityPlayer) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) this.getShooter();
|
||||
|
||||
if (!entityplayer.netServerHandler.disconnected && entityplayer.world == this.world) {
|
||||
// CraftBukkit start
|
||||
@ -41,7 +41,7 @@ public class EntityEnderPearl extends EntityProjectile {
|
||||
|
||||
if (!teleEvent.isCancelled() && !entityplayer.netServerHandler.disconnected) {
|
||||
entityplayer.netServerHandler.teleport(teleEvent.getTo());
|
||||
this.shooter.fallDistance = 0.0F;
|
||||
this.getShooter().fallDistance = 0.0F;
|
||||
|
||||
EntityDamageByEntityEvent damageEvent = new EntityDamageByEntityEvent(this.getBukkitEntity(), player, EntityDamageByEntityEvent.DamageCause.FALL, 5);
|
||||
Bukkit.getPluginManager().callEvent(damageEvent);
|
||||
|
@ -15,7 +15,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
public EntityEnderman(World world) {
|
||||
super(world);
|
||||
this.texture = "/mob/enderman.png";
|
||||
this.bI = 0.2F;
|
||||
this.bG = 0.2F;
|
||||
this.a(0.6F, 2.9F);
|
||||
this.X = 1.0F;
|
||||
}
|
||||
@ -78,7 +78,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
vec3d1 = vec3d1.a();
|
||||
double d1 = vec3d.b(vec3d1);
|
||||
|
||||
return d1 > 1.0D - 0.025D / d0 ? entityhuman.m(this) : false;
|
||||
return d1 > 1.0D - 0.025D / d0 ? entityhuman.n(this) : false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
this.damageEntity(DamageSource.DROWN, 1);
|
||||
}
|
||||
|
||||
this.bI = this.target != null ? 6.5F : 0.3F;
|
||||
this.bG = this.target != null ? 6.5F : 0.3F;
|
||||
int i;
|
||||
|
||||
if (!this.world.isStatic && this.world.getGameRules().getBoolean("mobGriefing")) {
|
||||
@ -135,10 +135,10 @@ public class EntityEnderman extends EntityMonster {
|
||||
this.world.addParticle("portal", this.locX + (this.random.nextDouble() - 0.5D) * (double) this.width, this.locY + this.random.nextDouble() * (double) this.length - 0.25D, this.locZ + (this.random.nextDouble() - 0.5D) * (double) this.width, (this.random.nextDouble() - 0.5D) * 2.0D, -this.random.nextDouble(), (this.random.nextDouble() - 0.5D) * 2.0D);
|
||||
}
|
||||
|
||||
if (this.world.t() && !this.world.isStatic) {
|
||||
if (this.world.u() && !this.world.isStatic) {
|
||||
float f = this.c(1.0F);
|
||||
|
||||
if (f > 0.5F && this.world.j(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
|
||||
if (f > 0.5F && this.world.k(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
|
||||
this.target = null;
|
||||
this.f(false);
|
||||
this.m();
|
||||
@ -151,7 +151,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
this.m();
|
||||
}
|
||||
|
||||
this.bG = false;
|
||||
this.bE = false;
|
||||
if (this.target != null) {
|
||||
this.a(this.target, 100.0F, 100.0F);
|
||||
}
|
||||
@ -159,14 +159,14 @@ public class EntityEnderman extends EntityMonster {
|
||||
if (!this.world.isStatic && this.isAlive()) {
|
||||
if (this.target != null) {
|
||||
if (this.target instanceof EntityHuman && this.d((EntityHuman) this.target)) {
|
||||
this.bD = this.bE = 0.0F;
|
||||
this.bI = 0.0F;
|
||||
this.bB = this.bC = 0.0F;
|
||||
this.bG = 0.0F;
|
||||
if (this.target.e((Entity) this) < 16.0D) {
|
||||
this.m();
|
||||
}
|
||||
|
||||
this.e = 0;
|
||||
} else if (this.target.e((Entity) this) > 256.0D && this.e++ >= 30 && this.o(this.target)) {
|
||||
} else if (this.target.e((Entity) this) > 256.0D && this.e++ >= 30 && this.p(this.target)) {
|
||||
this.e = 0;
|
||||
}
|
||||
} else {
|
||||
@ -186,7 +186,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
return this.j(d0, d1, d2);
|
||||
}
|
||||
|
||||
protected boolean o(Entity entity) {
|
||||
protected boolean p(Entity entity) {
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(this.locX - entity.locX, this.boundingBox.b + (double) (this.length / 2.0F) - entity.locY + (double) entity.getHeadHeight(), this.locZ - entity.locZ);
|
||||
|
||||
vec3d = vec3d.a();
|
||||
@ -262,20 +262,20 @@ public class EntityEnderman extends EntityMonster {
|
||||
}
|
||||
|
||||
this.world.makeSound(d3, d4, d5, "mob.endermen.portal", 1.0F, 1.0F);
|
||||
this.world.makeSound(this, "mob.endermen.portal", 1.0F, 1.0F);
|
||||
this.makeSound("mob.endermen.portal", 1.0F, 1.0F);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return this.q() ? "mob.endermen.scream" : "mob.endermen.idle";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.endermen.hit";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.endermen.death";
|
||||
}
|
||||
|
||||
@ -317,7 +317,9 @@ public class EntityEnderman extends EntityMonster {
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (damagesource instanceof EntityDamageSourceIndirect) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else if (damagesource instanceof EntityDamageSourceIndirect) {
|
||||
for (int j = 0; j < 64; ++j) {
|
||||
if (this.m()) {
|
||||
return true;
|
||||
|
@ -53,7 +53,7 @@ public class EntityExperienceOrb extends Entity {
|
||||
this.motY = 0.20000000298023224D;
|
||||
this.motX = (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F);
|
||||
this.motZ = (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F);
|
||||
this.world.makeSound(this, "random.fizz", 0.4F, 2.0F + this.random.nextFloat() * 0.4F);
|
||||
this.makeSound("random.fizz", 0.4F, 2.0F + this.random.nextFloat() * 0.4F);
|
||||
}
|
||||
|
||||
this.i(this.locX, (this.boundingBox.b + this.boundingBox.e) / 2.0D, this.locZ);
|
||||
@ -123,6 +123,9 @@ public class EntityExperienceOrb extends Entity {
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
this.K();
|
||||
this.d -= i;
|
||||
if (this.d <= 0) {
|
||||
@ -131,6 +134,7 @@ public class EntityExperienceOrb extends Entity {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
nbttagcompound.setShort("Health", (short) ((byte) this.d));
|
||||
@ -144,11 +148,11 @@ public class EntityExperienceOrb extends Entity {
|
||||
this.value = nbttagcompound.getShort("Value");
|
||||
}
|
||||
|
||||
public void b_(EntityHuman entityhuman) {
|
||||
public void c_(EntityHuman entityhuman) {
|
||||
if (!this.world.isStatic) {
|
||||
if (this.c == 0 && entityhuman.bU == 0) {
|
||||
entityhuman.bU = 2;
|
||||
this.world.makeSound(this, "random.orb", 0.1F, 0.5F * ((this.random.nextFloat() - this.random.nextFloat()) * 0.7F + 1.8F));
|
||||
if (this.c == 0 && entityhuman.bR == 0) {
|
||||
entityhuman.bR = 2;
|
||||
this.makeSound("random.orb", 0.1F, 0.5F * ((this.random.nextFloat() - this.random.nextFloat()) * 0.7F + 1.8F));
|
||||
entityhuman.receive(this, 1);
|
||||
entityhuman.giveExp(CraftEventFactory.callPlayerExpChangeEvent(entityhuman, this.value).getAmount()); // CraftBukkit - this.value to event.getAmount()
|
||||
this.die();
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.event.entity.ProjectileHitEvent; // CraftBukkit
|
||||
@ -105,10 +104,9 @@ public abstract class EntityFireball extends Entity {
|
||||
Entity entity = null;
|
||||
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;
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity1 = (Entity) iterator.next();
|
||||
for (int j = 0; j < list.size(); ++j) {
|
||||
Entity entity1 = (Entity) list.get(j);
|
||||
|
||||
if (entity1.L() && (!entity1.i(this.shooter) || this.as >= 25)) {
|
||||
float f = 0.3F;
|
||||
@ -169,7 +167,7 @@ public abstract class EntityFireball extends Entity {
|
||||
float f2 = this.c();
|
||||
|
||||
if (this.H()) {
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
for (int k = 0; k < 4; ++k) {
|
||||
float f3 = 0.25F;
|
||||
|
||||
this.world.addParticle("bubble", this.locX - this.motX * (double) f3, this.locY - this.motY * (double) f3, this.locZ - this.motZ * (double) f3, this.motX, this.motY, this.motZ);
|
||||
@ -230,6 +228,9 @@ public abstract class EntityFireball extends Entity {
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
this.K();
|
||||
if (damagesource.getEntity() != null) {
|
||||
Vec3D vec3d = damagesource.getEntity().Z();
|
||||
@ -252,6 +253,7 @@ public abstract class EntityFireball extends Entity {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public float c(float f) {
|
||||
return 1.0F;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
// CraftBukkit start
|
||||
@ -93,7 +92,7 @@ public class EntityFishingHook extends Entity {
|
||||
this.b(this.yaw, this.pitch);
|
||||
} else {
|
||||
if (!this.world.isStatic) {
|
||||
ItemStack itemstack = this.owner.bP();
|
||||
ItemStack itemstack = this.owner.bT();
|
||||
|
||||
if (this.owner.dead || !this.owner.isAlive() || itemstack == null || itemstack.getItem() != Item.FISHING_ROD || this.e(this.owner) > 1024.0D) {
|
||||
this.die();
|
||||
@ -152,12 +151,11 @@ public class EntityFishingHook extends Entity {
|
||||
Entity entity = null;
|
||||
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;
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
double d5;
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity1 = (Entity) iterator.next();
|
||||
for (int j = 0; j < list.size(); ++j) {
|
||||
Entity entity1 = (Entity) list.get(j);
|
||||
|
||||
if (entity1.L() && (entity1 != this.owner || this.j >= 5)) {
|
||||
float f = 0.3F;
|
||||
@ -221,9 +219,9 @@ public class EntityFishingHook extends Entity {
|
||||
byte b0 = 5;
|
||||
double d6 = 0.0D;
|
||||
|
||||
for (int j = 0; j < b0; ++j) {
|
||||
double d7 = this.boundingBox.b + (this.boundingBox.e - this.boundingBox.b) * (double) (j + 0) / (double) b0 - 0.125D + 0.125D;
|
||||
double d8 = this.boundingBox.b + (this.boundingBox.e - this.boundingBox.b) * (double) (j + 1) / (double) b0 - 0.125D + 0.125D;
|
||||
for (int k = 0; k < b0; ++k) {
|
||||
double d7 = this.boundingBox.b + (this.boundingBox.e - this.boundingBox.b) * (double) (k + 0) / (double) b0 - 0.125D + 0.125D;
|
||||
double d8 = this.boundingBox.b + (this.boundingBox.e - this.boundingBox.b) * (double) (k + 1) / (double) b0 - 0.125D + 0.125D;
|
||||
AxisAlignedBB axisalignedbb1 = AxisAlignedBB.a().a(this.boundingBox.a, d7, this.boundingBox.c, this.boundingBox.d, d8, this.boundingBox.f);
|
||||
|
||||
if (this.world.b(axisalignedbb1, Material.WATER)) {
|
||||
@ -237,27 +235,27 @@ public class EntityFishingHook extends Entity {
|
||||
} else {
|
||||
short short1 = 500;
|
||||
|
||||
if (this.world.B(MathHelper.floor(this.locX), MathHelper.floor(this.locY) + 1, MathHelper.floor(this.locZ))) {
|
||||
if (this.world.D(MathHelper.floor(this.locX), MathHelper.floor(this.locY) + 1, MathHelper.floor(this.locZ))) {
|
||||
short1 = 300;
|
||||
}
|
||||
|
||||
if (this.random.nextInt(short1) == 0) {
|
||||
this.as = this.random.nextInt(30) + 10;
|
||||
this.motY -= 0.20000000298023224D;
|
||||
this.world.makeSound(this, "random.splash", 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
this.makeSound("random.splash", 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
float f3 = (float) MathHelper.floor(this.boundingBox.b);
|
||||
|
||||
float f4;
|
||||
int k;
|
||||
int l;
|
||||
float f5;
|
||||
|
||||
for (k = 0; (float) k < 1.0F + this.width * 20.0F; ++k) {
|
||||
for (l = 0; (float) l < 1.0F + this.width * 20.0F; ++l) {
|
||||
f5 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width;
|
||||
f4 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width;
|
||||
this.world.addParticle("bubble", this.locX + (double) f5, (double) (f3 + 1.0F), this.locZ + (double) f4, this.motX, this.motY - (double) (this.random.nextFloat() * 0.2F), this.motZ);
|
||||
}
|
||||
|
||||
for (k = 0; (float) k < 1.0F + this.width * 20.0F; ++k) {
|
||||
for (l = 0; (float) l < 1.0F + this.width * 20.0F; ++l) {
|
||||
f5 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width;
|
||||
f4 = (this.random.nextFloat() * 2.0F - 1.0F) * this.width;
|
||||
this.world.addParticle("splash", this.locX + (double) f5, (double) (f3 + 1.0F), this.locZ + (double) f4, this.motX, this.motY, this.motZ);
|
||||
|
@ -26,7 +26,9 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if ("fireball".equals(damagesource.l()) && damagesource.getEntity() instanceof EntityHuman) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else if ("fireball".equals(damagesource.l()) && damagesource.getEntity() instanceof EntityHuman) {
|
||||
super.damageEntity(damagesource, 1000);
|
||||
((EntityHuman) damagesource.getEntity()).a((Statistic) AchievementList.y);
|
||||
return true;
|
||||
@ -51,12 +53,12 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
this.texture = b0 == 1 ? "/mob/ghast_fire.png" : "/mob/ghast.png";
|
||||
}
|
||||
|
||||
protected void bk() {
|
||||
protected void bn() {
|
||||
if (!this.world.isStatic && this.world.difficulty == 0) {
|
||||
this.die();
|
||||
}
|
||||
|
||||
this.bh();
|
||||
this.bk();
|
||||
this.f = this.g;
|
||||
double d0 = this.c - this.locX;
|
||||
double d1 = this.d - this.locY;
|
||||
@ -128,7 +130,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
double d7 = this.target.locZ - this.locZ;
|
||||
|
||||
this.aw = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F;
|
||||
if (this.m(this.target)) {
|
||||
if (this.n(this.target)) {
|
||||
if (this.g == 10) {
|
||||
this.world.a((EntityHuman) null, 1007, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
||||
}
|
||||
@ -182,15 +184,15 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return "mob.ghast.moan";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.ghast.scream";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.ghast.death";
|
||||
}
|
||||
|
||||
@ -219,7 +221,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
protected float aV() {
|
||||
protected float aX() {
|
||||
return 10.0F;
|
||||
}
|
||||
|
||||
@ -227,7 +229,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
return this.random.nextInt(20) == 0 && super.canSpawn() && this.world.difficulty > 0;
|
||||
}
|
||||
|
||||
public int bs() {
|
||||
public int bv() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -203,7 +203,14 @@ public abstract class EntityHanging extends Entity {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean j(Entity entity) {
|
||||
return entity instanceof EntityHuman ? this.damageEntity(DamageSource.playerAttack((EntityHuman) entity), 0) : false;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
if (!this.dead && !this.world.isStatic) {
|
||||
// CraftBukkit start
|
||||
HangingBreakEvent event = new HangingBreakEvent((Hanging) this.getBukkitEntity(), HangingBreakEvent.RemoveCause.DEFAULT);
|
||||
@ -248,6 +255,7 @@ public abstract class EntityHanging extends Entity {
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void move(double d0, double d1, double d2) {
|
||||
if (!this.world.isStatic && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) {
|
||||
|
@ -20,19 +20,18 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
public Container defaultContainer;
|
||||
public Container activeContainer;
|
||||
protected FoodMetaData foodData = new FoodMetaData();
|
||||
protected int bO = 0;
|
||||
public byte bP = 0;
|
||||
public int bQ = 0;
|
||||
public float bR;
|
||||
public float bS;
|
||||
protected int bM = 0;
|
||||
public byte bN = 0;
|
||||
public float bO;
|
||||
public float bP;
|
||||
public String name;
|
||||
public int bU = 0;
|
||||
public int bR = 0;
|
||||
public double bS;
|
||||
public double bT;
|
||||
public double bU;
|
||||
public double bV;
|
||||
public double bW;
|
||||
public double bX;
|
||||
public double bY;
|
||||
public double bZ;
|
||||
public double ca;
|
||||
// CraftBukkit start
|
||||
public boolean sleeping; // protected -> public
|
||||
public boolean fauxSleeping;
|
||||
@ -43,10 +42,10 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
public ChunkCoordinates cc;
|
||||
public ChunkCoordinates bZ;
|
||||
public int sleepTicks; // CraftBukkit - private -> public
|
||||
public float cd;
|
||||
public float ce;
|
||||
public float ca;
|
||||
public float cb;
|
||||
private ChunkCoordinates c;
|
||||
private boolean d;
|
||||
private ChunkCoordinates e;
|
||||
@ -57,8 +56,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
public float exp;
|
||||
private ItemStack f;
|
||||
private int g;
|
||||
protected float cj = 0.1F;
|
||||
protected float ck = 0.02F;
|
||||
protected float cg = 0.1F;
|
||||
protected float ch = 0.02F;
|
||||
private int h = 0;
|
||||
public EntityFishingHook hookedFish = null;
|
||||
|
||||
@ -84,21 +83,22 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
super.a();
|
||||
this.datawatcher.a(16, Byte.valueOf((byte) 0));
|
||||
this.datawatcher.a(17, Byte.valueOf((byte) 0));
|
||||
this.datawatcher.a(18, Integer.valueOf(0));
|
||||
}
|
||||
|
||||
public boolean bI() {
|
||||
public boolean bM() {
|
||||
return this.f != null;
|
||||
}
|
||||
|
||||
public void bK() {
|
||||
public void bO() {
|
||||
if (this.f != null) {
|
||||
this.f.b(this.world, this, this.g);
|
||||
}
|
||||
|
||||
this.bL();
|
||||
this.bP();
|
||||
}
|
||||
|
||||
public void bL() {
|
||||
public void bP() {
|
||||
this.f = null;
|
||||
this.g = 0;
|
||||
if (!this.world.isStatic) {
|
||||
@ -106,8 +106,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
public boolean be() {
|
||||
return this.bI() && Item.byId[this.f.id].d_(this.f) == EnumAnimation.d;
|
||||
public boolean bh() {
|
||||
return this.bM() && Item.byId[this.f.id].d_(this.f) == EnumAnimation.d;
|
||||
}
|
||||
|
||||
public void j_() {
|
||||
@ -123,12 +123,12 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.n();
|
||||
}
|
||||
} else {
|
||||
this.bL();
|
||||
this.bP();
|
||||
}
|
||||
}
|
||||
|
||||
if (this.bU > 0) {
|
||||
--this.bU;
|
||||
if (this.bR > 0) {
|
||||
--this.bR;
|
||||
}
|
||||
|
||||
if (this.isSleeping()) {
|
||||
@ -140,7 +140,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
if (!this.world.isStatic) {
|
||||
if (!this.j()) {
|
||||
this.a(true, true, false);
|
||||
} else if (this.world.t()) {
|
||||
} else if (this.world.u()) {
|
||||
this.a(false, true, true);
|
||||
}
|
||||
}
|
||||
@ -152,7 +152,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
super.j_();
|
||||
if (!this.world.isStatic && this.activeContainer != null && !this.activeContainer.c(this)) {
|
||||
if (!this.world.isStatic && this.activeContainer != null && !this.activeContainer.a(this)) {
|
||||
this.closeInventory();
|
||||
this.activeContainer = this.defaultContainer;
|
||||
}
|
||||
@ -161,41 +161,41 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
this.bV = this.bY;
|
||||
this.bW = this.bZ;
|
||||
this.bX = this.ca;
|
||||
double d0 = this.locX - this.bY;
|
||||
double d1 = this.locY - this.bZ;
|
||||
double d2 = this.locZ - this.ca;
|
||||
this.bS = this.bV;
|
||||
this.bT = this.bW;
|
||||
this.bU = this.bX;
|
||||
double d0 = this.locX - this.bV;
|
||||
double d1 = this.locY - this.bW;
|
||||
double d2 = this.locZ - this.bX;
|
||||
double d3 = 10.0D;
|
||||
|
||||
if (d0 > d3) {
|
||||
this.bV = this.bY = this.locX;
|
||||
this.bS = this.bV = this.locX;
|
||||
}
|
||||
|
||||
if (d2 > d3) {
|
||||
this.bX = this.ca = this.locZ;
|
||||
this.bU = this.bX = this.locZ;
|
||||
}
|
||||
|
||||
if (d1 > d3) {
|
||||
this.bW = this.bZ = this.locY;
|
||||
this.bT = this.bW = this.locY;
|
||||
}
|
||||
|
||||
if (d0 < -d3) {
|
||||
this.bV = this.bY = this.locX;
|
||||
this.bS = this.bV = this.locX;
|
||||
}
|
||||
|
||||
if (d2 < -d3) {
|
||||
this.bX = this.ca = this.locZ;
|
||||
this.bU = this.bX = this.locZ;
|
||||
}
|
||||
|
||||
if (d1 < -d3) {
|
||||
this.bW = this.bZ = this.locY;
|
||||
this.bT = this.bW = this.locY;
|
||||
}
|
||||
|
||||
this.bY += d0 * 0.25D;
|
||||
this.ca += d2 * 0.25D;
|
||||
this.bZ += d1 * 0.25D;
|
||||
this.bV += d0 * 0.25D;
|
||||
this.bX += d2 * 0.25D;
|
||||
this.bW += d1 * 0.25D;
|
||||
this.a(StatisticList.k, 1);
|
||||
if (this.vehicle == null) {
|
||||
this.e = null;
|
||||
@ -214,9 +214,13 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return 10;
|
||||
}
|
||||
|
||||
protected void makeSound(String s, float f, float f1) {
|
||||
this.world.a(this, s, f, f1);
|
||||
}
|
||||
|
||||
protected void c(ItemStack itemstack, int i) {
|
||||
if (itemstack.n() == EnumAnimation.c) {
|
||||
this.world.makeSound(this, "random.drink", 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
|
||||
this.makeSound("random.drink", 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
|
||||
}
|
||||
|
||||
if (itemstack.n() == EnumAnimation.b) {
|
||||
@ -233,7 +237,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.world.addParticle("iconcrack_" + itemstack.getItem().id, vec3d1.c, vec3d1.d, vec3d1.e, vec3d.c, vec3d.d + 0.05D, vec3d.e);
|
||||
}
|
||||
|
||||
this.world.makeSound(this, "random.eat", 0.5F + 0.5F * (float) this.random.nextInt(2), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
this.makeSound("random.eat", 0.5F + 0.5F * (float) this.random.nextInt(2), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@ -250,11 +254,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
this.bL();
|
||||
this.bP();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean bd() {
|
||||
protected boolean bg() {
|
||||
return this.getHealth() <= 0 || this.isSleeping();
|
||||
}
|
||||
|
||||
@ -271,8 +275,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
float f1 = this.pitch;
|
||||
|
||||
super.U();
|
||||
this.bR = this.bS;
|
||||
this.bS = 0.0F;
|
||||
this.bO = this.bP;
|
||||
this.bP = 0.0F;
|
||||
this.k(this.locX - d0, this.locY - d1, this.locZ - d2);
|
||||
if (this.vehicle instanceof EntityPig) {
|
||||
this.pitch = f1;
|
||||
@ -281,13 +285,13 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
protected void bk() {
|
||||
this.bl();
|
||||
protected void bn() {
|
||||
this.bo();
|
||||
}
|
||||
|
||||
public void c() {
|
||||
if (this.bO > 0) {
|
||||
--this.bO;
|
||||
if (this.bM > 0) {
|
||||
--this.bM;
|
||||
}
|
||||
|
||||
if (this.world.difficulty == 0 && this.getHealth() < this.getMaxHealth() && this.ticksLived % 20 * 12 == 0) {
|
||||
@ -296,13 +300,13 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
this.inventory.j();
|
||||
this.bR = this.bS;
|
||||
this.bO = this.bP;
|
||||
super.c();
|
||||
this.aM = this.abilities.b();
|
||||
this.aN = this.ck;
|
||||
this.aN = this.ch;
|
||||
if (this.isSprinting()) {
|
||||
this.aM = (float) ((double) this.aM + (double) this.abilities.b() * 0.3D);
|
||||
this.aN = (float) ((double) this.aN + (double) this.ck * 0.3D);
|
||||
this.aN = (float) ((double) this.aN + (double) this.ch * 0.3D);
|
||||
}
|
||||
|
||||
float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
|
||||
@ -321,27 +325,39 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
f1 = 0.0F;
|
||||
}
|
||||
|
||||
this.bS += (f - this.bS) * 0.4F;
|
||||
this.bP += (f - this.bP) * 0.4F;
|
||||
this.ba += (f1 - this.ba) * 0.8F;
|
||||
if (this.getHealth() > 0) {
|
||||
List list = this.world.getEntities(this, this.boundingBox.grow(1.0D, 0.0D, 1.0D));
|
||||
List list = this.world.getEntities(this, this.boundingBox.grow(1.0D, 0.5D, 1.0D));
|
||||
|
||||
if (list != null) {
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
Entity entity = (Entity) list.get(i);
|
||||
|
||||
if (!entity.dead) {
|
||||
this.q(entity);
|
||||
this.r(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void q(Entity entity) {
|
||||
entity.b_(this);
|
||||
private void r(Entity entity) {
|
||||
entity.c_(this);
|
||||
}
|
||||
|
||||
public int getScore() {
|
||||
return this.datawatcher.getInt(18);
|
||||
}
|
||||
|
||||
public void setScore(int i) {
|
||||
this.datawatcher.watch(18, Integer.valueOf(i));
|
||||
}
|
||||
|
||||
public void addScore(int i) {
|
||||
int j = this.getScore();
|
||||
|
||||
this.datawatcher.watch(18, Integer.valueOf(j + i));
|
||||
}
|
||||
|
||||
public void die(DamageSource damagesource) {
|
||||
@ -369,7 +385,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
public void c(Entity entity, int i) {
|
||||
this.bQ += i;
|
||||
this.addScore(i);
|
||||
if (entity instanceof EntityHuman) {
|
||||
this.a(StatisticList.A, 1);
|
||||
} else {
|
||||
@ -377,7 +393,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
public EntityItem bN() {
|
||||
public EntityItem bR() {
|
||||
return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, 1), false);
|
||||
}
|
||||
|
||||
@ -479,8 +495,9 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.exp = nbttagcompound.getFloat("XpP");
|
||||
this.expLevel = nbttagcompound.getInt("XpLevel");
|
||||
this.expTotal = nbttagcompound.getInt("XpTotal");
|
||||
this.setScore(nbttagcompound.getInt("Score"));
|
||||
if (this.sleeping) {
|
||||
this.cc = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||
this.bZ = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||
this.a(true, true, false);
|
||||
}
|
||||
|
||||
@ -513,6 +530,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
nbttagcompound.setFloat("XpP", this.exp);
|
||||
nbttagcompound.setInt("XpLevel", this.expLevel);
|
||||
nbttagcompound.setInt("XpTotal", this.expTotal);
|
||||
nbttagcompound.setInt("Score", this.getScore());
|
||||
if (this.c != null) {
|
||||
nbttagcompound.setInt("SpawnX", this.c.x);
|
||||
nbttagcompound.setInt("SpawnY", this.c.y);
|
||||
@ -543,10 +561,12 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (this.abilities.isInvulnerable && !damagesource.ignoresInvulnerability()) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else if (this.abilities.isInvulnerable && !damagesource.ignoresInvulnerability()) {
|
||||
return false;
|
||||
} else {
|
||||
this.bC = 0;
|
||||
this.bA = 0;
|
||||
if (this.getHealth() <= 0) {
|
||||
return false;
|
||||
} else {
|
||||
@ -646,11 +666,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.inventory.g(i);
|
||||
}
|
||||
|
||||
public int aU() {
|
||||
public int aW() {
|
||||
return this.inventory.k();
|
||||
}
|
||||
|
||||
public float bO() {
|
||||
public float bS() {
|
||||
int i = 0;
|
||||
ItemStack[] aitemstack = this.inventory.armor;
|
||||
int j = aitemstack.length;
|
||||
@ -667,8 +687,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
protected void d(DamageSource damagesource, int i) {
|
||||
if (!this.invulnerable) {
|
||||
if (!damagesource.ignoresArmor() && this.be()) {
|
||||
if (!this.isInvulnerable()) {
|
||||
if (!damagesource.ignoresArmor() && this.bh()) {
|
||||
i = 1 + i >> 1;
|
||||
}
|
||||
|
||||
@ -693,11 +713,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
public void d(ItemStack itemstack) {}
|
||||
|
||||
public boolean o(Entity entity) {
|
||||
if (entity.c(this)) {
|
||||
public boolean p(Entity entity) {
|
||||
if (entity.a(this)) {
|
||||
return true;
|
||||
} else {
|
||||
ItemStack itemstack = this.bP();
|
||||
ItemStack itemstack = this.bT();
|
||||
|
||||
if (itemstack != null && entity instanceof EntityLiving) {
|
||||
if (this.abilities.canInstantlyBuild) {
|
||||
@ -707,7 +727,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
if (itemstack.a((EntityLiving) entity)) {
|
||||
// CraftBukkit - bypass infinite items; <= 0 -> == 0
|
||||
if (itemstack.count == 0 && !this.abilities.canInstantlyBuild) {
|
||||
this.bQ();
|
||||
this.bU();
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -718,11 +738,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack bP() {
|
||||
public ItemStack bT() {
|
||||
return this.inventory.getItemInHand();
|
||||
}
|
||||
|
||||
public void bQ() {
|
||||
public void bU() {
|
||||
this.inventory.setItem(this.inventory.itemInHandIndex, (ItemStack) null);
|
||||
}
|
||||
|
||||
@ -732,6 +752,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
public void attack(Entity entity) {
|
||||
if (entity.aq()) {
|
||||
if (!entity.j(this)) {
|
||||
int i = this.inventory.a(entity);
|
||||
|
||||
if (this.hasEffect(MobEffectList.INCREASE_DAMAGE)) {
|
||||
@ -762,15 +783,23 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
i += k;
|
||||
boolean flag1 = entity.damageEntity(DamageSource.playerAttack(this), i);
|
||||
boolean flag1 = false;
|
||||
int l = EnchantmentManager.getFireAspectEnchantmentLevel(this);
|
||||
|
||||
if (entity instanceof EntityLiving && l > 0 && !entity.isBurning()) {
|
||||
flag1 = true;
|
||||
entity.setOnFire(1);
|
||||
}
|
||||
|
||||
boolean flag2 = entity.damageEntity(DamageSource.playerAttack(this), i);
|
||||
|
||||
// CraftBukkit start - Return when the damage fails so that the item will not lose durability
|
||||
if (!flag1) {
|
||||
if (!flag2) {
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (flag1) {
|
||||
if (flag2) {
|
||||
if (j > 0) {
|
||||
entity.g((double) (-MathHelper.sin(this.yaw * 3.1415927F / 180.0F) * (float) j * 0.5F), 0.1D, (double) (MathHelper.cos(this.yaw * 3.1415927F / 180.0F) * (float) j * 0.5F));
|
||||
this.motX *= 0.6D;
|
||||
@ -790,16 +819,16 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.a((Statistic) AchievementList.E);
|
||||
}
|
||||
|
||||
this.k(entity);
|
||||
this.l(entity);
|
||||
}
|
||||
|
||||
ItemStack itemstack = this.bP();
|
||||
ItemStack itemstack = this.bT();
|
||||
|
||||
if (itemstack != null && entity instanceof EntityLiving) {
|
||||
itemstack.a((EntityLiving) entity, this);
|
||||
// CraftBukkit - bypass infinite items; <= 0 -> == 0
|
||||
if (itemstack.count == 0) {
|
||||
this.bQ();
|
||||
this.bU();
|
||||
}
|
||||
}
|
||||
|
||||
@ -809,9 +838,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
this.a(StatisticList.w, i);
|
||||
int l = EnchantmentManager.getFireAspectEnchantmentLevel(this, (EntityLiving) entity);
|
||||
|
||||
if (l > 0 && flag1) {
|
||||
if (l > 0 && flag2) {
|
||||
// CraftBukkit start - raise a combust event when somebody hits with a fire enchanted item
|
||||
EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), l * 4);
|
||||
org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent);
|
||||
@ -820,6 +847,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
entity.setOnFire(combustEvent.getDuration());
|
||||
}
|
||||
// CraftBukkit end
|
||||
} else if (flag1) {
|
||||
entity.extinguish();
|
||||
}
|
||||
}
|
||||
|
||||
@ -827,6 +856,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void b(Entity entity) {}
|
||||
|
||||
@ -834,9 +864,9 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
public void die() {
|
||||
super.die();
|
||||
this.defaultContainer.a(this);
|
||||
this.defaultContainer.b(this);
|
||||
if (this.activeContainer != null) {
|
||||
this.activeContainer.a(this);
|
||||
this.activeContainer.b(this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -844,7 +874,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return !this.sleeping && super.inBlock();
|
||||
}
|
||||
|
||||
public boolean bS() {
|
||||
public boolean bW() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -858,7 +888,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return EnumBedResult.NOT_POSSIBLE_HERE;
|
||||
}
|
||||
|
||||
if (this.world.t()) {
|
||||
if (this.world.u()) {
|
||||
return EnumBedResult.NOT_POSSIBLE_NOW;
|
||||
}
|
||||
|
||||
@ -914,7 +944,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
f = 0.9F;
|
||||
}
|
||||
|
||||
this.u(i1);
|
||||
this.x(i1);
|
||||
this.setPosition((double) ((float) i + f), (double) ((float) j + 0.9375F), (double) ((float) k + f1));
|
||||
} else {
|
||||
this.setPosition((double) ((float) i + 0.5F), (double) ((float) j + 0.9375F), (double) ((float) k + 0.5F));
|
||||
@ -922,7 +952,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
this.sleeping = true;
|
||||
this.sleepTicks = 0;
|
||||
this.cc = new ChunkCoordinates(i, j, k);
|
||||
this.bZ = new ChunkCoordinates(i, j, k);
|
||||
this.motX = this.motZ = this.motY = 0.0D;
|
||||
if (!this.world.isStatic) {
|
||||
this.world.everyoneSleeping();
|
||||
@ -931,32 +961,32 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return EnumBedResult.OK;
|
||||
}
|
||||
|
||||
private void u(int i) {
|
||||
this.cd = 0.0F;
|
||||
this.ce = 0.0F;
|
||||
private void x(int i) {
|
||||
this.ca = 0.0F;
|
||||
this.cb = 0.0F;
|
||||
switch (i) {
|
||||
case 0:
|
||||
this.ce = -1.8F;
|
||||
this.cb = -1.8F;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
this.cd = 1.8F;
|
||||
this.ca = 1.8F;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
this.ce = 1.8F;
|
||||
this.cb = 1.8F;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
this.cd = -1.8F;
|
||||
this.ca = -1.8F;
|
||||
}
|
||||
}
|
||||
|
||||
public void a(boolean flag, boolean flag1, boolean flag2) {
|
||||
this.a(0.6F, 1.8F);
|
||||
this.e_();
|
||||
ChunkCoordinates chunkcoordinates = this.cc;
|
||||
ChunkCoordinates chunkcoordinates1 = this.cc;
|
||||
ChunkCoordinates chunkcoordinates = this.bZ;
|
||||
ChunkCoordinates chunkcoordinates1 = this.bZ;
|
||||
|
||||
if (chunkcoordinates != null && this.world.getTypeId(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) == Block.BED.id) {
|
||||
BlockBed.a(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, false);
|
||||
@ -996,27 +1026,32 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
if (flag2) {
|
||||
this.setRespawnPosition(this.cc, false);
|
||||
this.setRespawnPosition(this.bZ, false);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean j() {
|
||||
return this.world.getTypeId(this.cc.x, this.cc.y, this.cc.z) == Block.BED.id;
|
||||
return this.world.getTypeId(this.bZ.x, this.bZ.y, this.bZ.z) == Block.BED.id;
|
||||
}
|
||||
|
||||
public static ChunkCoordinates getBed(World world, ChunkCoordinates chunkcoordinates, boolean flag) {
|
||||
IChunkProvider ichunkprovider = world.H();
|
||||
IChunkProvider ichunkprovider = world.I();
|
||||
|
||||
ichunkprovider.getChunkAt(chunkcoordinates.x - 3 >> 4, chunkcoordinates.z - 3 >> 4);
|
||||
ichunkprovider.getChunkAt(chunkcoordinates.x + 3 >> 4, chunkcoordinates.z - 3 >> 4);
|
||||
ichunkprovider.getChunkAt(chunkcoordinates.x - 3 >> 4, chunkcoordinates.z + 3 >> 4);
|
||||
ichunkprovider.getChunkAt(chunkcoordinates.x + 3 >> 4, chunkcoordinates.z + 3 >> 4);
|
||||
if (world.getTypeId(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) != Block.BED.id) {
|
||||
return flag && world.isEmpty(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) && world.isEmpty(chunkcoordinates.x, chunkcoordinates.y + 1, chunkcoordinates.z) ? chunkcoordinates : null;
|
||||
} else {
|
||||
if (world.getTypeId(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) == Block.BED.id) {
|
||||
ChunkCoordinates chunkcoordinates1 = BlockBed.b(world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, 0);
|
||||
|
||||
return chunkcoordinates1;
|
||||
} else {
|
||||
Material material = world.getMaterial(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z);
|
||||
Material material1 = world.getMaterial(chunkcoordinates.x, chunkcoordinates.y + 1, chunkcoordinates.z);
|
||||
boolean flag1 = !material.isBuildable() && !material.isLiquid();
|
||||
boolean flag2 = !material1.isBuildable() && !material1.isLiquid();
|
||||
|
||||
return flag && flag1 && flag2 ? chunkcoordinates : null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1065,8 +1100,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
public void a(Statistic statistic, int i) {}
|
||||
|
||||
protected void bf() {
|
||||
super.bf();
|
||||
protected void bi() {
|
||||
super.bi();
|
||||
this.a(StatisticList.u, 1);
|
||||
if (this.isSprinting()) {
|
||||
this.j(0.8F);
|
||||
@ -1171,16 +1206,22 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
public void am() {
|
||||
if (!this.abilities.isFlying) {
|
||||
super.am();
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack q(int i) {
|
||||
return this.inventory.f(i);
|
||||
}
|
||||
|
||||
protected void bB() {}
|
||||
protected void bE() {}
|
||||
|
||||
protected void bC() {}
|
||||
protected void bF() {}
|
||||
|
||||
public void giveExp(int i) {
|
||||
this.bQ += i;
|
||||
this.addScore(i);
|
||||
int j = Integer.MAX_VALUE - this.expTotal;
|
||||
|
||||
if (i > j) {
|
||||
@ -1204,7 +1245,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
if (i > 0 && this.expLevel % 5 == 0 && (float) this.h < (float) this.ticksLived - 100.0F) {
|
||||
float f = this.expLevel > 30 ? 1.0F : (float) this.expLevel / 30.0F;
|
||||
|
||||
this.world.makeSound(this, "random.levelup", f * 0.75F, 1.0F);
|
||||
this.makeSound("random.levelup", f * 0.75F, 1.0F);
|
||||
this.h = this.ticksLived;
|
||||
}
|
||||
}
|
||||
@ -1229,7 +1270,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return (flag || this.foodData.c()) && !this.abilities.isInvulnerable;
|
||||
}
|
||||
|
||||
public boolean ca() {
|
||||
public boolean ce() {
|
||||
return this.getHealth() > 0 && this.getHealth() < this.getMaxHealth();
|
||||
}
|
||||
|
||||
@ -1249,14 +1290,21 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
} else {
|
||||
int l = this.world.getTypeId(i, j, k);
|
||||
|
||||
if (l > 0 && this.bP() != null) {
|
||||
if (l > 0) {
|
||||
Block block = Block.byId[l];
|
||||
ItemStack itemstack = this.bP();
|
||||
|
||||
if (block.material.q()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.bT() != null) {
|
||||
ItemStack itemstack = this.bT();
|
||||
|
||||
if (itemstack.b(block) || itemstack.a(block) > 1.0F) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -1292,14 +1340,14 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.expLevel = entityhuman.expLevel;
|
||||
this.expTotal = entityhuman.expTotal;
|
||||
this.exp = entityhuman.exp;
|
||||
this.bQ = entityhuman.bQ;
|
||||
this.setScore(entityhuman.getScore());
|
||||
this.aq = entityhuman.aq;
|
||||
} else if (this.world.getGameRules().getBoolean("keepInventory")) {
|
||||
this.inventory.b(entityhuman.inventory);
|
||||
this.expLevel = entityhuman.expLevel;
|
||||
this.expTotal = entityhuman.expTotal;
|
||||
this.exp = entityhuman.exp;
|
||||
this.bQ = entityhuman.bQ;
|
||||
this.setScore(entityhuman.getScore());
|
||||
}
|
||||
|
||||
this.enderChest = entityhuman.enderChest;
|
||||
@ -1333,7 +1381,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return i == 0 ? this.inventory.getItemInHand() : this.inventory.armor[i - 1];
|
||||
}
|
||||
|
||||
public ItemStack bA() {
|
||||
public ItemStack bD() {
|
||||
return this.inventory.getItemInHand();
|
||||
}
|
||||
|
||||
|
@ -32,16 +32,16 @@ public class EntityIronGolem extends EntityGolem {
|
||||
this.datawatcher.a(16, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
public boolean bb() {
|
||||
public boolean be() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void bj() {
|
||||
protected void bm() {
|
||||
if (--this.e <= 0) {
|
||||
this.e = 70 + this.random.nextInt(50);
|
||||
this.d = this.world.villages.getClosestVillage(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ), 32);
|
||||
if (this.d == null) {
|
||||
this.aK();
|
||||
this.aL();
|
||||
} else {
|
||||
ChunkCoordinates chunkcoordinates = this.d.getCenter();
|
||||
|
||||
@ -49,7 +49,7 @@ public class EntityIronGolem extends EntityGolem {
|
||||
}
|
||||
}
|
||||
|
||||
super.bj();
|
||||
super.bm();
|
||||
}
|
||||
|
||||
public int getMaxHealth() {
|
||||
@ -60,12 +60,12 @@ public class EntityIronGolem extends EntityGolem {
|
||||
return i;
|
||||
}
|
||||
|
||||
protected void n(Entity entity) {
|
||||
if (entity instanceof IMonster && this.aA().nextInt(20) == 0) {
|
||||
protected void o(Entity entity) {
|
||||
if (entity instanceof IMonster && this.aB().nextInt(20) == 0) {
|
||||
this.b((EntityLiving) entity);
|
||||
}
|
||||
|
||||
super.n(entity);
|
||||
super.o(entity);
|
||||
}
|
||||
|
||||
public void c() {
|
||||
@ -85,7 +85,7 @@ public class EntityIronGolem extends EntityGolem {
|
||||
int l = this.world.getTypeId(i, j, k);
|
||||
|
||||
if (l > 0) {
|
||||
this.world.addParticle("tilecrack_" + l, this.locX + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, this.boundingBox.b + 0.1D, this.locZ + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, 4.0D * ((double) this.random.nextFloat() - 0.5D), 0.5D, ((double) this.random.nextFloat() - 0.5D) * 4.0D);
|
||||
this.world.addParticle("tilecrack_" + l + "_" + this.world.getData(i, j, k), this.locX + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, this.boundingBox.b + 0.1D, this.locZ + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, 4.0D * ((double) this.random.nextFloat() - 0.5D), 0.5D, ((double) this.random.nextFloat() - 0.5D) * 4.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -104,7 +104,7 @@ public class EntityIronGolem extends EntityGolem {
|
||||
this.setPlayerCreated(nbttagcompound.getBoolean("PlayerCreated"));
|
||||
}
|
||||
|
||||
public boolean l(Entity entity) {
|
||||
public boolean m(Entity entity) {
|
||||
this.f = 10;
|
||||
this.world.broadcastEntityEffect(this, (byte) 4);
|
||||
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), 7 + this.random.nextInt(15));
|
||||
@ -113,7 +113,7 @@ public class EntityIronGolem extends EntityGolem {
|
||||
entity.motY += 0.4000000059604645D;
|
||||
}
|
||||
|
||||
this.world.makeSound(this, "mob.irongolem.throw", 1.0F, 1.0F);
|
||||
this.makeSound("mob.irongolem.throw", 1.0F, 1.0F);
|
||||
return flag;
|
||||
}
|
||||
|
||||
@ -126,20 +126,20 @@ public class EntityIronGolem extends EntityGolem {
|
||||
this.world.broadcastEntityEffect(this, (byte) 11);
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return "none";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.irongolem.hit";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.irongolem.death";
|
||||
}
|
||||
|
||||
protected void a(int i, int j, int k, int l) {
|
||||
this.world.makeSound(this, "mob.irongolem.walk", 1.0F, 1.0F);
|
||||
this.makeSound("mob.irongolem.walk", 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
protected void dropDeathLoot(boolean flag, int i) {
|
||||
|
@ -59,7 +59,7 @@ public class EntityItem extends Entity {
|
||||
this.lastY = this.locY;
|
||||
this.lastZ = this.locZ;
|
||||
this.motY -= 0.03999999910593033D;
|
||||
this.i(this.locX, (this.boundingBox.b + this.boundingBox.e) / 2.0D, this.locZ);
|
||||
this.Y = this.i(this.locX, (this.boundingBox.b + this.boundingBox.e) / 2.0D, this.locZ);
|
||||
this.move(this.motX, this.motY, this.motZ);
|
||||
boolean flag = (int) this.lastX != (int) this.locX || (int) this.lastY != (int) this.locY || (int) this.lastZ != (int) this.locZ;
|
||||
|
||||
@ -68,17 +68,11 @@ public class EntityItem extends Entity {
|
||||
this.motY = 0.20000000298023224D;
|
||||
this.motX = (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F);
|
||||
this.motZ = (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F);
|
||||
this.world.makeSound(this, "random.fizz", 0.4F, 2.0F + this.random.nextFloat() * 0.4F);
|
||||
this.makeSound("random.fizz", 0.4F, 2.0F + this.random.nextFloat() * 0.4F);
|
||||
}
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
Iterator iterator = this.world.a(EntityItem.class, this.boundingBox.grow(0.5D, 0.0D, 0.5D)).iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
EntityItem entityitem = (EntityItem) iterator.next();
|
||||
|
||||
this.a(entityitem);
|
||||
}
|
||||
this.d();
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,14 +106,27 @@ public class EntityItem extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
private void d() {
|
||||
Iterator iterator = this.world.a(EntityItem.class, this.boundingBox.grow(0.5D, 0.0D, 0.5D)).iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
EntityItem entityitem = (EntityItem) iterator.next();
|
||||
|
||||
this.a(entityitem);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean a(EntityItem entityitem) {
|
||||
if (entityitem == this) {
|
||||
return false;
|
||||
} else if (entityitem.isAlive() && this.isAlive()) {
|
||||
if (entityitem.itemStack.getItem() != this.itemStack.getItem()) {
|
||||
return false;
|
||||
} else if (!entityitem.itemStack.hasTag() && !this.itemStack.hasTag()) {
|
||||
if (entityitem.itemStack.getItem().l() && entityitem.itemStack.getData() != this.itemStack.getData()) {
|
||||
} else if (entityitem.itemStack.hasTag() ^ this.itemStack.hasTag()) {
|
||||
return false;
|
||||
} else if (entityitem.itemStack.hasTag() && !entityitem.itemStack.getTag().equals(this.itemStack.getTag())) {
|
||||
return false;
|
||||
} else if (entityitem.itemStack.getItem().l() && entityitem.itemStack.getData() != this.itemStack.getData()) {
|
||||
return false;
|
||||
} else if (entityitem.itemStack.count < this.itemStack.count) {
|
||||
return entityitem.a(this);
|
||||
@ -139,9 +146,6 @@ public class EntityItem extends Entity {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void c() {
|
||||
@ -157,6 +161,9 @@ public class EntityItem extends Entity {
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
this.K();
|
||||
this.e -= i;
|
||||
if (this.e <= 0) {
|
||||
@ -165,6 +172,7 @@ public class EntityItem extends Entity {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
nbttagcompound.setShort("Health", (short) ((byte) this.e));
|
||||
@ -185,7 +193,7 @@ public class EntityItem extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public void b_(EntityHuman entityhuman) {
|
||||
public void c_(EntityHuman entityhuman) {
|
||||
if ((!this.world.isStatic) && (this.itemStack != null)) { // CraftBukkit - nullcheck
|
||||
int i = this.itemStack.count;
|
||||
|
||||
@ -225,7 +233,7 @@ public class EntityItem extends Entity {
|
||||
entityhuman.a((Statistic) AchievementList.z);
|
||||
}
|
||||
|
||||
this.world.makeSound(this, "random.pop", 0.2F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
this.makeSound("random.pop", 0.2F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
entityhuman.receive(this, i);
|
||||
if (this.itemStack.count <= 0) {
|
||||
this.die();
|
||||
@ -242,4 +250,11 @@ public class EntityItem extends Entity {
|
||||
public boolean aq() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void b(int i) {
|
||||
super.b(i);
|
||||
if (!this.world.isStatic) {
|
||||
this.d();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.event.block.BlockIgniteEvent; // CraftBukkit
|
||||
@ -35,7 +34,7 @@ public class EntityLightning extends EntityWeather {
|
||||
this.c = this.random.nextInt(3) + 1;
|
||||
|
||||
// CraftBukkit
|
||||
if (!isEffect && world.difficulty >= 2 && world.areChunksLoaded(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2), 10)) {
|
||||
if (!isEffect && !world.isStatic && world.difficulty >= 2 && world.areChunksLoaded(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2), 10)) {
|
||||
int i = MathHelper.floor(d0);
|
||||
int j = MathHelper.floor(d1);
|
||||
int k = MathHelper.floor(d2);
|
||||
@ -86,7 +85,7 @@ public class EntityLightning extends EntityWeather {
|
||||
this.lifeTicks = 1;
|
||||
this.a = this.random.nextLong();
|
||||
// CraftBukkit
|
||||
if (!this.isEffect && this.world.areChunksLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ), 10)) {
|
||||
if (!this.isEffect && !this.world.isStatic && this.world.areChunksLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ), 10)) {
|
||||
int i = MathHelper.floor(this.locX);
|
||||
int j = MathHelper.floor(this.locY);
|
||||
int k = MathHelper.floor(this.locZ);
|
||||
@ -105,15 +104,12 @@ public class EntityLightning extends EntityWeather {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.lifeTicks >= 0 && !this.isEffect) { // CraftBukkit
|
||||
if (!this.world.isStatic && this.lifeTicks >= 0 && !this.isEffect) { // CraftBukkit
|
||||
double d0 = 3.0D;
|
||||
// CraftBukkit start - switch to array copy of list to avoid CMEs
|
||||
Object[] array = this.world.getEntities(this, AxisAlignedBB.a().a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + 6.0D + d0, this.locZ + d0)).toArray();
|
||||
Iterator iterator = com.google.common.collect.Iterators.forArray(array);
|
||||
// CraftBukkit end
|
||||
List list = this.world.getEntities(this, AxisAlignedBB.a().a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + 6.0D + d0, this.locZ + d0));
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
for (int l = 0; l < list.size(); ++l) {
|
||||
Entity entity = (Entity) list.get(l);
|
||||
|
||||
entity.a(this);
|
||||
}
|
||||
|
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
@ -13,7 +13,7 @@ public class EntityMagmaCube extends EntitySlime {
|
||||
return this.world.difficulty > 0 && this.world.b(this.boundingBox) && this.world.getCubes(this, this.boundingBox).isEmpty() && !this.world.containsLiquid(this.boundingBox);
|
||||
}
|
||||
|
||||
public int aU() {
|
||||
public int aW() {
|
||||
return this.getSize() * 3;
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ public class EntityMagmaCube extends EntitySlime {
|
||||
this.b *= 0.9F;
|
||||
}
|
||||
|
||||
protected void bf() {
|
||||
protected void bi() {
|
||||
this.motY = (double) (0.42F + (float) this.getSize() * 0.1F);
|
||||
this.am = true;
|
||||
}
|
||||
@ -81,11 +81,11 @@ public class EntityMagmaCube extends EntitySlime {
|
||||
return super.m() + 2;
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
}
|
||||
|
||||
public AxisAlignedBB g(Entity entity) {
|
||||
return entity.boundingBox;
|
||||
return entity.M() ? entity.boundingBox : null;
|
||||
}
|
||||
|
||||
public AxisAlignedBB E() {
|
||||
@ -125,6 +125,9 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
if (!this.world.isStatic && !this.dead) {
|
||||
// CraftBukkit start
|
||||
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||
@ -207,6 +210,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean L() {
|
||||
return !this.dead;
|
||||
@ -322,6 +326,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
int l = this.world.getTypeId(i, j, k);
|
||||
|
||||
if (BlockMinecartTrack.d(l)) {
|
||||
this.fallDistance = 0.0F;
|
||||
Vec3D vec3d = this.a(this.locX, this.locY, this.locZ);
|
||||
int i1 = this.world.getData(i, j, k);
|
||||
|
||||
@ -536,15 +541,15 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
this.motX += this.motX / d21 * d22;
|
||||
this.motZ += this.motZ / d21 * d22;
|
||||
} else if (i1 == 1) {
|
||||
if (this.world.s(i - 1, j, k)) {
|
||||
if (this.world.t(i - 1, j, k)) {
|
||||
this.motX = 0.02D;
|
||||
} else if (this.world.s(i + 1, j, k)) {
|
||||
} else if (this.world.t(i + 1, j, k)) {
|
||||
this.motX = -0.02D;
|
||||
}
|
||||
} else if (i1 == 0) {
|
||||
if (this.world.s(i, j, k - 1)) {
|
||||
if (this.world.t(i, j, k - 1)) {
|
||||
this.motZ = 0.02D;
|
||||
} else if (this.world.s(i, j, k + 1)) {
|
||||
} else if (this.world.t(i, j, k + 1)) {
|
||||
this.motZ = -0.02D;
|
||||
}
|
||||
}
|
||||
@ -904,7 +909,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
|
||||
public void update() {}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
if (this.type == 0) {
|
||||
if (this.passenger != null && this.passenger instanceof EntityHuman && this.passenger != entityhuman) {
|
||||
return true;
|
||||
@ -935,7 +940,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
public boolean a_(EntityHuman entityhuman) {
|
||||
return this.dead ? false : entityhuman.e(this) <= 64.0D;
|
||||
}
|
||||
|
||||
|
@ -10,11 +10,11 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
}
|
||||
|
||||
public void c() {
|
||||
this.bl();
|
||||
this.bo();
|
||||
float f = this.c(1.0F);
|
||||
|
||||
if (f > 0.5F) {
|
||||
this.bC += 2;
|
||||
this.bA += 2;
|
||||
}
|
||||
|
||||
super.c();
|
||||
@ -30,11 +30,13 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
protected Entity findTarget() {
|
||||
EntityHuman entityhuman = this.world.findNearbyVulnerablePlayer(this, 16.0D);
|
||||
|
||||
return entityhuman != null && this.m(entityhuman) ? entityhuman : null;
|
||||
return entityhuman != null && this.n(entityhuman) ? entityhuman : null;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (super.damageEntity(damagesource, i)) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else if (super.damageEntity(damagesource, i)) {
|
||||
Entity entity = damagesource.getEntity();
|
||||
|
||||
if (this.passenger != entity && this.vehicle != entity) {
|
||||
@ -65,7 +67,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean l(Entity entity) {
|
||||
public boolean m(Entity entity) {
|
||||
int i = this.c(entity);
|
||||
|
||||
if (this.hasEffect(MobEffectList.INCREASE_DAMAGE)) {
|
||||
@ -92,7 +94,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
this.motZ *= 0.6D;
|
||||
}
|
||||
|
||||
int k = EnchantmentManager.getFireAspectEnchantmentLevel(this, (EntityLiving) entity);
|
||||
int k = EnchantmentManager.getFireAspectEnchantmentLevel(this);
|
||||
|
||||
if (k > 0) {
|
||||
entity.setOnFire(k * 4);
|
||||
@ -105,12 +107,12 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
protected void a(Entity entity, float f) {
|
||||
if (this.attackTicks <= 0 && f < 2.0F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) {
|
||||
this.attackTicks = 20;
|
||||
this.l(entity);
|
||||
this.m(entity);
|
||||
}
|
||||
}
|
||||
|
||||
public float a(int i, int j, int k) {
|
||||
return 0.5F - this.world.o(i, j, k);
|
||||
return 0.5F - this.world.p(i, j, k);
|
||||
}
|
||||
|
||||
protected boolean i_() {
|
||||
@ -123,7 +125,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
} else {
|
||||
int l = this.world.getLightLevel(i, j, k);
|
||||
|
||||
if (this.world.L()) {
|
||||
if (this.world.M()) {
|
||||
int i1 = this.world.j;
|
||||
|
||||
this.world.j = 10;
|
||||
|
@ -10,7 +10,7 @@ public class EntityMushroomCow extends EntityCow {
|
||||
this.a(0.9F, 1.3F);
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
if (itemstack != null && itemstack.id == Item.BOWL.id && this.getAge() >= 0) {
|
||||
@ -52,11 +52,19 @@ public class EntityMushroomCow extends EntityCow {
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return super.c(entityhuman);
|
||||
return super.a(entityhuman);
|
||||
}
|
||||
}
|
||||
|
||||
public EntityAnimal createChild(EntityAnimal entityanimal) {
|
||||
public EntityMushroomCow c(EntityAgeable entityageable) {
|
||||
return new EntityMushroomCow(this.world);
|
||||
}
|
||||
|
||||
public EntityCow b(EntityAgeable entityageable) {
|
||||
return this.c(entityageable);
|
||||
}
|
||||
|
||||
public EntityAgeable createChild(EntityAgeable entityageable) {
|
||||
return this.c(entityageable);
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class EntityOcelot extends EntityTameableAnimal {
|
||||
this.datawatcher.a(18, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
public void bj() {
|
||||
public void bm() {
|
||||
if (this.getControllerMove().a()) {
|
||||
float f = this.getControllerMove().b();
|
||||
|
||||
@ -48,11 +48,11 @@ public class EntityOcelot extends EntityTameableAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean bg() {
|
||||
protected boolean bj() {
|
||||
return !this.isTamed();
|
||||
}
|
||||
|
||||
public boolean bb() {
|
||||
public boolean be() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -72,19 +72,19 @@ public class EntityOcelot extends EntityTameableAnimal {
|
||||
this.setCatType(nbttagcompound.getInt("CatType"));
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return this.isTamed() ? (this.r() ? "mob.cat.purr" : (this.random.nextInt(4) == 0 ? "mob.cat.purreow" : "mob.cat.meow")) : "";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.cat.hitt";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.cat.hitt";
|
||||
}
|
||||
|
||||
protected float aV() {
|
||||
protected float aX() {
|
||||
return 0.4F;
|
||||
}
|
||||
|
||||
@ -92,20 +92,24 @@ public class EntityOcelot extends EntityTameableAnimal {
|
||||
return Item.LEATHER.id;
|
||||
}
|
||||
|
||||
public boolean l(Entity entity) {
|
||||
public boolean m(Entity entity) {
|
||||
return entity.damageEntity(DamageSource.mobAttack(this), 3);
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
this.d.a(false);
|
||||
return super.damageEntity(damagesource, i);
|
||||
}
|
||||
}
|
||||
|
||||
protected void dropDeathLoot(boolean flag, int i) {
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this); // CraftBukkit - Call EntityDeathEvent
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
if (this.isTamed()) {
|
||||
@ -139,10 +143,10 @@ public class EntityOcelot extends EntityTameableAnimal {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.c(entityhuman);
|
||||
return super.a(entityhuman);
|
||||
}
|
||||
|
||||
public EntityAnimal createChild(EntityAnimal entityanimal) {
|
||||
public EntityOcelot b(EntityAgeable entityageable) {
|
||||
EntityOcelot entityocelot = new EntityOcelot(this.world);
|
||||
|
||||
if (this.isTamed()) {
|
||||
@ -208,7 +212,7 @@ public class EntityOcelot extends EntityTameableAnimal {
|
||||
return this.isTamed() ? "entity.Cat.name" : super.getLocalizedName();
|
||||
}
|
||||
|
||||
public void bD() {
|
||||
public void bG() {
|
||||
if (this.world.random.nextInt(7) == 0) {
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
EntityOcelot entityocelot = new EntityOcelot(this.world);
|
||||
@ -219,4 +223,8 @@ public class EntityOcelot extends EntityTameableAnimal {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public EntityAgeable createChild(EntityAgeable entityageable) {
|
||||
return this.b(entityageable);
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class EntityPig extends EntityAnimal {
|
||||
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
||||
}
|
||||
|
||||
public boolean bb() {
|
||||
public boolean be() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -33,12 +33,12 @@ public class EntityPig extends EntityAnimal {
|
||||
return 10;
|
||||
}
|
||||
|
||||
protected void bi() {
|
||||
super.bi();
|
||||
protected void bl() {
|
||||
super.bl();
|
||||
}
|
||||
|
||||
public boolean bF() {
|
||||
ItemStack itemstack = ((EntityHuman) this.passenger).bA();
|
||||
public boolean bI() {
|
||||
ItemStack itemstack = ((EntityHuman) this.passenger).bD();
|
||||
|
||||
return itemstack != null && itemstack.id == Item.CARROT_STICK.id;
|
||||
}
|
||||
@ -58,24 +58,24 @@ public class EntityPig extends EntityAnimal {
|
||||
this.setSaddle(nbttagcompound.getBoolean("Saddle"));
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
return "mob.pig.say";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
return "mob.pig.say";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
return "mob.pig.say";
|
||||
}
|
||||
|
||||
protected String aZ() {
|
||||
return "mob.pig.say";
|
||||
}
|
||||
|
||||
protected String ba() {
|
||||
return "mob.pig.death";
|
||||
}
|
||||
|
||||
protected void a(int i, int j, int k, int l) {
|
||||
this.world.makeSound(this, "mob.pig.step", 0.15F, 1.0F);
|
||||
this.makeSound("mob.pig.step", 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
if (super.c(entityhuman)) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
if (super.a(entityhuman)) {
|
||||
return true;
|
||||
} else if (this.hasSaddle() && !this.world.isStatic && (this.passenger == null || this.passenger == entityhuman)) {
|
||||
entityhuman.mount(this);
|
||||
@ -146,7 +146,7 @@ public class EntityPig extends EntityAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
public EntityAnimal createChild(EntityAnimal entityanimal) {
|
||||
public EntityPig b(EntityAgeable entityageable) {
|
||||
return new EntityPig(this.world);
|
||||
}
|
||||
|
||||
@ -157,4 +157,8 @@ public class EntityPig extends EntityAnimal {
|
||||
public PathfinderGoalPassengerCarrotStick n() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public EntityAgeable createChild(EntityAgeable entityageable) {
|
||||
return this.b(entityageable);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
// CraftBukkit start
|
||||
@ -16,18 +15,18 @@ public class EntityPigZombie extends EntityZombie {
|
||||
public EntityPigZombie(World world) {
|
||||
super(world);
|
||||
this.texture = "/mob/pigzombie.png";
|
||||
this.bI = 0.5F;
|
||||
this.bG = 0.5F;
|
||||
this.fireProof = true;
|
||||
}
|
||||
|
||||
protected boolean bb() {
|
||||
protected boolean be() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void j_() {
|
||||
this.bI = this.target != null ? 0.95F : 0.5F;
|
||||
this.bG = this.target != null ? 0.95F : 0.5F;
|
||||
if (this.soundDelay > 0 && --this.soundDelay == 0) {
|
||||
this.world.makeSound(this, "mob.zombiepig.zpigangry", this.aV() * 2.0F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 1.8F);
|
||||
this.makeSound("mob.zombiepig.zpigangry", this.aX() * 2.0F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 1.8F);
|
||||
}
|
||||
|
||||
super.j_();
|
||||
@ -52,29 +51,32 @@ public class EntityPigZombie extends EntityZombie {
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
Entity entity = damagesource.getEntity();
|
||||
|
||||
if (entity instanceof EntityHuman) {
|
||||
List list = this.world.getEntities(this, this.boundingBox.grow(32.0D, 32.0D, 32.0D));
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity1 = (Entity) iterator.next();
|
||||
for (int j = 0; j < list.size(); ++j) {
|
||||
Entity entity1 = (Entity) list.get(j);
|
||||
|
||||
if (entity1 instanceof EntityPigZombie) {
|
||||
EntityPigZombie entitypigzombie = (EntityPigZombie) entity1;
|
||||
|
||||
entitypigzombie.o(entity);
|
||||
entitypigzombie.p(entity);
|
||||
}
|
||||
}
|
||||
|
||||
this.o(entity);
|
||||
this.p(entity);
|
||||
}
|
||||
|
||||
return super.damageEntity(damagesource, i);
|
||||
}
|
||||
}
|
||||
|
||||
private void o(Entity entity) {
|
||||
private void p(Entity entity) {
|
||||
// CraftBukkit start
|
||||
org.bukkit.entity.Entity bukkitTarget = entity == null ? null : entity.getBukkitEntity();
|
||||
|
||||
@ -97,15 +99,15 @@ public class EntityPigZombie extends EntityZombie {
|
||||
this.soundDelay = this.random.nextInt(40);
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return "mob.zombiepig.zpig";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.zombiepig.zpighurt";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.zombiepig.zpigdeath";
|
||||
}
|
||||
|
||||
@ -140,7 +142,7 @@ public class EntityPigZombie extends EntityZombie {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -153,17 +155,17 @@ public class EntityPigZombie extends EntityZombie {
|
||||
return Item.ROTTEN_FLESH.id;
|
||||
}
|
||||
|
||||
protected void bB() {
|
||||
protected void bE() {
|
||||
this.setEquipment(0, new ItemStack(Item.GOLD_SWORD));
|
||||
}
|
||||
|
||||
public void bD() {
|
||||
super.bD();
|
||||
public void bG() {
|
||||
super.bG();
|
||||
this.setVillager(false);
|
||||
}
|
||||
|
||||
public int c(Entity entity) {
|
||||
ItemStack itemstack = this.bA();
|
||||
ItemStack itemstack = this.bD();
|
||||
int i = 5;
|
||||
|
||||
if (itemstack != null) {
|
||||
|
@ -27,14 +27,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
public double e;
|
||||
public final List chunkCoordIntPairQueue = new LinkedList();
|
||||
public final List removeQueue = new LinkedList();
|
||||
private int cn = -99999999;
|
||||
private int co = -99999999;
|
||||
private boolean cp = true;
|
||||
private int ck = -99999999;
|
||||
private int cl = -99999999;
|
||||
private boolean cm = true;
|
||||
public int lastSentExp = -99999999; // CraftBukkit - private -> public
|
||||
public int invulnerableTicks = 60; // CraftBukkit - private -> public
|
||||
private int cs = 0;
|
||||
private int ct = 0;
|
||||
private boolean cu = true;
|
||||
private int cp = 0;
|
||||
private int cq = 0;
|
||||
private boolean cr = true;
|
||||
private int containerCounter = 0;
|
||||
public boolean h;
|
||||
public int ping;
|
||||
@ -53,7 +53,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
super(world);
|
||||
iteminworldmanager.player = this;
|
||||
this.itemInWorldManager = iteminworldmanager;
|
||||
this.cs = minecraftserver.getServerConfigurationManager().o();
|
||||
this.cp = minecraftserver.getServerConfigurationManager().o();
|
||||
ChunkCoordinates chunkcoordinates = world.getSpawn();
|
||||
int i = chunkcoordinates.x;
|
||||
int j = chunkcoordinates.z;
|
||||
@ -136,15 +136,30 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.itemInWorldManager.a();
|
||||
--this.invulnerableTicks;
|
||||
this.activeContainer.b();
|
||||
|
||||
while (!this.removeQueue.isEmpty()) {
|
||||
int i = Math.min(this.removeQueue.size(), 127);
|
||||
int[] aint = new int[i];
|
||||
Iterator iterator = this.removeQueue.iterator();
|
||||
int j = 0;
|
||||
|
||||
while (iterator.hasNext() && j < i) {
|
||||
aint[j++] = ((Integer) iterator.next()).intValue();
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
this.netServerHandler.sendPacket(new Packet29DestroyEntity(aint));
|
||||
}
|
||||
|
||||
if (!this.chunkCoordIntPairQueue.isEmpty()) {
|
||||
ArrayList arraylist = new ArrayList();
|
||||
Iterator iterator = this.chunkCoordIntPairQueue.iterator();
|
||||
Iterator iterator1 = this.chunkCoordIntPairQueue.iterator();
|
||||
ArrayList arraylist1 = new ArrayList();
|
||||
|
||||
while (iterator.hasNext() && arraylist.size() < 5) {
|
||||
ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) iterator.next();
|
||||
while (iterator1.hasNext() && arraylist.size() < 5) {
|
||||
ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) iterator1.next();
|
||||
|
||||
iterator.remove();
|
||||
iterator1.remove();
|
||||
if (chunkcoordintpair != null && this.world.isLoaded(chunkcoordintpair.x << 4, 0, chunkcoordintpair.z << 4)) {
|
||||
arraylist.add(this.world.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z));
|
||||
arraylist1.addAll(((WorldServer) this.world).getTileEntities(chunkcoordintpair.x * 16, 0, chunkcoordintpair.z * 16, chunkcoordintpair.x * 16 + 16, 256, chunkcoordintpair.z * 16 + 16));
|
||||
@ -152,35 +167,24 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
if (!arraylist.isEmpty()) {
|
||||
// CraftBukkit start - don't use map chunk bulk for now TODO: fix this
|
||||
for (Object object : arraylist) {
|
||||
this.netServerHandler.sendPacket(new Packet51MapChunk((Chunk) object, true, 0xffff));
|
||||
}
|
||||
// this.netServerHandler.sendPacket(new Packet56MapChunkBulk(arraylist));
|
||||
// CraftBukkit end
|
||||
this.netServerHandler.sendPacket(new Packet56MapChunkBulk(arraylist));
|
||||
|
||||
Iterator iterator1 = arraylist1.iterator();
|
||||
Iterator iterator2 = arraylist1.iterator();
|
||||
|
||||
while (iterator1.hasNext()) {
|
||||
TileEntity tileentity = (TileEntity) iterator1.next();
|
||||
while (iterator2.hasNext()) {
|
||||
TileEntity tileentity = (TileEntity) iterator2.next();
|
||||
|
||||
this.b(tileentity);
|
||||
}
|
||||
|
||||
iterator2 = arraylist.iterator();
|
||||
|
||||
while (iterator2.hasNext()) {
|
||||
Chunk chunk = (Chunk) iterator2.next();
|
||||
|
||||
this.p().getTracker().a(this, chunk);
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.removeQueue.isEmpty()) {
|
||||
int i = Math.min(this.removeQueue.size(), 127);
|
||||
int[] aint = new int[i];
|
||||
Iterator iterator2 = this.removeQueue.iterator();
|
||||
int j = 0;
|
||||
|
||||
while (iterator2.hasNext() && j < i) {
|
||||
aint[j++] = ((Integer) iterator2.next()).intValue();
|
||||
iterator2.remove();
|
||||
}
|
||||
|
||||
this.netServerHandler.sendPacket(new Packet29DestroyEntity(aint));
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,11 +203,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getHealth() != this.cn || this.co != this.foodData.a() || this.foodData.e() == 0.0F != this.cp) {
|
||||
if (this.getHealth() != this.ck || this.cl != this.foodData.a() || this.foodData.e() == 0.0F != this.cm) {
|
||||
this.netServerHandler.sendPacket(new Packet8UpdateHealth(this.getHealth(), this.foodData.a(), this.foodData.e()));
|
||||
this.cn = this.getHealth();
|
||||
this.co = this.foodData.a();
|
||||
this.cp = this.foodData.e() == 0.0F;
|
||||
this.ck = this.getHealth();
|
||||
this.cl = this.foodData.a();
|
||||
this.cm = this.foodData.e() == 0.0F;
|
||||
}
|
||||
|
||||
if (this.expTotal != this.lastSentExp) {
|
||||
@ -273,7 +277,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (this.invulnerableTicks > 0) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
// CraftBukkit - this.server.getPvP() -> this.world.pvpMode
|
||||
boolean flag = this.server.T() && this.world.pvpMode && "fall".equals(damagesource.translationIndex);
|
||||
|
||||
if (!flag && this.invulnerableTicks > 0) {
|
||||
return false;
|
||||
} else {
|
||||
// CraftBukkit - this.server.getPvP() -> this.world.pvpMode
|
||||
@ -296,6 +306,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
return super.damageEntity(damagesource, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean h() {
|
||||
return this.server.getPvP();
|
||||
@ -324,14 +335,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
this.server.getServerConfigurationManager().changeDimension(this, i);
|
||||
this.lastSentExp = -1;
|
||||
this.cn = -1;
|
||||
this.co = -1;
|
||||
this.ck = -1;
|
||||
this.cl = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void b(TileEntity tileentity) {
|
||||
if (tileentity != null) {
|
||||
Packet packet = tileentity.l();
|
||||
Packet packet = tileentity.getUpdatePacket();
|
||||
|
||||
if (packet != null) {
|
||||
this.netServerHandler.sendPacket(packet);
|
||||
@ -350,7 +361,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
if (enumbedresult == EnumBedResult.OK) {
|
||||
Packet17EntityLocationAction packet17entitylocationaction = new Packet17EntityLocationAction(this, 0, i, j, k);
|
||||
|
||||
this.p().getTracker().a(this, packet17entitylocationaction);
|
||||
this.p().getTracker().a((Entity) this, (Packet) packet17entitylocationaction);
|
||||
this.netServerHandler.a(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
||||
this.netServerHandler.sendPacket(packet17entitylocationaction);
|
||||
}
|
||||
@ -573,7 +584,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public void k() {
|
||||
this.activeContainer.a((EntityHuman) this);
|
||||
this.activeContainer.b(this);
|
||||
this.activeContainer = this.defaultContainer;
|
||||
}
|
||||
|
||||
@ -605,7 +616,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public void m() {
|
||||
this.cn = -99999999;
|
||||
this.ck = -99999999;
|
||||
this.lastSentExp = -1; // CraftBukkit - Added to reset
|
||||
}
|
||||
|
||||
@ -631,8 +642,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
public void copyTo(EntityHuman entityhuman, boolean flag) {
|
||||
super.copyTo(entityhuman, flag);
|
||||
this.lastSentExp = -1;
|
||||
this.cn = -1;
|
||||
this.co = -1;
|
||||
this.ck = -1;
|
||||
this.cl = -1;
|
||||
this.removeQueue.addAll(((EntityPlayer) entityhuman).removeQueue);
|
||||
}
|
||||
|
||||
@ -702,11 +713,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
int i = 256 >> packet204localeandviewdistance.f();
|
||||
|
||||
if (i > 3 && i < 15) {
|
||||
this.cs = i;
|
||||
this.cp = i;
|
||||
}
|
||||
|
||||
this.ct = packet204localeandviewdistance.g();
|
||||
this.cu = packet204localeandviewdistance.h();
|
||||
this.cq = packet204localeandviewdistance.g();
|
||||
this.cr = packet204localeandviewdistance.h();
|
||||
if (this.server.I() && this.server.H().equals(this.name)) {
|
||||
this.server.c(packet204localeandviewdistance.i());
|
||||
}
|
||||
@ -719,7 +730,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public int getChatFlags() {
|
||||
return this.ct;
|
||||
return this.cq;
|
||||
}
|
||||
|
||||
public void a(String s, int i) {
|
||||
@ -739,10 +750,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
public long getPlayerTime() {
|
||||
if (this.relativeTime) {
|
||||
// Adds timeOffset to the current server time.
|
||||
return this.world.F() + this.timeOffset;
|
||||
return this.world.getDayTime() + this.timeOffset;
|
||||
} else {
|
||||
// Adds timeOffset to the beginning of this day.
|
||||
return this.world.F() - (this.world.F() % 24000) + this.timeOffset;
|
||||
return this.world.getDayTime() - (this.world.getDayTime() % 24000) + this.timeOffset;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ import org.bukkit.entity.LivingEntity;
|
||||
|
||||
public class EntityPotion extends EntityProjectile {
|
||||
|
||||
private ItemStack d;
|
||||
private ItemStack c;
|
||||
|
||||
public EntityPotion(World world) {
|
||||
super(world);
|
||||
@ -24,12 +24,12 @@ public class EntityPotion extends EntityProjectile {
|
||||
|
||||
public EntityPotion(World world, EntityLiving entityliving, ItemStack itemstack) {
|
||||
super(world, entityliving);
|
||||
this.d = itemstack;
|
||||
this.c = itemstack;
|
||||
}
|
||||
|
||||
public EntityPotion(World world, double d0, double d1, double d2, ItemStack itemstack) {
|
||||
super(world, d0, d1, d2);
|
||||
this.d = itemstack;
|
||||
this.c = itemstack;
|
||||
}
|
||||
|
||||
protected float g() {
|
||||
@ -45,24 +45,24 @@ public class EntityPotion extends EntityProjectile {
|
||||
}
|
||||
|
||||
public void setPotionValue(int i) {
|
||||
if (this.d == null) {
|
||||
this.d = new ItemStack(Item.POTION, 1, 0);
|
||||
if (this.c == null) {
|
||||
this.c = new ItemStack(Item.POTION, 1, 0);
|
||||
}
|
||||
|
||||
this.d.setData(i);
|
||||
this.c.setData(i);
|
||||
}
|
||||
|
||||
public int getPotionValue() {
|
||||
if (this.d == null) {
|
||||
this.d = new ItemStack(Item.POTION, 1, 0);
|
||||
if (this.c == null) {
|
||||
this.c = new ItemStack(Item.POTION, 1, 0);
|
||||
}
|
||||
|
||||
return this.d.getData();
|
||||
return this.c.getData();
|
||||
}
|
||||
|
||||
protected void a(MovingObjectPosition movingobjectposition) {
|
||||
if (!this.world.isStatic) {
|
||||
List list = Item.POTION.l(this.d);
|
||||
List list = Item.POTION.l(this.c);
|
||||
|
||||
if (list != null && !list.isEmpty()) {
|
||||
AxisAlignedBB axisalignedbb = this.boundingBox.grow(4.0D, 2.0D, 4.0D);
|
||||
@ -108,7 +108,7 @@ public class EntityPotion extends EntityProjectile {
|
||||
int i = mobeffect.getEffectId();
|
||||
|
||||
// CraftBukkit start - abide by PVP settings
|
||||
if (!this.world.pvpMode && entityliving instanceof EntityPlayer && entityliving != this.shooter) {
|
||||
if (!this.world.pvpMode && entityliving instanceof EntityPlayer && entityliving != this.getShooter()) {
|
||||
// Block SLOWER_MOVEMENT, SLOWER_DIG, HARM, BLINDNESS, HUNGER, WEAKNESS and POISON potions
|
||||
if (i == 2 || i == 4 || i == 7 || i == 15 || i == 17 || i == 18 || i == 19) continue;
|
||||
}
|
||||
@ -116,7 +116,7 @@ public class EntityPotion extends EntityProjectile {
|
||||
|
||||
if (MobEffectList.byId[i].isInstant()) {
|
||||
// CraftBukkit - added 'this'
|
||||
MobEffectList.byId[i].applyInstantEffect(this.shooter, entityliving, mobeffect.getAmplifier(), d1, this);
|
||||
MobEffectList.byId[i].applyInstantEffect(this.getShooter(), entityliving, mobeffect.getAmplifier(), d1, this);
|
||||
} else {
|
||||
int j = (int) (d1 * (double) mobeffect.getDuration() + 0.5D);
|
||||
|
||||
@ -138,20 +138,20 @@ public class EntityPotion extends EntityProjectile {
|
||||
public void a(NBTTagCompound nbttagcompound) {
|
||||
super.a(nbttagcompound);
|
||||
if (nbttagcompound.hasKey("Potion")) {
|
||||
this.d = ItemStack.a(nbttagcompound.getCompound("Potion"));
|
||||
this.c = ItemStack.a(nbttagcompound.getCompound("Potion"));
|
||||
} else {
|
||||
this.setPotionValue(nbttagcompound.getInt("potionValue"));
|
||||
}
|
||||
|
||||
if (this.d == null) {
|
||||
if (this.c == null) {
|
||||
this.die();
|
||||
}
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
super.b(nbttagcompound);
|
||||
if (this.d != null) {
|
||||
nbttagcompound.setCompound("Potion", this.d.save(new NBTTagCompound()));
|
||||
if (this.c != null) {
|
||||
nbttagcompound.setCompound("Potion", this.c.save(new NBTTagCompound()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.event.entity.ProjectileHitEvent; // CraftBukkit
|
||||
@ -13,9 +12,10 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
private int inBlockId = 0;
|
||||
protected boolean inGround = false;
|
||||
public int shake = 0;
|
||||
public EntityLiving shooter; // CraftBukkit - protected -> public
|
||||
private int h;
|
||||
private int i = 0;
|
||||
public EntityLiving shooter; // CraftBukkit - private -> public
|
||||
public String shooterName = null; // CraftBukkit - private -> public
|
||||
private int i;
|
||||
private int j = 0;
|
||||
|
||||
public EntityProjectile(World world) {
|
||||
super(world);
|
||||
@ -44,7 +44,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
|
||||
public EntityProjectile(World world, double d0, double d1, double d2) {
|
||||
super(world);
|
||||
this.h = 0;
|
||||
this.i = 0;
|
||||
this.a(0.25F, 0.25F);
|
||||
this.setPosition(d0, d1, d2);
|
||||
this.height = 0.0F;
|
||||
@ -77,7 +77,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
|
||||
this.lastYaw = this.yaw = (float) (Math.atan2(d0, d2) * 180.0D / 3.1415927410125732D);
|
||||
this.lastPitch = this.pitch = (float) (Math.atan2(d1, (double) f3) * 180.0D / 3.1415927410125732D);
|
||||
this.h = 0;
|
||||
this.i = 0;
|
||||
}
|
||||
|
||||
public void j_() {
|
||||
@ -93,8 +93,8 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
int i = this.world.getTypeId(this.blockX, this.blockY, this.blockZ);
|
||||
|
||||
if (i == this.inBlockId) {
|
||||
++this.h;
|
||||
if (this.h == 1200) {
|
||||
++this.i;
|
||||
if (this.i == 1200) {
|
||||
this.die();
|
||||
}
|
||||
|
||||
@ -105,10 +105,10 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
this.motX *= (double) (this.random.nextFloat() * 0.2F);
|
||||
this.motY *= (double) (this.random.nextFloat() * 0.2F);
|
||||
this.motZ *= (double) (this.random.nextFloat() * 0.2F);
|
||||
this.h = 0;
|
||||
this.i = 0;
|
||||
this.j = 0;
|
||||
} else {
|
||||
++this.i;
|
||||
++this.j;
|
||||
}
|
||||
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ);
|
||||
@ -125,12 +125,12 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
Entity entity = null;
|
||||
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;
|
||||
Iterator iterator = list.iterator();
|
||||
EntityLiving entityliving = this.getShooter();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity1 = (Entity) iterator.next();
|
||||
for (int j = 0; j < list.size(); ++j) {
|
||||
Entity entity1 = (Entity) list.get(j);
|
||||
|
||||
if (entity1.L() && (entity1 != this.shooter || this.i >= 5)) {
|
||||
if (entity1.L() && (entity1 != entityliving || this.j >= 5)) {
|
||||
float f = 0.3F;
|
||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f);
|
||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
||||
@ -194,7 +194,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
float f3 = this.g();
|
||||
|
||||
if (this.H()) {
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
for (int k = 0; k < 4; ++k) {
|
||||
float f4 = 0.25F;
|
||||
|
||||
this.world.addParticle("bubble", this.locX - this.motX * (double) f4, this.locY - this.motY * (double) f4, this.locZ - this.motZ * (double) f4, this.motX, this.motY, this.motZ);
|
||||
@ -223,6 +223,11 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
nbttagcompound.setByte("inTile", (byte) this.inBlockId);
|
||||
nbttagcompound.setByte("shake", (byte) this.shake);
|
||||
nbttagcompound.setByte("inGround", (byte) (this.inGround ? 1 : 0));
|
||||
if ((this.shooterName == null || this.shooterName.length() == 0) && this.shooter != null && this.shooter instanceof EntityHuman) {
|
||||
this.shooterName = this.shooter.getLocalizedName();
|
||||
}
|
||||
|
||||
nbttagcompound.setString("ownerName", this.shooterName == null ? "" : this.shooterName);
|
||||
}
|
||||
|
||||
public void a(NBTTagCompound nbttagcompound) {
|
||||
@ -232,5 +237,17 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
this.inBlockId = nbttagcompound.getByte("inTile") & 255;
|
||||
this.shake = nbttagcompound.getByte("shake") & 255;
|
||||
this.inGround = nbttagcompound.getByte("inGround") == 1;
|
||||
this.shooterName = nbttagcompound.getString("ownerName");
|
||||
if (this.shooterName != null && this.shooterName.length() == 0) {
|
||||
this.shooterName = null;
|
||||
}
|
||||
}
|
||||
|
||||
public EntityLiving getShooter() {
|
||||
if (this.shooter == null && this.shooterName != null && this.shooterName.length() > 0) {
|
||||
this.shooter = this.world.a(this.shooterName);
|
||||
}
|
||||
|
||||
return this.shooter;
|
||||
}
|
||||
}
|
||||
|
@ -9,9 +9,10 @@ import org.bukkit.event.player.PlayerShearEntityEvent;
|
||||
|
||||
public class EntitySheep extends EntityAnimal {
|
||||
|
||||
public static final float[][] d = new float[][] { { 1.0F, 1.0F, 1.0F}, { 0.95F, 0.7F, 0.2F}, { 0.9F, 0.5F, 0.85F}, { 0.6F, 0.7F, 0.95F}, { 0.9F, 0.9F, 0.2F}, { 0.5F, 0.8F, 0.1F}, { 0.95F, 0.7F, 0.8F}, { 0.3F, 0.3F, 0.3F}, { 0.6F, 0.6F, 0.6F}, { 0.3F, 0.6F, 0.7F}, { 0.7F, 0.4F, 0.9F}, { 0.2F, 0.4F, 0.8F}, { 0.5F, 0.4F, 0.3F}, { 0.4F, 0.5F, 0.2F}, { 0.8F, 0.3F, 0.3F}, { 0.1F, 0.1F, 0.1F}};
|
||||
private int e;
|
||||
private PathfinderGoalEatTile f = new PathfinderGoalEatTile(this);
|
||||
private final InventoryCrafting e = new InventoryCrafting(new ContainerSheepBreed(this), 2, 1);
|
||||
public static final float[][] d = new float[][] { { 1.0F, 1.0F, 1.0F}, { 0.85F, 0.5F, 0.2F}, { 0.7F, 0.3F, 0.85F}, { 0.4F, 0.6F, 0.85F}, { 0.9F, 0.9F, 0.2F}, { 0.5F, 0.8F, 0.1F}, { 0.95F, 0.5F, 0.65F}, { 0.3F, 0.3F, 0.3F}, { 0.6F, 0.6F, 0.6F}, { 0.3F, 0.5F, 0.6F}, { 0.5F, 0.25F, 0.7F}, { 0.2F, 0.3F, 0.7F}, { 0.4F, 0.3F, 0.2F}, { 0.4F, 0.5F, 0.2F}, { 0.6F, 0.2F, 0.2F}, { 0.1F, 0.1F, 0.1F}};
|
||||
private int f;
|
||||
private PathfinderGoalEatTile g = new PathfinderGoalEatTile(this);
|
||||
|
||||
public EntitySheep(World world) {
|
||||
super(world);
|
||||
@ -25,24 +26,26 @@ public class EntitySheep extends EntityAnimal {
|
||||
this.goalSelector.a(2, new PathfinderGoalBreed(this, f));
|
||||
this.goalSelector.a(3, new PathfinderGoalTempt(this, 0.25F, Item.WHEAT.id, false));
|
||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 0.25F));
|
||||
this.goalSelector.a(5, this.f);
|
||||
this.goalSelector.a(5, this.g);
|
||||
this.goalSelector.a(6, new PathfinderGoalRandomStroll(this, f));
|
||||
this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
||||
this.e.setItem(0, new ItemStack(Item.INK_SACK, 1, 0));
|
||||
this.e.setItem(1, new ItemStack(Item.INK_SACK, 1, 0));
|
||||
}
|
||||
|
||||
protected boolean bb() {
|
||||
protected boolean be() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void bi() {
|
||||
this.e = this.f.f();
|
||||
super.bi();
|
||||
protected void bl() {
|
||||
this.f = this.g.f();
|
||||
super.bl();
|
||||
}
|
||||
|
||||
public void c() {
|
||||
if (this.world.isStatic) {
|
||||
this.e = Math.max(0, this.e - 1);
|
||||
this.f = Math.max(0, this.f - 1);
|
||||
}
|
||||
|
||||
super.c();
|
||||
@ -73,7 +76,7 @@ public class EntitySheep extends EntityAnimal {
|
||||
return Block.WOOL.id;
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
if (itemstack != null && itemstack.id == Item.SHEARS.id && !this.isSheared() && !this.isBaby()) {
|
||||
@ -100,10 +103,10 @@ public class EntitySheep extends EntityAnimal {
|
||||
}
|
||||
|
||||
itemstack.damage(1, entityhuman);
|
||||
this.world.makeSound(this, "mob.sheep.shear", 1.0F, 1.0F);
|
||||
this.makeSound("mob.sheep.shear", 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
return super.c(entityhuman);
|
||||
return super.a(entityhuman);
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
@ -118,20 +121,20 @@ public class EntitySheep extends EntityAnimal {
|
||||
this.setColor(nbttagcompound.getByte("Color"));
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
return "mob.sheep.say";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
return "mob.sheep.say";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
return "mob.sheep.say";
|
||||
}
|
||||
|
||||
protected String aZ() {
|
||||
return "mob.sheep.say";
|
||||
}
|
||||
|
||||
protected String ba() {
|
||||
return "mob.sheep.say";
|
||||
}
|
||||
|
||||
protected void a(int i, int j, int k, int l) {
|
||||
this.world.makeSound(this, "mob.sheep.step", 0.15F, 1.0F);
|
||||
this.makeSound("mob.sheep.step", 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
@ -164,20 +167,16 @@ public class EntitySheep extends EntityAnimal {
|
||||
return i < 5 ? 15 : (i < 10 ? 7 : (i < 15 ? 8 : (i < 18 ? 12 : (random.nextInt(500) == 0 ? 6 : 0))));
|
||||
}
|
||||
|
||||
public EntityAnimal createChild(EntityAnimal entityanimal) {
|
||||
EntitySheep entitysheep = (EntitySheep) entityanimal;
|
||||
public EntitySheep b(EntityAgeable entityageable) {
|
||||
EntitySheep entitysheep = (EntitySheep) entityageable;
|
||||
EntitySheep entitysheep1 = new EntitySheep(this.world);
|
||||
int i = this.a(this, entitysheep);
|
||||
|
||||
if (this.random.nextBoolean()) {
|
||||
entitysheep1.setColor(this.getColor());
|
||||
} else {
|
||||
entitysheep1.setColor(entitysheep.getColor());
|
||||
}
|
||||
|
||||
entitysheep1.setColor(15 - i);
|
||||
return entitysheep1;
|
||||
}
|
||||
|
||||
public void aG() {
|
||||
public void aH() {
|
||||
// CraftBukkit start
|
||||
SheepRegrowWoolEvent event = new SheepRegrowWoolEvent((org.bukkit.entity.Sheep) this.getBukkitEntity());
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
@ -198,7 +197,33 @@ public class EntitySheep extends EntityAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
public void bD() {
|
||||
public void bG() {
|
||||
this.setColor(a(this.world.random));
|
||||
}
|
||||
|
||||
private int a(EntityAnimal entityanimal, EntityAnimal entityanimal1) {
|
||||
int i = this.b(entityanimal);
|
||||
int j = this.b(entityanimal1);
|
||||
|
||||
this.e.getItem(0).setData(i);
|
||||
this.e.getItem(1).setData(j);
|
||||
ItemStack itemstack = CraftingManager.getInstance().craft(this.e, ((EntitySheep) entityanimal).world);
|
||||
int k;
|
||||
|
||||
if (itemstack != null && itemstack.getItem().id == Item.INK_SACK.id) {
|
||||
k = itemstack.getData();
|
||||
} else {
|
||||
k = this.world.random.nextBoolean() ? i : j;
|
||||
}
|
||||
|
||||
return k;
|
||||
}
|
||||
|
||||
private int b(EntityAnimal entityanimal) {
|
||||
return 15 - ((EntitySheep) entityanimal).getColor();
|
||||
}
|
||||
|
||||
public EntityAgeable createChild(EntityAgeable entityageable) {
|
||||
return this.b(entityageable);
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ public class EntitySilverfish extends EntityMonster {
|
||||
super(world);
|
||||
this.texture = "/mob/silverfish.png";
|
||||
this.a(0.3F, 0.7F);
|
||||
this.bI = 0.6F;
|
||||
this.bG = 0.6F;
|
||||
}
|
||||
|
||||
public int getMaxHealth() {
|
||||
@ -27,25 +27,29 @@ public class EntitySilverfish extends EntityMonster {
|
||||
return this.world.findNearbyVulnerablePlayer(this, d0);
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return "mob.silverfish.say";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.silverfish.hit";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.silverfish.kill";
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
if (this.d <= 0 && (damagesource instanceof EntityDamageSource || damagesource == DamageSource.MAGIC)) {
|
||||
this.d = 20;
|
||||
}
|
||||
|
||||
return super.damageEntity(damagesource, i);
|
||||
}
|
||||
}
|
||||
|
||||
protected void a(Entity entity, float f) {
|
||||
if (this.attackTicks <= 0 && f < 1.2F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) {
|
||||
@ -55,7 +59,7 @@ public class EntitySilverfish extends EntityMonster {
|
||||
}
|
||||
|
||||
protected void a(int i, int j, int k, int l) {
|
||||
this.world.makeSound(this, "mob.silverfish.step", 0.15F, 1.0F);
|
||||
this.makeSound("mob.silverfish.step", 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
protected int getLootId() {
|
||||
@ -67,8 +71,8 @@ public class EntitySilverfish extends EntityMonster {
|
||||
super.j_();
|
||||
}
|
||||
|
||||
protected void bk() {
|
||||
super.bk();
|
||||
protected void bn() {
|
||||
super.bn();
|
||||
if (!this.world.isStatic) {
|
||||
int i;
|
||||
int j;
|
||||
@ -124,7 +128,7 @@ public class EntitySilverfish extends EntityMonster {
|
||||
// CraftBukkit end
|
||||
|
||||
this.world.setTypeIdAndData(i + Facing.b[l1], j + Facing.c[l1], k + Facing.d[l1], Block.MONSTER_EGGS.id, BlockMonsterEggs.f(l));
|
||||
this.aQ();
|
||||
this.aR();
|
||||
this.die();
|
||||
} else {
|
||||
this.i();
|
||||
|
@ -6,18 +6,24 @@ import org.bukkit.event.entity.EntityCombustEvent; // CraftBukkit
|
||||
|
||||
public class EntitySkeleton extends EntityMonster implements IRangedEntity {
|
||||
|
||||
private PathfinderGoalArrowAttack d = new PathfinderGoalArrowAttack(this, 0.25F, 60, 10.0F);
|
||||
private PathfinderGoalMeleeAttack e = new PathfinderGoalMeleeAttack(this, EntityHuman.class, 0.31F, false);
|
||||
|
||||
public EntitySkeleton(World world) {
|
||||
super(world);
|
||||
this.texture = "/mob/skeleton.png";
|
||||
this.bI = 0.25F;
|
||||
this.bG = 0.25F;
|
||||
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
||||
this.goalSelector.a(2, new PathfinderGoalRestrictSun(this));
|
||||
this.goalSelector.a(3, new PathfinderGoalFleeSun(this, this.bI));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, this.bI));
|
||||
this.goalSelector.a(3, new PathfinderGoalFleeSun(this, this.bG));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, this.bG));
|
||||
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
||||
this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this));
|
||||
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, false));
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 16.0F, 0, true));
|
||||
if (world != null && !world.isStatic) {
|
||||
this.m();
|
||||
}
|
||||
}
|
||||
|
||||
protected void a() {
|
||||
@ -25,7 +31,7 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity {
|
||||
this.datawatcher.a(13, new Byte((byte) 0));
|
||||
}
|
||||
|
||||
public boolean bb() {
|
||||
public boolean be() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -33,24 +39,24 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity {
|
||||
return 20;
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return "mob.skeleton.say";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.skeleton.hurt";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.skeleton.death";
|
||||
}
|
||||
|
||||
protected void a(int i, int j, int k, int l) {
|
||||
this.world.makeSound(this, "mob.skeleton.step", 0.15F, 1.0F);
|
||||
this.makeSound("mob.skeleton.step", 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
public boolean l(Entity entity) {
|
||||
if (super.l(entity)) {
|
||||
public boolean m(Entity entity) {
|
||||
if (super.m(entity)) {
|
||||
if (this.getSkeletonType() == 1 && entity instanceof EntityLiving) {
|
||||
((EntityLiving) entity).addEffect(new MobEffect(MobEffectList.WITHER.id, 200));
|
||||
}
|
||||
@ -63,7 +69,7 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity {
|
||||
|
||||
public int c(Entity entity) {
|
||||
if (this.getSkeletonType() == 1) {
|
||||
ItemStack itemstack = this.bA();
|
||||
ItemStack itemstack = this.bD();
|
||||
int i = 4;
|
||||
|
||||
if (itemstack != null) {
|
||||
@ -81,10 +87,10 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity {
|
||||
}
|
||||
|
||||
public void c() {
|
||||
if (this.world.t() && !this.world.isStatic) {
|
||||
if (this.world.u() && !this.world.isStatic) {
|
||||
float f = this.c(1.0F);
|
||||
|
||||
if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.j(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ))) {
|
||||
if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.k(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ))) {
|
||||
boolean flag = true;
|
||||
ItemStack itemstack = this.getEquipment(4);
|
||||
|
||||
@ -179,25 +185,29 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void bB() {
|
||||
super.bB();
|
||||
protected void bE() {
|
||||
super.bD();
|
||||
this.setEquipment(0, new ItemStack(Item.BOW));
|
||||
}
|
||||
|
||||
public void bD() {
|
||||
if (this.world.worldProvider instanceof WorldProviderHell && this.aA().nextInt(5) > 0) {
|
||||
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, EntityHuman.class, this.bI, false));
|
||||
public void bG() {
|
||||
if (this.world.worldProvider instanceof WorldProviderHell && this.aB().nextInt(5) > 0) {
|
||||
this.goalSelector.a(4, this.e);
|
||||
this.setSkeletonType(1);
|
||||
this.setEquipment(0, new ItemStack(Item.STONE_SWORD));
|
||||
} else {
|
||||
this.goalSelector.a(4, new PathfinderGoalArrowAttack(this, this.bI, 60, 10.0F));
|
||||
this.bB();
|
||||
this.bC();
|
||||
this.goalSelector.a(4, this.d);
|
||||
this.bE();
|
||||
this.bF();
|
||||
}
|
||||
|
||||
this.canPickUpLoot = this.random.nextFloat() < as[this.world.difficulty];
|
||||
if (this.random.nextFloat() >= as[this.world.difficulty]) {
|
||||
;
|
||||
}
|
||||
|
||||
this.canPickUpLoot = true;
|
||||
if (this.getEquipment(4) == null) {
|
||||
Calendar calendar = this.world.S();
|
||||
Calendar calendar = this.world.T();
|
||||
|
||||
if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.random.nextFloat() < 0.25F) {
|
||||
this.setEquipment(4, new ItemStack(this.random.nextFloat() < 0.1F ? Block.JACK_O_LANTERN : Block.PUMPKIN));
|
||||
@ -206,10 +216,22 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity {
|
||||
}
|
||||
}
|
||||
|
||||
public void m() {
|
||||
this.goalSelector.a((PathfinderGoal) this.e);
|
||||
this.goalSelector.a((PathfinderGoal) this.d);
|
||||
ItemStack itemstack = this.bD();
|
||||
|
||||
if (itemstack != null && itemstack.id == Item.BOW.id) {
|
||||
this.goalSelector.a(4, this.d);
|
||||
} else {
|
||||
this.goalSelector.a(4, this.e);
|
||||
}
|
||||
}
|
||||
|
||||
public void d(EntityLiving entityliving) {
|
||||
EntityArrow entityarrow = new EntityArrow(this.world, this, entityliving, 1.6F, 12.0F);
|
||||
int i = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_DAMAGE.id, this.bA());
|
||||
int j = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK.id, this.bA());
|
||||
int i = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_DAMAGE.id, this.bD());
|
||||
int j = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK.id, this.bD());
|
||||
|
||||
if (i > 0) {
|
||||
entityarrow.b(entityarrow.c() + (double) i * 0.5D + 0.5D);
|
||||
@ -219,11 +241,11 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity {
|
||||
entityarrow.a(j);
|
||||
}
|
||||
|
||||
if (EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_FIRE.id, this.bA()) > 0 || this.getSkeletonType() == 1) {
|
||||
if (EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_FIRE.id, this.bD()) > 0 || this.getSkeletonType() == 1) {
|
||||
entityarrow.setOnFire(100);
|
||||
}
|
||||
|
||||
this.world.makeSound(this, "random.bow", 1.0F, 1.0F / (this.aA().nextFloat() * 0.4F + 0.8F));
|
||||
this.makeSound("random.bow", 1.0F, 1.0F / (this.aB().nextFloat() * 0.4F + 0.8F));
|
||||
this.world.addEntity(entityarrow);
|
||||
}
|
||||
|
||||
@ -249,15 +271,18 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity {
|
||||
this.setSkeletonType(b0);
|
||||
}
|
||||
|
||||
if (this.getSkeletonType() == 1) {
|
||||
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, EntityHuman.class, this.bI, false));
|
||||
} else {
|
||||
this.goalSelector.a(4, new PathfinderGoalArrowAttack(this, this.bI, 60, 10.0F));
|
||||
}
|
||||
this.m();
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
super.b(nbttagcompound);
|
||||
nbttagcompound.setByte("SkeletonType", (byte) this.getSkeletonType());
|
||||
}
|
||||
|
||||
public void setEquipment(int i, ItemStack itemstack) {
|
||||
super.setEquipment(i, itemstack);
|
||||
if (!this.world.isStatic && i == 0) {
|
||||
this.m();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
||||
this.datawatcher.a(16, new Byte((byte) 1));
|
||||
}
|
||||
|
||||
// CraftBukkit - protected -> public
|
||||
public void setSize(int i) {
|
||||
this.datawatcher.watch(16, new Byte((byte) i));
|
||||
this.a(0.6F * (float) i, 0.6F * (float) i);
|
||||
@ -70,8 +71,10 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
||||
boolean flag = this.onGround;
|
||||
|
||||
super.j_();
|
||||
int i;
|
||||
|
||||
if (this.onGround && !flag) {
|
||||
int i = this.getSize();
|
||||
i = this.getSize();
|
||||
|
||||
for (int j = 0; j < i * 8; ++j) {
|
||||
float f = this.random.nextFloat() * 3.1415927F * 2.0F;
|
||||
@ -83,7 +86,7 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
||||
}
|
||||
|
||||
if (this.o()) {
|
||||
this.world.makeSound(this, this.n(), this.aV(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) / 0.8F);
|
||||
this.makeSound(this.n(), this.aX(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) / 0.8F);
|
||||
}
|
||||
|
||||
this.b = -0.5F;
|
||||
@ -92,10 +95,14 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
||||
}
|
||||
|
||||
this.k();
|
||||
if (this.world.isStatic) {
|
||||
i = this.getSize();
|
||||
this.a(0.6F * (float) i, 0.6F * (float) i);
|
||||
}
|
||||
}
|
||||
|
||||
protected void bk() {
|
||||
this.bh();
|
||||
protected void bn() {
|
||||
this.bk();
|
||||
EntityHuman entityhuman = this.world.findNearbyVulnerablePlayer(this, 16.0D); // CraftBukkit TODO: EntityTargetEvent
|
||||
|
||||
if (entityhuman != null) {
|
||||
@ -108,17 +115,17 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
||||
this.jumpDelay /= 3;
|
||||
}
|
||||
|
||||
this.bG = true;
|
||||
this.bE = true;
|
||||
if (this.q()) {
|
||||
this.world.makeSound(this, this.n(), this.aV(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 0.8F);
|
||||
this.makeSound(this.n(), this.aX(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 0.8F);
|
||||
}
|
||||
|
||||
this.bD = 1.0F - this.random.nextFloat() * 2.0F;
|
||||
this.bE = (float) (1 * this.getSize());
|
||||
this.bB = 1.0F - this.random.nextFloat() * 2.0F;
|
||||
this.bC = (float) (1 * this.getSize());
|
||||
} else {
|
||||
this.bG = false;
|
||||
this.bE = false;
|
||||
if (this.onGround) {
|
||||
this.bD = this.bE = 0.0F;
|
||||
this.bB = this.bC = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -167,12 +174,12 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
||||
super.die();
|
||||
}
|
||||
|
||||
public void b_(EntityHuman entityhuman) {
|
||||
public void c_(EntityHuman entityhuman) {
|
||||
if (this.l()) {
|
||||
int i = this.getSize();
|
||||
|
||||
if (this.m(entityhuman) && this.e(entityhuman) < 0.6D * (double) i * 0.6D * (double) i && entityhuman.damageEntity(DamageSource.mobAttack(this), this.m())) {
|
||||
this.world.makeSound(this, "mob.attack", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
if (this.n(entityhuman) && this.e(entityhuman) < 0.6D * (double) i * 0.6D * (double) i && entityhuman.damageEntity(DamageSource.mobAttack(this), this.m())) {
|
||||
this.makeSound("mob.attack", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -185,11 +192,11 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
||||
return this.getSize();
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
@ -217,11 +224,11 @@ public class EntitySlime extends EntityLiving implements IMonster {
|
||||
}
|
||||
}
|
||||
|
||||
protected float aV() {
|
||||
protected float aX() {
|
||||
return 0.4F * (float) this.getSize();
|
||||
}
|
||||
|
||||
public int bm() {
|
||||
public int bp() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity {
|
||||
this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, true, false, IMonster.a));
|
||||
}
|
||||
|
||||
public boolean bb() {
|
||||
public boolean be() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity {
|
||||
float f = MathHelper.sqrt(d0 * d0 + d2 * d2) * 0.2F;
|
||||
|
||||
entitysnowball.shoot(d0, d1 + (double) f, d2, 1.6F, 12.0F);
|
||||
this.world.makeSound(this, "random.bow", 1.0F, 1.0F / (this.aA().nextFloat() * 0.4F + 0.8F));
|
||||
this.makeSound("random.bow", 1.0F, 1.0F / (this.aB().nextFloat() * 0.4F + 0.8F));
|
||||
this.world.addEntity(entitysnowball);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ public class EntitySpider extends EntityMonster {
|
||||
super(world);
|
||||
this.texture = "/mob/spider.png";
|
||||
this.a(1.4F, 0.9F);
|
||||
this.bI = 0.8F;
|
||||
this.bG = 0.8F;
|
||||
}
|
||||
|
||||
protected void a() {
|
||||
@ -43,20 +43,20 @@ public class EntitySpider extends EntityMonster {
|
||||
}
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
return "mob.spider.say";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
return "mob.spider.say";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
return "mob.spider.say";
|
||||
}
|
||||
|
||||
protected String aZ() {
|
||||
return "mob.spider.say";
|
||||
}
|
||||
|
||||
protected String ba() {
|
||||
return "mob.spider.death";
|
||||
}
|
||||
|
||||
protected void a(int i, int j, int k, int l) {
|
||||
this.world.makeSound(this, "mob.spider.step", 0.15F, 1.0F);
|
||||
this.makeSound("mob.spider.step", 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
protected void a(Entity entity, float f) {
|
||||
@ -149,12 +149,12 @@ public class EntitySpider extends EntityMonster {
|
||||
this.datawatcher.watch(16, Byte.valueOf(b0));
|
||||
}
|
||||
|
||||
public void bD() {
|
||||
public void bG() {
|
||||
if (this.world.random.nextInt(100) == 0) {
|
||||
EntitySkeleton entityskeleton = new EntitySkeleton(this.world);
|
||||
|
||||
entityskeleton.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F);
|
||||
entityskeleton.bD();
|
||||
entityskeleton.bG();
|
||||
this.world.addEntity(entityskeleton);
|
||||
entityskeleton.mount(this);
|
||||
}
|
||||
|
@ -11,38 +11,38 @@ public class EntitySquid extends EntityWaterAnimal {
|
||||
public float h = 0.0F;
|
||||
public float i = 0.0F;
|
||||
public float j = 0.0F;
|
||||
public float bK = 0.0F;
|
||||
public float bI = 0.0F;
|
||||
private float bJ = 0.0F;
|
||||
private float bK = 0.0F;
|
||||
private float bL = 0.0F;
|
||||
private float bM = 0.0F;
|
||||
private float bN = 0.0F;
|
||||
private float bO = 0.0F;
|
||||
private float bP = 0.0F;
|
||||
private float bQ = 0.0F;
|
||||
|
||||
public EntitySquid(World world) {
|
||||
super(world);
|
||||
this.texture = "/mob/squid.png";
|
||||
this.a(0.95F, 0.95F);
|
||||
this.bM = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F;
|
||||
this.bK = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F;
|
||||
}
|
||||
|
||||
public int getMaxHealth() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected float aV() {
|
||||
protected String aZ() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected String ba() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected float aX() {
|
||||
return 0.4F;
|
||||
}
|
||||
|
||||
@ -72,12 +72,12 @@ public class EntitySquid extends EntityWaterAnimal {
|
||||
this.e = this.d;
|
||||
this.g = this.f;
|
||||
this.i = this.h;
|
||||
this.bK = this.j;
|
||||
this.h += this.bM;
|
||||
this.bI = this.j;
|
||||
this.h += this.bK;
|
||||
if (this.h > 6.2831855F) {
|
||||
this.h -= 6.2831855F;
|
||||
if (this.random.nextInt(10) == 0) {
|
||||
this.bM = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F;
|
||||
this.bK = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F;
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,28 +88,28 @@ public class EntitySquid extends EntityWaterAnimal {
|
||||
f = this.h / 3.1415927F;
|
||||
this.j = MathHelper.sin(f * f * 3.1415927F) * 3.1415927F * 0.25F;
|
||||
if ((double) f > 0.75D) {
|
||||
this.bJ = 1.0F;
|
||||
this.bL = 1.0F;
|
||||
this.bN = 1.0F;
|
||||
} else {
|
||||
this.bN *= 0.8F;
|
||||
this.bL *= 0.8F;
|
||||
}
|
||||
} else {
|
||||
this.j = 0.0F;
|
||||
this.bL *= 0.9F;
|
||||
this.bN *= 0.99F;
|
||||
this.bJ *= 0.9F;
|
||||
this.bL *= 0.99F;
|
||||
}
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
this.motX = (double) (this.bO * this.bL);
|
||||
this.motY = (double) (this.bP * this.bL);
|
||||
this.motZ = (double) (this.bQ * this.bL);
|
||||
this.motX = (double) (this.bM * this.bJ);
|
||||
this.motY = (double) (this.bN * this.bJ);
|
||||
this.motZ = (double) (this.bO * this.bJ);
|
||||
}
|
||||
|
||||
f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
|
||||
// CraftBukkit - Math -> TrigMath
|
||||
this.aw += (-((float) TrigMath.atan2(this.motX, this.motZ)) * 180.0F / 3.1415927F - this.aw) * 0.1F;
|
||||
this.yaw = this.aw;
|
||||
this.f += 3.1415927F * this.bN * 1.5F;
|
||||
this.f += 3.1415927F * this.bL * 1.5F;
|
||||
// CraftBukkit - Math -> TrigMath
|
||||
this.d += (-((float) TrigMath.atan2((double) f, this.motY)) * 180.0F / 3.1415927F - this.d) * 0.1F;
|
||||
} else {
|
||||
@ -129,19 +129,19 @@ public class EntitySquid extends EntityWaterAnimal {
|
||||
this.move(this.motX, this.motY, this.motZ);
|
||||
}
|
||||
|
||||
protected void bk() {
|
||||
++this.bC;
|
||||
if (this.bC > 100) {
|
||||
this.bO = this.bP = this.bQ = 0.0F;
|
||||
} else if (this.random.nextInt(50) == 0 || !this.ad || this.bO == 0.0F && this.bP == 0.0F && this.bQ == 0.0F) {
|
||||
protected void bn() {
|
||||
++this.bA;
|
||||
if (this.bA > 100) {
|
||||
this.bM = this.bN = this.bO = 0.0F;
|
||||
} else if (this.random.nextInt(50) == 0 || !this.ad || this.bM == 0.0F && this.bN == 0.0F && this.bO == 0.0F) {
|
||||
float f = this.random.nextFloat() * 3.1415927F * 2.0F;
|
||||
|
||||
this.bO = MathHelper.cos(f) * 0.2F;
|
||||
this.bP = -0.1F + this.random.nextFloat() * 0.2F;
|
||||
this.bQ = MathHelper.sin(f) * 0.2F;
|
||||
this.bM = MathHelper.cos(f) * 0.2F;
|
||||
this.bN = -0.1F + this.random.nextFloat() * 0.2F;
|
||||
this.bO = MathHelper.sin(f) * 0.2F;
|
||||
}
|
||||
|
||||
this.bh();
|
||||
this.bk();
|
||||
}
|
||||
|
||||
public boolean canSpawn() {
|
||||
|
@ -139,18 +139,15 @@ public class EntityTracker {
|
||||
}
|
||||
}
|
||||
|
||||
iterator = arraylist.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
EntityPlayer entityplayer1 = entityplayer;
|
||||
for (int i = 0; i < arraylist.size(); ++i) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) arraylist.get(i);
|
||||
Iterator iterator1 = this.b.iterator();
|
||||
|
||||
while (iterator1.hasNext()) {
|
||||
EntityTrackerEntry entitytrackerentry1 = (EntityTrackerEntry) iterator1.next();
|
||||
|
||||
if (entitytrackerentry1.tracker != entityplayer1) {
|
||||
entitytrackerentry1.updatePlayer(entityplayer1);
|
||||
if (entitytrackerentry1.tracker != entityplayer) {
|
||||
entitytrackerentry1.updatePlayer(entityplayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -184,4 +181,16 @@ public class EntityTracker {
|
||||
entitytrackerentry.clear(entityplayer);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(EntityPlayer entityplayer, Chunk chunk) {
|
||||
Iterator iterator = this.b.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) iterator.next();
|
||||
|
||||
if (entitytrackerentry.tracker != entityplayer && entitytrackerentry.tracker.ai == chunk.x && entitytrackerentry.tracker.ak == chunk.z) {
|
||||
entitytrackerentry.updatePlayer(entityplayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ public class EntityTrackerEntry {
|
||||
private boolean isMoving;
|
||||
private int u = 0;
|
||||
private Entity v;
|
||||
private boolean w = false;
|
||||
public boolean n = false;
|
||||
public Set trackedPlayers = new HashSet();
|
||||
|
||||
@ -78,18 +79,18 @@ public class EntityTrackerEntry {
|
||||
|
||||
if (i5 != null && i5.getItem() instanceof ItemWorldMap) {
|
||||
WorldMap i7 = Item.MAP.getSavedMap(i5, this.tracker.world);
|
||||
Iterator i8 = list.iterator();
|
||||
Iterator j0 = list.iterator();
|
||||
|
||||
while (i8.hasNext()) {
|
||||
EntityHuman j0 = (EntityHuman) i8.next();
|
||||
EntityPlayer j1 = (EntityPlayer) j0;
|
||||
while (j0.hasNext()) {
|
||||
EntityHuman j1 = (EntityHuman) j0.next();
|
||||
EntityPlayer j2 = (EntityPlayer) j1;
|
||||
|
||||
i7.a(j1, i5);
|
||||
if (j1.netServerHandler.lowPriorityCount() <= 5) {
|
||||
Packet j2 = Item.MAP.c(i5, this.tracker.world, j1);
|
||||
i7.a(j2, i5);
|
||||
if (j2.netServerHandler.lowPriorityCount() <= 5) {
|
||||
Packet j3 = Item.MAP.c(i5, this.tracker.world, j2);
|
||||
|
||||
if (j2 != null) {
|
||||
j1.netServerHandler.sendPacket(j2);
|
||||
if (j3 != null) {
|
||||
j2.netServerHandler.sendPacket(j3);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -131,7 +132,7 @@ public class EntityTrackerEntry {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (j1 >= -128 && j1 < 128 && k1 >= -128 && k1 < 128 && l1 >= -128 && l1 < 128 && this.u <= 400) {
|
||||
if (j1 >= -128 && j1 < 128 && k1 >= -128 && k1 < 128 && l1 >= -128 && l1 < 128 && this.u <= 400 && !this.w) {
|
||||
if (flag && flag1) {
|
||||
object = new Packet33RelEntityMoveLook(this.tracker.id, (byte) j1, (byte) k1, (byte) l1, (byte) l, (byte) i1);
|
||||
} else if (flag) {
|
||||
@ -186,6 +187,8 @@ public class EntityTrackerEntry {
|
||||
this.xRot = i1;
|
||||
}
|
||||
// CraftBukkit end */
|
||||
|
||||
this.w = false;
|
||||
} else {
|
||||
i = MathHelper.d(this.tracker.yaw * 256.0F / 360.0F);
|
||||
j = MathHelper.d(this.tracker.pitch * 256.0F / 360.0F);
|
||||
@ -200,6 +203,13 @@ public class EntityTrackerEntry {
|
||||
this.xLoc = this.tracker.ar.a(this.tracker.locX);
|
||||
this.yLoc = MathHelper.floor(this.tracker.locY * 32.0D);
|
||||
this.zLoc = this.tracker.ar.a(this.tracker.locZ);
|
||||
DataWatcher datawatcher2 = this.tracker.getDataWatcher();
|
||||
|
||||
if (datawatcher2.a()) {
|
||||
this.broadcastIncludingSelf(new Packet40EntityMetadata(this.tracker.id, datawatcher2, false));
|
||||
}
|
||||
|
||||
this.w = true;
|
||||
}
|
||||
|
||||
i = MathHelper.d(this.tracker.ap() * 256.0F / 360.0F);
|
||||
@ -355,12 +365,8 @@ public class EntityTrackerEntry {
|
||||
}
|
||||
|
||||
public void scanPlayers(List list) {
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
EntityHuman entityhuman = (EntityHuman) iterator.next();
|
||||
|
||||
this.updatePlayer((EntityPlayer) entityhuman);
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
this.updatePlayer((EntityPlayer) list.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,10 +11,10 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
|
||||
public EntityWitch(World world) {
|
||||
super(world);
|
||||
this.texture = "/mob/villager/witch.png";
|
||||
this.bI = 0.25F;
|
||||
this.bG = 0.25F;
|
||||
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
||||
this.goalSelector.a(2, new PathfinderGoalArrowAttack(this, this.bI, 60, 10.0F));
|
||||
this.goalSelector.a(2, new PathfinderGoalRandomStroll(this, this.bI));
|
||||
this.goalSelector.a(2, new PathfinderGoalArrowAttack(this, this.bG, 60, 10.0F));
|
||||
this.goalSelector.a(2, new PathfinderGoalRandomStroll(this, this.bG));
|
||||
this.goalSelector.a(3, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
||||
this.goalSelector.a(3, new PathfinderGoalRandomLookaround(this));
|
||||
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, false));
|
||||
@ -26,15 +26,15 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
|
||||
this.getDataWatcher().a(21, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return "mob.witch.idle";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.witch.hurt";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.witch.death";
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
|
||||
return 26;
|
||||
}
|
||||
|
||||
public boolean bb() {
|
||||
public boolean be() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
|
||||
if (this.m()) {
|
||||
if (this.e-- <= 0) {
|
||||
this.f(false);
|
||||
ItemStack itemstack = this.bA();
|
||||
ItemStack itemstack = this.bD();
|
||||
|
||||
this.setEquipment(0, (ItemStack) null);
|
||||
if (itemstack != null && itemstack.id == Item.POTION.id) {
|
||||
@ -83,15 +83,15 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
|
||||
short1 = 16307;
|
||||
} else if (this.random.nextFloat() < 0.05F && this.health < this.getMaxHealth()) {
|
||||
short1 = 16341;
|
||||
} else if (this.random.nextFloat() < 0.25F && this.aF() != null && !this.hasEffect(MobEffectList.FASTER_MOVEMENT) && this.aF().e(this) > 121.0D) {
|
||||
} else if (this.random.nextFloat() < 0.25F && this.aG() != null && !this.hasEffect(MobEffectList.FASTER_MOVEMENT) && this.aG().e(this) > 121.0D) {
|
||||
short1 = 16274;
|
||||
} else if (this.random.nextFloat() < 0.25F && this.aF() != null && !this.hasEffect(MobEffectList.FASTER_MOVEMENT) && this.aF().e(this) > 121.0D) {
|
||||
} else if (this.random.nextFloat() < 0.25F && this.aG() != null && !this.hasEffect(MobEffectList.FASTER_MOVEMENT) && this.aG().e(this) > 121.0D) {
|
||||
short1 = 16274;
|
||||
}
|
||||
|
||||
if (short1 > -1) {
|
||||
this.setEquipment(0, new ItemStack(Item.POTION, 1, short1));
|
||||
this.e = this.bA().m();
|
||||
this.e = this.bD().m();
|
||||
this.f(true);
|
||||
}
|
||||
}
|
||||
@ -117,8 +117,8 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
|
||||
return i;
|
||||
}
|
||||
|
||||
public float by() {
|
||||
float f = super.by();
|
||||
public float bB() {
|
||||
float f = super.bB();
|
||||
|
||||
if (this.m()) {
|
||||
f *= 0.75F;
|
||||
|
@ -16,7 +16,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
private int[] h = new int[2];
|
||||
private int[] i = new int[2];
|
||||
private int j;
|
||||
private static final IEntitySelector bK = new EntitySelectorNotUndead();
|
||||
private static final IEntitySelector bI = new EntitySelectorNotUndead();
|
||||
|
||||
public EntityWither(World world) {
|
||||
super(world);
|
||||
@ -24,15 +24,15 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
this.texture = "/mob/wither.png";
|
||||
this.a(0.9F, 4.0F);
|
||||
this.fireProof = true;
|
||||
this.bI = 0.6F;
|
||||
this.bG = 0.6F;
|
||||
this.getNavigation().e(true);
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
this.goalSelector.a(2, new PathfinderGoalArrowAttack(this, this.bI, 40, 20.0F));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, this.bI));
|
||||
this.goalSelector.a(2, new PathfinderGoalArrowAttack(this, this.bG, 40, 20.0F));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, this.bG));
|
||||
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, false));
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityLiving.class, 30.0F, 0, false, false, bK));
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityLiving.class, 30.0F, 0, false, false, bI));
|
||||
this.bc = 50;
|
||||
}
|
||||
|
||||
@ -52,19 +52,19 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
|
||||
public void a(NBTTagCompound nbttagcompound) {
|
||||
super.a(nbttagcompound);
|
||||
this.s(nbttagcompound.getInt("Invul"));
|
||||
this.t(nbttagcompound.getInt("Invul"));
|
||||
this.datawatcher.watch(16, Integer.valueOf(this.health));
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return "mob.wither.idle";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.wither.hurt";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.wither.death";
|
||||
}
|
||||
|
||||
@ -78,8 +78,8 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
double d1;
|
||||
double d2;
|
||||
|
||||
if (!this.world.isStatic && this.t(0) > 0) {
|
||||
Entity entity = this.world.getEntity(this.t(0));
|
||||
if (!this.world.isStatic && this.u(0) > 0) {
|
||||
Entity entity = this.world.getEntity(this.u(0));
|
||||
|
||||
if (entity != null) {
|
||||
if (this.locY < entity.locY || !this.o() && this.locY < entity.locY + 5.0D) {
|
||||
@ -118,7 +118,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
int j;
|
||||
|
||||
for (i = 0; i < 2; ++i) {
|
||||
j = this.t(i + 1);
|
||||
j = this.u(i + 1);
|
||||
Entity entity1 = null;
|
||||
|
||||
if (j > 0) {
|
||||
@ -126,9 +126,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
}
|
||||
|
||||
if (entity1 != null) {
|
||||
d0 = this.u(i + 1);
|
||||
d1 = this.v(i + 1);
|
||||
d2 = this.w(i + 1);
|
||||
d0 = this.v(i + 1);
|
||||
d1 = this.w(i + 1);
|
||||
d2 = this.x(i + 1);
|
||||
double d4 = entity1.locX - d0;
|
||||
double d5 = entity1.locY + (double) entity1.getHeadHeight() - d1;
|
||||
double d6 = entity1.locZ - d2;
|
||||
@ -146,9 +146,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
boolean flag = this.o();
|
||||
|
||||
for (j = 0; j < 3; ++j) {
|
||||
double d8 = this.u(j);
|
||||
double d9 = this.v(j);
|
||||
double d10 = this.w(j);
|
||||
double d8 = this.v(j);
|
||||
double d9 = this.w(j);
|
||||
double d10 = this.x(j);
|
||||
|
||||
this.world.addParticle("smoke", d8 + this.random.nextGaussian() * 0.30000001192092896D, d9 + this.random.nextGaussian() * 0.30000001192092896D, d10 + this.random.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D);
|
||||
if (flag && this.world.random.nextInt(4) == 0) {
|
||||
@ -163,7 +163,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
}
|
||||
}
|
||||
|
||||
protected void bi() {
|
||||
protected void bl() {
|
||||
int i;
|
||||
|
||||
if (this.n() > 0) {
|
||||
@ -181,12 +181,12 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
this.world.e(1013, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
||||
}
|
||||
|
||||
this.s(i);
|
||||
this.t(i);
|
||||
if (this.ticksLived % 10 == 0) {
|
||||
this.heal(10, EntityRegainHealthEvent.RegainReason.WITHER_SPAWN); // CraftBukkit
|
||||
}
|
||||
} else {
|
||||
super.bi();
|
||||
super.bl();
|
||||
|
||||
int j;
|
||||
|
||||
@ -210,11 +210,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
}
|
||||
}
|
||||
|
||||
j = this.t(i);
|
||||
j = this.u(i);
|
||||
if (j > 0) {
|
||||
Entity entity = this.world.getEntity(j);
|
||||
|
||||
if (entity != null && entity.isAlive() && this.e(entity) <= 900.0D && this.m(entity)) {
|
||||
if (entity != null && entity.isAlive() && this.e(entity) <= 900.0D && this.n(entity)) {
|
||||
this.a(i + 1, (EntityLiving) entity);
|
||||
this.h[i - 1] = this.ticksLived + 40 + this.random.nextInt(20);
|
||||
this.i[i - 1] = 0;
|
||||
@ -222,7 +222,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
this.c(i, 0);
|
||||
}
|
||||
} else {
|
||||
List list = this.world.a(EntityLiving.class, this.boundingBox.grow(20.0D, 8.0D, 20.0D), bK);
|
||||
List list = this.world.a(EntityLiving.class, this.boundingBox.grow(20.0D, 8.0D, 20.0D), bI);
|
||||
|
||||
for (int i1 = 0; i1 < 10 && !list.isEmpty(); ++i1) {
|
||||
EntityLiving entityliving = (EntityLiving) list.get(this.random.nextInt(list.size()));
|
||||
@ -244,8 +244,8 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.aF() != null) {
|
||||
this.c(0, this.aF().id);
|
||||
if (this.aG() != null) {
|
||||
this.c(0, this.aG().id);
|
||||
} else {
|
||||
this.c(0, 0);
|
||||
}
|
||||
@ -266,7 +266,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
int l2 = j1 + l1;
|
||||
int i3 = this.world.getTypeId(j2, k2, l2);
|
||||
|
||||
if (i3 > 0 && i3 != Block.BEDROCK.id) {
|
||||
if (i3 > 0 && i3 != Block.BEDROCK.id && i3 != Block.ENDER_PORTAL.id && i3 != Block.ENDER_PORTAL_FRAME.id) {
|
||||
int j3 = this.world.getData(j2, k2, l2);
|
||||
|
||||
// CraftBukkit start
|
||||
@ -297,17 +297,17 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
}
|
||||
|
||||
public void m() {
|
||||
this.s(220);
|
||||
this.t(220);
|
||||
this.setHealth(this.getMaxHealth() / 3);
|
||||
}
|
||||
|
||||
public void am() {}
|
||||
|
||||
public int aU() {
|
||||
public int aW() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
private double u(int i) {
|
||||
private double v(int i) {
|
||||
if (i <= 0) {
|
||||
return this.locX;
|
||||
} else {
|
||||
@ -318,11 +318,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
}
|
||||
}
|
||||
|
||||
private double v(int i) {
|
||||
private double w(int i) {
|
||||
return i <= 0 ? this.locY + 3.0D : this.locY + 2.2D;
|
||||
}
|
||||
|
||||
private double w(int i) {
|
||||
private double x(int i) {
|
||||
if (i <= 0) {
|
||||
return this.locZ;
|
||||
} else {
|
||||
@ -353,9 +353,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
|
||||
private void a(int i, double d0, double d1, double d2, boolean flag) {
|
||||
this.world.a((EntityHuman) null, 1014, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
||||
double d3 = this.u(i);
|
||||
double d4 = this.v(i);
|
||||
double d5 = this.w(i);
|
||||
double d3 = this.v(i);
|
||||
double d4 = this.w(i);
|
||||
double d5 = this.x(i);
|
||||
double d6 = d0 - d3;
|
||||
double d7 = d1 - d4;
|
||||
double d8 = d2 - d5;
|
||||
@ -376,7 +376,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (damagesource == DamageSource.DROWN) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else if (damagesource == DamageSource.DROWN) {
|
||||
return false;
|
||||
} else if (this.n() > 0) {
|
||||
return false;
|
||||
@ -415,8 +417,8 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
protected void bh() {
|
||||
this.bC = 0;
|
||||
protected void bk() {
|
||||
this.bA = 0;
|
||||
}
|
||||
|
||||
public boolean L() {
|
||||
@ -431,7 +433,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
|
||||
public void addEffect(MobEffect mobeffect) {}
|
||||
|
||||
protected boolean bb() {
|
||||
protected boolean be() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -443,11 +445,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
return this.datawatcher.getInt(20);
|
||||
}
|
||||
|
||||
public void s(int i) {
|
||||
public void t(int i) {
|
||||
this.datawatcher.watch(20, Integer.valueOf(i));
|
||||
}
|
||||
|
||||
public int t(int i) {
|
||||
public int u(int i) {
|
||||
return this.datawatcher.getInt(17 + i);
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ public class EntityWitherSkull extends EntityFireball {
|
||||
public float a(Explosion explosion, Block block, int i, int j, int k) {
|
||||
float f = super.a(explosion, block, i, j, k);
|
||||
|
||||
if (this.d() && block != Block.BEDROCK) {
|
||||
if (this.d() && block != Block.BEDROCK && block != Block.ENDER_PORTAL && block != Block.ENDER_PORTAL_FRAME) {
|
||||
f = Math.min(0.8F, f);
|
||||
}
|
||||
|
||||
|
@ -13,15 +13,15 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
super(world);
|
||||
this.texture = "/mob/wolf.png";
|
||||
this.a(0.6F, 0.8F);
|
||||
this.bI = 0.3F;
|
||||
this.bG = 0.3F;
|
||||
this.getNavigation().a(true);
|
||||
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
||||
this.goalSelector.a(2, this.d);
|
||||
this.goalSelector.a(3, new PathfinderGoalLeapAtTarget(this, 0.4F));
|
||||
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, this.bI, true));
|
||||
this.goalSelector.a(5, new PathfinderGoalFollowOwner(this, this.bI, 10.0F, 2.0F));
|
||||
this.goalSelector.a(6, new PathfinderGoalBreed(this, this.bI));
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomStroll(this, this.bI));
|
||||
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, this.bG, true));
|
||||
this.goalSelector.a(5, new PathfinderGoalFollowOwner(this, this.bG, 10.0F, 2.0F));
|
||||
this.goalSelector.a(6, new PathfinderGoalBreed(this, this.bG));
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomStroll(this, this.bG));
|
||||
this.goalSelector.a(8, new PathfinderGoalBeg(this, 8.0F));
|
||||
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
||||
this.goalSelector.a(9, new PathfinderGoalRandomLookaround(this));
|
||||
@ -31,7 +31,7 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
this.targetSelector.a(4, new PathfinderGoalRandomTargetNonTamed(this, EntitySheep.class, 16.0F, 200, false));
|
||||
}
|
||||
|
||||
public boolean bb() {
|
||||
public boolean be() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
protected void bj() {
|
||||
protected void bm() {
|
||||
this.datawatcher.watch(18, Integer.valueOf(this.getHealth()));
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
}
|
||||
|
||||
protected void a(int i, int j, int k, int l) {
|
||||
this.world.makeSound(this, "mob.wolf.step", 0.15F, 1.0F);
|
||||
this.makeSound("mob.wolf.step", 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
@ -75,23 +75,23 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean bg() {
|
||||
protected boolean bj() {
|
||||
return this.isAngry();
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return this.isAngry() ? "mob.wolf.growl" : (this.random.nextInt(3) == 0 ? (this.isTamed() && this.datawatcher.getInt(18) < 10 ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark");
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.wolf.hurt";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.wolf.death";
|
||||
}
|
||||
|
||||
protected float aV() {
|
||||
protected float aX() {
|
||||
return 0.4F;
|
||||
}
|
||||
|
||||
@ -112,14 +112,14 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
public void j_() {
|
||||
super.j_();
|
||||
this.f = this.e;
|
||||
if (this.bI()) {
|
||||
if (this.bM()) {
|
||||
this.e += (1.0F - this.e) * 0.4F;
|
||||
} else {
|
||||
this.e += (0.0F - this.e) * 0.4F;
|
||||
}
|
||||
|
||||
if (this.bI()) {
|
||||
this.bJ = 10;
|
||||
if (this.bM()) {
|
||||
this.bH = 10;
|
||||
}
|
||||
|
||||
if (this.G()) {
|
||||
@ -129,7 +129,7 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
this.j = 0.0F;
|
||||
} else if ((this.g || this.h) && this.h) {
|
||||
if (this.i == 0.0F) {
|
||||
this.world.makeSound(this, "mob.wolf.shake", this.aV(), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
this.makeSound("mob.wolf.shake", this.aX(), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
}
|
||||
|
||||
this.j = this.i;
|
||||
@ -159,11 +159,14 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
return this.length * 0.8F;
|
||||
}
|
||||
|
||||
public int bm() {
|
||||
return this.isSitting() ? 20 : super.bm();
|
||||
public int bp() {
|
||||
return this.isSitting() ? 20 : super.bp();
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
Entity entity = damagesource.getEntity();
|
||||
|
||||
this.d.a(false);
|
||||
@ -173,14 +176,15 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
|
||||
return super.damageEntity(damagesource, i);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean l(Entity entity) {
|
||||
public boolean m(Entity entity) {
|
||||
int i = this.isTamed() ? 4 : 2;
|
||||
|
||||
return entity.damageEntity(DamageSource.mobAttack(this), i);
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
if (this.isTamed()) {
|
||||
@ -205,7 +209,7 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
|
||||
if (i != this.getCollarColor()) {
|
||||
this.setCollarColor(i);
|
||||
if (!entityhuman.abilities.canInstantlyBuild && itemstack.count-- <= 0) {
|
||||
if (!entityhuman.abilities.canInstantlyBuild && --itemstack.count <= 0) {
|
||||
entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
|
||||
}
|
||||
|
||||
@ -216,7 +220,7 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
|
||||
if (entityhuman.name.equalsIgnoreCase(this.getOwnerName()) && !this.world.isStatic && !this.c(itemstack)) {
|
||||
this.d.a(!this.isSitting());
|
||||
this.bG = false;
|
||||
this.bE = false;
|
||||
this.setPathEntity((PathEntity) null);
|
||||
}
|
||||
} else if (itemstack != null && itemstack.id == Item.BONE.id && !this.isAngry()) {
|
||||
@ -248,14 +252,14 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.c(entityhuman);
|
||||
return super.a(entityhuman);
|
||||
}
|
||||
|
||||
public boolean c(ItemStack itemstack) {
|
||||
return itemstack == null ? false : (!(Item.byId[itemstack.id] instanceof ItemFood) ? false : ((ItemFood) Item.byId[itemstack.id]).i());
|
||||
}
|
||||
|
||||
public int bs() {
|
||||
public int bv() {
|
||||
return 8;
|
||||
}
|
||||
|
||||
@ -281,7 +285,7 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
this.datawatcher.watch(20, Byte.valueOf((byte) (i & 15)));
|
||||
}
|
||||
|
||||
public EntityAnimal createChild(EntityAnimal entityanimal) {
|
||||
public EntityWolf b(EntityAgeable entityageable) {
|
||||
EntityWolf entitywolf = new EntityWolf(this.world);
|
||||
|
||||
entitywolf.setOwnerName(this.getOwnerName());
|
||||
@ -313,7 +317,11 @@ public class EntityWolf extends EntityTameableAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean bI() {
|
||||
public boolean bM() {
|
||||
return this.datawatcher.getByte(19) == 1;
|
||||
}
|
||||
|
||||
public EntityAgeable createChild(EntityAgeable entityageable) {
|
||||
return this.b(entityageable);
|
||||
}
|
||||
}
|
||||
|
@ -11,15 +11,15 @@ public class EntityZombie extends EntityMonster {
|
||||
public EntityZombie(World world) {
|
||||
super(world);
|
||||
this.texture = "/mob/zombie.png";
|
||||
this.bI = 0.23F;
|
||||
this.bG = 0.23F;
|
||||
this.getNavigation().b(true);
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
this.goalSelector.a(1, new PathfinderGoalBreakDoor(this));
|
||||
this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, EntityHuman.class, this.bI, false));
|
||||
this.goalSelector.a(3, new PathfinderGoalMeleeAttack(this, EntityVillager.class, this.bI, true));
|
||||
this.goalSelector.a(4, new PathfinderGoalMoveTowardsRestriction(this, this.bI));
|
||||
this.goalSelector.a(5, new PathfinderGoalMoveThroughVillage(this, this.bI, false));
|
||||
this.goalSelector.a(6, new PathfinderGoalRandomStroll(this, this.bI));
|
||||
this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, EntityHuman.class, this.bG, false));
|
||||
this.goalSelector.a(3, new PathfinderGoalMeleeAttack(this, EntityVillager.class, this.bG, true));
|
||||
this.goalSelector.a(4, new PathfinderGoalMoveTowardsRestriction(this, this.bG));
|
||||
this.goalSelector.a(5, new PathfinderGoalMoveThroughVillage(this, this.bG, false));
|
||||
this.goalSelector.a(6, new PathfinderGoalRandomStroll(this, this.bG));
|
||||
this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, false));
|
||||
@ -27,8 +27,8 @@ public class EntityZombie extends EntityMonster {
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, 16.0F, 0, false));
|
||||
}
|
||||
|
||||
public float by() {
|
||||
return super.by() * (this.isBaby() ? 1.5F : 1.0F);
|
||||
public float bB() {
|
||||
return super.bB() * (this.isBaby() ? 1.5F : 1.0F);
|
||||
}
|
||||
|
||||
protected void a() {
|
||||
@ -42,8 +42,8 @@ public class EntityZombie extends EntityMonster {
|
||||
return 20;
|
||||
}
|
||||
|
||||
public int aU() {
|
||||
int i = super.aU() + 2;
|
||||
public int aW() {
|
||||
int i = super.aW() + 2;
|
||||
|
||||
if (i > 20) {
|
||||
i = 20;
|
||||
@ -52,7 +52,7 @@ public class EntityZombie extends EntityMonster {
|
||||
return i;
|
||||
}
|
||||
|
||||
protected boolean bb() {
|
||||
protected boolean be() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -73,10 +73,10 @@ public class EntityZombie extends EntityMonster {
|
||||
}
|
||||
|
||||
public void c() {
|
||||
if (this.world.t() && !this.world.isStatic && !this.isBaby()) {
|
||||
if (this.world.u() && !this.world.isStatic && !this.isBaby()) {
|
||||
float f = this.c(1.0F);
|
||||
|
||||
if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.j(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ))) {
|
||||
if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.k(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ))) {
|
||||
boolean flag = true;
|
||||
ItemStack itemstack = this.getEquipment(4);
|
||||
|
||||
@ -122,7 +122,7 @@ public class EntityZombie extends EntityMonster {
|
||||
}
|
||||
|
||||
public int c(Entity entity) {
|
||||
ItemStack itemstack = this.bA();
|
||||
ItemStack itemstack = this.bD();
|
||||
int i = 4;
|
||||
|
||||
if (itemstack != null) {
|
||||
@ -132,20 +132,20 @@ public class EntityZombie extends EntityMonster {
|
||||
return i;
|
||||
}
|
||||
|
||||
protected String aW() {
|
||||
protected String aY() {
|
||||
return "mob.zombie.say";
|
||||
}
|
||||
|
||||
protected String aX() {
|
||||
protected String aZ() {
|
||||
return "mob.zombie.hurt";
|
||||
}
|
||||
|
||||
protected String aY() {
|
||||
protected String ba() {
|
||||
return "mob.zombie.death";
|
||||
}
|
||||
|
||||
protected void a(int i, int j, int k, int l) {
|
||||
this.world.makeSound(this, "mob.zombie.step", 0.15F, 1.0F);
|
||||
this.makeSound("mob.zombie.step", 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
protected int getLootId() {
|
||||
@ -171,8 +171,8 @@ public class EntityZombie extends EntityMonster {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
protected void bB() {
|
||||
super.bB();
|
||||
protected void bE() {
|
||||
super.bE();
|
||||
if (this.random.nextFloat() < (this.world.difficulty == 3 ? 0.05F : 0.01F)) {
|
||||
int i = this.random.nextInt(3);
|
||||
|
||||
@ -221,9 +221,9 @@ public class EntityZombie extends EntityMonster {
|
||||
|
||||
EntityZombie entityzombie = new EntityZombie(this.world);
|
||||
|
||||
entityzombie.j(entityliving);
|
||||
entityzombie.k(entityliving);
|
||||
this.world.kill(entityliving);
|
||||
entityzombie.bD();
|
||||
entityzombie.bG();
|
||||
entityzombie.setVillager(true);
|
||||
if (entityliving.isBaby()) {
|
||||
entityzombie.setBaby(true);
|
||||
@ -234,16 +234,16 @@ public class EntityZombie extends EntityMonster {
|
||||
}
|
||||
}
|
||||
|
||||
public void bD() {
|
||||
public void bG() {
|
||||
this.canPickUpLoot = this.random.nextFloat() < as[this.world.difficulty];
|
||||
if (this.world.random.nextFloat() < 0.05F) {
|
||||
this.setVillager(true);
|
||||
}
|
||||
|
||||
this.bB();
|
||||
this.bC();
|
||||
this.bE();
|
||||
this.bF();
|
||||
if (this.getEquipment(4) == null) {
|
||||
Calendar calendar = this.world.S();
|
||||
Calendar calendar = this.world.T();
|
||||
|
||||
if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.random.nextFloat() < 0.25F) {
|
||||
this.setEquipment(4, new ItemStack(this.random.nextFloat() < 0.1F ? Block.JACK_O_LANTERN : Block.PUMPKIN));
|
||||
@ -252,8 +252,8 @@ public class EntityZombie extends EntityMonster {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
ItemStack itemstack = entityhuman.bP();
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
ItemStack itemstack = entityhuman.bT();
|
||||
|
||||
if (itemstack != null && itemstack.getItem() == Item.GOLDEN_APPLE && itemstack.getData() == 0 && this.isVillager() && this.hasEffect(MobEffectList.WEAKNESS)) {
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
@ -289,8 +289,8 @@ public class EntityZombie extends EntityMonster {
|
||||
protected void p() {
|
||||
EntityVillager entityvillager = new EntityVillager(this.world);
|
||||
|
||||
entityvillager.j(this);
|
||||
entityvillager.bD();
|
||||
entityvillager.k(this);
|
||||
entityvillager.bG();
|
||||
entityvillager.q();
|
||||
if (this.isBaby()) {
|
||||
entityvillager.setAge(-24000);
|
||||
|
@ -270,13 +270,17 @@ public class Explosion {
|
||||
data = Block.SKULL.getDropData(this.world, i, j, k);
|
||||
}
|
||||
|
||||
Block.byId[l].dropNaturally(this.world, i, j, k, data, event.getYield(), 0);
|
||||
Block block = Block.byId[l];
|
||||
|
||||
if (block.a(this)) {
|
||||
block.dropNaturally(this.world, i, j, k, data, event.getYield(), 0);
|
||||
}
|
||||
// CraftBukkit end
|
||||
if (this.world.setRawTypeIdAndData(i, j, k, 0, 0, this.world.isStatic)) {
|
||||
this.world.applyPhysics(i, j, k, 0);
|
||||
}
|
||||
|
||||
Block.byId[l].wasExploded(this.world, i, j, k);
|
||||
block.wasExploded(this.world, i, j, k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class FoodMetaData {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.foodLevel >= 18 && entityhuman.ca()) {
|
||||
if (this.foodLevel >= 18 && entityhuman.ce()) {
|
||||
++this.foodTickTimer;
|
||||
if (this.foodTickTimer >= 80) {
|
||||
// CraftBukkit - added RegainReason
|
||||
|
Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren