Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 04:20:08 +01:00
Update CraftBukkit to Minecraft 1.7.5
Dieser Commit ist enthalten in:
Ursprung
afb3511a4a
Commit
385ace970e
6
pom.xml
6
pom.xml
@ -4,7 +4,7 @@
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.7.2-R0.4-SNAPSHOT</version>
|
||||
<version>1.7.5-R0.1-SNAPSHOT</version>
|
||||
<name>CraftBukkit</name>
|
||||
<url>http://www.bukkit.org</url>
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<api.version>unknown</api.version>
|
||||
<junit.version>4.11</junit.version>
|
||||
<minecraft.version>1.7.2</minecraft.version>
|
||||
<minecraft_version>1_7_R1</minecraft_version>
|
||||
<minecraft.version>1.7.5</minecraft.version>
|
||||
<minecraft_version>1_7_R2</minecraft_version>
|
||||
<buildtag.prefix>git-Bukkit-</buildtag.prefix>
|
||||
<buildtag.suffix></buildtag.suffix>
|
||||
</properties>
|
||||
|
@ -1,68 +0,0 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AABBPool {
|
||||
|
||||
private final int a;
|
||||
private final int b;
|
||||
private final List pool = new ArrayList();
|
||||
private int d;
|
||||
private int largestSize;
|
||||
private int resizeTime;
|
||||
|
||||
public AABBPool(int i, int j) {
|
||||
this.a = i;
|
||||
this.b = j;
|
||||
}
|
||||
|
||||
public AxisAlignedBB a(double d0, double d1, double d2, double d3, double d4, double d5) {
|
||||
// CraftBukkit - don't pool objects indefinitely if thread doesn't adhere to contract
|
||||
if (this.resizeTime == 0) return new AxisAlignedBB(d0, d1, d2, d3, d4, d5);
|
||||
AxisAlignedBB axisalignedbb;
|
||||
|
||||
if (this.d >= this.pool.size()) {
|
||||
axisalignedbb = new AxisAlignedBB(d0, d1, d2, d3, d4, d5);
|
||||
this.pool.add(axisalignedbb);
|
||||
} else {
|
||||
axisalignedbb = (AxisAlignedBB) this.pool.get(this.d);
|
||||
axisalignedbb.b(d0, d1, d2, d3, d4, d5);
|
||||
}
|
||||
|
||||
++this.d;
|
||||
return axisalignedbb;
|
||||
}
|
||||
|
||||
public void a() {
|
||||
if (this.d > this.largestSize) {
|
||||
this.largestSize = this.d;
|
||||
}
|
||||
|
||||
// CraftBukkit start - Intelligent cache
|
||||
if ((this.resizeTime++ & 0xff) == 0) {
|
||||
int newSize = this.pool.size() - (this.pool.size() >> 3);
|
||||
// newSize will be 87.5%, but if we were not in that range, we clear some of the cache
|
||||
if (newSize > this.largestSize) {
|
||||
// Work down from size() to prevent insane array copies
|
||||
for (int i = this.pool.size() - 1; i > newSize; i--) {
|
||||
this.pool.remove(i);
|
||||
}
|
||||
}
|
||||
|
||||
this.largestSize = 0;
|
||||
// this.resizeTime = 0; // We do not reset to zero; it doubles for a flag
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
this.d = 0;
|
||||
}
|
||||
|
||||
public int c() {
|
||||
return this.pool.size();
|
||||
}
|
||||
|
||||
public int d() {
|
||||
return this.d;
|
||||
}
|
||||
}
|
@ -408,7 +408,7 @@ public class Block {
|
||||
}
|
||||
|
||||
public AxisAlignedBB a(World world, int i, int j, int k) {
|
||||
return AxisAlignedBB.a().a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ);
|
||||
return AxisAlignedBB.a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ);
|
||||
}
|
||||
|
||||
public boolean c() {
|
||||
@ -599,15 +599,15 @@ public class Block {
|
||||
}
|
||||
|
||||
private boolean a(Vec3D vec3d) {
|
||||
return vec3d == null ? false : vec3d.d >= this.minY && vec3d.d <= this.maxY && vec3d.e >= this.minZ && vec3d.e <= this.maxZ;
|
||||
return vec3d == null ? false : vec3d.b >= this.minY && vec3d.b <= this.maxY && vec3d.c >= this.minZ && vec3d.c <= this.maxZ;
|
||||
}
|
||||
|
||||
private boolean b(Vec3D vec3d) {
|
||||
return vec3d == null ? false : vec3d.c >= this.minX && vec3d.c <= this.maxX && vec3d.e >= this.minZ && vec3d.e <= this.maxZ;
|
||||
return vec3d == null ? false : vec3d.a >= this.minX && vec3d.a <= this.maxX && vec3d.c >= this.minZ && vec3d.c <= this.maxZ;
|
||||
}
|
||||
|
||||
private boolean c(Vec3D vec3d) {
|
||||
return vec3d == null ? false : vec3d.c >= this.minX && vec3d.c <= this.maxX && vec3d.d >= this.minY && vec3d.d <= this.maxY;
|
||||
return vec3d == null ? false : vec3d.a >= this.minX && vec3d.a <= this.maxX && vec3d.b >= this.minY && vec3d.b <= this.maxY;
|
||||
}
|
||||
|
||||
public void wasExploded(World world, int i, int j, int k, Explosion explosion) {}
|
||||
@ -681,7 +681,7 @@ public class Block {
|
||||
public void g() {}
|
||||
|
||||
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
entityhuman.a(StatisticList.C[b(this)], 1);
|
||||
entityhuman.a(StatisticList.MINE_BLOCK_COUNT[b(this)], 1);
|
||||
entityhuman.a(0.025F);
|
||||
if (this.E() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman)) {
|
||||
ItemStack itemstack = this.j(l);
|
||||
|
@ -250,7 +250,7 @@ public abstract class BlockButtonAbstract extends Block {
|
||||
boolean flag = (l & 8) != 0;
|
||||
|
||||
this.b(l);
|
||||
List list = world.a(EntityArrow.class, AxisAlignedBB.a().a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ));
|
||||
List list = world.a(EntityArrow.class, AxisAlignedBB.a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ));
|
||||
boolean flag1 = !list.isEmpty();
|
||||
|
||||
// CraftBukkit start - Call interact event when arrows turn on wooden buttons
|
||||
|
@ -37,7 +37,7 @@ public class BlockCactus extends Block {
|
||||
public AxisAlignedBB a(World world, int i, int j, int k) {
|
||||
float f = 0.0625F;
|
||||
|
||||
return AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f));
|
||||
return AxisAlignedBB.a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f));
|
||||
}
|
||||
|
||||
public boolean d() {
|
||||
|
@ -31,7 +31,7 @@ public class BlockCake extends Block {
|
||||
float f1 = (float) (1 + l * 2) / 16.0F;
|
||||
float f2 = 0.5F;
|
||||
|
||||
return AxisAlignedBB.a().a((double) ((float) i + f1), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) j + f2 - f), (double) ((float) (k + 1) - f));
|
||||
return AxisAlignedBB.a((double) ((float) i + f1), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) j + f2 - f), (double) ((float) (k + 1) - f));
|
||||
}
|
||||
|
||||
public boolean d() {
|
||||
|
@ -97,7 +97,7 @@ public abstract class BlockDiodeAbstract extends BlockDirectional {
|
||||
protected void b(World world, int i, int j, int k, Block block) {
|
||||
int l = world.getData(i, j, k);
|
||||
|
||||
if (!this.g((IBlockAccess) world, i, j, k, l)) {
|
||||
if (!this.g((IBlockAccess) world, i, j, k, l)) { // CraftBukkit - Cast world to IBlockAccess to call the right method.
|
||||
boolean flag = this.a(world, i, j, k, l);
|
||||
|
||||
if ((this.a && !flag || !this.a && flag) && !world.a(i, j, k, (Block) this)) {
|
||||
|
@ -89,7 +89,7 @@ public class BlockDispenser extends BlockContainer {
|
||||
}
|
||||
|
||||
protected IDispenseBehavior a(ItemStack itemstack) {
|
||||
return (IDispenseBehavior) a.a(itemstack.getItem());
|
||||
return (IDispenseBehavior) a.get(itemstack.getItem());
|
||||
}
|
||||
|
||||
public void doPhysics(World world, int i, int j, int k, Block block) {
|
||||
@ -168,9 +168,9 @@ public class BlockDispenser extends BlockContainer {
|
||||
|
||||
public static IPosition a(ISourceBlock isourceblock) {
|
||||
EnumFacing enumfacing = b(isourceblock.h());
|
||||
double d0 = isourceblock.getX() + 0.7D * (double) enumfacing.c();
|
||||
double d1 = isourceblock.getY() + 0.7D * (double) enumfacing.d();
|
||||
double d2 = isourceblock.getZ() + 0.7D * (double) enumfacing.e();
|
||||
double d0 = isourceblock.getX() + 0.7D * (double) enumfacing.getAdjacentX();
|
||||
double d1 = isourceblock.getY() + 0.7D * (double) enumfacing.getAdjacentY();
|
||||
double d2 = isourceblock.getZ() + 0.7D * (double) enumfacing.getAdjacentZ();
|
||||
|
||||
return new Position(d0, d1, d2);
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public class BlockFire extends Block {
|
||||
fireExtinguished(world, i, j, k); // CraftBukkit - invalid place location
|
||||
}
|
||||
|
||||
if (!flag && world.P() && (world.isRainingAt(i, j, k) || world.isRainingAt(i - 1, j, k) || world.isRainingAt(i + 1, j, k) || world.isRainingAt(i, j, k - 1) || world.isRainingAt(i, j, k + 1))) {
|
||||
if (!flag && world.Q() && (world.isRainingAt(i, j, k) || world.isRainingAt(i - 1, j, k) || world.isRainingAt(i + 1, j, k) || world.isRainingAt(i, j, k - 1) || world.isRainingAt(i, j, k + 1))) {
|
||||
fireExtinguished(world, i, j, k); // CraftBukkit - extinguished by rain
|
||||
} else {
|
||||
int l = world.getData(i, j, k);
|
||||
@ -135,7 +135,7 @@ public class BlockFire extends Block {
|
||||
j2 /= 2;
|
||||
}
|
||||
|
||||
if (j2 > 0 && random.nextInt(l1) <= j2 && (!world.P() || !world.isRainingAt(i1, k1, j1)) && !world.isRainingAt(i1 - 1, k1, k) && !world.isRainingAt(i1 + 1, k1, j1) && !world.isRainingAt(i1, k1, j1 - 1) && !world.isRainingAt(i1, k1, j1 + 1)) {
|
||||
if (j2 > 0 && random.nextInt(l1) <= j2 && (!world.Q() || !world.isRainingAt(i1, k1, j1)) && !world.isRainingAt(i1 - 1, k1, k) && !world.isRainingAt(i1 + 1, k1, j1) && !world.isRainingAt(i1, k1, j1 - 1) && !world.isRainingAt(i1, k1, j1 + 1)) {
|
||||
int k2 = l + random.nextInt(5) / 4;
|
||||
|
||||
if (k2 > 15) {
|
||||
|
@ -7,6 +7,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
import org.bukkit.event.block.BlockSpreadEvent;
|
||||
import org.bukkit.event.block.BlockFadeEvent;
|
||||
// CraftBukkit end
|
||||
@ -27,7 +28,7 @@ public class BlockGrass extends Block implements IBlockFragilePlantElement {
|
||||
// CraftBukkit start
|
||||
org.bukkit.World bworld = world.getWorld();
|
||||
BlockState blockState = bworld.getBlockAt(i, j, k).getState();
|
||||
blockState.setTypeId(Block.b(Blocks.DIRT));
|
||||
blockState.setType(CraftMagicNumbers.getMaterial(Blocks.DIRT));
|
||||
|
||||
BlockFadeEvent event = new BlockFadeEvent(blockState.getBlock(), blockState);
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
@ -47,7 +48,7 @@ public class BlockGrass extends Block implements IBlockFragilePlantElement {
|
||||
// CraftBukkit start
|
||||
org.bukkit.World bworld = world.getWorld();
|
||||
BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
|
||||
blockState.setTypeId(Block.b(Blocks.GRASS));
|
||||
blockState.setType(CraftMagicNumbers.getMaterial(Blocks.GRASS));
|
||||
|
||||
BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState);
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
|
@ -12,7 +12,7 @@ public class BlockIce extends BlockHalfTransparent {
|
||||
}
|
||||
|
||||
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
entityhuman.a(StatisticList.C[Block.b((Block) this)], 1);
|
||||
entityhuman.a(StatisticList.MINE_BLOCK_COUNT[Block.b((Block) this)], 1);
|
||||
entityhuman.a(0.025F);
|
||||
if (this.E() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman)) {
|
||||
ItemStack itemstack = this.j(l);
|
||||
|
@ -179,8 +179,8 @@ public abstract class BlockLeaves extends BlockTransparent {
|
||||
}
|
||||
|
||||
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
if (!world.isStatic && entityhuman.bD() != null && entityhuman.bD().getItem() == Items.SHEARS) {
|
||||
entityhuman.a(StatisticList.C[Block.b((Block) this)], 1);
|
||||
if (!world.isStatic && entityhuman.bE() != null && entityhuman.bE().getItem() == Items.SHEARS) {
|
||||
entityhuman.a(StatisticList.MINE_BLOCK_COUNT[Block.b((Block) this)], 1);
|
||||
this.a(world, i, j, k, new ItemStack(Item.getItemOf(this), 1, l & 3));
|
||||
} else {
|
||||
super.a(world, entityhuman, i, j, k, l);
|
||||
|
@ -52,7 +52,7 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
|
||||
boolean flag = (l & 8) != 0;
|
||||
boolean flag1 = false;
|
||||
float f = 0.125F;
|
||||
List list = world.a(EntityMinecartAbstract.class, AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)));
|
||||
List list = world.a(EntityMinecartAbstract.class, AxisAlignedBB.a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)));
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
flag1 = true;
|
||||
@ -102,13 +102,13 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
|
||||
public int g(World world, int i, int j, int k, int l) {
|
||||
if ((world.getData(i, j, k) & 8) > 0) {
|
||||
float f = 0.125F;
|
||||
List list = world.a(EntityMinecartCommandBlock.class, AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)));
|
||||
List list = world.a(EntityMinecartCommandBlock.class, AxisAlignedBB.a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)));
|
||||
|
||||
if (list.size() > 0) {
|
||||
return ((EntityMinecartCommandBlock) list.get(0)).e().g();
|
||||
}
|
||||
|
||||
List list1 = world.a(EntityMinecartAbstract.class, AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)), IEntitySelector.b);
|
||||
List list1 = world.a(EntityMinecartAbstract.class, AxisAlignedBB.a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)), IEntitySelector.c);
|
||||
|
||||
if (list1.size() > 0) {
|
||||
return Container.b((IInventory) list1.get(0));
|
||||
|
@ -64,7 +64,7 @@ public class BlockMushroom extends BlockPlant implements IBlockFragilePlantEleme
|
||||
// CraftBukkit start
|
||||
org.bukkit.World bworld = world.getWorld();
|
||||
BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
|
||||
blockState.setTypeId(Block.b(this)); // nms: this.id, 0, 2
|
||||
blockState.setType(org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(this)); // nms: this.id, 0, 2
|
||||
|
||||
BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(sourceX, sourceY, sourceZ), blockState);
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
|
@ -4,6 +4,7 @@ import java.util.Random;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
import org.bukkit.event.block.BlockFadeEvent;
|
||||
import org.bukkit.event.block.BlockSpreadEvent;
|
||||
// CraftBukkit end
|
||||
@ -22,7 +23,7 @@ public class BlockMycel extends Block {
|
||||
// CraftBukkit start
|
||||
org.bukkit.World bworld = world.getWorld();
|
||||
BlockState blockState = bworld.getBlockAt(i, j, k).getState();
|
||||
blockState.setTypeId(Block.b(Blocks.DIRT));
|
||||
blockState.setType(CraftMagicNumbers.getMaterial(Blocks.DIRT));
|
||||
|
||||
BlockFadeEvent event = new BlockFadeEvent(blockState.getBlock(), blockState);
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
@ -42,7 +43,7 @@ public class BlockMycel extends Block {
|
||||
// CraftBukkit start
|
||||
org.bukkit.World bworld = world.getWorld();
|
||||
BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
|
||||
blockState.setTypeId(Block.b(this));
|
||||
blockState.setType(CraftMagicNumbers.getMaterial(this));
|
||||
|
||||
BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState);
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
|
@ -27,7 +27,7 @@ public class BlockPortal extends BlockHalfTransparent {
|
||||
Entity entity = ItemMonsterEgg.spawnCreature(world, 57, (double) i + 0.5D, (double) l + 1.1D, (double) k + 0.5D, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL);
|
||||
|
||||
if (entity != null) {
|
||||
entity.portalCooldown = entity.ai();
|
||||
entity.portalCooldown = entity.ah();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -112,7 +112,7 @@ public class BlockPortal extends BlockHalfTransparent {
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
// CraftBukkit end
|
||||
|
||||
entity.ah();
|
||||
entity.ag();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ public abstract class BlockPressurePlateAbstract extends Block {
|
||||
protected AxisAlignedBB a(int i, int j, int k) {
|
||||
float f = 0.125F;
|
||||
|
||||
return AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f));
|
||||
return AxisAlignedBB.a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) j + 0.25D, (double) ((float) (k + 1) - f));
|
||||
}
|
||||
|
||||
public void remove(World world, int i, int j, int k, Block block, int l) {
|
||||
|
@ -63,7 +63,7 @@ public class BlockPressurePlateBinary extends BlockPressurePlateAbstract {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (!entity.az()) {
|
||||
if (!entity.ay()) {
|
||||
return 15;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit
|
||||
|
||||
public class BlockPressurePlateWeighted extends BlockPressurePlateAbstract {
|
||||
|
@ -33,6 +33,7 @@ public class BlockPumpkin extends BlockDirectional {
|
||||
if (world.addEntity(entitysnowman, SpawnReason.BUILD_SNOWMAN)) {
|
||||
blockList.updateList();
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
for (int l = 0; l < 120; ++l) {
|
||||
|
@ -156,8 +156,8 @@ public class BlockSkull extends BlockContainer {
|
||||
if (!world.isStatic) {
|
||||
entitywither = new EntityWither(world);
|
||||
entitywither.setPositionRotation((double) i + 0.5D, (double) j - 1.45D, (double) (k + l) + 1.5D, 90.0F, 0.0F);
|
||||
entitywither.aN = 90.0F;
|
||||
entitywither.bX();
|
||||
entitywither.aM = 90.0F;
|
||||
entitywither.bZ();
|
||||
|
||||
if (world.addEntity(entitywither, SpawnReason.BUILD_WITHER)) {
|
||||
if (!world.isStatic) {
|
||||
@ -200,7 +200,7 @@ public class BlockSkull extends BlockContainer {
|
||||
if (!world.isStatic) {
|
||||
entitywither = new EntityWither(world);
|
||||
entitywither.setPositionRotation((double) (i + l) + 1.5D, (double) j - 1.45D, (double) k + 0.5D, 0.0F, 0.0F);
|
||||
entitywither.bX();
|
||||
entitywither.bZ();
|
||||
|
||||
if (world.addEntity(entitywither, SpawnReason.BUILD_WITHER)) {
|
||||
if (!world.isStatic) {
|
||||
|
@ -16,7 +16,7 @@ public class BlockSnow extends Block {
|
||||
int l = world.getData(i, j, k) & 7;
|
||||
float f = 0.125F;
|
||||
|
||||
return AxisAlignedBB.a().a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) ((float) j + (float) l * f), (double) k + this.maxZ);
|
||||
return AxisAlignedBB.a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) ((float) j + (float) l * f), (double) k + this.maxZ);
|
||||
}
|
||||
|
||||
public boolean c() {
|
||||
@ -67,7 +67,7 @@ public class BlockSnow extends Block {
|
||||
|
||||
this.a(world, i, j, k, new ItemStack(Items.SNOW_BALL, i1 + 1, 0));
|
||||
world.setAir(i, j, k);
|
||||
entityhuman.a(StatisticList.C[Block.b((Block) this)], 1);
|
||||
entityhuman.a(StatisticList.MINE_BLOCK_COUNT[Block.b((Block) this)], 1);
|
||||
}
|
||||
|
||||
public Item getDropType(int i, Random random, int j) {
|
||||
|
@ -17,7 +17,7 @@ public class BlockSoil extends Block {
|
||||
}
|
||||
|
||||
public AxisAlignedBB a(World world, int i, int j, int k) {
|
||||
return AxisAlignedBB.a().a((double) (i + 0), (double) (j + 0), (double) (k + 0), (double) (i + 1), (double) (j + 1), (double) (k + 1));
|
||||
return AxisAlignedBB.a((double) (i + 0), (double) (j + 0), (double) (k + 0), (double) (i + 1), (double) (j + 1), (double) (k + 1));
|
||||
}
|
||||
|
||||
public boolean c() {
|
||||
|
@ -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.bD() != null && entityhuman.bD().getItem() == Items.SHEARS) {
|
||||
if (entityhuman.bE() != null && entityhuman.bE().getItem() == Items.SHEARS) {
|
||||
world.setData(i, j, k, l | 8, 4);
|
||||
}
|
||||
}
|
||||
@ -132,7 +132,7 @@ public class BlockTripwire extends Block {
|
||||
int l = world.getData(i, j, k);
|
||||
boolean flag = (l & 1) == 1;
|
||||
boolean flag1 = false;
|
||||
List list = world.getEntities((Entity) null, AxisAlignedBB.a().a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ));
|
||||
List list = world.getEntities((Entity) null, AxisAlignedBB.a((double) i + this.minX, (double) j + this.minY, (double) k + this.minZ, (double) i + this.maxX, (double) j + this.maxY, (double) k + this.maxZ));
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
Iterator iterator = list.iterator();
|
||||
@ -140,7 +140,7 @@ public class BlockTripwire extends Block {
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
|
||||
if (!entity.az()) {
|
||||
if (!entity.ay()) {
|
||||
flag1 = true;
|
||||
break;
|
||||
}
|
||||
|
@ -294,8 +294,8 @@ public class BlockVine extends Block {
|
||||
}
|
||||
|
||||
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
if (!world.isStatic && entityhuman.bD() != null && entityhuman.bD().getItem() == Items.SHEARS) {
|
||||
entityhuman.a(StatisticList.C[Block.b((Block) this)], 1);
|
||||
if (!world.isStatic && entityhuman.bE() != null && entityhuman.bE().getItem() == Items.SHEARS) {
|
||||
entityhuman.a(StatisticList.MINE_BLOCK_COUNT[Block.b((Block) this)], 1);
|
||||
this.a(world, i, j, k, new ItemStack(Blocks.VINE, 1, 0));
|
||||
} else {
|
||||
super.a(world, entityhuman, i, j, k, l);
|
||||
|
@ -591,7 +591,7 @@ public class Chunk {
|
||||
if (i != this.locX || j != this.locZ) {
|
||||
// CraftBukkit start
|
||||
Bukkit.getLogger().warning("Wrong location for " + entity + " in world '" + world.getWorld().getName() + "'!");
|
||||
// t.error("Wrong location! " + entity);
|
||||
// t.warn("Wrong location! " + entity + " (at " + i + ", " + j + " instead of " + this.locX + ", " + this.locZ + ")");
|
||||
// Thread.dumpStack();
|
||||
Bukkit.getLogger().warning("Entity is at " + entity.locX + "," + entity.locZ + " (chunk " + i + "," + j + ") but was stored in chunk " + this.locX + "," + this.locZ);
|
||||
// CraftBukkit end
|
||||
@ -607,15 +607,15 @@ public class Chunk {
|
||||
k = this.entitySlices.length - 1;
|
||||
}
|
||||
|
||||
entity.ah = true;
|
||||
entity.ai = this.locX;
|
||||
entity.aj = k;
|
||||
entity.ak = this.locZ;
|
||||
entity.ag = true;
|
||||
entity.ah = this.locX;
|
||||
entity.ai = k;
|
||||
entity.aj = this.locZ;
|
||||
this.entitySlices[k].add(entity);
|
||||
}
|
||||
|
||||
public void b(Entity entity) {
|
||||
this.a(entity, entity.aj);
|
||||
this.a(entity, entity.ai);
|
||||
}
|
||||
|
||||
public void a(Entity entity, int i) {
|
||||
@ -685,7 +685,7 @@ public class Chunk {
|
||||
// CraftBukkit start
|
||||
} else {
|
||||
System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.x + "," + tileentity.y + "," + tileentity.z
|
||||
+ " (" + org.bukkit.Material.getMaterial(Block.b(getType(i, j, k))) + ") where there was no entity tile!");
|
||||
+ " (" + org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(getType(i, j, k)) + ") where there was no entity tile!");
|
||||
System.out.println("Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16));
|
||||
new Exception().printStackTrace();
|
||||
// CraftBukkit end
|
||||
@ -714,7 +714,7 @@ public class Chunk {
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
|
||||
entity.X();
|
||||
entity.W();
|
||||
}
|
||||
|
||||
this.world.a(this.entitySlices[i]);
|
||||
@ -768,7 +768,7 @@ public class Chunk {
|
||||
|
||||
if (entity1 != entity && entity1.boundingBox.b(axisalignedbb) && (ientityselector == null || ientityselector.a(entity1))) {
|
||||
list.add(entity1);
|
||||
Entity[] aentity = entity1.at();
|
||||
Entity[] aentity = entity1.as();
|
||||
|
||||
if (aentity != null) {
|
||||
for (int i1 = 0; i1 < aentity.length; ++i1) {
|
||||
|
@ -2,10 +2,11 @@ package net.minecraft.server;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@ -45,6 +46,13 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
return this.chunks.containsKey(LongHash.toLong(i, j)); // CraftBukkit
|
||||
}
|
||||
|
||||
// CraftBukkit start - Change return type to Collection and return the values of our chunk map
|
||||
public java.util.Collection a() {
|
||||
// return this.chunkList;
|
||||
return this.chunks.values();
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public void queueUnload(int i, int j) {
|
||||
if (this.world.worldProvider.e()) {
|
||||
ChunkCoordinates chunkcoordinates = this.world.getSpawn();
|
||||
@ -74,7 +82,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
}
|
||||
}
|
||||
|
||||
public void a() {
|
||||
public void b() {
|
||||
Iterator iterator = this.chunks.values().iterator(); // CraftBukkit
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@ -291,7 +299,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void b() {
|
||||
public void c() {
|
||||
if (this.f != null) {
|
||||
this.f.b();
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
public void a(World world, Chunk chunk) {
|
||||
// CraftBukkit start - "handle" exception
|
||||
try {
|
||||
world.F();
|
||||
world.G();
|
||||
} catch (ExceptionWorldConflict ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
@ -167,12 +167,12 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener {
|
||||
} catch (Throwable exception) {
|
||||
if(this instanceof TileEntityCommandListener) {
|
||||
TileEntityCommandListener listener = (TileEntityCommandListener) this;
|
||||
MinecraftServer.av().log(Level.WARN, String.format("CommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), exception);
|
||||
MinecraftServer.getLogger().log(Level.WARN, String.format("CommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), exception);
|
||||
} else if (this instanceof EntityMinecartCommandBlockListener) {
|
||||
EntityMinecartCommandBlockListener listener = (EntityMinecartCommandBlockListener) this;
|
||||
MinecraftServer.av().log(Level.WARN, String.format("MinecartCommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), exception);
|
||||
MinecraftServer.getLogger().log(Level.WARN, String.format("MinecartCommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), exception);
|
||||
} else {
|
||||
MinecraftServer.av().log(Level.WARN, String.format("Unknown CommandBlock failed to handle command"), exception);
|
||||
MinecraftServer.getLogger().log(Level.WARN, String.format("Unknown CommandBlock failed to handle command"), exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public abstract class Container {
|
||||
public List b = new ArrayList();
|
||||
public List c = new ArrayList();
|
||||
public int windowId;
|
||||
private int f = -1;
|
||||
private int dragType = -1;
|
||||
public int g; // CraftBukkit - private -> public
|
||||
private final Set h = new HashSet();
|
||||
protected List listeners = new ArrayList();
|
||||
@ -125,8 +125,8 @@ public abstract class Container {
|
||||
} else if (playerinventory.getCarried() == null) {
|
||||
this.d();
|
||||
} else if (this.g == 0) {
|
||||
this.f = b(j);
|
||||
if (d(this.f)) {
|
||||
this.dragType = b(j);
|
||||
if (d(this.dragType)) {
|
||||
this.g = 1;
|
||||
this.h.clear();
|
||||
} else {
|
||||
@ -150,15 +150,15 @@ public abstract class Container {
|
||||
|
||||
if (slot1 != null && a(slot1, playerinventory.getCarried(), true) && slot1.isAllowed(playerinventory.getCarried()) && playerinventory.getCarried().count >= this.h.size() && this.b(slot1)) {
|
||||
ItemStack itemstack2 = itemstack1.cloneItemStack();
|
||||
int j1 = slot1.e() ? slot1.getItem().count : 0;
|
||||
int j1 = slot1.hasItem() ? slot1.getItem().count : 0;
|
||||
|
||||
a(this.h, this.f, itemstack2, j1);
|
||||
a(this.h, this.dragType, itemstack2, j1);
|
||||
if (itemstack2.count > itemstack2.getMaxStackSize()) {
|
||||
itemstack2.count = itemstack2.getMaxStackSize();
|
||||
}
|
||||
|
||||
if (itemstack2.count > slot1.a()) {
|
||||
itemstack2.count = slot1.a();
|
||||
if (itemstack2.count > slot1.getMaxStackSize()) {
|
||||
itemstack2.count = slot1.getMaxStackSize();
|
||||
}
|
||||
|
||||
l -= itemstack2.count - j1;
|
||||
@ -179,7 +179,7 @@ public abstract class Container {
|
||||
ItemStack oldCursor = playerinventory.getCarried();
|
||||
playerinventory.setCarried(CraftItemStack.asNMSCopy(newcursor));
|
||||
|
||||
InventoryDragEvent event = new InventoryDragEvent(view, (newcursor.getType() != org.bukkit.Material.AIR ? newcursor : null), CraftItemStack.asBukkitCopy(oldCursor), this.f == 1, eventmap); // Should be dragButton
|
||||
InventoryDragEvent event = new InventoryDragEvent(view, (newcursor.getType() != org.bukkit.Material.AIR ? newcursor : null), CraftItemStack.asBukkitCopy(oldCursor), this.dragType == 1, eventmap);
|
||||
entityhuman.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
// Whether or not a change was made to the inventory that requires an update.
|
||||
@ -244,7 +244,7 @@ public abstract class Container {
|
||||
}
|
||||
|
||||
slot2 = (Slot) this.c.get(i);
|
||||
if (slot2 != null && slot2.a(entityhuman)) {
|
||||
if (slot2 != null && slot2.isAllowed(entityhuman)) {
|
||||
itemstack1 = this.b(entityhuman, i);
|
||||
if (itemstack1 != null) {
|
||||
Item item = itemstack1.getItem();
|
||||
@ -272,8 +272,8 @@ public abstract class Container {
|
||||
if (itemstack1 == null) {
|
||||
if (itemstack4 != null && slot2.isAllowed(itemstack4)) {
|
||||
k1 = j == 0 ? itemstack4.count : 1;
|
||||
if (k1 > slot2.a()) {
|
||||
k1 = slot2.a();
|
||||
if (k1 > slot2.getMaxStackSize()) {
|
||||
k1 = slot2.getMaxStackSize();
|
||||
}
|
||||
|
||||
if (itemstack4.count >= k1) {
|
||||
@ -284,7 +284,7 @@ public abstract class Container {
|
||||
playerinventory.setCarried((ItemStack) null);
|
||||
}
|
||||
}
|
||||
} else if (slot2.a(entityhuman)) {
|
||||
} else if (slot2.isAllowed(entityhuman)) {
|
||||
if (itemstack4 == null) {
|
||||
k1 = j == 0 ? itemstack1.count : (itemstack1.count + 1) / 2;
|
||||
itemstack3 = slot2.a(k1);
|
||||
@ -297,8 +297,8 @@ public abstract class Container {
|
||||
} else if (slot2.isAllowed(itemstack4)) {
|
||||
if (itemstack1.getItem() == itemstack4.getItem() && itemstack1.getData() == itemstack4.getData() && ItemStack.equals(itemstack1, itemstack4)) {
|
||||
k1 = j == 0 ? itemstack4.count : 1;
|
||||
if (k1 > slot2.a() - itemstack1.count) {
|
||||
k1 = slot2.a() - itemstack1.count;
|
||||
if (k1 > slot2.getMaxStackSize() - itemstack1.count) {
|
||||
k1 = slot2.getMaxStackSize() - itemstack1.count;
|
||||
}
|
||||
|
||||
if (k1 > itemstack4.getMaxStackSize() - itemstack1.count) {
|
||||
@ -311,7 +311,7 @@ public abstract class Container {
|
||||
}
|
||||
|
||||
itemstack1.count += k1;
|
||||
} else if (itemstack4.count <= slot2.a()) {
|
||||
} else if (itemstack4.count <= slot2.getMaxStackSize()) {
|
||||
slot2.set(itemstack4);
|
||||
playerinventory.setCarried(itemstack1);
|
||||
}
|
||||
@ -334,17 +334,17 @@ public abstract class Container {
|
||||
}
|
||||
} else if (k == 2 && j >= 0 && j < 9) {
|
||||
slot2 = (Slot) this.c.get(i);
|
||||
if (slot2.a(entityhuman)) {
|
||||
if (slot2.isAllowed(entityhuman)) {
|
||||
itemstack1 = playerinventory.getItem(j);
|
||||
boolean flag = itemstack1 == null || slot2.inventory == playerinventory && slot2.isAllowed(itemstack1);
|
||||
|
||||
k1 = -1;
|
||||
if (!flag) {
|
||||
k1 = playerinventory.j();
|
||||
k1 = playerinventory.getFirstEmptySlotIndex();
|
||||
flag |= k1 > -1;
|
||||
}
|
||||
|
||||
if (slot2.e() && flag) {
|
||||
if (slot2.hasItem() && flag) {
|
||||
itemstack3 = slot2.getItem();
|
||||
playerinventory.setItem(j, itemstack3.cloneItemStack());
|
||||
if ((slot2.inventory != playerinventory || !slot2.isAllowed(itemstack1)) && itemstack1 != null) {
|
||||
@ -359,21 +359,21 @@ public abstract class Container {
|
||||
slot2.set(itemstack1);
|
||||
slot2.a(entityhuman, itemstack3);
|
||||
}
|
||||
} else if (!slot2.e() && itemstack1 != null && slot2.isAllowed(itemstack1)) {
|
||||
} else if (!slot2.hasItem() && itemstack1 != null && slot2.isAllowed(itemstack1)) {
|
||||
playerinventory.setItem(j, (ItemStack) null);
|
||||
slot2.set(itemstack1);
|
||||
}
|
||||
}
|
||||
} else if (k == 3 && entityhuman.abilities.canInstantlyBuild && playerinventory.getCarried() == null && i >= 0) {
|
||||
slot2 = (Slot) this.c.get(i);
|
||||
if (slot2 != null && slot2.e()) {
|
||||
if (slot2 != null && slot2.hasItem()) {
|
||||
itemstack1 = slot2.getItem().cloneItemStack();
|
||||
itemstack1.count = itemstack1.getMaxStackSize();
|
||||
playerinventory.setCarried(itemstack1);
|
||||
}
|
||||
} else if (k == 4 && playerinventory.getCarried() == null && i >= 0) {
|
||||
slot2 = (Slot) this.c.get(i);
|
||||
if (slot2 != null && slot2.e() && slot2.a(entityhuman)) {
|
||||
if (slot2 != null && slot2.hasItem() && slot2.isAllowed(entityhuman)) {
|
||||
itemstack1 = slot2.a(j == 0 ? 1 : slot2.getItem().count);
|
||||
slot2.a(entityhuman, itemstack1);
|
||||
entityhuman.drop(itemstack1, true);
|
||||
@ -381,7 +381,7 @@ public abstract class Container {
|
||||
} else if (k == 6 && i >= 0) {
|
||||
slot2 = (Slot) this.c.get(i);
|
||||
itemstack1 = playerinventory.getCarried();
|
||||
if (itemstack1 != null && (slot2 == null || !slot2.e() || !slot2.a(entityhuman))) {
|
||||
if (itemstack1 != null && (slot2 == null || !slot2.hasItem() || !slot2.isAllowed(entityhuman))) {
|
||||
l = j == 0 ? 0 : this.c.size() - 1;
|
||||
k1 = j == 0 ? 1 : -1;
|
||||
|
||||
@ -389,7 +389,7 @@ public abstract class Container {
|
||||
for (int i2 = l; i2 >= 0 && i2 < this.c.size() && itemstack1.count < itemstack1.getMaxStackSize(); i2 += k1) {
|
||||
Slot slot3 = (Slot) this.c.get(i2);
|
||||
|
||||
if (slot3.e() && a(slot3, itemstack1, true) && slot3.a(entityhuman) && this.a(itemstack1, slot3) && (l1 != 0 || slot3.getItem().count != slot3.getItem().getMaxStackSize())) {
|
||||
if (slot3.hasItem() && a(slot3, itemstack1, true) && slot3.isAllowed(entityhuman) && this.a(itemstack1, slot3) && (l1 != 0 || slot3.getItem().count != slot3.getItem().getMaxStackSize())) {
|
||||
int j2 = Math.min(itemstack1.getMaxStackSize() - itemstack1.count, slot3.getItem().count);
|
||||
ItemStack itemstack5 = slot3.a(j2);
|
||||
|
||||
@ -536,9 +536,9 @@ public abstract class Container {
|
||||
}
|
||||
|
||||
public static boolean a(Slot slot, ItemStack itemstack, boolean flag) {
|
||||
boolean flag1 = slot == null || !slot.e();
|
||||
boolean flag1 = slot == null || !slot.hasItem();
|
||||
|
||||
if (slot != null && slot.e() && itemstack != null && itemstack.doMaterialsMatch(slot.getItem()) && ItemStack.equals(slot.getItem(), itemstack)) {
|
||||
if (slot != null && slot.hasItem() && itemstack != null && itemstack.doMaterialsMatch(slot.getItem()) && ItemStack.equals(slot.getItem(), itemstack)) {
|
||||
int i = flag ? 0 : itemstack.count;
|
||||
|
||||
flag1 |= slot.getItem().count + i <= itemstack.getMaxStackSize();
|
||||
|
@ -329,7 +329,7 @@ public class ContainerAnvil extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.e()) {
|
||||
if (slot != null && slot.hasItem()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -365,7 +365,7 @@ public class ContainerAnvil extends Container {
|
||||
|
||||
public void a(String s) {
|
||||
this.n = s;
|
||||
if (this.getSlot(2).e()) {
|
||||
if (this.getSlot(2).hasItem()) {
|
||||
ItemStack itemstack = this.getSlot(2).getItem();
|
||||
|
||||
if (StringUtils.isBlank(s)) {
|
||||
|
@ -58,7 +58,7 @@ public class ContainerBeacon extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.e()) {
|
||||
if (slot != null && slot.hasItem()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -68,7 +68,7 @@ public class ContainerBeacon extends Container {
|
||||
}
|
||||
|
||||
slot.a(itemstack1, itemstack);
|
||||
} else if (!this.f.e() && this.f.isAllowed(itemstack1) && itemstack1.count == 1) {
|
||||
} else if (!this.f.hasItem() && this.f.isAllowed(itemstack1) && itemstack1.count == 1) {
|
||||
if (!this.a(itemstack1, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -64,12 +64,12 @@ public class ContainerBrewingStand extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.e()) {
|
||||
if (slot != null && slot.hasItem()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
if ((i < 0 || i > 2) && i != 3) {
|
||||
if (!this.f.e() && this.f.isAllowed(itemstack1)) {
|
||||
if (!this.f.hasItem() && this.f.isAllowed(itemstack1)) {
|
||||
if (!this.a(itemstack1, 3, 4, false)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ public class ContainerChest extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.e()) {
|
||||
if (slot != null && slot.hasItem()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
|
@ -49,7 +49,7 @@ public class ContainerDispenser extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.e()) {
|
||||
if (slot != null && slot.hasItem()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
|
@ -226,7 +226,7 @@ public class ContainerEnchantTable extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.e()) {
|
||||
if (slot != null && slot.hasItem()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -235,7 +235,7 @@ public class ContainerEnchantTable extends Container {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if (((Slot) this.c.get(0)).e() || !((Slot) this.c.get(0)).isAllowed(itemstack1)) {
|
||||
if (((Slot) this.c.get(0)).hasItem() || !((Slot) this.c.get(0)).isAllowed(itemstack1)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ public class ContainerFurnace extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.e()) {
|
||||
if (slot != null && slot.hasItem()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
|
@ -56,7 +56,7 @@ public class ContainerHopper extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.e()) {
|
||||
if (slot != null && slot.hasItem()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
|
@ -60,14 +60,14 @@ public class ContainerHorse extends Container {
|
||||
}
|
||||
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
return this.a.a(entityhuman) && this.f.isAlive() && this.f.d(entityhuman) < 8.0F;
|
||||
return this.a.a(entityhuman) && this.f.isAlive() && this.f.e(entityhuman) < 8.0F;
|
||||
}
|
||||
|
||||
public ItemStack b(EntityHuman entityhuman, int i) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.e()) {
|
||||
if (slot != null && slot.hasItem()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -75,7 +75,7 @@ public class ContainerHorse extends Container {
|
||||
if (!this.a(itemstack1, this.a.getSize(), this.c.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else if (this.getSlot(1).isAllowed(itemstack1) && !this.getSlot(1).e()) {
|
||||
} else if (this.getSlot(1).isAllowed(itemstack1) && !this.getSlot(1).hasItem()) {
|
||||
if (!this.a(itemstack1, 1, 2, false)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public class ContainerMerchant extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.e()) {
|
||||
if (slot != null && slot.hasItem()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
|
@ -87,7 +87,7 @@ public class ContainerPlayer extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.e()) {
|
||||
if (slot != null && slot.hasItem()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
@ -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.c.get(5 + ((ItemArmor) itemstack.getItem()).b)).e()) {
|
||||
} else if (itemstack.getItem() instanceof ItemArmor && !((Slot) this.c.get(5 + ((ItemArmor) itemstack.getItem()).b)).hasItem()) {
|
||||
int j = 5 + ((ItemArmor) itemstack.getItem()).b;
|
||||
|
||||
if (!this.a(itemstack1, j, j + 1, false)) {
|
||||
|
@ -89,7 +89,7 @@ public class ContainerWorkbench extends Container {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.c.get(i);
|
||||
|
||||
if (slot != null && slot.e()) {
|
||||
if (slot != null && slot.hasItem()) {
|
||||
ItemStack itemstack1 = slot.getItem();
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
|
@ -53,20 +53,20 @@ public class ControllerLook {
|
||||
// CraftBukkit end
|
||||
|
||||
this.a.pitch = this.a(this.a.pitch, f1, this.c);
|
||||
this.a.aP = this.a(this.a.aP, f, this.b);
|
||||
this.a.aO = this.a(this.a.aO, f, this.b);
|
||||
} else {
|
||||
this.a.aP = this.a(this.a.aP, this.a.aN, 10.0F);
|
||||
this.a.aO = this.a(this.a.aO, this.a.aM, 10.0F);
|
||||
}
|
||||
|
||||
float f2 = MathHelper.g(this.a.aP - this.a.aN);
|
||||
float f2 = MathHelper.g(this.a.aO - this.a.aM);
|
||||
|
||||
if (!this.a.getNavigation().g()) {
|
||||
if (f2 < -75.0F) {
|
||||
this.a.aP = this.a.aN - 75.0F;
|
||||
this.a.aO = this.a.aM - 75.0F;
|
||||
}
|
||||
|
||||
if (f2 > 75.0F) {
|
||||
this.a.aP = this.a.aN + 75.0F;
|
||||
this.a.aO = this.a.aM + 75.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -181,9 +181,14 @@ public class CrashReport {
|
||||
StackTraceElement[] astacktraceelement = this.c.getStackTrace();
|
||||
StackTraceElement stacktraceelement = null;
|
||||
StackTraceElement stacktraceelement1 = null;
|
||||
int k = astacktraceelement.length - j;
|
||||
|
||||
if (astacktraceelement != null && astacktraceelement.length - j < astacktraceelement.length) {
|
||||
stacktraceelement = astacktraceelement[astacktraceelement.length - j];
|
||||
if (k < 0) {
|
||||
System.out.println("Negative index in crash report handler (" + astacktraceelement.length + "/" + j + ")");
|
||||
}
|
||||
|
||||
if (astacktraceelement != null && 0 <= k && k < astacktraceelement.length) {
|
||||
stacktraceelement = astacktraceelement[k];
|
||||
if (astacktraceelement.length + 1 - j < astacktraceelement.length) {
|
||||
stacktraceelement1 = astacktraceelement[astacktraceelement.length + 1 - j];
|
||||
}
|
||||
@ -194,7 +199,7 @@ public class CrashReport {
|
||||
CrashReportSystemDetails crashreportsystemdetails1 = (CrashReportSystemDetails) this.e.get(this.e.size() - 1);
|
||||
|
||||
crashreportsystemdetails1.b(j);
|
||||
} else if (astacktraceelement != null && astacktraceelement.length >= j) {
|
||||
} else if (astacktraceelement != null && astacktraceelement.length >= j && 0 <= k && k < astacktraceelement.length) {
|
||||
this.h = new StackTraceElement[astacktraceelement.length - j];
|
||||
System.arraycopy(astacktraceelement, 0, this.h, 0, this.h.length);
|
||||
} else {
|
||||
@ -207,7 +212,7 @@ public class CrashReport {
|
||||
}
|
||||
|
||||
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!"};
|
||||
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!", "But it works on my machine."};
|
||||
|
||||
try {
|
||||
return astring[(int) (System.nanoTime() % (long) astring.length)];
|
||||
|
@ -67,14 +67,14 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true));
|
||||
// CraftBukkit end
|
||||
|
||||
h.info("Starting minecraft server version 1.7.2");
|
||||
h.info("Starting minecraft server version 1.7.5");
|
||||
if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
|
||||
h.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
|
||||
}
|
||||
|
||||
h.info("Loading properties");
|
||||
this.propertyManager = new PropertyManager(this.options); // CraftBukkit - CLI argument support
|
||||
if (this.L()) {
|
||||
if (this.M()) {
|
||||
this.c("127.0.0.1");
|
||||
} else {
|
||||
this.setOnlineMode(this.propertyManager.getBoolean("online-mode", true));
|
||||
@ -88,7 +88,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
this.setTexturePack(this.propertyManager.getString("resource-pack", ""));
|
||||
this.setMotd(this.propertyManager.getString("motd", "A Minecraft Server"));
|
||||
this.setForceGamemode(this.propertyManager.getBoolean("force-gamemode", false));
|
||||
this.d(this.propertyManager.getInt("player-idle-timeout", 0));
|
||||
this.setIdleTimeout(this.propertyManager.getInt("player-idle-timeout", 0));
|
||||
if (this.propertyManager.getInt("difficulty", 1) < 0) {
|
||||
this.propertyManager.a("difficulty", Integer.valueOf(0));
|
||||
} else if (this.propertyManager.getInt("difficulty", 1) > 3) {
|
||||
@ -106,16 +106,16 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
inetaddress = InetAddress.getByName(this.getServerIp());
|
||||
}
|
||||
|
||||
if (this.J() < 0) {
|
||||
if (this.K() < 0) {
|
||||
this.setPort(this.propertyManager.getInt("server-port", 25565));
|
||||
}
|
||||
|
||||
h.info("Generating keypair");
|
||||
this.a(MinecraftEncryption.b());
|
||||
h.info("Starting Minecraft server on " + (this.getServerIp().length() == 0 ? "*" : this.getServerIp()) + ":" + this.J());
|
||||
h.info("Starting Minecraft server on " + (this.getServerIp().length() == 0 ? "*" : this.getServerIp()) + ":" + this.K());
|
||||
|
||||
try {
|
||||
this.ag().a(inetaddress, this.J());
|
||||
this.ah().a(inetaddress, this.K());
|
||||
} catch (Throwable ioexception) { // CraftBukkit - IOException -> Throwable
|
||||
h.warn("**** FAILED TO BIND TO PORT!");
|
||||
h.warn("The exception was: {}", new Object[] { ioexception.toString()});
|
||||
@ -136,7 +136,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
this.convertable = new WorldLoaderServer(server.getWorldContainer()); // CraftBukkit - moved from MinecraftServer constructor
|
||||
long j = System.nanoTime();
|
||||
|
||||
if (this.M() == null) {
|
||||
if (this.N() == null) {
|
||||
this.k(this.propertyManager.getString("level-name", "world"));
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
worldtype = WorldType.NORMAL;
|
||||
}
|
||||
|
||||
this.ar();
|
||||
this.as();
|
||||
this.getEnableCommandBlock();
|
||||
this.l();
|
||||
this.getSnooperEnabled();
|
||||
@ -172,7 +172,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
this.c(MathHelper.a(this.getMaxBuildHeight(), 64, 256));
|
||||
this.propertyManager.a("max-build-height", Integer.valueOf(this.getMaxBuildHeight()));
|
||||
h.info("Preparing level \"" + this.M() + "\"");
|
||||
this.a(this.M(), this.M(), k, worldtype, s2);
|
||||
this.a(this.N(), this.N(), k, worldtype, s2);
|
||||
long i1 = System.nanoTime() - j;
|
||||
String s3 = String.format("%.3fs", new Object[] { Double.valueOf((double) i1 / 1.0E9D)});
|
||||
|
||||
@ -225,7 +225,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
|
||||
protected void a(CrashReport crashreport) {
|
||||
while (this.isRunning()) {
|
||||
this.aw();
|
||||
this.ax();
|
||||
|
||||
try {
|
||||
Thread.sleep(10L);
|
||||
@ -242,13 +242,13 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
return crashreport;
|
||||
}
|
||||
|
||||
protected void s() {
|
||||
protected void t() {
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void u() { // CraftBukkit - protected -> public
|
||||
super.u();
|
||||
this.aw();
|
||||
public void v() { // CraftBukkit - protected -> public
|
||||
super.v();
|
||||
this.ax();
|
||||
}
|
||||
|
||||
public boolean getAllowNether() {
|
||||
@ -260,8 +260,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
}
|
||||
|
||||
public void a(MojangStatisticsGenerator mojangstatisticsgenerator) {
|
||||
mojangstatisticsgenerator.a("whitelist_enabled", Boolean.valueOf(this.ax().getHasWhitelist()));
|
||||
mojangstatisticsgenerator.a("whitelist_count", Integer.valueOf(this.ax().getWhitelisted().size()));
|
||||
mojangstatisticsgenerator.a("whitelist_enabled", Boolean.valueOf(this.ay().getHasWhitelist()));
|
||||
mojangstatisticsgenerator.a("whitelist_count", Integer.valueOf(this.ay().getWhitelisted().size()));
|
||||
super.a(mojangstatisticsgenerator);
|
||||
}
|
||||
|
||||
@ -273,7 +273,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
this.i.add(new ServerCommand(s, icommandlistener));
|
||||
}
|
||||
|
||||
public void aw() {
|
||||
public void ax() {
|
||||
while (!this.i.isEmpty()) {
|
||||
ServerCommand servercommand = (ServerCommand) this.i.remove(0);
|
||||
|
||||
@ -288,11 +288,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
}
|
||||
}
|
||||
|
||||
public boolean V() {
|
||||
public boolean W() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public DedicatedPlayerList ax() {
|
||||
public DedicatedPlayerList ay() {
|
||||
return (DedicatedPlayerList) super.getPlayerList();
|
||||
}
|
||||
|
||||
@ -322,12 +322,12 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
return file1 != null ? file1.getAbsolutePath() : "No settings file";
|
||||
}
|
||||
|
||||
public void ay() {
|
||||
public void az() {
|
||||
ServerGUI.a(this);
|
||||
this.o = true;
|
||||
}
|
||||
|
||||
public boolean ai() {
|
||||
public boolean aj() {
|
||||
return this.o;
|
||||
}
|
||||
|
||||
@ -346,9 +346,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
public boolean a(World world, int i, int j, int k, EntityHuman entityhuman) {
|
||||
if (world.worldProvider.dimension != 0) {
|
||||
return false;
|
||||
} else if (this.ax().getOPs().isEmpty()) {
|
||||
} else if (this.ay().getOPs().isEmpty()) {
|
||||
return false;
|
||||
} else if (this.ax().isOp(entityhuman.getName())) {
|
||||
} else if (this.ay().isOp(entityhuman.getName())) {
|
||||
return false;
|
||||
} else if (this.getSpawnProtection() <= 0) {
|
||||
return false;
|
||||
@ -366,21 +366,24 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
return this.propertyManager.getInt("op-permission-level", 4);
|
||||
}
|
||||
|
||||
public void d(int i) {
|
||||
super.d(i);
|
||||
public void setIdleTimeout(int i) {
|
||||
super.setIdleTimeout(i);
|
||||
this.propertyManager.a("player-idle-timeout", Integer.valueOf(i));
|
||||
this.a();
|
||||
}
|
||||
|
||||
public boolean ar() {
|
||||
public boolean m() {
|
||||
return this.propertyManager.getBoolean("broadcast-rcon-to-ops", true);
|
||||
}
|
||||
|
||||
public boolean as() {
|
||||
return this.propertyManager.getBoolean("announce-player-achievements", true);
|
||||
}
|
||||
|
||||
public PlayerList getPlayerList() {
|
||||
return this.ax();
|
||||
return this.ay();
|
||||
}
|
||||
|
||||
static Logger az() {
|
||||
static Logger aA() {
|
||||
return h;
|
||||
}
|
||||
}
|
||||
|
@ -13,10 +13,10 @@ final class DispenseBehaviorArmor extends DispenseBehaviorItem {
|
||||
|
||||
protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.b(isourceblock.h());
|
||||
int i = isourceblock.getBlockX() + enumfacing.c();
|
||||
int j = isourceblock.getBlockY() + enumfacing.d();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.e();
|
||||
AxisAlignedBB axisalignedbb = AxisAlignedBB.a().a((double) i, (double) j, (double) k, (double) (i + 1), (double) (j + 1), (double) (k + 1));
|
||||
int i = isourceblock.getBlockX() + enumfacing.getAdjacentX();
|
||||
int j = isourceblock.getBlockY() + enumfacing.getAdjacentY();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ();
|
||||
AxisAlignedBB axisalignedbb = AxisAlignedBB.a((double) i, (double) j, (double) k, (double) (i + 1), (double) (j + 1), (double) (k + 1));
|
||||
List list = isourceblock.k().a(EntityLiving.class, axisalignedbb, (IEntitySelector) (new EntitySelectorEquipable(itemstack)));
|
||||
|
||||
if (list.size() > 0) {
|
||||
@ -44,7 +44,7 @@ final class DispenseBehaviorArmor extends DispenseBehaviorItem {
|
||||
itemstack.count++;
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem());
|
||||
if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) {
|
||||
idispensebehavior.a(isourceblock, eventStack);
|
||||
return itemstack;
|
||||
|
@ -14,12 +14,12 @@ final class DispenseBehaviorBoat extends DispenseBehaviorItem {
|
||||
public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.b(isourceblock.h());
|
||||
World world = isourceblock.k();
|
||||
double d0 = isourceblock.getX() + (double) ((float) enumfacing.c() * 1.125F);
|
||||
double d1 = isourceblock.getY() + (double) ((float) enumfacing.d() * 1.125F);
|
||||
double d2 = isourceblock.getZ() + (double) ((float) enumfacing.e() * 1.125F);
|
||||
int i = isourceblock.getBlockX() + enumfacing.c();
|
||||
int j = isourceblock.getBlockY() + enumfacing.d();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.e();
|
||||
double d0 = isourceblock.getX() + (double) ((float) enumfacing.getAdjacentX() * 1.125F);
|
||||
double d1 = isourceblock.getY() + (double) ((float) enumfacing.getAdjacentY() * 1.125F);
|
||||
double d2 = isourceblock.getZ() + (double) ((float) enumfacing.getAdjacentZ() * 1.125F);
|
||||
int i = isourceblock.getBlockX() + enumfacing.getAdjacentX();
|
||||
int j = isourceblock.getBlockY() + enumfacing.getAdjacentY();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ();
|
||||
Material material = world.getType(i, j, k).getMaterial();
|
||||
double d3;
|
||||
|
||||
@ -52,7 +52,7 @@ final class DispenseBehaviorBoat extends DispenseBehaviorItem {
|
||||
itemstack.count++;
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem());
|
||||
if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) {
|
||||
idispensebehavior.a(isourceblock, eventStack);
|
||||
return itemstack;
|
||||
|
@ -15,9 +15,9 @@ final class DispenseBehaviorBonemeal extends DispenseBehaviorItem {
|
||||
if (itemstack.getData() == 15) {
|
||||
EnumFacing enumfacing = BlockDispenser.b(isourceblock.h());
|
||||
World world = isourceblock.k();
|
||||
int i = isourceblock.getBlockX() + enumfacing.c();
|
||||
int j = isourceblock.getBlockY() + enumfacing.d();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.e();
|
||||
int i = isourceblock.getBlockX() + enumfacing.getAdjacentX();
|
||||
int j = isourceblock.getBlockY() + enumfacing.getAdjacentY();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ();
|
||||
|
||||
// CraftBukkit start
|
||||
org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockX(), isourceblock.getBlockY(), isourceblock.getBlockZ());
|
||||
@ -35,7 +35,7 @@ final class DispenseBehaviorBonemeal extends DispenseBehaviorItem {
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem());
|
||||
if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) {
|
||||
idispensebehavior.a(isourceblock, eventStack);
|
||||
return itemstack;
|
||||
|
@ -14,9 +14,9 @@ final class DispenseBehaviorEmptyBucket extends DispenseBehaviorItem {
|
||||
public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.b(isourceblock.h());
|
||||
World world = isourceblock.k();
|
||||
int i = isourceblock.getBlockX() + enumfacing.c();
|
||||
int j = isourceblock.getBlockY() + enumfacing.d();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.e();
|
||||
int i = isourceblock.getBlockX() + enumfacing.getAdjacentX();
|
||||
int j = isourceblock.getBlockY() + enumfacing.getAdjacentY();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ();
|
||||
Material material = world.getType(i, j, k).getMaterial();
|
||||
int l = world.getData(i, j, k);
|
||||
Item item;
|
||||
@ -47,7 +47,7 @@ final class DispenseBehaviorEmptyBucket extends DispenseBehaviorItem {
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem());
|
||||
if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) {
|
||||
idispensebehavior.a(isourceblock, eventStack);
|
||||
return itemstack;
|
||||
|
@ -20,9 +20,9 @@ final class DispenseBehaviorFilledBucket extends DispenseBehaviorItem {
|
||||
|
||||
// CraftBukkit start
|
||||
World world = isourceblock.k();
|
||||
int x = i + enumfacing.c();
|
||||
int y = j + enumfacing.d();
|
||||
int z = k + enumfacing.e();
|
||||
int x = i + enumfacing.getAdjacentX();
|
||||
int y = j + enumfacing.getAdjacentY();
|
||||
int z = k + enumfacing.getAdjacentZ();
|
||||
if (world.isEmpty(x, y, z) || !world.getType(x, y, z).getMaterial().isBuildable()) {
|
||||
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack);
|
||||
@ -39,7 +39,7 @@ final class DispenseBehaviorFilledBucket extends DispenseBehaviorItem {
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem());
|
||||
if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) {
|
||||
idispensebehavior.a(isourceblock, eventStack);
|
||||
return itemstack;
|
||||
@ -50,7 +50,7 @@ final class DispenseBehaviorFilledBucket extends DispenseBehaviorItem {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (itembucket.a(isourceblock.k(), i + enumfacing.c(), j + enumfacing.d(), k + enumfacing.e())) {
|
||||
if (itembucket.a(isourceblock.k(), i + enumfacing.getAdjacentX(), j + enumfacing.getAdjacentY(), k + enumfacing.getAdjacentZ())) {
|
||||
// CraftBukkit start - Handle stacked buckets
|
||||
Item item = Items.BUCKET;
|
||||
if (--itemstack.count == 0) {
|
||||
|
@ -14,14 +14,14 @@ final class DispenseBehaviorFireball extends DispenseBehaviorItem {
|
||||
public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.b(isourceblock.h());
|
||||
IPosition iposition = BlockDispenser.a(isourceblock);
|
||||
double d0 = iposition.getX() + (double) ((float) enumfacing.c() * 0.3F);
|
||||
double d1 = iposition.getY() + (double) ((float) enumfacing.c() * 0.3F);
|
||||
double d2 = iposition.getZ() + (double) ((float) enumfacing.e() * 0.3F);
|
||||
double d0 = iposition.getX() + (double) ((float) enumfacing.getAdjacentX() * 0.3F);
|
||||
double d1 = iposition.getY() + (double) ((float) enumfacing.getAdjacentY() * 0.3F);
|
||||
double d2 = iposition.getZ() + (double) ((float) enumfacing.getAdjacentZ() * 0.3F);
|
||||
World world = isourceblock.k();
|
||||
Random random = world.random;
|
||||
double d3 = random.nextGaussian() * 0.05D + (double) enumfacing.c();
|
||||
double d4 = random.nextGaussian() * 0.05D + (double) enumfacing.d();
|
||||
double d5 = random.nextGaussian() * 0.05D + (double) enumfacing.e();
|
||||
double d3 = random.nextGaussian() * 0.05D + (double) enumfacing.getAdjacentX();
|
||||
double d4 = random.nextGaussian() * 0.05D + (double) enumfacing.getAdjacentY();
|
||||
double d5 = random.nextGaussian() * 0.05D + (double) enumfacing.getAdjacentZ();
|
||||
|
||||
// CraftBukkit start
|
||||
ItemStack itemstack1 = itemstack.a(1);
|
||||
@ -42,7 +42,7 @@ final class DispenseBehaviorFireball extends DispenseBehaviorItem {
|
||||
itemstack.count++;
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem());
|
||||
if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) {
|
||||
idispensebehavior.a(isourceblock, eventStack);
|
||||
return itemstack;
|
||||
|
@ -11,9 +11,9 @@ final class DispenseBehaviorFireworks extends DispenseBehaviorItem {
|
||||
|
||||
public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.b(isourceblock.h());
|
||||
double d0 = isourceblock.getX() + (double) enumfacing.c();
|
||||
double d0 = isourceblock.getX() + (double) enumfacing.getAdjacentX();
|
||||
double d1 = (double) ((float) isourceblock.getBlockY() + 0.2F);
|
||||
double d2 = isourceblock.getZ() + (double) enumfacing.e();
|
||||
double d2 = isourceblock.getZ() + (double) enumfacing.getAdjacentZ();
|
||||
|
||||
// CraftBukkit start
|
||||
World world = isourceblock.k();
|
||||
@ -35,7 +35,7 @@ final class DispenseBehaviorFireworks extends DispenseBehaviorItem {
|
||||
itemstack.count++;
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem());
|
||||
if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) {
|
||||
idispensebehavior.a(isourceblock, eventStack);
|
||||
return itemstack;
|
||||
|
@ -14,9 +14,9 @@ final class DispenseBehaviorFlintAndSteel extends DispenseBehaviorItem {
|
||||
protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.b(isourceblock.h());
|
||||
World world = isourceblock.k();
|
||||
int i = isourceblock.getBlockX() + enumfacing.c();
|
||||
int j = isourceblock.getBlockY() + enumfacing.d();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.e();
|
||||
int i = isourceblock.getBlockX() + enumfacing.getAdjacentX();
|
||||
int j = isourceblock.getBlockY() + enumfacing.getAdjacentY();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ();
|
||||
|
||||
// CraftBukkit start
|
||||
org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockX(), isourceblock.getBlockY(), isourceblock.getBlockZ());
|
||||
@ -34,7 +34,7 @@ final class DispenseBehaviorFlintAndSteel extends DispenseBehaviorItem {
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem());
|
||||
if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) {
|
||||
idispensebehavior.a(isourceblock, eventStack);
|
||||
return itemstack;
|
||||
|
@ -41,9 +41,9 @@ public class DispenseBehaviorItem implements IDispenseBehavior {
|
||||
EntityItem entityitem = new EntityItem(world, d0, d1 - 0.3D, d2, itemstack);
|
||||
double d3 = world.random.nextDouble() * 0.1D + 0.2D;
|
||||
|
||||
entityitem.motX = (double) enumfacing.c() * d3;
|
||||
entityitem.motX = (double) enumfacing.getAdjacentX() * d3;
|
||||
entityitem.motY = 0.20000000298023224D;
|
||||
entityitem.motZ = (double) enumfacing.e() * d3;
|
||||
entityitem.motZ = (double) enumfacing.getAdjacentZ() * d3;
|
||||
entityitem.motX += world.random.nextGaussian() * 0.007499999832361937D * (double) i;
|
||||
entityitem.motY += world.random.nextGaussian() * 0.007499999832361937D * (double) i;
|
||||
entityitem.motZ += world.random.nextGaussian() * 0.007499999832361937D * (double) i;
|
||||
@ -69,7 +69,7 @@ public class DispenseBehaviorItem implements IDispenseBehavior {
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem());
|
||||
if (idispensebehavior != IDispenseBehavior.a && idispensebehavior.getClass() != DispenseBehaviorItem.class) {
|
||||
idispensebehavior.a(isourceblock, eventStack);
|
||||
} else {
|
||||
@ -93,6 +93,6 @@ public class DispenseBehaviorItem implements IDispenseBehavior {
|
||||
}
|
||||
|
||||
private int a(EnumFacing enumfacing) {
|
||||
return enumfacing.c() + 1 + (enumfacing.e() + 1) * 3;
|
||||
return enumfacing.getAdjacentX() + 1 + (enumfacing.getAdjacentZ() + 1) * 3;
|
||||
}
|
||||
}
|
||||
|
@ -14,12 +14,12 @@ final class DispenseBehaviorMinecart extends DispenseBehaviorItem {
|
||||
public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.b(isourceblock.h());
|
||||
World world = isourceblock.k();
|
||||
double d0 = isourceblock.getX() + (double) ((float) enumfacing.c() * 1.125F);
|
||||
double d1 = isourceblock.getY() + (double) ((float) enumfacing.d() * 1.125F);
|
||||
double d2 = isourceblock.getZ() + (double) ((float) enumfacing.e() * 1.125F);
|
||||
int i = isourceblock.getBlockX() + enumfacing.c();
|
||||
int j = isourceblock.getBlockY() + enumfacing.d();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.e();
|
||||
double d0 = isourceblock.getX() + (double) ((float) enumfacing.getAdjacentX() * 1.125F);
|
||||
double d1 = isourceblock.getY() + (double) ((float) enumfacing.getAdjacentY() * 1.125F);
|
||||
double d2 = isourceblock.getZ() + (double) ((float) enumfacing.getAdjacentZ() * 1.125F);
|
||||
int i = isourceblock.getBlockX() + enumfacing.getAdjacentX();
|
||||
int j = isourceblock.getBlockY() + enumfacing.getAdjacentY();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ();
|
||||
Block block = world.getType(i, j, k);
|
||||
double d3;
|
||||
|
||||
@ -52,7 +52,7 @@ final class DispenseBehaviorMinecart extends DispenseBehaviorItem {
|
||||
itemstack.count++;
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem());
|
||||
if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) {
|
||||
idispensebehavior.a(isourceblock, eventStack);
|
||||
return itemstack;
|
||||
|
@ -11,9 +11,9 @@ final class DispenseBehaviorMonsterEgg extends DispenseBehaviorItem {
|
||||
|
||||
public ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.b(isourceblock.h());
|
||||
double d0 = isourceblock.getX() + (double) enumfacing.c();
|
||||
double d0 = isourceblock.getX() + (double) enumfacing.getAdjacentX();
|
||||
double d1 = (double) ((float) isourceblock.getBlockY() + 0.2F);
|
||||
double d2 = isourceblock.getZ() + (double) enumfacing.e();
|
||||
double d2 = isourceblock.getZ() + (double) enumfacing.getAdjacentZ();
|
||||
|
||||
// CraftBukkit start
|
||||
World world = isourceblock.k();
|
||||
@ -35,7 +35,7 @@ final class DispenseBehaviorMonsterEgg extends DispenseBehaviorItem {
|
||||
itemstack.count++;
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem());
|
||||
if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) {
|
||||
idispensebehavior.a(isourceblock, eventStack);
|
||||
return itemstack;
|
||||
|
@ -20,7 +20,7 @@ public abstract class DispenseBehaviorProjectile extends DispenseBehaviorItem {
|
||||
org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockX(), isourceblock.getBlockY(), isourceblock.getBlockZ());
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
|
||||
BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) enumfacing.c(), (double) ((float) enumfacing.d() + 0.1F), (double) enumfacing.e()));
|
||||
BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) enumfacing.getAdjacentX(), (double) ((float) enumfacing.getAdjacentY() + 0.1F), (double) enumfacing.getAdjacentZ()));
|
||||
if (!BlockDispenser.eventFired) {
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
@ -34,7 +34,7 @@ public abstract class DispenseBehaviorProjectile extends DispenseBehaviorItem {
|
||||
itemstack.count++;
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem());
|
||||
if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) {
|
||||
idispensebehavior.a(isourceblock, eventStack);
|
||||
return itemstack;
|
||||
|
@ -12,9 +12,9 @@ final class DispenseBehaviorTNT extends DispenseBehaviorItem {
|
||||
protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
EnumFacing enumfacing = BlockDispenser.b(isourceblock.h());
|
||||
World world = isourceblock.k();
|
||||
int i = isourceblock.getBlockX() + enumfacing.c();
|
||||
int j = isourceblock.getBlockY() + enumfacing.d();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.e();
|
||||
int i = isourceblock.getBlockX() + enumfacing.getAdjacentX();
|
||||
int j = isourceblock.getBlockY() + enumfacing.getAdjacentY();
|
||||
int k = isourceblock.getBlockZ() + enumfacing.getAdjacentZ();
|
||||
|
||||
// CraftBukkit start
|
||||
ItemStack itemstack1 = itemstack.a(1);
|
||||
@ -35,7 +35,7 @@ final class DispenseBehaviorTNT extends DispenseBehaviorItem {
|
||||
itemstack.count++;
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem());
|
||||
IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.get(eventStack.getItem());
|
||||
if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) {
|
||||
idispensebehavior.a(isourceblock, eventStack);
|
||||
return itemstack;
|
||||
|
@ -73,7 +73,7 @@ public abstract class Enchantment {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float a(int i, EntityLiving entityliving) {
|
||||
public float a(int i, EnumMonsterType enummonstertype) {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
|
@ -40,11 +40,11 @@ public abstract class Entity {
|
||||
|
||||
private static int entityCount;
|
||||
private int id;
|
||||
public double k;
|
||||
public boolean l;
|
||||
public double j;
|
||||
public boolean k;
|
||||
public Entity passenger;
|
||||
public Entity vehicle;
|
||||
public boolean o;
|
||||
public boolean n;
|
||||
public World world;
|
||||
public double lastX;
|
||||
public double lastY;
|
||||
@ -62,26 +62,27 @@ public abstract class Entity {
|
||||
public final AxisAlignedBB boundingBox;
|
||||
public boolean onGround;
|
||||
public boolean positionChanged;
|
||||
public boolean F;
|
||||
public boolean G;
|
||||
public boolean H;
|
||||
public boolean velocityChanged;
|
||||
protected boolean J;
|
||||
public boolean K;
|
||||
protected boolean I;
|
||||
public boolean J;
|
||||
public boolean dead;
|
||||
public float height;
|
||||
public float width;
|
||||
public float length;
|
||||
public float O;
|
||||
public float P;
|
||||
public float Q;
|
||||
public float R;
|
||||
public float fallDistance;
|
||||
private int d;
|
||||
public double S;
|
||||
public double T;
|
||||
public double U;
|
||||
public double V;
|
||||
public float V;
|
||||
public float W;
|
||||
public float X;
|
||||
public boolean Y;
|
||||
public boolean X;
|
||||
public float Y;
|
||||
public float Z;
|
||||
protected Random random;
|
||||
public int ticksLived;
|
||||
@ -94,20 +95,20 @@ public abstract class Entity {
|
||||
protected DataWatcher datawatcher;
|
||||
private double g;
|
||||
private double h;
|
||||
public boolean ah;
|
||||
public boolean ag;
|
||||
public int ah;
|
||||
public int ai;
|
||||
public int aj;
|
||||
public int ak;
|
||||
public boolean ak;
|
||||
public boolean al;
|
||||
public boolean am;
|
||||
public int portalCooldown;
|
||||
protected boolean ao;
|
||||
protected int ap;
|
||||
protected boolean an;
|
||||
protected int ao;
|
||||
public int dimension;
|
||||
protected int ar;
|
||||
protected int aq;
|
||||
private boolean invulnerable;
|
||||
public UUID uniqueID; // CraftBukkit - protected -> public
|
||||
public EnumEntitySize at;
|
||||
public EnumEntitySize as;
|
||||
public boolean valid; // CraftBukkit
|
||||
public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only
|
||||
|
||||
@ -121,9 +122,9 @@ public abstract class Entity {
|
||||
|
||||
public Entity(World world) {
|
||||
this.id = entityCount++;
|
||||
this.k = 1.0D;
|
||||
this.j = 1.0D;
|
||||
this.boundingBox = AxisAlignedBB.a(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
this.K = true;
|
||||
this.J = true;
|
||||
this.width = 0.6F;
|
||||
this.length = 1.8F;
|
||||
this.d = 1;
|
||||
@ -131,7 +132,7 @@ public abstract class Entity {
|
||||
this.maxFireTicks = 1;
|
||||
this.justCreated = true;
|
||||
this.uniqueID = UUID.randomUUID();
|
||||
this.at = EnumEntitySize.SIZE_2;
|
||||
this.as = EnumEntitySize.SIZE_2;
|
||||
this.world = world;
|
||||
this.setPosition(0.0D, 0.0D, 0.0D);
|
||||
if (world != null) {
|
||||
@ -179,17 +180,17 @@ public abstract class Entity {
|
||||
|
||||
f2 = f % 2.0F;
|
||||
if ((double) f2 < 0.375D) {
|
||||
this.at = EnumEntitySize.SIZE_1;
|
||||
this.as = EnumEntitySize.SIZE_1;
|
||||
} else if ((double) f2 < 0.75D) {
|
||||
this.at = EnumEntitySize.SIZE_2;
|
||||
this.as = EnumEntitySize.SIZE_2;
|
||||
} else if ((double) f2 < 1.0D) {
|
||||
this.at = EnumEntitySize.SIZE_3;
|
||||
this.as = EnumEntitySize.SIZE_3;
|
||||
} else if ((double) f2 < 1.375D) {
|
||||
this.at = EnumEntitySize.SIZE_4;
|
||||
this.as = EnumEntitySize.SIZE_4;
|
||||
} else if ((double) f2 < 1.75D) {
|
||||
this.at = EnumEntitySize.SIZE_5;
|
||||
this.as = EnumEntitySize.SIZE_5;
|
||||
} else {
|
||||
this.at = EnumEntitySize.SIZE_6;
|
||||
this.as = EnumEntitySize.SIZE_6;
|
||||
}
|
||||
}
|
||||
|
||||
@ -232,20 +233,20 @@ public abstract class Entity {
|
||||
float f = this.width / 2.0F;
|
||||
float f1 = this.length;
|
||||
|
||||
this.boundingBox.b(d0 - (double) f, d1 - (double) this.height + (double) this.W, d2 - (double) f, d0 + (double) f, d1 - (double) this.height + (double) this.W + (double) f1, d2 + (double) f);
|
||||
this.boundingBox.b(d0 - (double) f, d1 - (double) this.height + (double) this.V, d2 - (double) f, d0 + (double) f, d1 - (double) this.height + (double) this.V + (double) f1, d2 + (double) f);
|
||||
}
|
||||
|
||||
public void h() {
|
||||
this.C();
|
||||
this.B();
|
||||
}
|
||||
|
||||
public void C() {
|
||||
public void B() {
|
||||
this.world.methodProfiler.a("entityBaseTick");
|
||||
if (this.vehicle != null && this.vehicle.dead) {
|
||||
this.vehicle = null;
|
||||
}
|
||||
|
||||
this.P = this.Q;
|
||||
this.O = this.P;
|
||||
this.lastX = this.locX;
|
||||
this.lastY = this.locY;
|
||||
this.lastZ = this.locZ;
|
||||
@ -257,12 +258,12 @@ public abstract class Entity {
|
||||
this.world.methodProfiler.a("portal");
|
||||
MinecraftServer minecraftserver = ((WorldServer) this.world).getMinecraftServer();
|
||||
|
||||
i = this.D();
|
||||
if (this.ao) {
|
||||
i = this.C();
|
||||
if (this.an) {
|
||||
if (true || minecraftserver.getAllowNether()) { // CraftBukkit
|
||||
if (this.vehicle == null && this.ap++ >= i) {
|
||||
this.ap = i;
|
||||
this.portalCooldown = this.ai();
|
||||
if (this.vehicle == null && this.ao++ >= i) {
|
||||
this.ao = i;
|
||||
this.portalCooldown = this.ah();
|
||||
byte b0;
|
||||
|
||||
if (this.world.worldProvider.dimension == -1) {
|
||||
@ -274,15 +275,15 @@ public abstract class Entity {
|
||||
this.b(b0);
|
||||
}
|
||||
|
||||
this.ao = false;
|
||||
this.an = false;
|
||||
}
|
||||
} else {
|
||||
if (this.ap > 0) {
|
||||
this.ap -= 4;
|
||||
if (this.ao > 0) {
|
||||
this.ao -= 4;
|
||||
}
|
||||
|
||||
if (this.ap < 0) {
|
||||
this.ap = 0;
|
||||
if (this.ao < 0) {
|
||||
this.ao = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -293,7 +294,7 @@ public abstract class Entity {
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
|
||||
if (this.isSprinting() && !this.M()) {
|
||||
if (this.isSprinting() && !this.L()) {
|
||||
int j = MathHelper.floor(this.locX);
|
||||
|
||||
i = MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height);
|
||||
@ -305,7 +306,7 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
this.N();
|
||||
this.M();
|
||||
if (this.world.isStatic) {
|
||||
this.fireTicks = 0;
|
||||
} else if (this.fireTicks > 0) {
|
||||
@ -323,13 +324,13 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.P()) {
|
||||
this.E();
|
||||
if (this.O()) {
|
||||
this.D();
|
||||
this.fallDistance *= 0.5F;
|
||||
}
|
||||
|
||||
if (this.locY < -64.0D) {
|
||||
this.G();
|
||||
this.F();
|
||||
}
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
@ -340,11 +341,11 @@ public abstract class Entity {
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
|
||||
public int D() {
|
||||
public int C() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected void E() {
|
||||
protected void D() {
|
||||
if (!this.fireProof) {
|
||||
// CraftBukkit start - Fallen in lava TODO: this event spams!
|
||||
if (this instanceof EntityLiving) {
|
||||
@ -396,7 +397,7 @@ public abstract class Entity {
|
||||
this.fireTicks = 0;
|
||||
}
|
||||
|
||||
protected void G() {
|
||||
protected void F() {
|
||||
this.die();
|
||||
}
|
||||
|
||||
@ -411,7 +412,7 @@ public abstract class Entity {
|
||||
// CraftBukkit start - Don't do anything if we aren't moving
|
||||
// We need to do this regardless of whether or not we are moving thanks to portals
|
||||
try {
|
||||
this.I();
|
||||
this.H();
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Checking entity block collision");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being checked for collision");
|
||||
@ -424,20 +425,20 @@ public abstract class Entity {
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
if (this.Y) {
|
||||
if (this.X) {
|
||||
this.boundingBox.d(d0, d1, d2);
|
||||
this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D;
|
||||
this.locY = this.boundingBox.b + (double) this.height - (double) this.W;
|
||||
this.locY = this.boundingBox.b + (double) this.height - (double) this.V;
|
||||
this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D;
|
||||
} else {
|
||||
this.world.methodProfiler.a("move");
|
||||
this.W *= 0.4F;
|
||||
this.V *= 0.4F;
|
||||
double d3 = this.locX;
|
||||
double d4 = this.locY;
|
||||
double d5 = this.locZ;
|
||||
|
||||
if (this.J) {
|
||||
this.J = false;
|
||||
if (this.I) {
|
||||
this.I = false;
|
||||
d0 *= 0.25D;
|
||||
d1 *= 0.05000000074505806D;
|
||||
d2 *= 0.25D;
|
||||
@ -504,7 +505,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.boundingBox.d(0.0D, d1, 0.0D);
|
||||
if (!this.K && d7 != d1) {
|
||||
if (!this.J && d7 != d1) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
@ -519,7 +520,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.boundingBox.d(d0, 0.0D, 0.0D);
|
||||
if (!this.K && d6 != d0) {
|
||||
if (!this.J && d6 != d0) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
@ -530,7 +531,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.boundingBox.d(0.0D, 0.0D, d2);
|
||||
if (!this.K && d8 != d2) {
|
||||
if (!this.J && d8 != d2) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
@ -541,12 +542,12 @@ public abstract class Entity {
|
||||
double d12;
|
||||
int k;
|
||||
|
||||
if (this.X > 0.0F && flag1 && (flag || this.W < 0.05F) && (d6 != d0 || d8 != d2)) {
|
||||
if (this.W > 0.0F && flag1 && (flag || this.V < 0.05F) && (d6 != d0 || d8 != d2)) {
|
||||
d10 = d0;
|
||||
d11 = d1;
|
||||
d12 = d2;
|
||||
d0 = d6;
|
||||
d1 = (double) this.X;
|
||||
d1 = (double) this.W;
|
||||
d2 = d8;
|
||||
AxisAlignedBB axisalignedbb1 = this.boundingBox.clone();
|
||||
|
||||
@ -558,7 +559,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.boundingBox.d(0.0D, d1, 0.0D);
|
||||
if (!this.K && d7 != d1) {
|
||||
if (!this.J && d7 != d1) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
@ -569,7 +570,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.boundingBox.d(d0, 0.0D, 0.0D);
|
||||
if (!this.K && d6 != d0) {
|
||||
if (!this.J && d6 != d0) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
@ -580,18 +581,18 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.boundingBox.d(0.0D, 0.0D, d2);
|
||||
if (!this.K && d8 != d2) {
|
||||
if (!this.J && d8 != d2) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
}
|
||||
|
||||
if (!this.K && d7 != d1) {
|
||||
if (!this.J && d7 != d1) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
} else {
|
||||
d1 = (double) (-this.X);
|
||||
d1 = (double) (-this.W);
|
||||
|
||||
for (k = 0; k < list.size(); ++k) {
|
||||
d1 = ((AxisAlignedBB) list.get(k)).b(this.boundingBox, d1);
|
||||
@ -611,12 +612,12 @@ public abstract class Entity {
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("rest");
|
||||
this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D;
|
||||
this.locY = this.boundingBox.b + (double) this.height - (double) this.W;
|
||||
this.locY = this.boundingBox.b + (double) this.height - (double) this.V;
|
||||
this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D;
|
||||
this.positionChanged = d6 != d0 || d8 != d2;
|
||||
this.G = d7 != d1;
|
||||
this.F = d7 != d1;
|
||||
this.onGround = d7 != d1 && d7 < 0.0D;
|
||||
this.H = this.positionChanged || this.G;
|
||||
this.G = this.positionChanged || this.F;
|
||||
this.a(d1, this.onGround);
|
||||
if (d6 != d0) {
|
||||
this.motX = 0.0D;
|
||||
@ -670,18 +671,18 @@ public abstract class Entity {
|
||||
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.d && block.getMaterial() != Material.AIR) {
|
||||
this.d = (int) this.R + 1;
|
||||
if (this.M()) {
|
||||
this.P = (float) ((double) this.P + (double) MathHelper.sqrt(d10 * d10 + d12 * d12) * 0.6D);
|
||||
this.Q = (float) ((double) this.Q + (double) MathHelper.sqrt(d10 * d10 + d11 * d11 + d12 * d12) * 0.6D);
|
||||
if (this.Q > (float) this.d && block.getMaterial() != Material.AIR) {
|
||||
this.d = (int) this.Q + 1;
|
||||
if (this.L()) {
|
||||
float f = MathHelper.sqrt(this.motX * this.motX * 0.20000000298023224D + this.motY * this.motY + this.motZ * this.motZ * 0.20000000298023224D) * 0.35F;
|
||||
|
||||
if (f > 1.0F) {
|
||||
f = 1.0F;
|
||||
}
|
||||
|
||||
this.makeSound(this.H(), f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
this.makeSound(this.G(), f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
}
|
||||
|
||||
this.a(l, k, i1, block);
|
||||
@ -692,7 +693,7 @@ public abstract class Entity {
|
||||
// CraftBukkit start - Move to the top of the method
|
||||
/*
|
||||
try {
|
||||
this.I();
|
||||
this.H();
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Checking entity block collision");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being checked for collision");
|
||||
@ -702,7 +703,7 @@ public abstract class Entity {
|
||||
}
|
||||
*/
|
||||
// CraftBukkit end
|
||||
boolean flag2 = this.L();
|
||||
boolean flag2 = this.K();
|
||||
|
||||
if (this.world.e(this.boundingBox.shrink(0.001D, 0.001D, 0.001D))) {
|
||||
this.burn(1);
|
||||
@ -734,11 +735,11 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
protected String H() {
|
||||
protected String G() {
|
||||
return "game.neutral.swim";
|
||||
}
|
||||
|
||||
protected void I() {
|
||||
protected void H() {
|
||||
int i = MathHelper.floor(this.boundingBox.a + 0.001D);
|
||||
int j = MathHelper.floor(this.boundingBox.b + 0.001D);
|
||||
int k = MathHelper.floor(this.boundingBox.c + 0.001D);
|
||||
@ -797,7 +798,7 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public AxisAlignedBB J() {
|
||||
public AxisAlignedBB I() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -817,15 +818,15 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean L() {
|
||||
public boolean K() {
|
||||
return this.inWater || this.world.isRainingAt(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) || this.world.isRainingAt(MathHelper.floor(this.locX), MathHelper.floor(this.locY + (double) this.length), MathHelper.floor(this.locZ));
|
||||
}
|
||||
|
||||
public boolean M() {
|
||||
public boolean L() {
|
||||
return this.inWater;
|
||||
}
|
||||
|
||||
public boolean N() {
|
||||
public boolean M() {
|
||||
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.inWater && !this.justCreated) {
|
||||
float f = MathHelper.sqrt(this.motX * this.motX * 0.20000000298023224D + this.motY * this.motY + this.motZ * this.motZ * 0.20000000298023224D) * 0.2F;
|
||||
@ -834,7 +835,7 @@ public abstract class Entity {
|
||||
f = 1.0F;
|
||||
}
|
||||
|
||||
this.makeSound(this.O(), f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
this.makeSound(this.N(), f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
float f1 = (float) MathHelper.floor(this.boundingBox.b);
|
||||
|
||||
int i;
|
||||
@ -864,7 +865,7 @@ public abstract class Entity {
|
||||
return this.inWater;
|
||||
}
|
||||
|
||||
protected String O() {
|
||||
protected String N() {
|
||||
return "game.neutral.swim.splash";
|
||||
}
|
||||
|
||||
@ -889,7 +890,7 @@ public abstract class Entity {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
public boolean P() {
|
||||
public boolean O() {
|
||||
return this.world.a(this.boundingBox.grow(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.LAVA);
|
||||
}
|
||||
|
||||
@ -945,7 +946,7 @@ public abstract class Entity {
|
||||
this.lastZ = this.locZ = d2;
|
||||
this.lastYaw = this.yaw = f;
|
||||
this.lastPitch = this.pitch = f1;
|
||||
this.W = 0.0F;
|
||||
this.V = 0.0F;
|
||||
double d3 = (double) (this.lastYaw - f);
|
||||
|
||||
if (d3 < -180.0D) {
|
||||
@ -961,15 +962,15 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public void setPositionRotation(double d0, double d1, double d2, float f, float f1) {
|
||||
this.T = this.lastX = this.locX = d0;
|
||||
this.U = this.lastY = this.locY = d1 + (double) this.height;
|
||||
this.V = this.lastZ = this.locZ = d2;
|
||||
this.S = this.lastX = this.locX = d0;
|
||||
this.T = this.lastY = this.locY = d1 + (double) this.height;
|
||||
this.U = this.lastZ = this.locZ = d2;
|
||||
this.yaw = f;
|
||||
this.pitch = f1;
|
||||
this.setPosition(this.locX, this.locY, this.locZ);
|
||||
}
|
||||
|
||||
public float d(Entity entity) {
|
||||
public float e(Entity entity) {
|
||||
float f = (float) (this.locX - entity.locX);
|
||||
float f1 = (float) (this.locY - entity.locY);
|
||||
float f2 = (float) (this.locZ - entity.locZ);
|
||||
@ -993,7 +994,7 @@ public abstract class Entity {
|
||||
return (double) MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
||||
}
|
||||
|
||||
public double e(Entity entity) {
|
||||
public double f(Entity entity) {
|
||||
double d0 = this.locX - entity.locX;
|
||||
double d1 = this.locY - entity.locY;
|
||||
double d2 = this.locZ - entity.locZ;
|
||||
@ -1023,8 +1024,8 @@ public abstract class Entity {
|
||||
d1 *= d3;
|
||||
d0 *= 0.05000000074505806D;
|
||||
d1 *= 0.05000000074505806D;
|
||||
d0 *= (double) (1.0F - this.Z);
|
||||
d1 *= (double) (1.0F - this.Z);
|
||||
d0 *= (double) (1.0F - this.Y);
|
||||
d1 *= (double) (1.0F - this.Y);
|
||||
this.g(-d0, 0.0D, -d1);
|
||||
entity.g(d0, 0.0D, d1);
|
||||
}
|
||||
@ -1035,10 +1036,10 @@ public abstract class Entity {
|
||||
this.motX += d0;
|
||||
this.motY += d1;
|
||||
this.motZ += d2;
|
||||
this.am = true;
|
||||
this.al = true;
|
||||
}
|
||||
|
||||
protected void Q() {
|
||||
protected void P() {
|
||||
this.velocityChanged = true;
|
||||
}
|
||||
|
||||
@ -1046,23 +1047,23 @@ public abstract class Entity {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
this.Q();
|
||||
this.P();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean Q() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean R() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean S() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void b(Entity entity, int i) {}
|
||||
|
||||
public boolean c(NBTTagCompound nbttagcompound) {
|
||||
String s = this.W();
|
||||
String s = this.V();
|
||||
|
||||
if (!this.dead && s != null) {
|
||||
nbttagcompound.setString("id", s);
|
||||
@ -1074,7 +1075,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public boolean d(NBTTagCompound nbttagcompound) {
|
||||
String s = this.W();
|
||||
String s = this.V();
|
||||
|
||||
if (!this.dead && s != null && this.passenger == null) {
|
||||
nbttagcompound.setString("id", s);
|
||||
@ -1087,7 +1088,7 @@ public abstract class Entity {
|
||||
|
||||
public void e(NBTTagCompound nbttagcompound) {
|
||||
try {
|
||||
nbttagcompound.set("Pos", this.a(new double[] { this.locX, this.locY + (double) this.W, this.locZ}));
|
||||
nbttagcompound.set("Pos", this.a(new double[] { this.locX, this.locY + (double) this.V, this.locZ}));
|
||||
nbttagcompound.set("Motion", this.a(new double[] { this.motX, this.motY, this.motZ}));
|
||||
|
||||
// CraftBukkit start - Checking for NaN pitch/yaw and resetting to zero
|
||||
@ -1156,9 +1157,9 @@ public abstract class Entity {
|
||||
}
|
||||
// CraftBukkit end */
|
||||
|
||||
this.lastX = this.T = this.locX = nbttaglist.d(0);
|
||||
this.lastY = this.U = this.locY = nbttaglist.d(1);
|
||||
this.lastZ = this.V = this.locZ = nbttaglist.d(2);
|
||||
this.lastX = this.S = this.locX = nbttaglist.d(0);
|
||||
this.lastY = this.T = this.locY = nbttaglist.d(1);
|
||||
this.lastZ = this.U = this.locZ = nbttaglist.d(2);
|
||||
this.lastYaw = this.yaw = nbttaglist2.e(0);
|
||||
this.lastPitch = this.pitch = nbttaglist2.e(1);
|
||||
this.fallDistance = nbttagcompound.getFloat("FallDistance");
|
||||
@ -1175,7 +1176,7 @@ public abstract class Entity {
|
||||
this.setPosition(this.locX, this.locY, this.locZ);
|
||||
this.b(this.yaw, this.pitch);
|
||||
this.a(nbttagcompound);
|
||||
if (this.V()) {
|
||||
if (this.U()) {
|
||||
this.setPosition(this.locX, this.locY, this.locZ);
|
||||
}
|
||||
|
||||
@ -1239,11 +1240,11 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean V() {
|
||||
protected boolean U() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected final String W() {
|
||||
protected final String V() {
|
||||
return EntityTypes.b(this);
|
||||
}
|
||||
|
||||
@ -1251,7 +1252,7 @@ public abstract class Entity {
|
||||
|
||||
protected abstract void b(NBTTagCompound nbttagcompound);
|
||||
|
||||
public void X() {}
|
||||
public void W() {}
|
||||
|
||||
protected NBTTagList a(double... adouble) {
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
@ -1326,11 +1327,11 @@ public abstract class Entity {
|
||||
return false;
|
||||
}
|
||||
|
||||
public AxisAlignedBB g(Entity entity) {
|
||||
public AxisAlignedBB h(Entity entity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void ab() {
|
||||
public void aa() {
|
||||
if (this.vehicle.dead) {
|
||||
this.vehicle = null;
|
||||
} else {
|
||||
@ -1339,7 +1340,7 @@ public abstract class Entity {
|
||||
this.motZ = 0.0D;
|
||||
this.h();
|
||||
if (this.vehicle != null) {
|
||||
this.vehicle.ac();
|
||||
this.vehicle.ab();
|
||||
this.h += (double) (this.vehicle.yaw - this.vehicle.lastYaw);
|
||||
|
||||
for (this.g += (double) (this.vehicle.pitch - this.vehicle.lastPitch); this.h >= 180.0D; this.h -= 360.0D) {
|
||||
@ -1384,17 +1385,17 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public void ac() {
|
||||
public void ab() {
|
||||
if (this.passenger != null) {
|
||||
this.passenger.setPosition(this.locX, this.locY + this.ae() + this.passenger.ad(), this.locZ);
|
||||
this.passenger.setPosition(this.locX, this.locY + this.ad() + this.passenger.ac(), this.locZ);
|
||||
}
|
||||
}
|
||||
|
||||
public double ad() {
|
||||
public double ac() {
|
||||
return (double) this.height;
|
||||
}
|
||||
|
||||
public double ae() {
|
||||
public double ad() {
|
||||
return (double) this.length * 0.75D;
|
||||
}
|
||||
|
||||
@ -1475,35 +1476,43 @@ public abstract class Entity {
|
||||
this.vehicle.passenger = null;
|
||||
}
|
||||
|
||||
if (entity != null) {
|
||||
for (Entity entity1 = entity.vehicle; entity1 != null; entity1 = entity1.vehicle) {
|
||||
if (entity1 == this) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.vehicle = entity;
|
||||
entity.passenger = this;
|
||||
}
|
||||
}
|
||||
|
||||
public float af() {
|
||||
public float ae() {
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
public Vec3D ag() {
|
||||
public Vec3D af() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void ah() {
|
||||
public void ag() {
|
||||
if (this.portalCooldown > 0) {
|
||||
this.portalCooldown = this.ai();
|
||||
this.portalCooldown = this.ah();
|
||||
} else {
|
||||
double d0 = this.lastX - this.locX;
|
||||
double d1 = this.lastZ - this.locZ;
|
||||
|
||||
if (!this.world.isStatic && !this.ao) {
|
||||
this.ar = Direction.a(d0, d1);
|
||||
if (!this.world.isStatic && !this.an) {
|
||||
this.aq = Direction.a(d0, d1);
|
||||
}
|
||||
|
||||
this.ao = true;
|
||||
this.an = true;
|
||||
}
|
||||
}
|
||||
|
||||
public int ai() {
|
||||
public int ah() {
|
||||
return 300;
|
||||
}
|
||||
|
||||
@ -1519,7 +1528,7 @@ public abstract class Entity {
|
||||
return !this.fireProof && (this.fireTicks > 0 || flag && this.g(0));
|
||||
}
|
||||
|
||||
public boolean am() {
|
||||
public boolean al() {
|
||||
return this.vehicle != null;
|
||||
}
|
||||
|
||||
@ -1686,8 +1695,8 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public void as() {
|
||||
this.J = true;
|
||||
public void ar() {
|
||||
this.I = true;
|
||||
this.fallDistance = 0.0F;
|
||||
}
|
||||
|
||||
@ -1701,11 +1710,11 @@ public abstract class Entity {
|
||||
return LocaleI18n.get("entity." + s + ".name");
|
||||
}
|
||||
|
||||
public Entity[] at() {
|
||||
public Entity[] as() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean h(Entity entity) {
|
||||
public boolean i(Entity entity) {
|
||||
return this == entity;
|
||||
}
|
||||
|
||||
@ -1713,11 +1722,11 @@ public abstract class Entity {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
public boolean av() {
|
||||
public boolean au() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean i(Entity entity) {
|
||||
public boolean j(Entity entity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1729,7 +1738,7 @@ public abstract class Entity {
|
||||
return this.invulnerable;
|
||||
}
|
||||
|
||||
public void j(Entity entity) {
|
||||
public void k(Entity entity) {
|
||||
this.setPositionRotation(entity.locX, entity.locY, entity.locZ, entity.yaw, entity.pitch);
|
||||
}
|
||||
|
||||
@ -1739,7 +1748,7 @@ public abstract class Entity {
|
||||
entity.e(nbttagcompound);
|
||||
this.f(nbttagcompound);
|
||||
this.portalCooldown = entity.portalCooldown;
|
||||
this.ar = entity.ar;
|
||||
this.aq = entity.aq;
|
||||
}
|
||||
|
||||
public void b(int i) {
|
||||
@ -1762,7 +1771,7 @@ public abstract class Entity {
|
||||
Location exit = exitWorld != null ? minecraftserver.getPlayerList().calculateTarget(enter, minecraftserver.getWorldServer(i)) : null;
|
||||
boolean useTravelAgent = exitWorld != null && !(this.dimension == 1 && exitWorld.dimension == 1); // don't use agent for custom worlds or return from THE_END
|
||||
|
||||
TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().t() : org.bukkit.craftbukkit.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins
|
||||
TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().getTravelAgent() : org.bukkit.craftbukkit.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins
|
||||
EntityPortalEvent event = new EntityPortalEvent(this.getBukkitEntity(), enter, exit, agent);
|
||||
event.useTravelAgent(useTravelAgent);
|
||||
event.getEntity().getServer().getPluginManager().callEvent(event);
|
||||
@ -1835,15 +1844,15 @@ public abstract class Entity {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int ax() {
|
||||
public int aw() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public int ay() {
|
||||
return this.ar;
|
||||
public int ax() {
|
||||
return this.aq;
|
||||
}
|
||||
|
||||
public boolean az() {
|
||||
public boolean ay() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1860,7 +1869,7 @@ public abstract class Entity {
|
||||
return this.uniqueID;
|
||||
}
|
||||
|
||||
public boolean aC() {
|
||||
public boolean aB() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -19,20 +19,20 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
public int fromPlayer;
|
||||
public int shake;
|
||||
public Entity shooter;
|
||||
private int j;
|
||||
private int at;
|
||||
private int au;
|
||||
private double damage = 2.0D;
|
||||
public int aw; // CraftBukkit - private -> public
|
||||
public int knockbackStrength; // CraftBukkit - private -> public
|
||||
|
||||
public EntityArrow(World world) {
|
||||
super(world);
|
||||
this.k = 10.0D;
|
||||
this.j = 10.0D;
|
||||
this.a(0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public EntityArrow(World world, double d0, double d1, double d2) {
|
||||
super(world);
|
||||
this.k = 10.0D;
|
||||
this.j = 10.0D;
|
||||
this.a(0.5F, 0.5F);
|
||||
this.setPosition(d0, d1, d2);
|
||||
this.height = 0.0F;
|
||||
@ -40,7 +40,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
|
||||
public EntityArrow(World world, EntityLiving entityliving, EntityLiving entityliving1, float f, float f1) {
|
||||
super(world);
|
||||
this.k = 10.0D;
|
||||
this.j = 10.0D;
|
||||
this.shooter = entityliving;
|
||||
this.projectileSource = (LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit
|
||||
if (entityliving instanceof EntityHuman) {
|
||||
@ -69,7 +69,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
|
||||
public EntityArrow(World world, EntityLiving entityliving, float f) {
|
||||
super(world);
|
||||
this.k = 10.0D;
|
||||
this.j = 10.0D;
|
||||
this.shooter = entityliving;
|
||||
this.projectileSource = (LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit
|
||||
if (entityliving instanceof EntityHuman) {
|
||||
@ -112,7 +112,7 @@ public class EntityArrow 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.j = 0;
|
||||
this.at = 0;
|
||||
}
|
||||
|
||||
public void h() {
|
||||
@ -130,7 +130,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
block.updateShape(this.world, this.d, this.e, this.f);
|
||||
AxisAlignedBB axisalignedbb = block.a(this.world, this.d, this.e, this.f);
|
||||
|
||||
if (axisalignedbb != null && axisalignedbb.a(this.world.getVec3DPool().create(this.locX, this.locY, this.locZ))) {
|
||||
if (axisalignedbb != null && axisalignedbb.a(Vec3D.a(this.locX, this.locY, this.locZ))) {
|
||||
this.inGround = true;
|
||||
}
|
||||
}
|
||||
@ -143,8 +143,8 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
int i = this.world.getData(this.d, this.e, this.f);
|
||||
|
||||
if (block == this.g && i == this.h) {
|
||||
++this.j;
|
||||
if (this.j == 1200) {
|
||||
++this.at;
|
||||
if (this.at == 1200) {
|
||||
this.die();
|
||||
}
|
||||
} else {
|
||||
@ -152,19 +152,19 @@ public class EntityArrow 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.j = 0;
|
||||
this.at = 0;
|
||||
this.au = 0;
|
||||
}
|
||||
} else {
|
||||
++this.au;
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ);
|
||||
Vec3D vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
Vec3D vec3d = Vec3D.a(this.locX, this.locY, this.locZ);
|
||||
Vec3D vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
MovingObjectPosition movingobjectposition = this.world.rayTrace(vec3d, vec3d1, false, true, false);
|
||||
|
||||
vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ);
|
||||
vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
vec3d = Vec3D.a(this.locX, this.locY, this.locZ);
|
||||
vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
if (movingobjectposition != null) {
|
||||
vec3d1 = this.world.getVec3DPool().create(movingobjectposition.pos.c, movingobjectposition.pos.d, movingobjectposition.pos.e);
|
||||
vec3d1 = Vec3D.a(movingobjectposition.pos.a, movingobjectposition.pos.b, movingobjectposition.pos.c);
|
||||
}
|
||||
|
||||
Entity entity = null;
|
||||
@ -177,7 +177,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
for (j = 0; j < list.size(); ++j) {
|
||||
Entity entity1 = (Entity) list.get(j);
|
||||
|
||||
if (entity1.R() && (entity1 != this.shooter || this.au >= 5)) {
|
||||
if (entity1.Q() && (entity1 != this.shooter || this.au >= 5)) {
|
||||
f1 = 0.3F;
|
||||
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.grow((double) f1, (double) f1, (double) f1);
|
||||
MovingObjectPosition movingobjectposition1 = axisalignedbb1.a(vec3d, vec3d1);
|
||||
@ -215,7 +215,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
f2 = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ);
|
||||
int k = MathHelper.f((double) f2 * this.damage);
|
||||
|
||||
if (this.f()) {
|
||||
if (this.isCritical()) {
|
||||
k += this.random.nextInt(k / 2 + 2);
|
||||
}
|
||||
|
||||
@ -244,13 +244,13 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
EntityLiving entityliving = (EntityLiving) movingobjectposition.entity;
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
entityliving.p(entityliving.aZ() + 1);
|
||||
entityliving.p(entityliving.aY() + 1);
|
||||
}
|
||||
|
||||
if (this.aw > 0) {
|
||||
if (this.knockbackStrength > 0) {
|
||||
f3 = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
|
||||
if (f3 > 0.0F) {
|
||||
movingobjectposition.entity.g(this.motX * (double) this.aw * 0.6000000238418579D / (double) f3, 0.1D, this.motZ * (double) this.aw * 0.6000000238418579D / (double) f3);
|
||||
movingobjectposition.entity.g(this.motX * (double) this.knockbackStrength * 0.6000000238418579D / (double) f3, 0.1D, this.motZ * (double) this.knockbackStrength * 0.6000000238418579D / (double) f3);
|
||||
}
|
||||
}
|
||||
|
||||
@ -282,9 +282,9 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
this.f = movingobjectposition.d;
|
||||
this.g = this.world.getType(d, e, f); // CraftBukkit - Get correct block for storage
|
||||
this.h = this.world.getData(this.d, this.e, this.f);
|
||||
this.motX = (double) ((float) (movingobjectposition.pos.c - this.locX));
|
||||
this.motY = (double) ((float) (movingobjectposition.pos.d - this.locY));
|
||||
this.motZ = (double) ((float) (movingobjectposition.pos.e - this.locZ));
|
||||
this.motX = (double) ((float) (movingobjectposition.pos.a - this.locX));
|
||||
this.motY = (double) ((float) (movingobjectposition.pos.b - this.locY));
|
||||
this.motZ = (double) ((float) (movingobjectposition.pos.c - this.locZ));
|
||||
f2 = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ);
|
||||
this.locX -= this.motX / (double) f2 * 0.05000000074505806D;
|
||||
this.locY -= this.motY / (double) f2 * 0.05000000074505806D;
|
||||
@ -292,14 +292,14 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
this.makeSound("random.bowhit", 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
|
||||
this.inGround = true;
|
||||
this.shake = 7;
|
||||
this.a(false);
|
||||
this.setCritical(false);
|
||||
if (this.g.getMaterial() != Material.AIR) {
|
||||
this.g.a(this.world, this.d, this.e, this.f, (Entity) this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.f()) {
|
||||
if (this.isCritical()) {
|
||||
for (j = 0; j < 4; ++j) {
|
||||
this.world.addParticle("crit", this.locX + this.motX * (double) j / 4.0D, this.locY + this.motY * (double) j / 4.0D, this.locZ + this.motZ * (double) j / 4.0D, -this.motX, -this.motY + 0.2D, -this.motZ);
|
||||
}
|
||||
@ -332,7 +332,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
float f4 = 0.99F;
|
||||
|
||||
f1 = 0.05F;
|
||||
if (this.M()) {
|
||||
if (this.L()) {
|
||||
for (int l = 0; l < 4; ++l) {
|
||||
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);
|
||||
@ -341,7 +341,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
f4 = 0.8F;
|
||||
}
|
||||
|
||||
if (this.L()) {
|
||||
if (this.K()) {
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
@ -350,7 +350,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
this.motZ *= (double) f4;
|
||||
this.motY -= (double) f1;
|
||||
this.setPosition(this.locX, this.locY, this.locZ);
|
||||
this.I();
|
||||
this.H();
|
||||
}
|
||||
}
|
||||
|
||||
@ -358,7 +358,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
nbttagcompound.setShort("xTile", (short) this.d);
|
||||
nbttagcompound.setShort("yTile", (short) this.e);
|
||||
nbttagcompound.setShort("zTile", (short) this.f);
|
||||
nbttagcompound.setShort("life", (short) this.j);
|
||||
nbttagcompound.setShort("life", (short) this.at);
|
||||
nbttagcompound.setByte("inTile", (byte) Block.b(this.g));
|
||||
nbttagcompound.setByte("inData", (byte) this.h);
|
||||
nbttagcompound.setByte("shake", (byte) this.shake);
|
||||
@ -371,7 +371,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
this.d = nbttagcompound.getShort("xTile");
|
||||
this.e = nbttagcompound.getShort("yTile");
|
||||
this.f = nbttagcompound.getShort("zTile");
|
||||
this.j = nbttagcompound.getShort("life");
|
||||
this.at = nbttagcompound.getShort("life");
|
||||
this.g = Block.e(nbttagcompound.getByte("inTile") & 255);
|
||||
this.h = nbttagcompound.getByte("inData") & 255;
|
||||
this.shake = nbttagcompound.getByte("shake") & 255;
|
||||
@ -430,15 +430,15 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
return this.damage;
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
this.aw = i;
|
||||
public void setKnockbackStrength(int i) {
|
||||
this.knockbackStrength = i;
|
||||
}
|
||||
|
||||
public boolean av() {
|
||||
public boolean au() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void a(boolean flag) {
|
||||
public void setCritical(boolean flag) {
|
||||
byte b0 = this.datawatcher.getByte(16);
|
||||
|
||||
if (flag) {
|
||||
@ -448,7 +448,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean f() {
|
||||
public boolean isCritical() {
|
||||
byte b0 = this.datawatcher.getByte(16);
|
||||
|
||||
return (b0 & 1) != 0;
|
||||
|
@ -12,8 +12,8 @@ public class EntityBlaze extends EntityMonster {
|
||||
this.b = 10;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.e).setValue(6.0D);
|
||||
}
|
||||
|
||||
@ -26,11 +26,11 @@ public class EntityBlaze extends EntityMonster {
|
||||
return "mob.blaze.breathe";
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.blaze.hit";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "mob.blaze.death";
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ public class EntityBlaze extends EntityMonster {
|
||||
|
||||
public void e() {
|
||||
if (!this.world.isStatic) {
|
||||
if (this.L()) {
|
||||
if (this.K()) {
|
||||
this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ public class EntityBlaze extends EntityMonster {
|
||||
this.bp = 0.5F + (float) this.random.nextGaussian() * 3.0F;
|
||||
}
|
||||
|
||||
if (this.bR() != null && this.bR().locY + (double) this.bR().getHeadHeight() > this.locY + (double) this.getHeadHeight() + (double) this.bp) {
|
||||
if (this.bT() != null && this.bT().locY + (double) this.bT().getHeadHeight() > this.locY + (double) this.getHeadHeight() + (double) this.bp) {
|
||||
this.motY += (0.30000001192092896D - this.motY) * 0.30000001192092896D;
|
||||
}
|
||||
}
|
||||
@ -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.m(entity);
|
||||
this.n(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));
|
||||
@ -118,7 +118,7 @@ public class EntityBlaze extends EntityMonster {
|
||||
}
|
||||
|
||||
public boolean isBurning() {
|
||||
return this.bX();
|
||||
return this.bZ();
|
||||
}
|
||||
|
||||
protected void dropDeathLoot(boolean flag, int i) {
|
||||
@ -137,7 +137,7 @@ public class EntityBlaze extends EntityMonster {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public boolean bX() {
|
||||
public boolean bZ() {
|
||||
return (this.datawatcher.getByte(16) & 1) != 0;
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class EntityBoat extends Entity {
|
||||
super(world);
|
||||
this.a = true;
|
||||
this.b = 0.07D;
|
||||
this.l = true;
|
||||
this.k = true;
|
||||
this.a(1.5F, 0.6F);
|
||||
this.height = this.length / 2.0F;
|
||||
}
|
||||
@ -63,15 +63,15 @@ public class EntityBoat extends Entity {
|
||||
this.datawatcher.a(19, new Float(0.0F));
|
||||
}
|
||||
|
||||
public AxisAlignedBB g(Entity entity) {
|
||||
public AxisAlignedBB h(Entity entity) {
|
||||
return entity.boundingBox;
|
||||
}
|
||||
|
||||
public AxisAlignedBB J() {
|
||||
public AxisAlignedBB I() {
|
||||
return this.boundingBox;
|
||||
}
|
||||
|
||||
public boolean S() {
|
||||
public boolean R() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ public class EntityBoat extends Entity {
|
||||
this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit
|
||||
}
|
||||
|
||||
public double ae() {
|
||||
public double ad() {
|
||||
return (double) this.length * 0.0D - 0.30000001192092896D;
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ public class EntityBoat extends Entity {
|
||||
this.c(-this.i());
|
||||
this.a(10);
|
||||
this.setDamage(this.getDamage() + f * 10.0F);
|
||||
this.Q();
|
||||
this.P();
|
||||
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
|
||||
|
||||
if (flag || this.getDamage() > 40.0F) {
|
||||
@ -143,7 +143,7 @@ public class EntityBoat extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean R() {
|
||||
public boolean Q() {
|
||||
return !this.dead;
|
||||
}
|
||||
|
||||
@ -174,7 +174,7 @@ public class EntityBoat extends Entity {
|
||||
for (int i = 0; i < b0; ++i) {
|
||||
double d1 = this.boundingBox.b + (this.boundingBox.e - this.boundingBox.b) * (double) (i + 0) / (double) b0 - 0.125D;
|
||||
double d2 = this.boundingBox.b + (this.boundingBox.e - this.boundingBox.b) * (double) (i + 1) / (double) b0 - 0.125D;
|
||||
AxisAlignedBB axisalignedbb = AxisAlignedBB.a().a(this.boundingBox.a, d1, this.boundingBox.c, this.boundingBox.d, d2, this.boundingBox.f);
|
||||
AxisAlignedBB axisalignedbb = AxisAlignedBB.a(this.boundingBox.a, d1, this.boundingBox.c, this.boundingBox.d, d2, this.boundingBox.f);
|
||||
|
||||
if (this.world.b(axisalignedbb, Material.WATER)) {
|
||||
d0 += 1.0D / (double) b0;
|
||||
@ -251,10 +251,10 @@ public class EntityBoat extends Entity {
|
||||
|
||||
if (this.passenger != null && this.passenger instanceof EntityLiving) {
|
||||
EntityLiving entityliving = (EntityLiving) this.passenger;
|
||||
float f = this.passenger.yaw + -entityliving.be * 90.0F;
|
||||
float f = this.passenger.yaw + -entityliving.bd * 90.0F;
|
||||
|
||||
this.motX += -Math.sin((double) (f * 3.1415927F / 180.0F)) * this.b * (double) entityliving.bf * 0.05000000074505806D;
|
||||
this.motZ += Math.cos((double) (f * 3.1415927F / 180.0F)) * this.b * (double) entityliving.bf * 0.05000000074505806D;
|
||||
this.motX += -Math.sin((double) (f * 3.1415927F / 180.0F)) * this.b * (double) entityliving.be * 0.05000000074505806D;
|
||||
this.motZ += Math.cos((double) (f * 3.1415927F / 180.0F)) * this.b * (double) entityliving.be * 0.05000000074505806D;
|
||||
}
|
||||
// CraftBukkit start - Support unoccupied deceleration
|
||||
else if (unoccupiedDeceleration >= 0) {
|
||||
@ -397,7 +397,7 @@ public class EntityBoat extends Entity {
|
||||
for (int k1 = 0; k1 < list.size(); ++k1) {
|
||||
Entity entity = (Entity) list.get(k1);
|
||||
|
||||
if (entity != this.passenger && entity.S() && entity instanceof EntityBoat) {
|
||||
if (entity != this.passenger && entity.R() && entity instanceof EntityBoat) {
|
||||
entity.collide(this);
|
||||
}
|
||||
}
|
||||
@ -411,12 +411,12 @@ public class EntityBoat extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public void ac() {
|
||||
public void ab() {
|
||||
if (this.passenger != null) {
|
||||
double d0 = Math.cos((double) this.yaw * 3.141592653589793D / 180.0D) * 0.4D;
|
||||
double d1 = Math.sin((double) this.yaw * 3.141592653589793D / 180.0D) * 0.4D;
|
||||
|
||||
this.passenger.setPosition(this.locX + d0, this.locY + this.ae() + this.passenger.ad(), this.locZ + d1);
|
||||
this.passenger.setPosition(this.locX + d0, this.locY + this.ad() + this.passenger.ac(), this.locZ + d1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ public class EntityChicken extends EntityAnimal {
|
||||
public float bs;
|
||||
public float bt = 1.0F;
|
||||
public int bu;
|
||||
public boolean bv;
|
||||
|
||||
public EntityChicken(World world) {
|
||||
super(world);
|
||||
@ -25,12 +26,12 @@ public class EntityChicken extends EntityAnimal {
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||
}
|
||||
|
||||
public boolean bk() {
|
||||
public boolean bj() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(4.0D);
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.25D);
|
||||
}
|
||||
@ -71,11 +72,11 @@ public class EntityChicken extends EntityAnimal {
|
||||
return "mob.chicken.say";
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.chicken.hurt";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "mob.chicken.hurt";
|
||||
}
|
||||
|
||||
@ -114,6 +115,45 @@ public class EntityChicken extends EntityAnimal {
|
||||
return itemstack != null && itemstack.getItem() instanceof ItemSeeds;
|
||||
}
|
||||
|
||||
public void a(NBTTagCompound nbttagcompound) {
|
||||
super.a(nbttagcompound);
|
||||
this.bv = nbttagcompound.getBoolean("IsChickenJockey");
|
||||
}
|
||||
|
||||
protected int getExpValue(EntityHuman entityhuman) {
|
||||
return this.bZ() ? 10 : super.getExpValue(entityhuman);
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
super.b(nbttagcompound);
|
||||
nbttagcompound.setBoolean("IsChickenJockey", this.bv);
|
||||
}
|
||||
|
||||
protected boolean isTypeNotPersistent() {
|
||||
return this.bZ() && this.passenger == null;
|
||||
}
|
||||
|
||||
public void ab() {
|
||||
super.ab();
|
||||
float f = MathHelper.sin(this.aM * 3.1415927F / 180.0F);
|
||||
float f1 = MathHelper.cos(this.aM * 3.1415927F / 180.0F);
|
||||
float f2 = 0.1F;
|
||||
float f3 = 0.0F;
|
||||
|
||||
this.passenger.setPosition(this.locX + (double) (f2 * f), this.locY + (double) (this.length * 0.5F) + this.passenger.ac() + (double) f3, this.locZ - (double) (f2 * f1));
|
||||
if (this.passenger instanceof EntityLiving) {
|
||||
((EntityLiving) this.passenger).aM = this.aM;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean bZ() {
|
||||
return this.bv;
|
||||
}
|
||||
|
||||
public void i(boolean flag) {
|
||||
this.bv = flag;
|
||||
}
|
||||
|
||||
public EntityAgeable createChild(EntityAgeable entityageable) {
|
||||
return this.b(entityageable);
|
||||
}
|
||||
|
@ -22,12 +22,12 @@ public class EntityCow extends EntityAnimal {
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||
}
|
||||
|
||||
public boolean bk() {
|
||||
public boolean bj() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(10.0D);
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.20000000298023224D);
|
||||
}
|
||||
@ -36,11 +36,11 @@ public class EntityCow extends EntityAnimal {
|
||||
return "mob.cow.say";
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.cow.hurt";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "mob.cow.hurt";
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ public class EntityCow extends EntityAnimal {
|
||||
this.makeSound("mob.cow.step", 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
protected float bf() {
|
||||
protected float be() {
|
||||
return 0.4F;
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,11 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
super(world);
|
||||
}
|
||||
|
||||
protected boolean bN() {
|
||||
protected boolean bP() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void bq() {
|
||||
protected void bp() {
|
||||
this.world.methodProfiler.a("ai");
|
||||
if (this.bo > 0 && --this.bo == 0) {
|
||||
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.d);
|
||||
@ -37,7 +37,7 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
attributeinstance.b(i);
|
||||
}
|
||||
|
||||
this.bn = this.bN();
|
||||
this.bn = this.bP();
|
||||
float f11 = 16.0F;
|
||||
|
||||
if (this.target == null) {
|
||||
@ -61,9 +61,9 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
this.pathEntity = this.world.findPath(this, this.target, f11, true, false, false, true);
|
||||
}
|
||||
} else if (this.target.isAlive()) {
|
||||
float f1 = this.target.d((Entity) this);
|
||||
float f1 = this.target.e((Entity) this);
|
||||
|
||||
if (this.o(this.target)) {
|
||||
if (this.p(this.target)) {
|
||||
this.a(this.target, f1);
|
||||
}
|
||||
} else {
|
||||
@ -88,13 +88,13 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
this.world.methodProfiler.b();
|
||||
if (!this.bn && this.target != null && (this.pathEntity == null || this.random.nextInt(20) == 0)) {
|
||||
this.pathEntity = this.world.findPath(this, this.target, f11, true, false, false, true);
|
||||
} else if (!this.bn && (this.pathEntity == null && this.random.nextInt(180) == 0 || this.random.nextInt(120) == 0 || this.bo > 0) && this.aV < 100) {
|
||||
this.bO();
|
||||
} else if (!this.bn && (this.pathEntity == null && this.random.nextInt(180) == 0 || this.random.nextInt(120) == 0 || this.bo > 0) && this.aU < 100) {
|
||||
this.bQ();
|
||||
}
|
||||
|
||||
int i = MathHelper.floor(this.boundingBox.b + 0.5D);
|
||||
boolean flag = this.M();
|
||||
boolean flag1 = this.P();
|
||||
boolean flag = this.L();
|
||||
boolean flag1 = this.O();
|
||||
|
||||
this.pitch = 0.0F;
|
||||
if (this.pathEntity != null && this.random.nextInt(100) != 0) {
|
||||
@ -102,7 +102,7 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
Vec3D vec3d = this.pathEntity.a((Entity) this);
|
||||
double d0 = (double) (this.width * 2.0F);
|
||||
|
||||
while (vec3d != null && vec3d.d(this.locX, vec3d.d, this.locZ) < d0 * d0) {
|
||||
while (vec3d != null && vec3d.d(this.locX, vec3d.b, this.locZ) < d0 * d0) {
|
||||
this.pathEntity.a();
|
||||
if (this.pathEntity.b()) {
|
||||
vec3d = null;
|
||||
@ -112,16 +112,16 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
}
|
||||
}
|
||||
|
||||
this.bd = false;
|
||||
this.bc = false;
|
||||
if (vec3d != null) {
|
||||
double d1 = vec3d.c - this.locX;
|
||||
double d2 = vec3d.e - this.locZ;
|
||||
double d3 = vec3d.d - (double) i;
|
||||
double d1 = vec3d.a - this.locX;
|
||||
double d2 = vec3d.c - this.locZ;
|
||||
double d3 = vec3d.b - (double) i;
|
||||
// CraftBukkit - Math -> TrigMath
|
||||
float f2 = (float) (org.bukkit.craftbukkit.TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||
float f3 = MathHelper.g(f2 - this.yaw);
|
||||
|
||||
this.bf = (float) this.getAttributeInstance(GenericAttributes.d).getValue();
|
||||
this.be = (float) this.getAttributeInstance(GenericAttributes.d).getValue();
|
||||
if (f3 > 30.0F) {
|
||||
f3 = 30.0F;
|
||||
}
|
||||
@ -138,12 +138,12 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
|
||||
this.yaw = (float) (Math.atan2(d5, d4) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||
f3 = (f4 - this.yaw + 90.0F) * 3.1415927F / 180.0F;
|
||||
this.be = -MathHelper.sin(f3) * this.bf * 1.0F;
|
||||
this.bf = MathHelper.cos(f3) * this.bf * 1.0F;
|
||||
this.bd = -MathHelper.sin(f3) * this.be * 1.0F;
|
||||
this.be = MathHelper.cos(f3) * this.be * 1.0F;
|
||||
}
|
||||
|
||||
if (d3 > 0.0D) {
|
||||
this.bd = true;
|
||||
this.bc = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,22 +151,22 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
this.a(this.target, 30.0F, 30.0F);
|
||||
}
|
||||
|
||||
if (this.positionChanged && !this.bQ()) {
|
||||
this.bd = true;
|
||||
if (this.positionChanged && !this.bS()) {
|
||||
this.bc = true;
|
||||
}
|
||||
|
||||
if (this.random.nextFloat() < 0.8F && (flag || flag1)) {
|
||||
this.bd = true;
|
||||
this.bc = true;
|
||||
}
|
||||
|
||||
this.world.methodProfiler.b();
|
||||
} else {
|
||||
super.bq();
|
||||
super.bp();
|
||||
this.pathEntity = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected void bO() {
|
||||
protected void bQ() {
|
||||
this.world.methodProfiler.a("stroll");
|
||||
boolean flag = false;
|
||||
int i = -1;
|
||||
@ -214,7 +214,7 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
return super.canSpawn() && this.a(i, j, k) >= 0.0F;
|
||||
}
|
||||
|
||||
public boolean bQ() {
|
||||
public boolean bS() {
|
||||
return this.pathEntity != null;
|
||||
}
|
||||
|
||||
@ -222,7 +222,7 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
this.pathEntity = pathentity;
|
||||
}
|
||||
|
||||
public Entity bR() {
|
||||
public Entity bT() {
|
||||
return this.target;
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
this.target = entity;
|
||||
}
|
||||
|
||||
public boolean bS() {
|
||||
public boolean bU() {
|
||||
return this.b(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||
}
|
||||
|
||||
@ -243,29 +243,29 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
this.br = (float) l;
|
||||
}
|
||||
|
||||
public ChunkCoordinates bT() {
|
||||
public ChunkCoordinates bV() {
|
||||
return this.bq;
|
||||
}
|
||||
|
||||
public float bU() {
|
||||
public float bW() {
|
||||
return this.br;
|
||||
}
|
||||
|
||||
public void bV() {
|
||||
public void bX() {
|
||||
this.br = -1.0F;
|
||||
}
|
||||
|
||||
public boolean bW() {
|
||||
public boolean bY() {
|
||||
return this.br != -1.0F;
|
||||
}
|
||||
|
||||
protected void bJ() {
|
||||
super.bJ();
|
||||
if (this.bL() && this.getLeashHolder() != null && this.getLeashHolder().world == this.world) {
|
||||
protected void bL() {
|
||||
super.bL();
|
||||
if (this.bN() && this.getLeashHolder() != null && this.getLeashHolder().world == this.world) {
|
||||
Entity entity = this.getLeashHolder();
|
||||
|
||||
this.a((int) entity.locX, (int) entity.locY, (int) entity.locZ, 5);
|
||||
float f = this.d(entity);
|
||||
float f = this.e(entity);
|
||||
|
||||
if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) {
|
||||
if (f > 10.0F) {
|
||||
@ -301,11 +301,11 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
|
||||
this.unleash(true, true);
|
||||
}
|
||||
} else if (!this.bL() && this.bt) {
|
||||
} else if (!this.bN() && this.bt) {
|
||||
this.bt = false;
|
||||
this.goalSelector.a(this.bs);
|
||||
this.getNavigation().a(true);
|
||||
this.bV();
|
||||
this.bX();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,16 +26,16 @@ public class EntityCreeper extends EntityMonster {
|
||||
this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, false));
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.25D);
|
||||
}
|
||||
|
||||
public boolean bk() {
|
||||
public boolean bj() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int ax() {
|
||||
public int aw() {
|
||||
return this.getGoalTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public class EntityCreeper extends EntityMonster {
|
||||
|
||||
nbttagcompound.setShort("Fuse", (short) this.maxFuseTicks);
|
||||
nbttagcompound.setByte("ExplosionRadius", (byte) this.explosionRadius);
|
||||
nbttagcompound.setBoolean("ignited", this.ca());
|
||||
nbttagcompound.setBoolean("ignited", this.cc());
|
||||
}
|
||||
|
||||
public void a(NBTTagCompound nbttagcompound) {
|
||||
@ -77,18 +77,18 @@ public class EntityCreeper extends EntityMonster {
|
||||
}
|
||||
|
||||
if (nbttagcompound.getBoolean("ignited")) {
|
||||
this.cb();
|
||||
this.cd();
|
||||
}
|
||||
}
|
||||
|
||||
public void h() {
|
||||
if (this.isAlive()) {
|
||||
this.bp = this.fuseTicks;
|
||||
if (this.ca()) {
|
||||
if (this.cc()) {
|
||||
this.a(1);
|
||||
}
|
||||
|
||||
int i = this.bZ();
|
||||
int i = this.cb();
|
||||
|
||||
if (i > 0 && this.fuseTicks == 0) {
|
||||
this.makeSound("creeper.primed", 1.0F, 0.5F);
|
||||
@ -101,18 +101,18 @@ public class EntityCreeper extends EntityMonster {
|
||||
|
||||
if (this.fuseTicks >= this.maxFuseTicks) {
|
||||
this.fuseTicks = this.maxFuseTicks;
|
||||
this.cc();
|
||||
this.ce();
|
||||
}
|
||||
}
|
||||
|
||||
super.h();
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.creeper.say";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "mob.creeper.death";
|
||||
}
|
||||
|
||||
@ -159,7 +159,7 @@ public class EntityCreeper extends EntityMonster {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
public boolean m(Entity entity) {
|
||||
public boolean n(Entity entity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ public class EntityCreeper extends EntityMonster {
|
||||
return Items.SULPHUR;
|
||||
}
|
||||
|
||||
public int bZ() {
|
||||
public int cb() {
|
||||
return this.datawatcher.getByte(16);
|
||||
}
|
||||
|
||||
@ -203,9 +203,9 @@ public class EntityCreeper extends EntityMonster {
|
||||
|
||||
if (itemstack != null && itemstack.getItem() == Items.FLINT_AND_STEEL) {
|
||||
this.world.makeSound(this.locX + 0.5D, this.locY + 0.5D, this.locZ + 0.5D, "fire.ignite", 1.0F, this.random.nextFloat() * 0.4F + 0.8F);
|
||||
entityhuman.ba();
|
||||
entityhuman.aZ();
|
||||
if (!this.world.isStatic) {
|
||||
this.cb();
|
||||
this.cd();
|
||||
itemstack.damage(1, entityhuman);
|
||||
return true;
|
||||
}
|
||||
@ -214,7 +214,7 @@ public class EntityCreeper extends EntityMonster {
|
||||
return super.a(entityhuman);
|
||||
}
|
||||
|
||||
private void cc() {
|
||||
private void ce() {
|
||||
if (!this.world.isStatic) {
|
||||
boolean flag = this.world.getGameRules().getBoolean("mobGriefing");
|
||||
|
||||
@ -233,11 +233,11 @@ public class EntityCreeper extends EntityMonster {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean ca() {
|
||||
public boolean cc() {
|
||||
return this.datawatcher.getByte(18) != 0;
|
||||
}
|
||||
|
||||
public void cb() {
|
||||
public void cd() {
|
||||
this.datawatcher.watch(18, Byte.valueOf((byte) 1));
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ public class EntityDamageSourceIndirect extends EntityDamageSource {
|
||||
|
||||
public IChatBaseComponent getLocalizedDeathMessage(EntityLiving entityliving) {
|
||||
IChatBaseComponent ichatbasecomponent = this.owner == null ? this.p.getScoreboardDisplayName() : this.owner.getScoreboardDisplayName();
|
||||
ItemStack itemstack = this.owner instanceof EntityLiving ? ((EntityLiving) this.owner).be() : null;
|
||||
ItemStack itemstack = this.owner instanceof EntityLiving ? ((EntityLiving) this.owner).bd() : null;
|
||||
String s = "death.attack." + this.translationIndex;
|
||||
String s1 = s + ".item";
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class EntityEgg extends EntityProjectile {
|
||||
movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.getShooter()), 0.0F);
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - Fire PlayerEggThrowEvent
|
||||
boolean hatching = !this.world.isStatic && this.random.nextInt(8) == 0;
|
||||
int numHatching = (this.random.nextInt(32) == 0) ? 4 : 1;
|
||||
if (!hatching) {
|
||||
|
@ -9,7 +9,7 @@ public class EntityEnderCrystal extends Entity {
|
||||
|
||||
public EntityEnderCrystal(World world) {
|
||||
super(world);
|
||||
this.l = true;
|
||||
this.k = true;
|
||||
this.a(2.0F, 2.0F);
|
||||
this.height = this.length / 2.0F;
|
||||
this.b = 5;
|
||||
@ -47,7 +47,7 @@ public class EntityEnderCrystal extends Entity {
|
||||
|
||||
protected void a(NBTTagCompound nbttagcompound) {}
|
||||
|
||||
public boolean R() {
|
||||
public boolean Q() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
|
||||
public double h;
|
||||
public double i;
|
||||
public double j;
|
||||
public double bm;
|
||||
public double[][] bn = new double[64][3];
|
||||
public int bo = -1;
|
||||
public EntityComplexPart[] children;
|
||||
@ -43,14 +43,14 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
this.children = new EntityComplexPart[] { this.bq = new EntityComplexPart(this, "head", 6.0F, 6.0F), this.br = new EntityComplexPart(this, "body", 8.0F, 8.0F), this.bs = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bt = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bu = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bv = new EntityComplexPart(this, "wing", 4.0F, 4.0F), this.bw = new EntityComplexPart(this, "wing", 4.0F, 4.0F)};
|
||||
this.setHealth(this.getMaxHealth());
|
||||
this.a(16.0F, 8.0F);
|
||||
this.Y = true;
|
||||
this.X = true;
|
||||
this.fireProof = true;
|
||||
this.i = 100.0D;
|
||||
this.al = true;
|
||||
this.ak = true;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(200.0D);
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
f2 = (this.random.nextFloat() - 0.5F) * 8.0F;
|
||||
this.world.addParticle("largeexplode", this.locX + (double) f, this.locY + 2.0D + (double) f1, this.locZ + (double) f2, 0.0D, 0.0D, 0.0D);
|
||||
} else {
|
||||
this.bN();
|
||||
this.bP();
|
||||
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.bA) {
|
||||
@ -129,27 +129,27 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
float f3;
|
||||
|
||||
if (this.world.isStatic) {
|
||||
if (this.bh > 0) {
|
||||
d0 = this.locX + (this.bi - this.locX) / (double) this.bh;
|
||||
d1 = this.locY + (this.bj - this.locY) / (double) this.bh;
|
||||
d2 = this.locZ + (this.bk - this.locZ) / (double) this.bh;
|
||||
d3 = MathHelper.g(this.bl - (double) this.yaw);
|
||||
this.yaw = (float) ((double) this.yaw + d3 / (double) this.bh);
|
||||
this.pitch = (float) ((double) this.pitch + (this.bm - (double) this.pitch) / (double) this.bh);
|
||||
--this.bh;
|
||||
if (this.bg > 0) {
|
||||
d0 = this.locX + (this.bh - this.locX) / (double) this.bg;
|
||||
d1 = this.locY + (this.bi - this.locY) / (double) this.bg;
|
||||
d2 = this.locZ + (this.bj - this.locZ) / (double) this.bg;
|
||||
d3 = MathHelper.g(this.bk - (double) this.yaw);
|
||||
this.yaw = (float) ((double) this.yaw + d3 / (double) this.bg);
|
||||
this.pitch = (float) ((double) this.pitch + (this.bm - (double) this.pitch) / (double) this.bg);
|
||||
--this.bg;
|
||||
this.setPosition(d0, d1, d2);
|
||||
this.b(this.yaw, this.pitch);
|
||||
}
|
||||
} else {
|
||||
d0 = this.h - this.locX;
|
||||
d1 = this.i - this.locY;
|
||||
d2 = this.j - this.locZ;
|
||||
d2 = this.bm - this.locZ;
|
||||
d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
if (this.bD != null) {
|
||||
this.h = this.bD.locX;
|
||||
this.j = this.bD.locZ;
|
||||
this.bm = this.bD.locZ;
|
||||
double d4 = this.h - this.locX;
|
||||
double d5 = this.j - this.locZ;
|
||||
double d5 = this.bm - this.locZ;
|
||||
double d6 = Math.sqrt(d4 * d4 + d5 * d5);
|
||||
double d7 = 0.4000000059604645D + d6 / 80.0D - 1.0D;
|
||||
|
||||
@ -160,11 +160,11 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
this.i = this.bD.boundingBox.b + d7;
|
||||
} else {
|
||||
this.h += this.random.nextGaussian() * 2.0D;
|
||||
this.j += this.random.nextGaussian() * 2.0D;
|
||||
this.bm += this.random.nextGaussian() * 2.0D;
|
||||
}
|
||||
|
||||
if (this.bz || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.G) {
|
||||
this.bO();
|
||||
if (this.bz || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.F) {
|
||||
this.bQ();
|
||||
}
|
||||
|
||||
d1 /= (double) MathHelper.sqrt(d0 * d0 + d2 * d2);
|
||||
@ -190,15 +190,15 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
d9 = -50.0D;
|
||||
}
|
||||
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(this.h - this.locX, this.i - this.locY, this.j - this.locZ).a();
|
||||
Vec3D vec3d1 = this.world.getVec3DPool().create((double) MathHelper.sin(this.yaw * 3.1415927F / 180.0F), this.motY, (double) (-MathHelper.cos(this.yaw * 3.1415927F / 180.0F))).a();
|
||||
Vec3D vec3d = Vec3D.a(this.h - this.locX, this.i - this.locY, this.bm - this.locZ).a();
|
||||
Vec3D vec3d1 = Vec3D.a((double) MathHelper.sin(this.yaw * 3.1415927F / 180.0F), this.motY, (double) (-MathHelper.cos(this.yaw * 3.1415927F / 180.0F))).a();
|
||||
float f4 = (float) (vec3d1.b(vec3d) + 0.5D) / 1.5F;
|
||||
|
||||
if (f4 < 0.0F) {
|
||||
f4 = 0.0F;
|
||||
}
|
||||
|
||||
this.bg *= 0.8F;
|
||||
this.bf *= 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;
|
||||
|
||||
@ -206,8 +206,8 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
d10 = 40.0D;
|
||||
}
|
||||
|
||||
this.bg = (float) ((double) this.bg + d9 * (0.699999988079071D / d10 / (double) f5));
|
||||
this.yaw += this.bg * 0.1F;
|
||||
this.bf = (float) ((double) this.bf + d9 * (0.699999988079071D / d10 / (double) f5));
|
||||
this.yaw += this.bf * 0.1F;
|
||||
float f6 = (float) (2.0D / (d10 + 1.0D));
|
||||
float f7 = 0.06F;
|
||||
|
||||
@ -218,7 +218,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
this.move(this.motX, this.motY, this.motZ);
|
||||
}
|
||||
|
||||
Vec3D vec3d2 = this.world.getVec3DPool().create(this.motX, this.motY, this.motZ).a();
|
||||
Vec3D vec3d2 = Vec3D.a(this.motX, this.motY, this.motZ).a();
|
||||
float f8 = (float) (vec3d2.b(vec3d1) + 1.0D) / 2.0F;
|
||||
|
||||
f8 = 0.8F + 0.15F * f8;
|
||||
@ -227,7 +227,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
this.motY *= 0.9100000262260437D;
|
||||
}
|
||||
|
||||
this.aN = this.yaw;
|
||||
this.aM = this.yaw;
|
||||
this.bq.width = this.bq.length = 3.0F;
|
||||
this.bs.width = this.bs.length = 2.0F;
|
||||
this.bt.width = this.bt.length = 2.0F;
|
||||
@ -260,8 +260,8 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
double[] adouble = this.b(5, 1.0F);
|
||||
double[] adouble1 = this.b(0, 1.0F);
|
||||
|
||||
f3 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F - this.bg * 0.01F);
|
||||
float f13 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F - this.bg * 0.01F);
|
||||
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);
|
||||
|
||||
this.bq.h();
|
||||
this.bq.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);
|
||||
@ -298,7 +298,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
}
|
||||
}
|
||||
|
||||
private void bN() {
|
||||
private void bP() {
|
||||
if (this.bC != null) {
|
||||
if (this.bC.dead) {
|
||||
if (!this.world.isStatic) {
|
||||
@ -335,7 +335,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
EntityEnderCrystal entityendercrystal1 = (EntityEnderCrystal) iterator.next();
|
||||
double d1 = entityendercrystal1.e(this);
|
||||
double d1 = entityendercrystal1.f(this);
|
||||
|
||||
if (d1 < d0) {
|
||||
d0 = d1;
|
||||
@ -375,7 +375,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
}
|
||||
}
|
||||
|
||||
private void bO() {
|
||||
private void bQ() {
|
||||
this.bz = false;
|
||||
if (this.random.nextInt(2) == 0 && !this.world.players.isEmpty()) {
|
||||
// CraftBukkit start
|
||||
@ -397,12 +397,12 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
do {
|
||||
this.h = 0.0D;
|
||||
this.i = (double) (70.0F + this.random.nextFloat() * 50.0F);
|
||||
this.j = 0.0D;
|
||||
this.bm = 0.0D;
|
||||
this.h += (double) (this.random.nextFloat() * 120.0F - 60.0F);
|
||||
this.j += (double) (this.random.nextFloat() * 120.0F - 60.0F);
|
||||
this.bm += (double) (this.random.nextFloat() * 120.0F - 60.0F);
|
||||
double d0 = this.locX - this.h;
|
||||
double d1 = this.locY - this.i;
|
||||
double d2 = this.locZ - this.j;
|
||||
double d2 = this.locZ - this.bm;
|
||||
|
||||
flag = d0 * d0 + d1 * d1 + d2 * d2 > 100.0D;
|
||||
} while (!flag);
|
||||
@ -507,9 +507,9 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
|
||||
this.h = this.locX + (double) (f2 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F);
|
||||
this.i = this.locY + (double) (this.random.nextFloat() * 3.0F) + 1.0D;
|
||||
this.j = this.locZ - (double) (f3 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F);
|
||||
this.bm = this.locZ - (double) (f3 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F);
|
||||
this.bD = null;
|
||||
if (damagesource.getEntity() instanceof EntityHuman || damagesource.c()) {
|
||||
if (damagesource.getEntity() instanceof EntityHuman || damagesource.isExplosion()) {
|
||||
this.dealDamage(damagesource, f);
|
||||
}
|
||||
|
||||
@ -524,7 +524,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
return super.damageEntity(damagesource, f);
|
||||
}
|
||||
|
||||
protected void aF() {
|
||||
protected void aE() {
|
||||
if (this.dead) return; // CraftBukkit - can't kill what's already dead
|
||||
++this.bB;
|
||||
if (this.bB >= 180 && this.bB <= 200) {
|
||||
@ -555,7 +555,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
}
|
||||
|
||||
this.move(0.0D, 0.10000000149011612D, 0.0D);
|
||||
this.aN = this.yaw += 20.0F;
|
||||
this.aM = this.yaw += 20.0F;
|
||||
if (this.bB == 200 && !this.world.isStatic) {
|
||||
i = this.expToDrop - (10 * this.expToDrop / 12); // CraftBukkit - drop the remaining experience
|
||||
|
||||
@ -638,11 +638,11 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
|
||||
protected void w() {}
|
||||
|
||||
public Entity[] at() {
|
||||
public Entity[] as() {
|
||||
return this.children;
|
||||
}
|
||||
|
||||
public boolean R() {
|
||||
public boolean Q() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -654,11 +654,11 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
return "mob.enderdragon.growl";
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.enderdragon.hit";
|
||||
}
|
||||
|
||||
protected float bf() {
|
||||
protected float be() {
|
||||
return 5.0F;
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,8 @@ public class EntityEnderPearl extends EntityProjectile {
|
||||
if (this.getShooter() != null && this.getShooter() instanceof EntityPlayer) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) this.getShooter();
|
||||
|
||||
if (entityplayer.playerConnection.b().d() && entityplayer.world == this.world) {
|
||||
// CraftBukkit start
|
||||
if (entityplayer.playerConnection.b().isConnected() && entityplayer.world == this.world) {
|
||||
// CraftBukkit start - Fire PlayerTeleportEvent
|
||||
org.bukkit.craftbukkit.entity.CraftPlayer player = entityplayer.getBukkitEntity();
|
||||
org.bukkit.Location location = getBukkitEntity().getLocation();
|
||||
location.setPitch(player.getLocation().getPitch());
|
||||
|
@ -21,11 +21,11 @@ public class EntityEnderman extends EntityMonster {
|
||||
public EntityEnderman(World world) {
|
||||
super(world);
|
||||
this.a(0.6F, 2.9F);
|
||||
this.X = 1.0F;
|
||||
this.W = 1.0F;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(40.0D);
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.30000001192092896D);
|
||||
this.getAttributeInstance(GenericAttributes.e).setValue(7.0D);
|
||||
@ -80,18 +80,18 @@ public class EntityEnderman extends EntityMonster {
|
||||
return false;
|
||||
} else {
|
||||
Vec3D vec3d = entityhuman.j(1.0F).a();
|
||||
Vec3D vec3d1 = this.world.getVec3DPool().create(this.locX - entityhuman.locX, this.boundingBox.b + (double) (this.length / 2.0F) - (entityhuman.locY + (double) entityhuman.getHeadHeight()), this.locZ - entityhuman.locZ);
|
||||
Vec3D vec3d1 = Vec3D.a(this.locX - entityhuman.locX, this.boundingBox.b + (double) (this.length / 2.0F) - (entityhuman.locY + (double) entityhuman.getHeadHeight()), this.locZ - entityhuman.locZ);
|
||||
double d0 = vec3d1.b();
|
||||
|
||||
vec3d1 = vec3d1.a();
|
||||
double d1 = vec3d.b(vec3d1);
|
||||
|
||||
return d1 > 1.0D - 0.025D / d0 ? entityhuman.o(this) : false;
|
||||
return d1 > 1.0D - 0.025D / d0 && entityhuman.p(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void e() {
|
||||
if (this.L()) {
|
||||
if (this.K()) {
|
||||
this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
}
|
||||
|
||||
@ -150,29 +150,29 @@ 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.v() && !this.world.isStatic) {
|
||||
if (this.world.w() && !this.world.isStatic) {
|
||||
float f = this.d(1.0F);
|
||||
|
||||
if (f > 0.5F && this.world.i(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.a(false);
|
||||
this.bv = false;
|
||||
this.bX();
|
||||
this.bZ();
|
||||
}
|
||||
}
|
||||
|
||||
if (this.L() || this.isBurning()) {
|
||||
if (this.K() || this.isBurning()) {
|
||||
this.target = null;
|
||||
this.a(false);
|
||||
this.bv = false;
|
||||
this.bX();
|
||||
this.bZ();
|
||||
}
|
||||
|
||||
if (this.cb() && !this.bv && this.random.nextInt(100) == 0) {
|
||||
if (this.cd() && !this.bv && this.random.nextInt(100) == 0) {
|
||||
this.a(false);
|
||||
}
|
||||
|
||||
this.bd = false;
|
||||
this.bc = false;
|
||||
if (this.target != null) {
|
||||
this.a(this.target, 100.0F, 100.0F);
|
||||
}
|
||||
@ -180,12 +180,12 @@ public class EntityEnderman extends EntityMonster {
|
||||
if (!this.world.isStatic && this.isAlive()) {
|
||||
if (this.target != null) {
|
||||
if (this.target instanceof EntityHuman && this.f((EntityHuman) this.target)) {
|
||||
if (this.target.e((Entity) this) < 16.0D) {
|
||||
this.bX();
|
||||
if (this.target.f((Entity) this) < 16.0D) {
|
||||
this.bZ();
|
||||
}
|
||||
|
||||
this.bs = 0;
|
||||
} else if (this.target.e((Entity) this) > 256.0D && this.bs++ >= 30 && this.c(this.target)) {
|
||||
} else if (this.target.f((Entity) this) > 256.0D && this.bs++ >= 30 && this.c(this.target)) {
|
||||
this.bs = 0;
|
||||
}
|
||||
} else {
|
||||
@ -197,7 +197,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
super.e();
|
||||
}
|
||||
|
||||
protected boolean bX() {
|
||||
protected boolean bZ() {
|
||||
double d0 = this.locX + (this.random.nextDouble() - 0.5D) * 64.0D;
|
||||
double d1 = this.locY + (double) (this.random.nextInt(64) - 32);
|
||||
double d2 = this.locZ + (this.random.nextDouble() - 0.5D) * 64.0D;
|
||||
@ -206,13 +206,13 @@ public class EntityEnderman extends EntityMonster {
|
||||
}
|
||||
|
||||
protected boolean c(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 = Vec3D.a(this.locX - entity.locX, this.boundingBox.b + (double) (this.length / 2.0F) - entity.locY + (double) entity.getHeadHeight(), this.locZ - entity.locZ);
|
||||
|
||||
vec3d = vec3d.a();
|
||||
double d0 = 16.0D;
|
||||
double d1 = this.locX + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.c * d0;
|
||||
double d2 = this.locY + (double) (this.random.nextInt(16) - 8) - vec3d.d * d0;
|
||||
double d3 = this.locZ + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.e * d0;
|
||||
double d1 = this.locX + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.a * d0;
|
||||
double d2 = this.locY + (double) (this.random.nextInt(16) - 8) - vec3d.b * d0;
|
||||
double d3 = this.locZ + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.c * d0;
|
||||
|
||||
return this.k(d1, d2, d3);
|
||||
}
|
||||
@ -287,14 +287,14 @@ public class EntityEnderman extends EntityMonster {
|
||||
}
|
||||
|
||||
protected String t() {
|
||||
return this.cb() ? "mob.endermen.scream" : "mob.endermen.idle";
|
||||
return this.cd() ? "mob.endermen.scream" : "mob.endermen.idle";
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.endermen.hit";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "mob.endermen.death";
|
||||
}
|
||||
|
||||
@ -348,7 +348,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
this.bv = false;
|
||||
|
||||
for (int i = 0; i < 64; ++i) {
|
||||
if (this.bX()) {
|
||||
if (this.bZ()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -360,7 +360,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean cb() {
|
||||
public boolean cd() {
|
||||
return this.datawatcher.getByte(18) > 0;
|
||||
}
|
||||
|
||||
@ -371,7 +371,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
static {
|
||||
br[Block.b((Block) Blocks.GRASS)] = true;
|
||||
br[Block.b(Blocks.DIRT)] = true;
|
||||
br[Block.b(Blocks.SAND)] = true;
|
||||
br[Block.b((Block) Blocks.SAND)] = true;
|
||||
br[Block.b(Blocks.GRAVEL)] = true;
|
||||
br[Block.b((Block) Blocks.YELLOW_FLOWER)] = true;
|
||||
br[Block.b((Block) Blocks.RED_ROSE)] = true;
|
||||
|
@ -60,7 +60,7 @@ public class EntityExperienceOrb extends Entity {
|
||||
double d0 = 8.0D;
|
||||
|
||||
if (this.targetTime < this.a - 20 + this.getId() % 100) {
|
||||
if (this.targetPlayer == null || this.targetPlayer.e(this) > d0 * d0) {
|
||||
if (this.targetPlayer == null || this.targetPlayer.f(this) > d0 * d0) {
|
||||
this.targetPlayer = this.world.findNearbyPlayer(this, d0);
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ public class EntityExperienceOrb extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean N() {
|
||||
public boolean M() {
|
||||
return this.world.a(this.boundingBox, Material.WATER, (Entity) this);
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ public class EntityExperienceOrb extends Entity {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
this.Q();
|
||||
this.P();
|
||||
this.d = (int) ((float) this.d - f);
|
||||
if (this.d <= 0) {
|
||||
this.die();
|
||||
@ -145,11 +145,11 @@ public class EntityExperienceOrb extends Entity {
|
||||
|
||||
public void b_(EntityHuman entityhuman) {
|
||||
if (!this.world.isStatic) {
|
||||
if (this.c == 0 && entityhuman.bu == 0) {
|
||||
entityhuman.bu = 2;
|
||||
if (this.c == 0 && entityhuman.bt == 0) {
|
||||
entityhuman.bt = 2;
|
||||
this.world.makeSound(entityhuman, "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()
|
||||
entityhuman.giveExp(CraftEventFactory.callPlayerExpChangeEvent(entityhuman, this.value).getAmount()); // CraftBukkit - this.value -> event.getAmount()
|
||||
this.die();
|
||||
}
|
||||
}
|
||||
@ -182,7 +182,7 @@ public class EntityExperienceOrb extends Entity {
|
||||
return i >= 2477 ? 2477 : (i >= 1237 ? 1237 : (i >= 617 ? 617 : (i >= 307 ? 307 : (i >= 149 ? 149 : (i >= 73 ? 73 : (i >= 37 ? 37 : (i >= 17 ? 17 : (i >= 7 ? 7 : (i >= 3 ? 3 : 1)))))))));
|
||||
}
|
||||
|
||||
public boolean av() {
|
||||
public boolean au() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class EntityFallingBlock extends Entity {
|
||||
this.fallHurtAmount = 2.0F;
|
||||
this.id = block;
|
||||
this.data = i;
|
||||
this.l = true;
|
||||
this.k = true;
|
||||
this.a(0.98F, 0.98F);
|
||||
this.height = this.length / 2.0F;
|
||||
this.setPosition(d0, d1, d2);
|
||||
@ -56,7 +56,7 @@ public class EntityFallingBlock extends Entity {
|
||||
|
||||
protected void c() {}
|
||||
|
||||
public boolean R() {
|
||||
public boolean Q() {
|
||||
return !this.dead;
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ public class EntityFallingBlock extends Entity {
|
||||
this.motY *= -0.5D;
|
||||
if (this.world.getType(i, j, k) != Blocks.PISTON_MOVING) {
|
||||
this.die();
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire EntityChangeBlockEvent
|
||||
if (!this.f && this.world.mayPlace(this.id, i, j, k, true, 1, (Entity) null, (ItemStack) null) && !BlockFalling.canFall(this.world, i, j - 1, k) /* mimic the false conditions of setTypeIdAndData */ && i >= -30000000 && k >= -30000000 && i < 30000000 && k < 30000000 && j > 0 && j < 256 && !(this.world.getType(i, j, k) == this.id && this.world.getData(i, j, k) == this.data)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this, i, j, k, this.id, this.data).isCancelled()) {
|
||||
return;
|
||||
|
@ -12,7 +12,7 @@ public abstract class EntityFireball extends Entity {
|
||||
private Block h;
|
||||
private boolean i;
|
||||
public EntityLiving shooter;
|
||||
private int j;
|
||||
private int at;
|
||||
private int au;
|
||||
public double dirX;
|
||||
public double dirY;
|
||||
@ -72,8 +72,8 @@ public abstract class EntityFireball extends Entity {
|
||||
this.setOnFire(1);
|
||||
if (this.i) {
|
||||
if (this.world.getType(this.e, this.f, this.g) == this.h) {
|
||||
++this.j;
|
||||
if (this.j == 600) {
|
||||
++this.at;
|
||||
if (this.at == 600) {
|
||||
this.die();
|
||||
}
|
||||
|
||||
@ -84,20 +84,20 @@ public abstract class EntityFireball extends Entity {
|
||||
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.j = 0;
|
||||
this.at = 0;
|
||||
this.au = 0;
|
||||
} else {
|
||||
++this.au;
|
||||
}
|
||||
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ);
|
||||
Vec3D vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
Vec3D vec3d = Vec3D.a(this.locX, this.locY, this.locZ);
|
||||
Vec3D vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
MovingObjectPosition movingobjectposition = this.world.a(vec3d, vec3d1);
|
||||
|
||||
vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ);
|
||||
vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
vec3d = Vec3D.a(this.locX, this.locY, this.locZ);
|
||||
vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
if (movingobjectposition != null) {
|
||||
vec3d1 = this.world.getVec3DPool().create(movingobjectposition.pos.c, movingobjectposition.pos.d, movingobjectposition.pos.e);
|
||||
vec3d1 = Vec3D.a(movingobjectposition.pos.a, movingobjectposition.pos.b, movingobjectposition.pos.c);
|
||||
}
|
||||
|
||||
Entity entity = null;
|
||||
@ -107,7 +107,7 @@ public abstract class EntityFireball extends Entity {
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
Entity entity1 = (Entity) list.get(i);
|
||||
|
||||
if (entity1.R() && (!entity1.h(this.shooter) || this.au >= 25)) {
|
||||
if (entity1.Q() && (!entity1.i(this.shooter) || this.au >= 25)) {
|
||||
float f = 0.3F;
|
||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f);
|
||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
||||
@ -130,7 +130,7 @@ public abstract class EntityFireball extends Entity {
|
||||
if (movingobjectposition != null) {
|
||||
this.a(movingobjectposition);
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - Fire ProjectileHitEvent
|
||||
if (this.dead) {
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this);
|
||||
}
|
||||
@ -164,7 +164,7 @@ public abstract class EntityFireball extends Entity {
|
||||
this.yaw = this.lastYaw + (this.yaw - this.lastYaw) * 0.2F;
|
||||
float f2 = this.e();
|
||||
|
||||
if (this.M()) {
|
||||
if (this.L()) {
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
float f3 = 0.25F;
|
||||
|
||||
@ -220,11 +220,11 @@ public abstract class EntityFireball extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean R() {
|
||||
public boolean Q() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public float af() {
|
||||
public float ae() {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@ -232,7 +232,7 @@ public abstract class EntityFireball extends Entity {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
this.Q();
|
||||
this.P();
|
||||
if (damagesource.getEntity() != null) {
|
||||
// CraftBukkit start
|
||||
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(damagesource.getEntity().getBukkitEntity(), this.getBukkitEntity(), org.bukkit.event.entity.EntityDamageEvent.DamageCause.ENTITY_ATTACK, f);
|
||||
@ -244,12 +244,12 @@ public abstract class EntityFireball extends Entity {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
Vec3D vec3d = damagesource.getEntity().ag();
|
||||
Vec3D vec3d = damagesource.getEntity().af();
|
||||
|
||||
if (vec3d != null) {
|
||||
this.motX = vec3d.c;
|
||||
this.motY = vec3d.d;
|
||||
this.motZ = vec3d.e;
|
||||
this.motX = vec3d.a;
|
||||
this.motY = vec3d.b;
|
||||
this.motZ = vec3d.c;
|
||||
this.dirX = this.motX * 0.1D;
|
||||
this.dirY = this.motY * 0.1D;
|
||||
this.dirZ = this.motZ * 0.1D;
|
||||
|
@ -39,9 +39,9 @@ public class EntityFireworks extends Entity {
|
||||
}
|
||||
|
||||
public void h() {
|
||||
this.T = this.locX;
|
||||
this.U = this.locY;
|
||||
this.V = this.locZ;
|
||||
this.S = this.locX;
|
||||
this.T = this.locY;
|
||||
this.U = this.locZ;
|
||||
super.h();
|
||||
this.motX *= 1.15D;
|
||||
this.motZ *= 1.15D;
|
||||
@ -115,7 +115,7 @@ public class EntityFireworks extends Entity {
|
||||
return super.d(f);
|
||||
}
|
||||
|
||||
public boolean av() {
|
||||
public boolean au() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ public class EntityFishingHook extends Entity {
|
||||
private int g = -1;
|
||||
private int h = -1;
|
||||
private int i = -1;
|
||||
private Block j;
|
||||
private Block at;
|
||||
private boolean au;
|
||||
public int a;
|
||||
public EntityHuman owner;
|
||||
@ -39,12 +39,12 @@ public class EntityFishingHook extends Entity {
|
||||
public EntityFishingHook(World world) {
|
||||
super(world);
|
||||
this.a(0.25F, 0.25F);
|
||||
this.al = true;
|
||||
this.ak = true;
|
||||
}
|
||||
|
||||
public EntityFishingHook(World world, EntityHuman entityhuman) {
|
||||
super(world);
|
||||
this.al = true;
|
||||
this.ak = true;
|
||||
this.owner = entityhuman;
|
||||
this.owner.hookedFish = this;
|
||||
this.a(0.25F, 0.25F);
|
||||
@ -101,9 +101,9 @@ public class EntityFishingHook extends Entity {
|
||||
this.b(this.yaw, this.pitch);
|
||||
} else {
|
||||
if (!this.world.isStatic) {
|
||||
ItemStack itemstack = this.owner.bD();
|
||||
ItemStack itemstack = this.owner.bE();
|
||||
|
||||
if (this.owner.dead || !this.owner.isAlive() || itemstack == null || itemstack.getItem() != Items.FISHING_ROD || this.e(this.owner) > 1024.0D) {
|
||||
if (this.owner.dead || !this.owner.isAlive() || itemstack == null || itemstack.getItem() != Items.FISHING_ROD || this.f(this.owner) > 1024.0D) {
|
||||
this.die();
|
||||
this.owner.hookedFish = null;
|
||||
return;
|
||||
@ -126,7 +126,7 @@ public class EntityFishingHook extends Entity {
|
||||
}
|
||||
|
||||
if (this.au) {
|
||||
if (this.world.getType(this.g, this.h, this.i) == this.j) {
|
||||
if (this.world.getType(this.g, this.h, this.i) == this.at) {
|
||||
++this.av;
|
||||
if (this.av == 1200) {
|
||||
this.die();
|
||||
@ -145,14 +145,14 @@ public class EntityFishingHook extends Entity {
|
||||
++this.aw;
|
||||
}
|
||||
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ);
|
||||
Vec3D vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
Vec3D vec3d = Vec3D.a(this.locX, this.locY, this.locZ);
|
||||
Vec3D vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
MovingObjectPosition movingobjectposition = this.world.a(vec3d, vec3d1);
|
||||
|
||||
vec3d = this.world.getVec3DPool().create(this.locX, this.locY, this.locZ);
|
||||
vec3d1 = this.world.getVec3DPool().create(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
vec3d = Vec3D.a(this.locX, this.locY, this.locZ);
|
||||
vec3d1 = Vec3D.a(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ);
|
||||
if (movingobjectposition != null) {
|
||||
vec3d1 = this.world.getVec3DPool().create(movingobjectposition.pos.c, movingobjectposition.pos.d, movingobjectposition.pos.e);
|
||||
vec3d1 = Vec3D.a(movingobjectposition.pos.a, movingobjectposition.pos.b, movingobjectposition.pos.c);
|
||||
}
|
||||
|
||||
Entity entity = null;
|
||||
@ -164,7 +164,7 @@ public class EntityFishingHook extends Entity {
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
Entity entity1 = (Entity) list.get(i);
|
||||
|
||||
if (entity1.R() && (entity1 != this.owner || this.aw >= 5)) {
|
||||
if (entity1.Q() && (entity1 != this.owner || this.aw >= 5)) {
|
||||
float f = 0.3F;
|
||||
AxisAlignedBB axisalignedbb = entity1.boundingBox.grow((double) f, (double) f, (double) f);
|
||||
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
|
||||
@ -230,7 +230,7 @@ public class EntityFishingHook extends Entity {
|
||||
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;
|
||||
AxisAlignedBB axisalignedbb1 = AxisAlignedBB.a().a(this.boundingBox.a, d7, this.boundingBox.c, this.boundingBox.d, d8, this.boundingBox.f);
|
||||
AxisAlignedBB axisalignedbb1 = AxisAlignedBB.a(this.boundingBox.a, d7, this.boundingBox.c, this.boundingBox.d, d8, this.boundingBox.f);
|
||||
|
||||
if (this.world.b(axisalignedbb1, Material.WATER)) {
|
||||
d6 += 1.0D / (double) b0;
|
||||
@ -344,7 +344,7 @@ public class EntityFishingHook extends Entity {
|
||||
nbttagcompound.setShort("xTile", (short) this.g);
|
||||
nbttagcompound.setShort("yTile", (short) this.h);
|
||||
nbttagcompound.setShort("zTile", (short) this.i);
|
||||
nbttagcompound.setByte("inTile", (byte) Block.b(this.j));
|
||||
nbttagcompound.setByte("inTile", (byte) Block.b(this.at));
|
||||
nbttagcompound.setByte("shake", (byte) this.a);
|
||||
nbttagcompound.setByte("inGround", (byte) (this.au ? 1 : 0));
|
||||
}
|
||||
@ -353,7 +353,7 @@ public class EntityFishingHook extends Entity {
|
||||
this.g = nbttagcompound.getShort("xTile");
|
||||
this.h = nbttagcompound.getShort("yTile");
|
||||
this.i = nbttagcompound.getShort("zTile");
|
||||
this.j = Block.e(nbttagcompound.getByte("inTile") & 255);
|
||||
this.at = Block.e(nbttagcompound.getByte("inTile") & 255);
|
||||
this.a = nbttagcompound.getByte("shake") & 255;
|
||||
this.au = nbttagcompound.getByte("inGround") == 1;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
|
||||
public int h;
|
||||
public double i;
|
||||
public double j;
|
||||
public double bm;
|
||||
public double bn;
|
||||
private Entity target;
|
||||
private int br;
|
||||
@ -42,12 +42,12 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
this.datawatcher.a(16, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(10.0D);
|
||||
}
|
||||
|
||||
protected void bq() {
|
||||
protected void bp() {
|
||||
if (!this.world.isStatic && this.world.difficulty == EnumDifficulty.PEACEFUL) {
|
||||
this.die();
|
||||
}
|
||||
@ -55,32 +55,32 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
this.w();
|
||||
this.bo = this.bp;
|
||||
double d0 = this.i - this.locX;
|
||||
double d1 = this.j - this.locY;
|
||||
double d1 = this.bm - this.locY;
|
||||
double d2 = this.bn - this.locZ;
|
||||
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
|
||||
if (d3 < 1.0D || d3 > 3600.0D) {
|
||||
this.i = this.locX + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
this.j = this.locY + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
this.bm = this.locY + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
this.bn = this.locZ + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
}
|
||||
|
||||
if (this.h-- <= 0) {
|
||||
this.h += this.random.nextInt(5) + 2;
|
||||
d3 = (double) MathHelper.sqrt(d3);
|
||||
if (this.a(this.i, this.j, this.bn, d3)) {
|
||||
if (this.a(this.i, this.bm, this.bn, d3)) {
|
||||
this.motX += d0 / d3 * 0.1D;
|
||||
this.motY += d1 / d3 * 0.1D;
|
||||
this.motZ += d2 / d3 * 0.1D;
|
||||
} else {
|
||||
this.i = this.locX;
|
||||
this.j = this.locY;
|
||||
this.bm = this.locY;
|
||||
this.bn = this.locZ;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.target != null && this.target.dead) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire EntityTargetEvent
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, EntityTargetEvent.TargetReason.TARGET_DIED);
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
@ -95,7 +95,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
}
|
||||
|
||||
if (this.target == null || this.br-- <= 0) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire EntityTargetEvent
|
||||
Entity target = this.world.findNearbyVulnerablePlayer(this, 100.0D);
|
||||
if (target != null) {
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), target.getBukkitEntity(), EntityTargetEvent.TargetReason.CLOSEST_PLAYER);
|
||||
@ -118,13 +118,13 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
|
||||
double d4 = 64.0D;
|
||||
|
||||
if (this.target != null && this.target.e((Entity) this) < d4 * d4) {
|
||||
if (this.target != null && this.target.f((Entity) this) < d4 * d4) {
|
||||
double d5 = this.target.locX - this.locX;
|
||||
double d6 = this.target.boundingBox.b + (double) (this.target.length / 2.0F) - (this.locY + (double) (this.length / 2.0F));
|
||||
double d7 = this.target.locZ - this.locZ;
|
||||
|
||||
this.aN = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F;
|
||||
if (this.o(this.target)) {
|
||||
this.aM = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F;
|
||||
if (this.p(this.target)) {
|
||||
if (this.bp == 10) {
|
||||
this.world.a((EntityHuman) null, 1007, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
||||
}
|
||||
@ -139,9 +139,9 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
double d8 = 4.0D;
|
||||
Vec3D vec3d = this.j(1.0F);
|
||||
|
||||
entitylargefireball.locX = this.locX + vec3d.c * d8;
|
||||
entitylargefireball.locX = this.locX + vec3d.a * d8;
|
||||
entitylargefireball.locY = this.locY + (double) (this.length / 2.0F) + 0.5D;
|
||||
entitylargefireball.locZ = this.locZ + vec3d.e * d8;
|
||||
entitylargefireball.locZ = this.locZ + vec3d.c * d8;
|
||||
this.world.addEntity(entitylargefireball);
|
||||
this.bp = -40;
|
||||
}
|
||||
@ -149,7 +149,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
--this.bp;
|
||||
}
|
||||
} else {
|
||||
this.aN = this.yaw = -((float) Math.atan2(this.motX, this.motZ)) * 180.0F / 3.1415927F;
|
||||
this.aM = this.yaw = -((float) Math.atan2(this.motX, this.motZ)) * 180.0F / 3.1415927F;
|
||||
if (this.bp > 0) {
|
||||
--this.bp;
|
||||
}
|
||||
@ -167,7 +167,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
|
||||
private boolean a(double d0, double d1, double d2, double d3) {
|
||||
double d4 = (this.i - this.locX) / d3;
|
||||
double d5 = (this.j - this.locY) / d3;
|
||||
double d5 = (this.bm - this.locY) / d3;
|
||||
double d6 = (this.bn - this.locZ) / d3;
|
||||
AxisAlignedBB axisalignedbb = this.boundingBox.clone();
|
||||
|
||||
@ -185,11 +185,11 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
return "mob.ghast.moan";
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.ghast.scream";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "mob.ghast.death";
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
protected float bf() {
|
||||
protected float be() {
|
||||
return 10.0F;
|
||||
}
|
||||
|
||||
@ -226,7 +226,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
return this.random.nextInt(20) == 0 && super.canSpawn() && this.world.difficulty != EnumDifficulty.PEACEFUL;
|
||||
}
|
||||
|
||||
public int bz() {
|
||||
public int bB() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ public abstract class EntityHanging extends Entity {
|
||||
if (this.e++ == 100 && !this.world.isStatic) {
|
||||
this.e = 0;
|
||||
if (!this.dead && !this.survives()) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire break events
|
||||
Material material = this.world.getType((int) this.locX, (int) this.locY, (int) this.locZ).getMaterial();
|
||||
HangingBreakEvent.RemoveCause cause;
|
||||
|
||||
@ -199,11 +199,11 @@ public abstract class EntityHanging extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean R() {
|
||||
public boolean Q() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean i(Entity entity) {
|
||||
public boolean j(Entity entity) {
|
||||
return entity instanceof EntityHuman ? this.damageEntity(DamageSource.playerAttack((EntityHuman) entity), 0.0F) : false;
|
||||
}
|
||||
|
||||
@ -216,7 +216,7 @@ public abstract class EntityHanging extends Entity {
|
||||
return false;
|
||||
} else {
|
||||
if (!this.dead && !this.world.isStatic) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire break events
|
||||
HangingBreakEvent event = new HangingBreakEvent((Hanging) this.getBukkitEntity(), HangingBreakEvent.RemoveCause.DEFAULT);
|
||||
PaintingBreakEvent paintingEvent = null;
|
||||
if (damagesource.getEntity() != null) {
|
||||
@ -226,7 +226,7 @@ public abstract class EntityHanging extends Entity {
|
||||
// Fire old painting event until it can be removed
|
||||
paintingEvent = new org.bukkit.event.painting.PaintingBreakByEntityEvent((Painting) this.getBukkitEntity(), damagesource.getEntity() == null ? null : damagesource.getEntity().getBukkitEntity());
|
||||
}
|
||||
} else if (damagesource.c()) {
|
||||
} else if (damagesource.isExplosion()) {
|
||||
event = new HangingBreakEvent((Hanging) this.getBukkitEntity(), HangingBreakEvent.RemoveCause.EXPLOSION);
|
||||
}
|
||||
|
||||
@ -243,7 +243,7 @@ public abstract class EntityHanging extends Entity {
|
||||
// CraftBukkit end
|
||||
|
||||
this.die();
|
||||
this.Q();
|
||||
this.P();
|
||||
this.b(damagesource.getEntity());
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ public abstract class EntityHanging extends Entity {
|
||||
if (!this.world.isStatic && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) {
|
||||
if (this.dead) return; // CraftBukkit
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire break events
|
||||
// TODO - Does this need its own cause? Seems to only be triggered by pistons
|
||||
HangingBreakEvent event = new HangingBreakEvent((Hanging) this.getBukkitEntity(), HangingBreakEvent.RemoveCause.PHYSICS);
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
@ -334,7 +334,7 @@ public abstract class EntityHanging extends Entity {
|
||||
|
||||
public abstract void b(Entity entity);
|
||||
|
||||
protected boolean V() {
|
||||
protected boolean U() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
|
||||
public void setType(int i) {
|
||||
this.datawatcher.watch(19, Byte.valueOf((byte) i));
|
||||
this.cN();
|
||||
this.cP();
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
@ -78,7 +78,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
|
||||
public void setVariant(int i) {
|
||||
this.datawatcher.watch(20, Integer.valueOf(i));
|
||||
this.cN();
|
||||
this.cP();
|
||||
}
|
||||
|
||||
public int getVariant() {
|
||||
@ -125,7 +125,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean bZ() {
|
||||
public boolean cb() {
|
||||
return !this.isBaby();
|
||||
}
|
||||
|
||||
@ -133,8 +133,8 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return this.x(2);
|
||||
}
|
||||
|
||||
public boolean ce() {
|
||||
return this.bZ();
|
||||
public boolean cg() {
|
||||
return this.cb();
|
||||
}
|
||||
|
||||
public String getOwnerName() {
|
||||
@ -145,7 +145,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.datawatcher.watch(21, s);
|
||||
}
|
||||
|
||||
public float cg() {
|
||||
public float ci() {
|
||||
int i = this.getAge();
|
||||
|
||||
return i >= 0 ? 1.0F : 0.5F + (float) (-24000 - i) / -24000.0F * 0.5F;
|
||||
@ -153,13 +153,13 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
|
||||
public void a(boolean flag) {
|
||||
if (flag) {
|
||||
this.a(this.cg());
|
||||
this.a(this.ci());
|
||||
} else {
|
||||
this.a(1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean ch() {
|
||||
public boolean cj() {
|
||||
return this.br;
|
||||
}
|
||||
|
||||
@ -171,12 +171,12 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.br = flag;
|
||||
}
|
||||
|
||||
public boolean bK() {
|
||||
return !this.cC() && super.bK();
|
||||
public boolean bM() {
|
||||
return !this.cE() && super.bM();
|
||||
}
|
||||
|
||||
protected void o(float f) {
|
||||
if (f > 6.0F && this.ck()) {
|
||||
if (f > 6.0F && this.cm()) {
|
||||
this.o(false);
|
||||
}
|
||||
}
|
||||
@ -185,7 +185,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return this.x(8);
|
||||
}
|
||||
|
||||
public int cj() {
|
||||
public int cl() {
|
||||
return this.datawatcher.getInt(22);
|
||||
}
|
||||
|
||||
@ -199,25 +199,25 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean ck() {
|
||||
public boolean cm() {
|
||||
return this.x(32);
|
||||
}
|
||||
|
||||
public boolean cl() {
|
||||
public boolean cn() {
|
||||
return this.x(64);
|
||||
}
|
||||
|
||||
public boolean cm() {
|
||||
public boolean co() {
|
||||
return this.x(16);
|
||||
}
|
||||
|
||||
public boolean cn() {
|
||||
public boolean cp() {
|
||||
return this.bH;
|
||||
}
|
||||
|
||||
public void d(ItemStack itemstack) {
|
||||
this.datawatcher.watch(22, Integer.valueOf(this.e(itemstack)));
|
||||
this.cN();
|
||||
this.cP();
|
||||
}
|
||||
|
||||
public void k(boolean flag) {
|
||||
@ -257,15 +257,15 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return this.passenger != null && this.passenger.equals(entity) ? false : super.damageEntity(damagesource, f);
|
||||
}
|
||||
|
||||
public int aV() {
|
||||
return by[this.cj()];
|
||||
public int aU() {
|
||||
return by[this.cl()];
|
||||
}
|
||||
|
||||
public boolean S() {
|
||||
public boolean R() {
|
||||
return this.passenger == null;
|
||||
}
|
||||
|
||||
public boolean cp() {
|
||||
public boolean cr() {
|
||||
int i = MathHelper.floor(this.locX);
|
||||
int j = MathHelper.floor(this.locZ);
|
||||
|
||||
@ -273,15 +273,15 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void cq() {
|
||||
public void cs() {
|
||||
if (!this.world.isStatic && this.hasChest()) {
|
||||
this.a(Item.getItemOf(Blocks.CHEST), 1);
|
||||
this.setHasChest(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void cJ() {
|
||||
this.cQ();
|
||||
private void cL() {
|
||||
this.cS();
|
||||
this.world.makeSound(this, "eating", 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F);
|
||||
}
|
||||
|
||||
@ -293,7 +293,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
int i = MathHelper.f(f * 0.5F - 3.0F);
|
||||
|
||||
if (i > 0) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire EntityDamageEvent
|
||||
EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, this, EntityDamageEvent.DamageCause.FALL, i);
|
||||
if (!event.isCancelled()) {
|
||||
float damage = (float) event.getDamage();
|
||||
@ -325,7 +325,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
private int cK() {
|
||||
private int cM() {
|
||||
int i = this.getType();
|
||||
|
||||
return this.hasChest() /* && (i == 1 || i == 2) */ ? 17 : 2; // CraftBukkit - Remove type check
|
||||
@ -334,7 +334,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
public void loadChest() { // CraftBukkit - private -> public
|
||||
InventoryHorseChest inventoryhorsechest = this.inventoryChest;
|
||||
|
||||
this.inventoryChest = new InventoryHorseChest("HorseChest", this.cK(), this); // CraftBukkit - add this horse
|
||||
this.inventoryChest = new InventoryHorseChest("HorseChest", this.cM(), this); // CraftBukkit - add this horse
|
||||
this.inventoryChest.a(this.getName());
|
||||
if (inventoryhorsechest != null) {
|
||||
inventoryhorsechest.b(this);
|
||||
@ -352,38 +352,38 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
this.inventoryChest.a(this);
|
||||
this.cM();
|
||||
this.cO();
|
||||
}
|
||||
|
||||
private void cM() {
|
||||
private void cO() {
|
||||
if (!this.world.isStatic) {
|
||||
this.n(this.inventoryChest.getItem(0) != null);
|
||||
if (this.cz()) {
|
||||
if (this.cB()) {
|
||||
this.d(this.inventoryChest.getItem(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void a(InventorySubcontainer inventorysubcontainer) {
|
||||
int i = this.cj();
|
||||
boolean flag = this.cs();
|
||||
int i = this.cl();
|
||||
boolean flag = this.cu();
|
||||
|
||||
this.cM();
|
||||
if (this.ticksLived > 20) {
|
||||
if (i == 0 && i != this.cj()) {
|
||||
if (i == 0 && i != this.cl()) {
|
||||
this.makeSound("mob.horse.armor", 0.5F, 1.0F);
|
||||
} else if (i != this.cj()) {
|
||||
} else if (i != this.cl()) {
|
||||
this.makeSound("mob.horse.armor", 0.5F, 1.0F);
|
||||
}
|
||||
|
||||
if (!flag && this.cs()) {
|
||||
if (!flag && this.cu()) {
|
||||
this.makeSound("mob.horse.leather", 0.5F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canSpawn() {
|
||||
this.cp();
|
||||
this.cr();
|
||||
return super.canSpawn();
|
||||
}
|
||||
|
||||
@ -410,8 +410,8 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return this.getAttributeInstance(attributeJumpStrength).getValue();
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
this.cQ();
|
||||
protected String aT() {
|
||||
this.cS();
|
||||
int i = this.getType();
|
||||
|
||||
return i == 3 ? "mob.horse.zombie.death" : (i == 4 ? "mob.horse.skeleton.death" : (i != 1 && i != 2 ? "mob.horse.death" : "mob.horse.donkey.death"));
|
||||
@ -424,10 +424,10 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return i == 4 ? Items.BONE : (i == 3 ? (flag ? Item.d(0) : Items.ROTTEN_FLESH) : Items.LEATHER);
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
this.cQ();
|
||||
protected String aS() {
|
||||
this.cS();
|
||||
if (this.random.nextInt(3) == 0) {
|
||||
this.cS();
|
||||
this.cU();
|
||||
}
|
||||
|
||||
int i = this.getType();
|
||||
@ -435,14 +435,14 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return i == 3 ? "mob.horse.zombie.hit" : (i == 4 ? "mob.horse.skeleton.hit" : (i != 1 && i != 2 ? "mob.horse.hit" : "mob.horse.donkey.hit"));
|
||||
}
|
||||
|
||||
public boolean cs() {
|
||||
public boolean cu() {
|
||||
return this.x(4);
|
||||
}
|
||||
|
||||
protected String t() {
|
||||
this.cQ();
|
||||
if (this.random.nextInt(10) == 0 && !this.bh()) {
|
||||
this.cS();
|
||||
this.cS();
|
||||
if (this.random.nextInt(10) == 0 && !this.bg()) {
|
||||
this.cU();
|
||||
}
|
||||
|
||||
int i = this.getType();
|
||||
@ -450,9 +450,9 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return i == 3 ? "mob.horse.zombie.idle" : (i == 4 ? "mob.horse.skeleton.idle" : (i != 1 && i != 2 ? "mob.horse.idle" : "mob.horse.donkey.idle"));
|
||||
}
|
||||
|
||||
protected String ct() {
|
||||
this.cQ();
|
||||
protected String cv() {
|
||||
this.cS();
|
||||
this.cU();
|
||||
int i = this.getType();
|
||||
|
||||
return i != 3 && i != 4 ? (i != 1 && i != 2 ? "mob.horse.angry" : "mob.horse.donkey.angry") : null;
|
||||
@ -486,14 +486,14 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
this.bc().b(attributeJumpStrength);
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.bb().b(attributeJumpStrength);
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(53.0D);
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.22499999403953552D);
|
||||
}
|
||||
|
||||
public int bz() {
|
||||
public int bB() {
|
||||
return 6;
|
||||
}
|
||||
|
||||
@ -501,7 +501,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return this.maxDomestication; // CraftBukkit - return stored max domestication instead of 100
|
||||
}
|
||||
|
||||
protected float bf() {
|
||||
protected float be() {
|
||||
return 0.8F;
|
||||
}
|
||||
|
||||
@ -509,7 +509,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return 400;
|
||||
}
|
||||
|
||||
private void cN() {
|
||||
private void cP() {
|
||||
this.bQ = null;
|
||||
}
|
||||
|
||||
@ -525,18 +525,18 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
|
||||
if (itemstack != null && itemstack.getItem() == Items.MONSTER_EGG) {
|
||||
return super.a(entityhuman);
|
||||
} else if (!this.isTame() && this.cC()) {
|
||||
} else if (!this.isTame() && this.cE()) {
|
||||
return false;
|
||||
} else if (this.isTame() && this.bZ() && entityhuman.isSneaking()) {
|
||||
} else if (this.isTame() && this.cb() && entityhuman.isSneaking()) {
|
||||
this.g(entityhuman);
|
||||
return true;
|
||||
} else if (this.ce() && this.passenger != null) {
|
||||
} else if (this.cg() && this.passenger != null) {
|
||||
return super.a(entityhuman);
|
||||
} else {
|
||||
if (itemstack != null) {
|
||||
boolean flag = false;
|
||||
|
||||
if (this.cz()) {
|
||||
if (this.cB()) {
|
||||
byte b0 = -1;
|
||||
|
||||
if (itemstack.getItem() == Items.HORSE_ARMOR_IRON) {
|
||||
@ -549,7 +549,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
|
||||
if (b0 >= 0) {
|
||||
if (!this.isTame()) {
|
||||
this.cH();
|
||||
this.cJ();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -558,7 +558,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
if (!flag && !this.cC()) {
|
||||
if (!flag && !this.cE()) {
|
||||
float f = 0.0F;
|
||||
short short1 = 0;
|
||||
byte b1 = 0;
|
||||
@ -605,7 +605,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!this.bZ() && short1 > 0) {
|
||||
if (!this.cb() && short1 > 0) {
|
||||
this.a(short1);
|
||||
flag = true;
|
||||
}
|
||||
@ -616,7 +616,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
this.cJ();
|
||||
this.cL();
|
||||
}
|
||||
}
|
||||
|
||||
@ -625,18 +625,18 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return true;
|
||||
}
|
||||
|
||||
this.cH();
|
||||
this.cJ();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!flag && this.cA() && !this.hasChest() && itemstack.getItem() == Item.getItemOf(Blocks.CHEST)) {
|
||||
if (!flag && this.cC() && !this.hasChest() && itemstack.getItem() == Item.getItemOf(Blocks.CHEST)) {
|
||||
this.setHasChest(true);
|
||||
this.makeSound("mob.chickenplop", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
flag = true;
|
||||
this.loadChest();
|
||||
}
|
||||
|
||||
if (!flag && this.ce() && !this.cs() && itemstack.getItem() == Items.SADDLE) {
|
||||
if (!flag && this.cg() && !this.cu() && itemstack.getItem() == Items.SADDLE) {
|
||||
this.g(entityhuman);
|
||||
return true;
|
||||
}
|
||||
@ -650,7 +650,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.ce() && this.passenger == null) {
|
||||
if (this.cg() && this.passenger == null) {
|
||||
if (itemstack != null && itemstack.a(entityhuman, (EntityLiving) this)) {
|
||||
return true;
|
||||
} else {
|
||||
@ -673,48 +673,48 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean cz() {
|
||||
public boolean cB() {
|
||||
return this.getType() == 0;
|
||||
}
|
||||
|
||||
public boolean cA() {
|
||||
int i = this.getType();
|
||||
|
||||
return i == 2 || i == 1;
|
||||
}
|
||||
|
||||
protected boolean bh() {
|
||||
return this.passenger != null && this.cs() ? true : this.ck() || this.cl();
|
||||
}
|
||||
|
||||
public boolean cC() {
|
||||
int i = this.getType();
|
||||
|
||||
return i == 2 || i == 1;
|
||||
}
|
||||
|
||||
protected boolean bg() {
|
||||
return this.passenger != null && this.cu() ? true : this.cm() || this.cn();
|
||||
}
|
||||
|
||||
public boolean cE() {
|
||||
int i = this.getType();
|
||||
|
||||
return i == 3 || i == 4;
|
||||
}
|
||||
|
||||
public boolean cD() {
|
||||
return this.cC() || this.getType() == 2;
|
||||
public boolean cF() {
|
||||
return this.cE() || this.getType() == 2;
|
||||
}
|
||||
|
||||
public boolean c(ItemStack itemstack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void cP() {
|
||||
private void cR() {
|
||||
this.bp = 1;
|
||||
}
|
||||
|
||||
public void die(DamageSource damagesource) {
|
||||
super.die(damagesource);
|
||||
if (!this.world.isStatic) {
|
||||
this.cI();
|
||||
this.cK();
|
||||
}
|
||||
}
|
||||
|
||||
public void e() {
|
||||
if (this.random.nextInt(200) == 0) {
|
||||
this.cP();
|
||||
this.cR();
|
||||
}
|
||||
|
||||
super.e();
|
||||
@ -723,19 +723,19 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.heal(1.0F);
|
||||
}
|
||||
|
||||
if (!this.ck() && this.passenger == null && this.random.nextInt(300) == 0 && this.world.getType(MathHelper.floor(this.locX), MathHelper.floor(this.locY) - 1, MathHelper.floor(this.locZ)) == Blocks.GRASS) {
|
||||
if (!this.cm() && this.passenger == null && this.random.nextInt(300) == 0 && this.world.getType(MathHelper.floor(this.locX), MathHelper.floor(this.locY) - 1, MathHelper.floor(this.locZ)) == Blocks.GRASS) {
|
||||
this.o(true);
|
||||
}
|
||||
|
||||
if (this.ck() && ++this.bD > 50) {
|
||||
if (this.cm() && ++this.bD > 50) {
|
||||
this.bD = 0;
|
||||
this.o(false);
|
||||
}
|
||||
|
||||
if (this.cm() && !this.bZ() && !this.ck()) {
|
||||
if (this.co() && !this.cb() && !this.cm()) {
|
||||
EntityHorse entityhorse = this.a(this, 16.0D);
|
||||
|
||||
if (entityhorse != null && this.e(entityhorse) > 4.0D) {
|
||||
if (entityhorse != null && this.f(entityhorse) > 4.0D) {
|
||||
PathEntity pathentity = this.world.findPath(this, entityhorse, 16.0F, true, false, false, true);
|
||||
|
||||
this.setPathEntity(pathentity);
|
||||
@ -748,7 +748,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
super.h();
|
||||
if (this.world.isStatic && this.datawatcher.a()) {
|
||||
this.datawatcher.e();
|
||||
this.cN();
|
||||
this.cP();
|
||||
}
|
||||
|
||||
if (this.bE > 0 && ++this.bE > 30) {
|
||||
@ -773,7 +773,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
this.bK = this.bJ;
|
||||
if (this.ck()) {
|
||||
if (this.cm()) {
|
||||
this.bJ += (1.0F - this.bJ) * 0.4F + 0.05F;
|
||||
if (this.bJ > 1.0F) {
|
||||
this.bJ = 1.0F;
|
||||
@ -786,7 +786,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
this.bM = this.bL;
|
||||
if (this.cl()) {
|
||||
if (this.cn()) {
|
||||
this.bK = this.bJ = 0.0F;
|
||||
this.bL += (1.0F - this.bL) * 0.4F + 0.05F;
|
||||
if (this.bL > 1.0F) {
|
||||
@ -814,15 +814,15 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void cQ() {
|
||||
private void cS() {
|
||||
if (!this.world.isStatic) {
|
||||
this.bE = 1;
|
||||
this.b(128, true);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean cR() {
|
||||
return this.passenger == null && this.vehicle == null && this.isTame() && this.bZ() && !this.cD() && this.getHealth() >= this.getMaxHealth();
|
||||
private boolean cT() {
|
||||
return this.passenger == null && this.vehicle == null && this.isTame() && this.cb() && !this.cF() && this.getHealth() >= this.getMaxHealth();
|
||||
}
|
||||
|
||||
public void e(boolean flag) {
|
||||
@ -841,25 +841,25 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.b(64, flag);
|
||||
}
|
||||
|
||||
private void cS() {
|
||||
private void cU() {
|
||||
if (!this.world.isStatic) {
|
||||
this.bF = 1;
|
||||
this.p(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void cH() {
|
||||
this.cS();
|
||||
String s = this.ct();
|
||||
public void cJ() {
|
||||
this.cU();
|
||||
String s = this.cv();
|
||||
|
||||
if (s != null) {
|
||||
this.makeSound(s, this.bf(), this.bg());
|
||||
this.makeSound(s, this.be(), this.bf());
|
||||
}
|
||||
}
|
||||
|
||||
public void cI() {
|
||||
public void cK() {
|
||||
this.a(this, this.inventoryChest);
|
||||
this.cq();
|
||||
this.cs();
|
||||
}
|
||||
|
||||
private void a(Entity entity, InventoryHorseChest inventoryhorsechest) {
|
||||
@ -881,31 +881,31 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
public void e(float f, float f1) {
|
||||
if (this.passenger != null && this.passenger instanceof EntityLiving && this.cs()) { // CraftBukkit - Check type of passenger
|
||||
if (this.passenger != null && this.passenger instanceof EntityLiving && this.cu()) {
|
||||
this.lastYaw = this.yaw = this.passenger.yaw;
|
||||
this.pitch = this.passenger.pitch * 0.5F;
|
||||
this.b(this.yaw, this.pitch);
|
||||
this.aP = this.aN = this.yaw;
|
||||
f = ((EntityLiving) this.passenger).be * 0.5F;
|
||||
f1 = ((EntityLiving) this.passenger).bf;
|
||||
this.aO = this.aM = this.yaw;
|
||||
f = ((EntityLiving) this.passenger).bd * 0.5F;
|
||||
f1 = ((EntityLiving) this.passenger).be;
|
||||
if (f1 <= 0.0F) {
|
||||
f1 *= 0.25F;
|
||||
this.bP = 0;
|
||||
}
|
||||
|
||||
if (this.onGround && this.bt == 0.0F && this.cl() && !this.bI) {
|
||||
if (this.onGround && this.bt == 0.0F && this.cn() && !this.bI) {
|
||||
f = 0.0F;
|
||||
f1 = 0.0F;
|
||||
}
|
||||
|
||||
if (this.bt > 0.0F && !this.ch() && this.onGround) {
|
||||
if (this.bt > 0.0F && !this.cj() && this.onGround) {
|
||||
this.motY = this.getJumpStrength() * (double) this.bt;
|
||||
if (this.hasEffect(MobEffectList.JUMP)) {
|
||||
this.motY += (double) ((float) (this.getEffect(MobEffectList.JUMP).getAmplifier() + 1) * 0.1F);
|
||||
}
|
||||
|
||||
this.j(true);
|
||||
this.am = true;
|
||||
this.al = true;
|
||||
if (f1 > 0.0F) {
|
||||
float f2 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F);
|
||||
float f3 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F);
|
||||
@ -918,8 +918,8 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.bt = 0.0F;
|
||||
}
|
||||
|
||||
this.X = 1.0F;
|
||||
this.aR = this.bl() * 0.1F;
|
||||
this.W = 1.0F;
|
||||
this.aQ = this.bk() * 0.1F;
|
||||
if (!this.world.isStatic) {
|
||||
this.i((float) this.getAttributeInstance(GenericAttributes.d).getValue());
|
||||
super.e(f, f1);
|
||||
@ -930,7 +930,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.j(false);
|
||||
}
|
||||
|
||||
this.aF = this.aG;
|
||||
this.aE = this.aF;
|
||||
double d0 = this.locX - this.lastX;
|
||||
double d1 = this.locZ - this.lastZ;
|
||||
float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F;
|
||||
@ -939,21 +939,21 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
f4 = 1.0F;
|
||||
}
|
||||
|
||||
this.aG += (f4 - this.aG) * 0.4F;
|
||||
this.aH += this.aG;
|
||||
this.aF += (f4 - this.aF) * 0.4F;
|
||||
this.aG += this.aF;
|
||||
} else {
|
||||
this.X = 0.5F;
|
||||
this.aR = 0.02F;
|
||||
this.W = 0.5F;
|
||||
this.aQ = 0.02F;
|
||||
super.e(f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
super.b(nbttagcompound);
|
||||
nbttagcompound.setBoolean("EatingHaystack", this.ck());
|
||||
nbttagcompound.setBoolean("EatingHaystack", this.cm());
|
||||
nbttagcompound.setBoolean("ChestedHorse", this.hasChest());
|
||||
nbttagcompound.setBoolean("HasReproduced", this.cn());
|
||||
nbttagcompound.setBoolean("Bred", this.cm());
|
||||
nbttagcompound.setBoolean("HasReproduced", this.cp());
|
||||
nbttagcompound.setBoolean("Bred", this.co());
|
||||
nbttagcompound.setInt("Type", this.getType());
|
||||
nbttagcompound.setInt("Variant", this.getVariant());
|
||||
nbttagcompound.setInt("Temper", this.getTemper());
|
||||
@ -1005,7 +1005,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.maxDomestication = nbttagcompound.getInt("Bukkit.MaxDomestication");
|
||||
}
|
||||
// CraftBukkit end
|
||||
AttributeInstance attributeinstance = this.bc().a("Speed");
|
||||
AttributeInstance attributeinstance = this.bb().a("Speed");
|
||||
|
||||
if (attributeinstance != null) {
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(attributeinstance.b() * 0.25D);
|
||||
@ -1044,7 +1044,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.inventoryChest.setItem(0, new ItemStack(Items.SADDLE));
|
||||
}
|
||||
|
||||
this.cM();
|
||||
this.cO();
|
||||
}
|
||||
|
||||
public boolean mate(EntityAnimal entityanimal) {
|
||||
@ -1055,7 +1055,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
} else {
|
||||
EntityHorse entityhorse = (EntityHorse) entityanimal;
|
||||
|
||||
if (this.cR() && entityhorse.cR()) {
|
||||
if (this.cT() && entityhorse.cT()) {
|
||||
int i = this.getType();
|
||||
int j = entityhorse.getType();
|
||||
|
||||
@ -1105,13 +1105,13 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
entityhorse1.setType(k);
|
||||
double d0 = this.getAttributeInstance(GenericAttributes.a).b() + entityageable.getAttributeInstance(GenericAttributes.a).b() + (double) this.cT();
|
||||
double d0 = this.getAttributeInstance(GenericAttributes.a).b() + entityageable.getAttributeInstance(GenericAttributes.a).b() + (double) this.cV();
|
||||
|
||||
entityhorse1.getAttributeInstance(GenericAttributes.a).setValue(d0 / 3.0D);
|
||||
double d1 = this.getAttributeInstance(attributeJumpStrength).b() + entityageable.getAttributeInstance(attributeJumpStrength).b() + this.cU();
|
||||
double d1 = this.getAttributeInstance(attributeJumpStrength).b() + entityageable.getAttributeInstance(attributeJumpStrength).b() + this.cW();
|
||||
|
||||
entityhorse1.getAttributeInstance(attributeJumpStrength).setValue(d1 / 3.0D);
|
||||
double d2 = this.getAttributeInstance(GenericAttributes.d).b() + entityageable.getAttributeInstance(GenericAttributes.d).b() + this.cV();
|
||||
double d2 = this.getAttributeInstance(GenericAttributes.d).b() + entityageable.getAttributeInstance(GenericAttributes.d).b() + this.cX();
|
||||
|
||||
entityhorse1.getAttributeInstance(GenericAttributes.d).setValue(d2 / 3.0D);
|
||||
return entityhorse1;
|
||||
@ -1147,9 +1147,9 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
if (j != 4 && j != 3) {
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue((double) this.cT());
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue((double) this.cV());
|
||||
if (j == 0) {
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(this.cV());
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(this.cX());
|
||||
} else {
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.17499999701976776D);
|
||||
}
|
||||
@ -1159,7 +1159,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
if (j != 2 && j != 1) {
|
||||
this.getAttributeInstance(attributeJumpStrength).setValue(this.cU());
|
||||
this.getAttributeInstance(attributeJumpStrength).setValue(this.cW());
|
||||
} else {
|
||||
this.getAttributeInstance(attributeJumpStrength).setValue(0.5D);
|
||||
}
|
||||
@ -1168,12 +1168,12 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return (GroupDataEntity) object;
|
||||
}
|
||||
|
||||
protected boolean bk() {
|
||||
protected boolean bj() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void w(int i) {
|
||||
if (this.cs()) {
|
||||
if (this.cu()) {
|
||||
// CraftBukkit start - fire HorseJumpEvent, use event power
|
||||
if (i < 0) {
|
||||
i = 0;
|
||||
@ -1189,37 +1189,37 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
org.bukkit.event.entity.HorseJumpEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callHorseJumpEvent(this, power);
|
||||
if (!event.isCancelled()) {
|
||||
this.bI = true;
|
||||
this.cS();
|
||||
this.cU();
|
||||
this.bt = event.getPower();
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
||||
public void ac() {
|
||||
super.ac();
|
||||
public void ab() {
|
||||
super.ab();
|
||||
if (this.bM > 0.0F) {
|
||||
float f = MathHelper.sin(this.aN * 3.1415927F / 180.0F);
|
||||
float f1 = MathHelper.cos(this.aN * 3.1415927F / 180.0F);
|
||||
float f = MathHelper.sin(this.aM * 3.1415927F / 180.0F);
|
||||
float f1 = MathHelper.cos(this.aM * 3.1415927F / 180.0F);
|
||||
float f2 = 0.7F * this.bM;
|
||||
float f3 = 0.15F * this.bM;
|
||||
|
||||
this.passenger.setPosition(this.locX + (double) (f2 * f), this.locY + this.ae() + this.passenger.ad() + (double) f3, this.locZ - (double) (f2 * f1));
|
||||
this.passenger.setPosition(this.locX + (double) (f2 * f), this.locY + this.ad() + this.passenger.ac() + (double) f3, this.locZ - (double) (f2 * f1));
|
||||
if (this.passenger instanceof EntityLiving) {
|
||||
((EntityLiving) this.passenger).aN = this.aN;
|
||||
((EntityLiving) this.passenger).aM = this.aM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float cT() {
|
||||
private float cV() {
|
||||
return 15.0F + (float) this.random.nextInt(8) + (float) this.random.nextInt(9);
|
||||
}
|
||||
|
||||
private double cU() {
|
||||
private double cW() {
|
||||
return 0.4000000059604645D + this.random.nextDouble() * 0.2D + this.random.nextDouble() * 0.2D + this.random.nextDouble() * 0.2D;
|
||||
}
|
||||
|
||||
private double cV() {
|
||||
private double cX() {
|
||||
return (0.44999998807907104D + this.random.nextDouble() * 0.3D + this.random.nextDouble() * 0.3D + this.random.nextDouble() * 0.3D) * 0.25D;
|
||||
}
|
||||
|
||||
|
@ -27,16 +27,16 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
public Container defaultContainer;
|
||||
public Container activeContainer;
|
||||
protected FoodMetaData foodData = new FoodMetaData(this); // CraftBukkit - add "this" to constructor
|
||||
protected int br;
|
||||
protected int bq;
|
||||
public float br;
|
||||
public float bs;
|
||||
public float bt;
|
||||
public int bu;
|
||||
public int bt;
|
||||
public double bu;
|
||||
public double bv;
|
||||
public double bw;
|
||||
public double bx;
|
||||
public double by;
|
||||
public double bz;
|
||||
public double bA;
|
||||
// CraftBukkit start
|
||||
public boolean sleeping; // protected -> public
|
||||
public boolean fauxSleeping;
|
||||
@ -48,22 +48,22 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
public ChunkCoordinates bC;
|
||||
public ChunkCoordinates bB;
|
||||
public int sleepTicks; // CraftBukkit - private -> public
|
||||
public float bC;
|
||||
public float bD;
|
||||
public float bE;
|
||||
private ChunkCoordinates c;
|
||||
private boolean d;
|
||||
private ChunkCoordinates e;
|
||||
public PlayerAbilities abilities = new PlayerAbilities();
|
||||
public int oldLevel = -1; // CraftBukkit
|
||||
public int oldLevel = -1; // CraftBukkit - add field
|
||||
public int expLevel;
|
||||
public int expTotal;
|
||||
public float exp;
|
||||
private ItemStack f;
|
||||
private int g;
|
||||
protected float bJ = 0.1F;
|
||||
protected float bK = 0.02F;
|
||||
protected float bI = 0.1F;
|
||||
protected float bJ = 0.02F;
|
||||
private int h;
|
||||
private final GameProfile i;
|
||||
public EntityFishingHook hookedFish;
|
||||
@ -78,13 +78,13 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
ChunkCoordinates chunkcoordinates = world.getSpawn();
|
||||
|
||||
this.setPositionRotation((double) chunkcoordinates.x + 0.5D, (double) (chunkcoordinates.y + 1), (double) chunkcoordinates.z + 0.5D, 0.0F, 0.0F);
|
||||
this.ba = 180.0F;
|
||||
this.az = 180.0F;
|
||||
this.maxFireTicks = 20;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
this.bc().b(GenericAttributes.e).setValue(1.0D);
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.bb().b(GenericAttributes.e).setValue(1.0D);
|
||||
}
|
||||
|
||||
protected void c() {
|
||||
@ -94,19 +94,19 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.datawatcher.a(18, Integer.valueOf(0));
|
||||
}
|
||||
|
||||
public boolean bw() {
|
||||
public boolean bx() {
|
||||
return this.f != null;
|
||||
}
|
||||
|
||||
public void by() {
|
||||
public void bz() {
|
||||
if (this.f != null) {
|
||||
this.f.b(this.world, this, this.g);
|
||||
}
|
||||
|
||||
this.bz();
|
||||
this.bA();
|
||||
}
|
||||
|
||||
public void bz() {
|
||||
public void bA() {
|
||||
this.f = null;
|
||||
this.g = 0;
|
||||
if (!this.world.isStatic) {
|
||||
@ -115,7 +115,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
public boolean isBlocking() {
|
||||
return this.bw() && this.f.getItem().d(this.f) == EnumAnimation.BLOCK;
|
||||
return this.bx() && this.f.getItem().d(this.f) == EnumAnimation.BLOCK;
|
||||
}
|
||||
|
||||
public void h() {
|
||||
@ -131,12 +131,12 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.p();
|
||||
}
|
||||
} else {
|
||||
this.bz();
|
||||
this.bA();
|
||||
}
|
||||
}
|
||||
|
||||
if (this.bu > 0) {
|
||||
--this.bu;
|
||||
if (this.bt > 0) {
|
||||
--this.bt;
|
||||
}
|
||||
|
||||
if (this.isSleeping()) {
|
||||
@ -148,7 +148,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.v()) {
|
||||
} else if (this.world.w()) {
|
||||
this.a(false, true, true);
|
||||
}
|
||||
}
|
||||
@ -169,41 +169,41 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
this.bu = this.bx;
|
||||
this.bv = this.by;
|
||||
this.bw = this.bz;
|
||||
this.bx = this.bA;
|
||||
double d0 = this.locX - this.by;
|
||||
double d1 = this.locY - this.bz;
|
||||
double d2 = this.locZ - this.bA;
|
||||
double d0 = this.locX - this.bx;
|
||||
double d1 = this.locY - this.by;
|
||||
double d2 = this.locZ - this.bz;
|
||||
double d3 = 10.0D;
|
||||
|
||||
if (d0 > d3) {
|
||||
this.bv = this.by = this.locX;
|
||||
this.bu = this.bx = this.locX;
|
||||
}
|
||||
|
||||
if (d2 > d3) {
|
||||
this.bx = this.bA = this.locZ;
|
||||
this.bw = this.bz = this.locZ;
|
||||
}
|
||||
|
||||
if (d1 > d3) {
|
||||
this.bw = this.bz = this.locY;
|
||||
this.bv = this.by = this.locY;
|
||||
}
|
||||
|
||||
if (d0 < -d3) {
|
||||
this.bv = this.by = this.locX;
|
||||
this.bu = this.by = this.locX;
|
||||
}
|
||||
|
||||
if (d2 < -d3) {
|
||||
this.bx = this.bA = this.locZ;
|
||||
this.bw = this.bz = this.locZ;
|
||||
}
|
||||
|
||||
if (d1 < -d3) {
|
||||
this.bw = this.bz = this.locY;
|
||||
this.bv = this.bz = this.locY;
|
||||
}
|
||||
|
||||
this.by += d0 * 0.25D;
|
||||
this.bA += d2 * 0.25D;
|
||||
this.bz += d1 * 0.25D;
|
||||
this.bx += d0 * 0.25D;
|
||||
this.bz += d2 * 0.25D;
|
||||
this.by += d1 * 0.25D;
|
||||
if (this.vehicle == null) {
|
||||
this.e = null;
|
||||
}
|
||||
@ -214,19 +214,19 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
public int D() {
|
||||
public int C() {
|
||||
return this.abilities.isInvulnerable ? 0 : 80;
|
||||
}
|
||||
|
||||
protected String H() {
|
||||
protected String G() {
|
||||
return "game.player.swim";
|
||||
}
|
||||
|
||||
protected String O() {
|
||||
protected String N() {
|
||||
return "game.player.swim.splash";
|
||||
}
|
||||
|
||||
public int ai() {
|
||||
public int ah() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
@ -241,11 +241,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
if (itemstack.o() == EnumAnimation.EAT) {
|
||||
for (int j = 0; j < i; ++j) {
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(((double) this.random.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D);
|
||||
Vec3D vec3d = Vec3D.a(((double) this.random.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D);
|
||||
|
||||
vec3d.a(-this.pitch * 3.1415927F / 180.0F);
|
||||
vec3d.b(-this.yaw * 3.1415927F / 180.0F);
|
||||
Vec3D vec3d1 = this.world.getVec3DPool().create(((double) this.random.nextFloat() - 0.5D) * 0.3D, (double) (-this.random.nextFloat()) * 0.6D - 0.3D, 0.6D);
|
||||
Vec3D vec3d1 = Vec3D.a(((double) this.random.nextFloat() - 0.5D) * 0.3D, (double) (-this.random.nextFloat()) * 0.6D - 0.3D, 0.6D);
|
||||
|
||||
vec3d1.a(-this.pitch * 3.1415927F / 180.0F);
|
||||
vec3d1.b(-this.yaw * 3.1415927F / 180.0F);
|
||||
@ -256,7 +256,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
s = s + "_" + itemstack.getData();
|
||||
}
|
||||
|
||||
this.world.addParticle(s, vec3d1.c, vec3d1.d, vec3d1.e, vec3d.c, vec3d.d + 0.05D, vec3d.e);
|
||||
this.world.addParticle(s, vec3d1.a, vec3d1.b, vec3d1.c, vec3d.a, vec3d.b + 0.05D, vec3d.c);
|
||||
}
|
||||
|
||||
this.makeSound("random.eat", 0.5F + 0.5F * (float) this.random.nextInt(2), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
@ -268,7 +268,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.c(this.f, 16);
|
||||
int i = this.f.count;
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerItemConsumeEvent
|
||||
org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.f);
|
||||
PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem);
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
@ -302,11 +302,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
this.bz();
|
||||
this.bA();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean bh() {
|
||||
protected boolean bg() {
|
||||
return this.getHealth() <= 0.0F || this.isSleeping();
|
||||
}
|
||||
|
||||
@ -339,7 +339,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
*/
|
||||
super.setPassengerOf(entity);
|
||||
if (!this.world.isStatic && this.vehicle == null) {
|
||||
this.l(originalVehicle);
|
||||
this.m(originalVehicle);
|
||||
}
|
||||
// CraftBukkit end
|
||||
} else {
|
||||
@ -347,7 +347,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
public void ab() {
|
||||
public void aa() {
|
||||
if (!this.world.isStatic && this.isSneaking()) {
|
||||
this.mount((Entity) null);
|
||||
this.setSneaking(false);
|
||||
@ -358,26 +358,26 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
float f = this.yaw;
|
||||
float f1 = this.pitch;
|
||||
|
||||
super.ab();
|
||||
this.bs = this.bt;
|
||||
this.bt = 0.0F;
|
||||
super.aa();
|
||||
this.br = this.bs;
|
||||
this.bs = 0.0F;
|
||||
this.l(this.locX - d0, this.locY - d1, this.locZ - d2);
|
||||
if (this.vehicle instanceof EntityPig) {
|
||||
this.pitch = f1;
|
||||
this.yaw = f;
|
||||
this.aN = ((EntityPig) this.vehicle).aN;
|
||||
this.aM = ((EntityPig) this.vehicle).aM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void bq() {
|
||||
super.bq();
|
||||
this.bb();
|
||||
protected void bp() {
|
||||
super.bp();
|
||||
this.ba();
|
||||
}
|
||||
|
||||
public void e() {
|
||||
if (this.br > 0) {
|
||||
--this.br;
|
||||
if (this.bq > 0) {
|
||||
--this.bq;
|
||||
}
|
||||
|
||||
if (this.world.difficulty == EnumDifficulty.PEACEFUL && this.getHealth() < this.getMaxHealth() && this.world.getGameRules().getBoolean("naturalRegeneration") && this.ticksLived % 20 * 12 == 0) {
|
||||
@ -386,7 +386,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
this.inventory.k();
|
||||
this.bs = this.bt;
|
||||
this.br = this.bs;
|
||||
super.e();
|
||||
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.d);
|
||||
|
||||
@ -394,9 +394,9 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
attributeinstance.setValue((double) this.abilities.b());
|
||||
}
|
||||
|
||||
this.aR = this.bK;
|
||||
this.aQ = this.bJ;
|
||||
if (this.isSprinting()) {
|
||||
this.aR = (float) ((double) this.aR + (double) this.bK * 0.3D);
|
||||
this.aQ = (float) ((double) this.aQ + (double) this.bJ * 0.3D);
|
||||
}
|
||||
|
||||
this.i((float) attributeinstance.getValue());
|
||||
@ -416,8 +416,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
f1 = 0.0F;
|
||||
}
|
||||
|
||||
this.bt += (f - this.bt) * 0.4F;
|
||||
this.aK += (f1 - this.aK) * 0.8F;
|
||||
this.bs += (f - this.bs) * 0.4F;
|
||||
this.aJ += (f1 - this.aJ) * 0.8F;
|
||||
if (this.getHealth() > 0.0F) {
|
||||
AxisAlignedBB axisalignedbb = null;
|
||||
|
||||
@ -434,14 +434,14 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
Entity entity = (Entity) list.get(i);
|
||||
|
||||
if (!entity.dead) {
|
||||
this.r(entity);
|
||||
this.d(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void r(Entity entity) {
|
||||
private void d(Entity entity) {
|
||||
entity.b_(this);
|
||||
}
|
||||
|
||||
@ -473,8 +473,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
if (damagesource != null) {
|
||||
this.motX = (double) (-MathHelper.cos((this.aA + this.yaw) * 3.1415927F / 180.0F) * 0.1F);
|
||||
this.motZ = (double) (-MathHelper.sin((this.aA + this.yaw) * 3.1415927F / 180.0F) * 0.1F);
|
||||
this.motX = (double) (-MathHelper.cos((this.az + this.yaw) * 3.1415927F / 180.0F) * 0.1F);
|
||||
this.motZ = (double) (-MathHelper.sin((this.az + this.yaw) * 3.1415927F / 180.0F) * 0.1F);
|
||||
} else {
|
||||
this.motX = this.motZ = 0.0D;
|
||||
}
|
||||
@ -483,11 +483,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.a(StatisticList.v, 1);
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "game.player.hurt";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "game.player.die";
|
||||
}
|
||||
|
||||
@ -557,7 +557,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
entityitem.motZ += Math.sin((double) f1) * (double) f;
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerDropItemEvent
|
||||
Player player = (Player) this.getBukkitEntity();
|
||||
CraftItem drop = new CraftItem(this.world.getServer(), entityitem);
|
||||
|
||||
@ -635,7 +635,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.expTotal = nbttagcompound.getInt("XpTotal");
|
||||
this.setScore(nbttagcompound.getInt("Score"));
|
||||
if (this.sleeping) {
|
||||
this.bC = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||
this.bB = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||
this.a(true, true, false);
|
||||
}
|
||||
|
||||
@ -711,7 +711,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
} else if (this.abilities.isInvulnerable && !damagesource.ignoresInvulnerability()) {
|
||||
return false;
|
||||
} else {
|
||||
this.aV = 0;
|
||||
this.aU = 0;
|
||||
if (this.getHealth() <= 0.0F) {
|
||||
return false;
|
||||
} else {
|
||||
@ -779,11 +779,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.inventory.a(f);
|
||||
}
|
||||
|
||||
public int aV() {
|
||||
public int aU() {
|
||||
return this.inventory.l();
|
||||
}
|
||||
|
||||
public float bC() {
|
||||
public float bD() {
|
||||
int i = 0;
|
||||
ItemStack[] aitemstack = this.inventory.armor;
|
||||
int j = aitemstack.length;
|
||||
@ -809,14 +809,14 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
f = this.c(damagesource, f);
|
||||
float f1 = f;
|
||||
|
||||
f = Math.max(f - this.bs(), 0.0F);
|
||||
this.m(this.bs() - (f1 - f));
|
||||
f = Math.max(f - this.br(), 0.0F);
|
||||
this.m(this.br() - (f1 - f));
|
||||
if (f != 0.0F) {
|
||||
this.a(damagesource.f());
|
||||
float f2 = this.getHealth();
|
||||
|
||||
this.setHealth(this.getHealth() - f);
|
||||
this.aW().a(damagesource, f2, f);
|
||||
this.aV().a(damagesource, f2, f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -837,8 +837,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
public void b(ItemStack itemstack) {}
|
||||
|
||||
public boolean p(Entity entity) {
|
||||
ItemStack itemstack = this.bD();
|
||||
public boolean q(Entity entity) {
|
||||
ItemStack itemstack = this.bE();
|
||||
ItemStack itemstack1 = itemstack != null ? itemstack.cloneItemStack() : null;
|
||||
|
||||
if (!entity.c(this)) {
|
||||
@ -850,7 +850,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
if (itemstack.a(this, (EntityLiving) entity)) {
|
||||
// CraftBukkit - bypass infinite items; <= 0 -> == 0
|
||||
if (itemstack.count == 0 && !this.abilities.canInstantlyBuild) {
|
||||
this.bE();
|
||||
this.bF();
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -859,9 +859,9 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
return false;
|
||||
} else {
|
||||
if (itemstack != null && itemstack == this.bD()) {
|
||||
if (itemstack != null && itemstack == this.bE()) {
|
||||
if (itemstack.count <= 0 && !this.abilities.canInstantlyBuild) {
|
||||
this.bE();
|
||||
this.bF();
|
||||
} else if (itemstack.count < itemstack1.count && this.abilities.canInstantlyBuild) {
|
||||
itemstack.count = itemstack1.count;
|
||||
}
|
||||
@ -871,21 +871,21 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack bD() {
|
||||
public ItemStack bE() {
|
||||
return this.inventory.getItemInHand();
|
||||
}
|
||||
|
||||
public void bE() {
|
||||
public void bF() {
|
||||
this.inventory.setItem(this.inventory.itemInHandIndex, (ItemStack) null);
|
||||
}
|
||||
|
||||
public double ad() {
|
||||
public double ac() {
|
||||
return (double) (this.height - 0.5F);
|
||||
}
|
||||
|
||||
public void attack(Entity entity) {
|
||||
if (entity.av()) {
|
||||
if (!entity.i(this)) {
|
||||
if (entity.au()) {
|
||||
if (!entity.j(this)) {
|
||||
float f = (float) this.getAttributeInstance(GenericAttributes.e).getValue();
|
||||
int i = 0;
|
||||
float f1 = 0.0F;
|
||||
@ -900,7 +900,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
if (f > 0.0F || f1 > 0.0F) {
|
||||
boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.h_() && !this.M() && !this.hasEffect(MobEffectList.BLINDNESS) && this.vehicle == null && entity instanceof EntityLiving;
|
||||
boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.h_() && !this.L() && !this.hasEffect(MobEffectList.BLINDNESS) && this.vehicle == null && entity instanceof EntityLiving;
|
||||
|
||||
if (flag && f > 0.0F) {
|
||||
f *= 1.5F;
|
||||
@ -937,13 +937,13 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.a((Statistic) AchievementList.F);
|
||||
}
|
||||
|
||||
this.k(entity);
|
||||
this.l(entity);
|
||||
if (entity instanceof EntityLiving) {
|
||||
EnchantmentManager.a((EntityLiving) entity, (Entity) this);
|
||||
}
|
||||
|
||||
EnchantmentManager.b(this, entity);
|
||||
ItemStack itemstack = this.bD();
|
||||
ItemStack itemstack = this.bE();
|
||||
Object object = entity;
|
||||
|
||||
if (entity instanceof EntityComplexPart) {
|
||||
@ -958,7 +958,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
itemstack.a((EntityLiving) object, this);
|
||||
// CraftBukkit - bypass infinite items; <= 0 -> == 0
|
||||
if (itemstack.count == 0) {
|
||||
this.bE();
|
||||
this.bF();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1015,7 +1015,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return EnumBedResult.NOT_POSSIBLE_HERE;
|
||||
}
|
||||
|
||||
if (this.world.v()) {
|
||||
if (this.world.w()) {
|
||||
return EnumBedResult.NOT_POSSIBLE_NOW;
|
||||
}
|
||||
|
||||
@ -1025,18 +1025,18 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
double d0 = 8.0D;
|
||||
double d1 = 5.0D;
|
||||
List list = this.world.a(EntityMonster.class, AxisAlignedBB.a().a((double) i - d0, (double) j - d1, (double) k - d0, (double) i + d0, (double) j + d1, (double) k + d0));
|
||||
List list = this.world.a(EntityMonster.class, AxisAlignedBB.a((double) i - d0, (double) j - d1, (double) k - d0, (double) i + d0, (double) j + d1, (double) k + d0));
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
return EnumBedResult.NOT_SAFE;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.am()) {
|
||||
if (this.al()) {
|
||||
this.mount((Entity) null);
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerBedEnterEvent
|
||||
if (this.getBukkitEntity() instanceof Player) {
|
||||
Player player = (Player) this.getBukkitEntity();
|
||||
org.bukkit.block.Block bed = this.world.getWorld().getBlockAt(i, j, k);
|
||||
@ -1083,7 +1083,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
this.sleeping = true;
|
||||
this.sleepTicks = 0;
|
||||
this.bC = new ChunkCoordinates(i, j, k);
|
||||
this.bB = new ChunkCoordinates(i, j, k);
|
||||
this.motX = this.motZ = this.motY = 0.0D;
|
||||
if (!this.world.isStatic) {
|
||||
this.world.everyoneSleeping();
|
||||
@ -1093,31 +1093,31 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
private void w(int i) {
|
||||
this.bC = 0.0F;
|
||||
this.bD = 0.0F;
|
||||
this.bE = 0.0F;
|
||||
switch (i) {
|
||||
case 0:
|
||||
this.bE = -1.8F;
|
||||
this.bD = -1.8F;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
this.bD = 1.8F;
|
||||
this.bC = 1.8F;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
this.bE = 1.8F;
|
||||
this.bD = 1.8F;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
this.bD = -1.8F;
|
||||
this.bC = -1.8F;
|
||||
}
|
||||
}
|
||||
|
||||
public void a(boolean flag, boolean flag1, boolean flag2) {
|
||||
this.a(0.6F, 1.8F);
|
||||
this.e_();
|
||||
ChunkCoordinates chunkcoordinates = this.bC;
|
||||
ChunkCoordinates chunkcoordinates1 = this.bC;
|
||||
ChunkCoordinates chunkcoordinates = this.bB;
|
||||
ChunkCoordinates chunkcoordinates1 = this.bB;
|
||||
|
||||
if (chunkcoordinates != null && this.world.getType(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) == Blocks.BED) {
|
||||
BlockBed.a(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, false);
|
||||
@ -1134,7 +1134,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.world.everyoneSleeping();
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerBedLeaveEvent
|
||||
if (this.getBukkitEntity() instanceof Player) {
|
||||
Player player = (Player) this.getBukkitEntity();
|
||||
|
||||
@ -1157,16 +1157,16 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
if (flag2) {
|
||||
this.setRespawnPosition(this.bC, false);
|
||||
this.setRespawnPosition(this.bB, false);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean j() {
|
||||
return this.world.getType(this.bC.x, this.bC.y, this.bC.z) == Blocks.BED;
|
||||
return this.world.getType(this.bB.x, this.bB.y, this.bB.z) == Blocks.BED;
|
||||
}
|
||||
|
||||
public static ChunkCoordinates getBed(World world, ChunkCoordinates chunkcoordinates, boolean flag) {
|
||||
IChunkProvider ichunkprovider = world.K();
|
||||
IChunkProvider ichunkprovider = world.L();
|
||||
|
||||
ichunkprovider.getChunkAt(chunkcoordinates.x - 3 >> 4, chunkcoordinates.z - 3 >> 4);
|
||||
ichunkprovider.getChunkAt(chunkcoordinates.x + 3 >> 4, chunkcoordinates.z - 3 >> 4);
|
||||
@ -1232,8 +1232,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
public void a(Statistic statistic, int i) {}
|
||||
|
||||
public void bj() {
|
||||
super.bj();
|
||||
public void bi() {
|
||||
super.bi();
|
||||
this.a(StatisticList.r, 1);
|
||||
if (this.isSprinting()) {
|
||||
this.a(0.8F);
|
||||
@ -1249,12 +1249,12 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
if (this.abilities.isFlying && this.vehicle == null) {
|
||||
double d3 = this.motY;
|
||||
float f2 = this.aR;
|
||||
float f2 = this.aQ;
|
||||
|
||||
this.aR = this.abilities.a();
|
||||
this.aQ = this.abilities.a();
|
||||
super.e(f, f1);
|
||||
this.motY = d3 * 0.6D;
|
||||
this.aR = f2;
|
||||
this.aQ = f2;
|
||||
} else {
|
||||
super.e(f, f1);
|
||||
}
|
||||
@ -1262,7 +1262,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.checkMovement(this.locX - d0, this.locY - d1, this.locZ - d2);
|
||||
}
|
||||
|
||||
public float bl() {
|
||||
public float bk() {
|
||||
return (float) this.getAttributeInstance(GenericAttributes.d).getValue();
|
||||
}
|
||||
|
||||
@ -1276,7 +1276,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.a(StatisticList.m, i);
|
||||
this.a(0.015F * (float) i * 0.01F);
|
||||
}
|
||||
} else if (this.M()) {
|
||||
} else if (this.L()) {
|
||||
i = Math.round(MathHelper.sqrt(d0 * d0 + d2 * d2) * 100.0F);
|
||||
if (i > 0) {
|
||||
this.a(StatisticList.i, i);
|
||||
@ -1348,16 +1348,16 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
int i = EntityTypes.a(entityliving);
|
||||
MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.a.get(Integer.valueOf(i));
|
||||
MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.eggInfo.get(Integer.valueOf(i));
|
||||
|
||||
if (monsteregginfo != null) {
|
||||
this.a(monsteregginfo.d, 1);
|
||||
this.a(monsteregginfo.killEntityStatistic, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void as() {
|
||||
public void ar() {
|
||||
if (!this.abilities.isFlying) {
|
||||
super.as();
|
||||
super.ar();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1417,7 +1417,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return (flag || this.foodData.c()) && !this.abilities.isInvulnerable;
|
||||
}
|
||||
|
||||
public boolean bP() {
|
||||
public boolean bQ() {
|
||||
return this.getHealth() > 0.0F && this.getHealth() < this.getMaxHealth();
|
||||
}
|
||||
|
||||
@ -1442,8 +1442,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.bD() != null) {
|
||||
ItemStack itemstack = this.bD();
|
||||
if (this.bE() != null) {
|
||||
ItemStack itemstack = this.bE();
|
||||
|
||||
if (itemstack.b(block) || itemstack.a(block) > 1.0F) {
|
||||
return true;
|
||||
@ -1482,7 +1482,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.expTotal = entityhuman.expTotal;
|
||||
this.exp = entityhuman.exp;
|
||||
this.setScore(entityhuman.getScore());
|
||||
this.ar = entityhuman.ar;
|
||||
this.aq = entityhuman.aq;
|
||||
} else if (this.world.getGameRules().getBoolean("keepInventory")) {
|
||||
this.inventory.b(entityhuman.inventory);
|
||||
this.expLevel = entityhuman.expLevel;
|
||||
@ -1518,7 +1518,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return i == 0 ? this.inventory.getItemInHand() : this.inventory.armor[i - 1];
|
||||
}
|
||||
|
||||
public ItemStack be() {
|
||||
public ItemStack bd() {
|
||||
return this.inventory.getItemInHand();
|
||||
}
|
||||
|
||||
@ -1530,7 +1530,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return this.inventory.armor;
|
||||
}
|
||||
|
||||
public boolean aC() {
|
||||
public boolean aB() {
|
||||
return !this.abilities.isFlying;
|
||||
}
|
||||
|
||||
@ -1543,10 +1543,10 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
public IChatBaseComponent getScoreboardDisplayName() {
|
||||
// CraftBukkit todo: fun
|
||||
// CraftBukkit - todo: fun
|
||||
ChatComponentText chatcomponenttext = new ChatComponentText(ScoreboardTeam.getPlayerDisplayName(this.getScoreboardTeam(), this.getName()));
|
||||
|
||||
chatcomponenttext.b().a(new ChatClickable(EnumClickAction.SUGGEST_COMMAND, "/msg " + this.getName() + " "));
|
||||
chatcomponenttext.getChatModifier().setChatClickable(new ChatClickable(EnumClickAction.SUGGEST_COMMAND, "/msg " + this.getName() + " "));
|
||||
return chatcomponenttext;
|
||||
}
|
||||
|
||||
@ -1558,7 +1558,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.getDataWatcher().watch(17, Float.valueOf(f));
|
||||
}
|
||||
|
||||
public float bs() {
|
||||
public float br() {
|
||||
return this.getDataWatcher().getFloat(17);
|
||||
}
|
||||
|
||||
|
@ -14,9 +14,9 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
|
||||
public int a_;
|
||||
protected int b;
|
||||
private ControllerLook h;
|
||||
private ControllerLook lookController;
|
||||
private ControllerMove moveController;
|
||||
private ControllerJump lookController;
|
||||
private ControllerJump bm;
|
||||
private EntityAIBodyControl bn;
|
||||
private Navigation navigation;
|
||||
protected final PathfinderGoalSelector goalSelector;
|
||||
@ -38,9 +38,9 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
super(world);
|
||||
this.goalSelector = new PathfinderGoalSelector(world != null && world.methodProfiler != null ? world.methodProfiler : null);
|
||||
this.targetSelector = new PathfinderGoalSelector(world != null && world.methodProfiler != null ? world.methodProfiler : null);
|
||||
this.h = new ControllerLook(this);
|
||||
this.lookController = new ControllerLook(this);
|
||||
this.moveController = new ControllerMove(this);
|
||||
this.lookController = new ControllerJump(this);
|
||||
this.bm = new ControllerJump(this);
|
||||
this.bn = new EntityAIBodyControl(this);
|
||||
this.navigation = new Navigation(this, world);
|
||||
this.bq = new EntitySenses(this);
|
||||
@ -50,13 +50,13 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
this.bc().b(GenericAttributes.b).setValue(16.0D);
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.bb().b(GenericAttributes.b).setValue(16.0D);
|
||||
}
|
||||
|
||||
public ControllerLook getControllerLook() {
|
||||
return this.h;
|
||||
return this.lookController;
|
||||
}
|
||||
|
||||
public ControllerMove getControllerMove() {
|
||||
@ -64,7 +64,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
|
||||
public ControllerJump getControllerJump() {
|
||||
return this.lookController;
|
||||
return this.bm;
|
||||
}
|
||||
|
||||
public Navigation getNavigation() {
|
||||
@ -103,12 +103,12 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
String s = this.t();
|
||||
|
||||
if (s != null) {
|
||||
this.makeSound(s, this.bf(), this.bg());
|
||||
this.makeSound(s, this.be(), this.bf());
|
||||
}
|
||||
}
|
||||
|
||||
public void C() {
|
||||
super.C();
|
||||
public void B() {
|
||||
super.B();
|
||||
this.world.methodProfiler.a("mobBaseTick");
|
||||
if (this.isAlive() && this.random.nextInt(1000) < this.a_++) {
|
||||
this.a_ = -this.q();
|
||||
@ -154,7 +154,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
|
||||
protected float f(float f, float f1) {
|
||||
if (this.bk()) {
|
||||
if (this.bj()) {
|
||||
this.bn.a();
|
||||
return f1;
|
||||
} else {
|
||||
@ -205,7 +205,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
super.b(nbttagcompound);
|
||||
nbttagcompound.setBoolean("CanPickUpLoot", this.bH());
|
||||
nbttagcompound.setBoolean("CanPickUpLoot", this.bJ());
|
||||
nbttagcompound.setBoolean("PersistenceRequired", this.persistent);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
@ -294,7 +294,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
|
||||
public void n(float f) {
|
||||
this.bf = f;
|
||||
this.be = f;
|
||||
}
|
||||
|
||||
public void i(float f) {
|
||||
@ -305,7 +305,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
public void e() {
|
||||
super.e();
|
||||
this.world.methodProfiler.a("looting");
|
||||
if (!this.world.isStatic && this.bH() && !this.aU && this.world.getGameRules().getBoolean("mobGriefing")) {
|
||||
if (!this.world.isStatic && this.bJ() && !this.aT && this.world.getGameRules().getBoolean("mobGriefing")) {
|
||||
List list = this.world.a(EntityItem.class, this.boundingBox.grow(1.0D, 0.0D, 1.0D));
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
@ -379,7 +379,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
|
||||
protected boolean bk() {
|
||||
protected boolean bj() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -389,7 +389,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
|
||||
protected void w() {
|
||||
if (this.persistent) {
|
||||
this.aV = 0;
|
||||
this.aU = 0;
|
||||
} else {
|
||||
EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
|
||||
|
||||
@ -403,17 +403,17 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
this.die();
|
||||
}
|
||||
|
||||
if (this.aV > 600 && this.random.nextInt(800) == 0 && d3 > 1024.0D) { // CraftBukkit - remove isTypeNotPersistent() check
|
||||
if (this.aU > 600 && this.random.nextInt(800) == 0 && d3 > 1024.0D) { // CraftBukkit - remove isTypeNotPersistent() check
|
||||
this.die();
|
||||
} else if (d3 < 1024.0D) {
|
||||
this.aV = 0;
|
||||
this.aU = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void bn() {
|
||||
++this.aV;
|
||||
protected void bm() {
|
||||
++this.aU;
|
||||
this.world.methodProfiler.a("checkDespawn");
|
||||
this.w();
|
||||
this.world.methodProfiler.b();
|
||||
@ -430,23 +430,23 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
this.navigation.f();
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("mob tick");
|
||||
this.bp();
|
||||
this.bo();
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("controls");
|
||||
this.world.methodProfiler.a("move");
|
||||
this.moveController.c();
|
||||
this.world.methodProfiler.c("look");
|
||||
this.h.a();
|
||||
this.lookController.a();
|
||||
this.world.methodProfiler.c("jump");
|
||||
this.lookController.b();
|
||||
this.bm.b();
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
|
||||
protected void bq() {
|
||||
super.bq();
|
||||
protected void bp() {
|
||||
super.bp();
|
||||
this.bd = 0.0F;
|
||||
this.be = 0.0F;
|
||||
this.bf = 0.0F;
|
||||
this.w();
|
||||
float f = 8.0F;
|
||||
|
||||
@ -457,33 +457,33 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
this.bu = entityhuman;
|
||||
this.g = 10 + this.random.nextInt(20);
|
||||
} else {
|
||||
this.bg = (this.random.nextFloat() - 0.5F) * 20.0F;
|
||||
this.bf = (this.random.nextFloat() - 0.5F) * 20.0F;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.bu != null) {
|
||||
this.a(this.bu, 10.0F, (float) this.x());
|
||||
if (this.g-- <= 0 || this.bu.dead || this.bu.e((Entity) this) > (double) (f * f)) {
|
||||
this.a(this.bu, 10.0F, (float) this.bv());
|
||||
if (this.g-- <= 0 || this.bu.dead || this.bu.f((Entity) this) > (double) (f * f)) {
|
||||
this.bu = null;
|
||||
}
|
||||
} else {
|
||||
if (this.random.nextFloat() < 0.05F) {
|
||||
this.bg = (this.random.nextFloat() - 0.5F) * 20.0F;
|
||||
this.bf = (this.random.nextFloat() - 0.5F) * 20.0F;
|
||||
}
|
||||
|
||||
this.yaw += this.bg;
|
||||
this.yaw += this.bf;
|
||||
this.pitch = this.f;
|
||||
}
|
||||
|
||||
boolean flag = this.M();
|
||||
boolean flag1 = this.P();
|
||||
boolean flag = this.L();
|
||||
boolean flag1 = this.O();
|
||||
|
||||
if (flag || flag1) {
|
||||
this.bd = this.random.nextFloat() < 0.8F;
|
||||
this.bc = this.random.nextFloat() < 0.8F;
|
||||
}
|
||||
}
|
||||
|
||||
public int x() {
|
||||
public int bv() {
|
||||
return 40;
|
||||
}
|
||||
|
||||
@ -526,11 +526,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return this.world.b(this.boundingBox) && this.world.getCubes(this, this.boundingBox).isEmpty() && !this.world.containsLiquid(this.boundingBox);
|
||||
}
|
||||
|
||||
public int bz() {
|
||||
public int bB() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
public int ax() {
|
||||
public int aw() {
|
||||
if (this.getGoalTarget() == null) {
|
||||
return 3;
|
||||
} else {
|
||||
@ -545,7 +545,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack be() {
|
||||
public ItemStack bd() {
|
||||
return this.equipment[0];
|
||||
}
|
||||
|
||||
@ -591,7 +591,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
protected void bA() {
|
||||
protected void bC() {
|
||||
if (this.random.nextFloat() < 0.15F * this.world.b(this.locX, this.locY, this.locZ)) {
|
||||
int i = this.random.nextInt(2);
|
||||
float f = this.world.difficulty == EnumDifficulty.HARD ? 0.1F : 0.25F;
|
||||
@ -709,11 +709,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
protected void bB() {
|
||||
protected void bD() {
|
||||
float f = this.world.b(this.locX, this.locY, this.locZ);
|
||||
|
||||
if (this.be() != null && this.random.nextFloat() < 0.25F * f) {
|
||||
EnchantmentManager.a(this.random, this.be(), (int) (5.0F + f * (float) this.random.nextInt(18)));
|
||||
if (this.bd() != null && this.random.nextFloat() < 0.25F * f) {
|
||||
EnchantmentManager.a(this.random, this.bd(), (int) (5.0F + f * (float) this.random.nextInt(18)));
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
@ -730,7 +730,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return groupdataentity;
|
||||
}
|
||||
|
||||
public boolean bC() {
|
||||
public boolean bE() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -738,7 +738,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return this.hasCustomName() ? this.getCustomName() : super.getName();
|
||||
}
|
||||
|
||||
public void bD() {
|
||||
public void bF() {
|
||||
this.persistent = true;
|
||||
}
|
||||
|
||||
@ -766,7 +766,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
this.dropChances[i] = f;
|
||||
}
|
||||
|
||||
public boolean bH() {
|
||||
public boolean bJ() {
|
||||
return this.canPickUpLoot;
|
||||
}
|
||||
|
||||
@ -779,8 +779,8 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
|
||||
public final boolean c(EntityHuman entityhuman) {
|
||||
if (this.bL() && this.getLeashHolder() == entityhuman) {
|
||||
// CraftBukkit start
|
||||
if (this.bN() && this.getLeashHolder() == entityhuman) {
|
||||
// CraftBukkit start - fire PlayerUnleashEntityEvent
|
||||
if (CraftEventFactory.callPlayerUnleashEntityEvent(this, entityhuman).isCancelled()) {
|
||||
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, this, this.getLeashHolder()));
|
||||
return false;
|
||||
@ -791,9 +791,9 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
} else {
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
if (itemstack != null && itemstack.getItem() == Items.LEASH && this.bK()) {
|
||||
if (itemstack != null && itemstack.getItem() == Items.LEASH && this.bM()) {
|
||||
if (!(this instanceof EntityTameableAnimal) || !((EntityTameableAnimal) this).isTamed()) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerLeashEntityEvent
|
||||
if (CraftEventFactory.callPlayerLeashEntityEvent(this, entityhuman, entityhuman).isCancelled()) {
|
||||
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, this, this.getLeashHolder()));
|
||||
return false;
|
||||
@ -805,7 +805,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
|
||||
if (entityhuman.getName().equalsIgnoreCase(((EntityTameableAnimal) this).getOwnerName())) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerLeashEntityEvent
|
||||
if (CraftEventFactory.callPlayerLeashEntityEvent(this, entityhuman, entityhuman).isCancelled()) {
|
||||
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, this, this.getLeashHolder()));
|
||||
return false;
|
||||
@ -825,9 +825,9 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void bJ() {
|
||||
protected void bL() {
|
||||
if (this.bx != null) {
|
||||
this.bN();
|
||||
this.bP();
|
||||
}
|
||||
|
||||
if (this.bv) {
|
||||
@ -852,11 +852,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean bK() {
|
||||
return !this.bL() && !(this instanceof IMonster);
|
||||
public boolean bM() {
|
||||
return !this.bN() && !(this instanceof IMonster);
|
||||
}
|
||||
|
||||
public boolean bL() {
|
||||
public boolean bN() {
|
||||
return this.bv;
|
||||
}
|
||||
|
||||
@ -872,7 +872,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
private void bN() {
|
||||
private void bP() {
|
||||
if (this.bv && this.bx != null) {
|
||||
if (this.bx.hasKeyOfType("UUIDMost", 4) && this.bx.hasKeyOfType("UUIDLeast", 4)) {
|
||||
UUID uuid = new UUID(this.bx.getLong("UUIDMost"), this.bx.getLong("UUIDLeast"));
|
||||
|
@ -31,16 +31,16 @@ public class EntityIronGolem extends EntityGolem {
|
||||
this.datawatcher.a(16, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
public boolean bk() {
|
||||
public boolean bj() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void bp() {
|
||||
protected void bo() {
|
||||
if (--this.bq <= 0) {
|
||||
this.bq = 70 + this.random.nextInt(50);
|
||||
this.bp = this.world.villages.getClosestVillage(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ), 32);
|
||||
if (this.bp == null) {
|
||||
this.bV();
|
||||
this.bX();
|
||||
} else {
|
||||
ChunkCoordinates chunkcoordinates = this.bp.getCenter();
|
||||
|
||||
@ -48,11 +48,11 @@ public class EntityIronGolem extends EntityGolem {
|
||||
}
|
||||
}
|
||||
|
||||
super.bp();
|
||||
super.bo();
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(100.0D);
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.25D);
|
||||
}
|
||||
@ -61,12 +61,12 @@ public class EntityIronGolem extends EntityGolem {
|
||||
return i;
|
||||
}
|
||||
|
||||
protected void n(Entity entity) {
|
||||
if (entity instanceof IMonster && this.aI().nextInt(20) == 0) {
|
||||
protected void o(Entity entity) {
|
||||
if (entity instanceof IMonster && this.aH().nextInt(20) == 0) {
|
||||
this.setGoalTarget((EntityLiving) entity);
|
||||
}
|
||||
|
||||
super.n(entity);
|
||||
super.o(entity);
|
||||
}
|
||||
|
||||
public void e() {
|
||||
@ -105,7 +105,7 @@ public class EntityIronGolem extends EntityGolem {
|
||||
this.setPlayerCreated(nbttagcompound.getBoolean("PlayerCreated"));
|
||||
}
|
||||
|
||||
public boolean m(Entity entity) {
|
||||
public boolean n(Entity entity) {
|
||||
this.br = 10;
|
||||
this.world.broadcastEntityEffect(this, (byte) 4);
|
||||
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), (float) (7 + this.random.nextInt(15)));
|
||||
@ -118,7 +118,7 @@ public class EntityIronGolem extends EntityGolem {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public Village bX() {
|
||||
public Village bZ() {
|
||||
return this.bp;
|
||||
}
|
||||
|
||||
@ -127,11 +127,11 @@ public class EntityIronGolem extends EntityGolem {
|
||||
this.world.broadcastEntityEffect(this, (byte) 11);
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.irongolem.hit";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "mob.irongolem.death";
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ public class EntityIronGolem extends EntityGolem {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public int bZ() {
|
||||
public int cb() {
|
||||
return this.bs;
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ public class EntityItem extends Entity {
|
||||
this.lastY = this.locY;
|
||||
this.lastZ = this.locZ;
|
||||
this.motY -= 0.03999999910593033D;
|
||||
this.Y = this.j(this.locX, (this.boundingBox.b + this.boundingBox.e) / 2.0D, this.locZ);
|
||||
this.X = this.j(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;
|
||||
|
||||
@ -105,7 +105,7 @@ public class EntityItem extends Entity {
|
||||
|
||||
// ++this.age; // CraftBukkit - Moved up
|
||||
if (!this.world.isStatic && this.age >= 6000) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire ItemDespawnEvent
|
||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
|
||||
this.age = 0;
|
||||
return;
|
||||
@ -164,7 +164,7 @@ public class EntityItem extends Entity {
|
||||
this.age = 4800;
|
||||
}
|
||||
|
||||
public boolean N() {
|
||||
public boolean M() {
|
||||
return this.world.a(this.boundingBox, Material.WATER, (Entity) this);
|
||||
}
|
||||
|
||||
@ -175,10 +175,10 @@ public class EntityItem extends Entity {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else if (this.getItemStack() != null && this.getItemStack().getItem() == Items.NETHER_STAR && damagesource.c()) {
|
||||
} else if (this.getItemStack() != null && this.getItemStack().getItem() == Items.NETHER_STAR && damagesource.isExplosion()) {
|
||||
return false;
|
||||
} else {
|
||||
this.Q();
|
||||
this.P();
|
||||
this.e = (int) ((float) this.e - f);
|
||||
if (this.e <= 0) {
|
||||
this.die();
|
||||
@ -217,7 +217,7 @@ public class EntityItem extends Entity {
|
||||
|
||||
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Item");
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - Handle missing "Item" compounds
|
||||
if (nbttagcompound1 != null) {
|
||||
ItemStack itemstack = ItemStack.createStack(nbttagcompound1);
|
||||
if (itemstack != null) {
|
||||
@ -239,7 +239,7 @@ public class EntityItem extends Entity {
|
||||
ItemStack itemstack = this.getItemStack();
|
||||
int i = itemstack.count;
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerPickupItemEvent
|
||||
int canHold = entityhuman.inventory.canHold(itemstack);
|
||||
int remaining = itemstack.count - canHold;
|
||||
|
||||
@ -301,7 +301,7 @@ public class EntityItem extends Entity {
|
||||
return LocaleI18n.get("item." + this.getItemStack().a());
|
||||
}
|
||||
|
||||
public boolean av() {
|
||||
public boolean au() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -315,15 +315,7 @@ public class EntityItem extends Entity {
|
||||
public ItemStack getItemStack() {
|
||||
ItemStack itemstack = this.getDataWatcher().getItemStack(10);
|
||||
|
||||
if (itemstack == null) {
|
||||
if (this.world != null) {
|
||||
d.error("Item entity " + this.getId() + " has no item?!");
|
||||
}
|
||||
|
||||
return new ItemStack(Blocks.STONE);
|
||||
} else {
|
||||
return itemstack;
|
||||
}
|
||||
return itemstack == null ? new ItemStack(Blocks.STONE) : itemstack;
|
||||
}
|
||||
|
||||
public void setItemStack(ItemStack itemstack) {
|
||||
|
@ -23,7 +23,7 @@ public class EntityItemFrame extends EntityHanging {
|
||||
return false;
|
||||
} else if (this.getItem() != null) {
|
||||
if (!this.world.isStatic) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire EntityDamageEvent
|
||||
org.bukkit.event.entity.EntityDamageEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.handleEntityDamageEvent(this, damagesource, f);
|
||||
if ((event != null && event.isCancelled()) || this.dead) {
|
||||
return true;
|
||||
@ -136,7 +136,7 @@ public class EntityItemFrame extends EntityHanging {
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
if (this.getItem() == null) {
|
||||
ItemStack itemstack = entityhuman.be();
|
||||
ItemStack itemstack = entityhuman.bd();
|
||||
|
||||
if (itemstack != null && !this.world.isStatic) {
|
||||
this.setItem(itemstack);
|
||||
|
@ -20,7 +20,7 @@ public class EntityLargeFireball extends EntityFireball {
|
||||
movingobjectposition.entity.damageEntity(DamageSource.fireball(this, this.shooter), 6.0F);
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire ExplosionPrimeEvent
|
||||
ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(this.world.getServer(), this));
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class EntityLeash extends EntityHanging {
|
||||
public void a(NBTTagCompound nbttagcompound) {}
|
||||
|
||||
public boolean c(EntityHuman entityhuman) {
|
||||
ItemStack itemstack = entityhuman.be();
|
||||
ItemStack itemstack = entityhuman.bd();
|
||||
boolean flag = false;
|
||||
double d0;
|
||||
List list;
|
||||
@ -50,13 +50,13 @@ public class EntityLeash extends EntityHanging {
|
||||
|
||||
if (itemstack != null && itemstack.getItem() == Items.LEASH && !this.world.isStatic) {
|
||||
d0 = 7.0D;
|
||||
list = this.world.a(EntityInsentient.class, AxisAlignedBB.a().a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + d0, this.locZ + d0));
|
||||
list = this.world.a(EntityInsentient.class, AxisAlignedBB.a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + d0, this.locZ + d0));
|
||||
if (list != null) {
|
||||
iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
entityinsentient = (EntityInsentient) iterator.next();
|
||||
if (entityinsentient.bL() && entityinsentient.getLeashHolder() == entityhuman) {
|
||||
if (entityinsentient.bN() && entityinsentient.getLeashHolder() == entityhuman) {
|
||||
// CraftBukkit start
|
||||
if (CraftEventFactory.callPlayerLeashEntityEvent(entityinsentient, this, entityhuman).isCancelled()) {
|
||||
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, entityinsentient, entityinsentient.getLeashHolder()));
|
||||
@ -77,13 +77,13 @@ public class EntityLeash extends EntityHanging {
|
||||
// CraftBukkit end
|
||||
if (true || entityhuman.abilities.canInstantlyBuild) { // CraftBukkit - Process for non-creative as well
|
||||
d0 = 7.0D;
|
||||
list = this.world.a(EntityInsentient.class, AxisAlignedBB.a().a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + d0, this.locZ + d0));
|
||||
list = this.world.a(EntityInsentient.class, AxisAlignedBB.a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + d0, this.locZ + d0));
|
||||
if (list != null) {
|
||||
iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
entityinsentient = (EntityInsentient) iterator.next();
|
||||
if (entityinsentient.bL() && entityinsentient.getLeashHolder() == this) {
|
||||
if (entityinsentient.bN() && entityinsentient.getLeashHolder() == this) {
|
||||
// CraftBukkit start
|
||||
if (CraftEventFactory.callPlayerUnleashEntityEvent(entityinsentient, entityhuman).isCancelled()) {
|
||||
die = false;
|
||||
@ -112,13 +112,13 @@ public class EntityLeash extends EntityHanging {
|
||||
public static EntityLeash a(World world, int i, int j, int k) {
|
||||
EntityLeash entityleash = new EntityLeash(world, i, j, k);
|
||||
|
||||
entityleash.o = true;
|
||||
entityleash.n = true;
|
||||
world.addEntity(entityleash);
|
||||
return entityleash;
|
||||
}
|
||||
|
||||
public static EntityLeash b(World world, int i, int j, int k) {
|
||||
List list = world.a(EntityLeash.class, AxisAlignedBB.a().a((double) i - 1.0D, (double) j - 1.0D, (double) k - 1.0D, (double) i + 1.0D, (double) j + 1.0D, (double) k + 1.0D));
|
||||
List list = world.a(EntityLeash.class, AxisAlignedBB.a((double) i - 1.0D, (double) j - 1.0D, (double) k - 1.0D, (double) i + 1.0D, (double) j + 1.0D, (double) k + 1.0D));
|
||||
|
||||
if (list != null) {
|
||||
Iterator iterator = list.iterator();
|
||||
|
@ -22,16 +22,15 @@ public class EntityLightning extends EntityWeather {
|
||||
|
||||
super(world);
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit - Set isEffect
|
||||
this.isEffect = isEffect;
|
||||
// CraftBukkit end
|
||||
|
||||
this.setPositionRotation(d0, d1, d2, 0.0F, 0.0F);
|
||||
this.lifeTicks = 2;
|
||||
this.a = this.random.nextLong();
|
||||
this.c = this.random.nextInt(3) + 1;
|
||||
|
||||
// CraftBukkit
|
||||
// CraftBukkit - add "!isEffect"
|
||||
if (!isEffect && !world.isStatic && world.getGameRules().getBoolean("doFireTick") && (world.difficulty == EnumDifficulty.NORMAL || world.difficulty == EnumDifficulty.HARD) && world.areChunksLoaded(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2), 10)) {
|
||||
int i = MathHelper.floor(d0);
|
||||
int j = MathHelper.floor(d1);
|
||||
@ -76,7 +75,7 @@ public class EntityLightning extends EntityWeather {
|
||||
--this.c;
|
||||
this.lifeTicks = 1;
|
||||
this.a = this.random.nextLong();
|
||||
// CraftBukkit
|
||||
// CraftBukkit - add "!isEffect"
|
||||
if (!isEffect && !this.world.isStatic && this.world.getGameRules().getBoolean("doFireTick") && 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);
|
||||
@ -98,7 +97,7 @@ public class EntityLightning extends EntityWeather {
|
||||
this.world.q = 2;
|
||||
} else {
|
||||
double d0 = 3.0D;
|
||||
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));
|
||||
List list = this.world.getEntities(this, AxisAlignedBB.a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + 6.0D + d0, this.locZ + d0));
|
||||
|
||||
for (int l = 0; l < list.size(); ++l) {
|
||||
Entity entity = (Entity) list.get(l);
|
||||
|
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
@ -7,8 +7,8 @@ public class EntityMagmaCube extends EntitySlime {
|
||||
this.fireProof = true;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.20000000298023224D);
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ public class EntityMagmaCube extends EntitySlime {
|
||||
return this.world.difficulty != EnumDifficulty.PEACEFUL && this.world.b(this.boundingBox) && this.world.getCubes(this, this.boundingBox).isEmpty() && !this.world.containsLiquid(this.boundingBox);
|
||||
}
|
||||
|
||||
public int aV() {
|
||||
public int aU() {
|
||||
return this.getSize() * 3;
|
||||
}
|
||||
|
||||
@ -24,11 +24,11 @@ public class EntityMagmaCube extends EntitySlime {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
protected String bN() {
|
||||
protected String bP() {
|
||||
return "flame";
|
||||
}
|
||||
|
||||
protected EntitySlime bO() {
|
||||
protected EntitySlime bQ() {
|
||||
return new EntityMagmaCube(this.world);
|
||||
}
|
||||
|
||||
@ -61,38 +61,38 @@ public class EntityMagmaCube extends EntitySlime {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected int bP() {
|
||||
return super.bP() * 4;
|
||||
protected int bR() {
|
||||
return super.bR() * 4;
|
||||
}
|
||||
|
||||
protected void bQ() {
|
||||
protected void bS() {
|
||||
this.h *= 0.9F;
|
||||
}
|
||||
|
||||
protected void bj() {
|
||||
protected void bi() {
|
||||
this.motY = (double) (0.42F + (float) this.getSize() * 0.1F);
|
||||
this.am = true;
|
||||
this.al = true;
|
||||
}
|
||||
|
||||
protected void b(float f) {}
|
||||
|
||||
protected boolean bR() {
|
||||
protected boolean bT() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected int bS() {
|
||||
return super.bS() + 2;
|
||||
protected int bU() {
|
||||
return super.bU() + 2;
|
||||
}
|
||||
|
||||
protected String bT() {
|
||||
protected String bV() {
|
||||
return this.getSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small";
|
||||
}
|
||||
|
||||
public boolean P() {
|
||||
public boolean O() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean bU() {
|
||||
protected boolean bW() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
|
||||
public EntityMinecartAbstract(World world) {
|
||||
super(world);
|
||||
this.l = true;
|
||||
this.k = true;
|
||||
this.a(0.98F, 0.7F);
|
||||
this.height = this.length / 2.0F;
|
||||
}
|
||||
@ -79,15 +79,15 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
this.datawatcher.a(22, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
public AxisAlignedBB g(Entity entity) {
|
||||
return entity.S() ? entity.boundingBox : null;
|
||||
public AxisAlignedBB h(Entity entity) {
|
||||
return entity.R() ? entity.boundingBox : null;
|
||||
}
|
||||
|
||||
public AxisAlignedBB J() {
|
||||
public AxisAlignedBB I() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean S() {
|
||||
public boolean R() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit
|
||||
}
|
||||
|
||||
public double ae() {
|
||||
public double ad() {
|
||||
return (double) this.length * 0.0D - 0.30000001192092896D;
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
if (this.isInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire VehicleDamageEvent
|
||||
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||
org.bukkit.entity.Entity passenger = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity();
|
||||
|
||||
@ -129,7 +129,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
|
||||
this.j(-this.l());
|
||||
this.c(10);
|
||||
this.Q();
|
||||
this.P();
|
||||
this.setDamage(this.getDamage() + f * 10.0F);
|
||||
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
|
||||
|
||||
@ -173,7 +173,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
this.a(itemstack, 0.0F);
|
||||
}
|
||||
|
||||
public boolean R() {
|
||||
public boolean Q() {
|
||||
return !this.dead;
|
||||
}
|
||||
|
||||
@ -208,12 +208,12 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
this.world.methodProfiler.a("portal");
|
||||
MinecraftServer minecraftserver = ((WorldServer) this.world).getMinecraftServer();
|
||||
|
||||
i = this.D();
|
||||
if (this.ao) {
|
||||
i = this.C();
|
||||
if (this.an) {
|
||||
if (true || minecraftserver.getAllowNether()) { // CraftBukkit - multi-world should still allow teleport even if default vanilla nether disabled
|
||||
if (this.vehicle == null && this.ap++ >= i) {
|
||||
this.ap = i;
|
||||
this.portalCooldown = this.ai();
|
||||
if (this.vehicle == null && this.ao++ >= i) {
|
||||
this.ao = i;
|
||||
this.portalCooldown = this.ah();
|
||||
byte b0;
|
||||
|
||||
if (this.world.worldProvider.dimension == -1) {
|
||||
@ -225,15 +225,15 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
this.b(b0);
|
||||
}
|
||||
|
||||
this.ao = false;
|
||||
this.an = false;
|
||||
}
|
||||
} else {
|
||||
if (this.ap > 0) {
|
||||
this.ap -= 4;
|
||||
if (this.ao > 0) {
|
||||
this.ao -= 4;
|
||||
}
|
||||
|
||||
if (this.ap < 0) {
|
||||
this.ap = 0;
|
||||
if (this.ao < 0) {
|
||||
this.ao = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -289,7 +289,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
this.b(d4);
|
||||
}
|
||||
|
||||
this.I();
|
||||
this.H();
|
||||
this.pitch = 0.0F;
|
||||
double d6 = this.lastX - this.locX;
|
||||
double d7 = this.lastZ - this.locZ;
|
||||
@ -329,7 +329,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
for (int i1 = 0; i1 < list.size(); ++i1) {
|
||||
Entity entity = (Entity) list.get(i1);
|
||||
|
||||
if (entity != this.passenger && entity.S() && entity instanceof EntityMinecartAbstract) {
|
||||
if (entity != this.passenger && entity.R() && entity instanceof EntityMinecartAbstract) {
|
||||
entity.collide(this);
|
||||
}
|
||||
}
|
||||
@ -365,7 +365,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
}
|
||||
|
||||
if (this.onGround) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - replace magic numbers with our variables
|
||||
this.motX *= this.derailedX;
|
||||
this.motY *= this.derailedY;
|
||||
this.motZ *= this.derailedZ;
|
||||
@ -374,7 +374,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
|
||||
this.move(this.motX, this.motY, this.motZ);
|
||||
if (!this.onGround) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - replace magic numbers with our variables
|
||||
this.motX *= this.flyingX;
|
||||
this.motY *= this.flyingY;
|
||||
this.motZ *= this.flyingZ;
|
||||
@ -444,7 +444,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
double d10;
|
||||
|
||||
if (this.passenger != null && this.passenger instanceof EntityLiving) {
|
||||
d7 = (double) ((EntityLiving) this.passenger).bf;
|
||||
d7 = (double) ((EntityLiving) this.passenger).be;
|
||||
if (d7 > 0.0D) {
|
||||
d8 = -Math.sin((double) (this.passenger.yaw * 3.1415927F / 180.0F));
|
||||
d9 = Math.cos((double) (this.passenger.yaw * 3.1415927F / 180.0F));
|
||||
@ -530,7 +530,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
Vec3D vec3d1 = this.a(this.locX, this.locY, this.locZ);
|
||||
|
||||
if (vec3d1 != null && vec3d != null) {
|
||||
double d14 = (vec3d.d - vec3d1.d) * 0.05D;
|
||||
double d14 = (vec3d.b - vec3d1.b) * 0.05D;
|
||||
|
||||
d6 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ);
|
||||
if (d6 > 0.0D) {
|
||||
@ -538,7 +538,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
this.motZ = this.motZ / d6 * (d6 + d14);
|
||||
}
|
||||
|
||||
this.setPosition(this.locX, vec3d1.d, this.locZ);
|
||||
this.setPosition(this.locX, vec3d1.b, this.locZ);
|
||||
}
|
||||
|
||||
int i1 = MathHelper.floor(this.locX);
|
||||
@ -575,7 +575,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
}
|
||||
|
||||
protected void i() {
|
||||
if (this.passenger != null || !this.slowWhenEmpty) { // CraftBukkit
|
||||
if (this.passenger != null || !this.slowWhenEmpty) { // CraftBukkit - add !this.slowWhenEmpty
|
||||
this.motX *= 0.996999979019165D;
|
||||
this.motY *= 0.0D;
|
||||
this.motZ *= 0.996999979019165D;
|
||||
@ -645,7 +645,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
d1 += 0.5D;
|
||||
}
|
||||
|
||||
return this.world.getVec3DPool().create(d0, d1, d2);
|
||||
return Vec3D.a(d0, d1, d2);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -714,15 +714,15 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
d1 *= d3;
|
||||
d0 *= 0.10000000149011612D;
|
||||
d1 *= 0.10000000149011612D;
|
||||
d0 *= (double) (1.0F - this.Z);
|
||||
d1 *= (double) (1.0F - this.Z);
|
||||
d0 *= (double) (1.0F - this.Y);
|
||||
d1 *= (double) (1.0F - this.Y);
|
||||
d0 *= 0.5D;
|
||||
d1 *= 0.5D;
|
||||
if (entity instanceof EntityMinecartAbstract) {
|
||||
double d4 = entity.locX - this.locX;
|
||||
double d5 = entity.locZ - this.locZ;
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(d4, 0.0D, d5).a();
|
||||
Vec3D vec3d1 = this.world.getVec3DPool().create((double) MathHelper.cos(this.yaw * 3.1415927F / 180.0F), 0.0D, (double) MathHelper.sin(this.yaw * 3.1415927F / 180.0F)).a();
|
||||
Vec3D vec3d = Vec3D.a(d4, 0.0D, d5).a();
|
||||
Vec3D vec3d1 = Vec3D.a((double) MathHelper.cos(this.yaw * 3.1415927F / 180.0F), 0.0D, (double) MathHelper.sin(this.yaw * 3.1415927F / 180.0F)).a();
|
||||
double d6 = Math.abs(vec3d.b(vec3d1));
|
||||
|
||||
if (d6 < 0.800000011920929D) {
|
||||
|
@ -129,7 +129,7 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
|
||||
public void update() {}
|
||||
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
return this.dead ? false : entityhuman.e(this) <= 64.0D;
|
||||
return this.dead ? false : entityhuman.f(this) <= 64.0D;
|
||||
}
|
||||
|
||||
public void startOpen() {}
|
||||
|
@ -10,11 +10,11 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
}
|
||||
|
||||
public void e() {
|
||||
this.bb();
|
||||
this.ba();
|
||||
float f = this.d(1.0F);
|
||||
|
||||
if (f > 0.5F) {
|
||||
this.aV += 2;
|
||||
this.aU += 2;
|
||||
}
|
||||
|
||||
super.e();
|
||||
@ -27,18 +27,18 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
}
|
||||
}
|
||||
|
||||
protected String H() {
|
||||
protected String G() {
|
||||
return "game.hostile.swim";
|
||||
}
|
||||
|
||||
protected String O() {
|
||||
protected String N() {
|
||||
return "game.hostile.swim.splash";
|
||||
}
|
||||
|
||||
protected Entity findTarget() {
|
||||
EntityHuman entityhuman = this.world.findNearbyVulnerablePlayer(this, 16.0D);
|
||||
|
||||
return entityhuman != null && this.o(entityhuman) ? entityhuman : null;
|
||||
return entityhuman != null && this.p(entityhuman) ? entityhuman : null;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
@ -75,11 +75,11 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
}
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "game.hostile.hurt";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "game.hostile.die";
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
return i > 4 ? "game.hostile.hurt.fall.big" : "game.hostile.hurt.fall.small";
|
||||
}
|
||||
|
||||
public boolean m(Entity entity) {
|
||||
public boolean n(Entity entity) {
|
||||
float f = (float) this.getAttributeInstance(GenericAttributes.e).getValue();
|
||||
int i = 0;
|
||||
|
||||
@ -124,7 +124,7 @@ 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.m(entity);
|
||||
this.n(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
} else {
|
||||
int l = this.world.getLightLevel(i, j, k);
|
||||
|
||||
if (this.world.O()) {
|
||||
if (this.world.P()) {
|
||||
int i1 = this.world.j;
|
||||
|
||||
this.world.j = 10;
|
||||
@ -158,12 +158,12 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||
return this.world.difficulty != EnumDifficulty.PEACEFUL && this.j_() && super.canSpawn();
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
this.bc().b(GenericAttributes.e);
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.bb().b(GenericAttributes.e);
|
||||
}
|
||||
|
||||
protected boolean aG() {
|
||||
protected boolean aF() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class EntityMushroomCow extends EntityCow {
|
||||
|
||||
entitycow.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
||||
entitycow.setHealth(this.getHealth());
|
||||
entitycow.aN = this.aN;
|
||||
entitycow.aM = this.aM;
|
||||
this.world.addEntity(entitycow);
|
||||
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
|
@ -27,7 +27,7 @@ public class EntityOcelot extends EntityTameableAnimal {
|
||||
this.datawatcher.a(18, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
public void bp() {
|
||||
public void bo() {
|
||||
if (this.getControllerMove().a()) {
|
||||
double d0 = this.getControllerMove().b();
|
||||
|
||||
@ -48,15 +48,15 @@ public class EntityOcelot extends EntityTameableAnimal {
|
||||
}
|
||||
|
||||
protected boolean isTypeNotPersistent() {
|
||||
return !this.isTamed(); // CraftBukkit
|
||||
return !this.isTamed() /*&& this.ticksLived > 2400*/; // CraftBukkit
|
||||
}
|
||||
|
||||
public boolean bk() {
|
||||
public boolean bj() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(10.0D);
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.30000001192092896D);
|
||||
}
|
||||
@ -74,18 +74,18 @@ public class EntityOcelot extends EntityTameableAnimal {
|
||||
}
|
||||
|
||||
protected String t() {
|
||||
return this.isTamed() ? (this.cc() ? "mob.cat.purr" : (this.random.nextInt(4) == 0 ? "mob.cat.purreow" : "mob.cat.meow")) : "";
|
||||
return this.isTamed() ? (this.ce() ? "mob.cat.purr" : (this.random.nextInt(4) == 0 ? "mob.cat.purreow" : "mob.cat.meow")) : "";
|
||||
}
|
||||
|
||||
protected String aS() {
|
||||
return "mob.cat.hitt";
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
return "mob.cat.hitt";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
return "mob.cat.hitt";
|
||||
}
|
||||
|
||||
protected float bf() {
|
||||
protected float be() {
|
||||
return 0.4F;
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ public class EntityOcelot extends EntityTameableAnimal {
|
||||
return Items.LEATHER;
|
||||
}
|
||||
|
||||
public boolean m(Entity entity) {
|
||||
public boolean n(Entity entity) {
|
||||
return entity.damageEntity(DamageSource.mobAttack(this), 3.0F);
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ public class EntityOcelot extends EntityTameableAnimal {
|
||||
if (entityhuman.getName().equalsIgnoreCase(this.getOwnerName()) && !this.world.isStatic && !this.c(itemstack)) {
|
||||
this.bp.setSitting(!this.isSitting());
|
||||
}
|
||||
} else if (this.bq.f() && itemstack != null && itemstack.getItem() == Items.RAW_FISH && entityhuman.e(this) < 9.0D) {
|
||||
} else if (this.bq.f() && itemstack != null && itemstack.getItem() == Items.RAW_FISH && entityhuman.f(this) < 9.0D) {
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
--itemstack.count;
|
||||
}
|
||||
@ -173,7 +173,7 @@ public class EntityOcelot extends EntityTameableAnimal {
|
||||
} else {
|
||||
EntityOcelot entityocelot = (EntityOcelot) entityanimal;
|
||||
|
||||
return !entityocelot.isTamed() ? false : this.cc() && entityocelot.cc();
|
||||
return !entityocelot.isTamed() ? false : this.ce() && entityocelot.ce();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,22 +25,22 @@ public class EntityPig extends EntityAnimal {
|
||||
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
||||
}
|
||||
|
||||
public boolean bk() {
|
||||
public boolean bj() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(10.0D);
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.25D);
|
||||
}
|
||||
|
||||
protected void bn() {
|
||||
super.bn();
|
||||
protected void bm() {
|
||||
super.bm();
|
||||
}
|
||||
|
||||
public boolean bC() {
|
||||
ItemStack itemstack = ((EntityHuman) this.passenger).be();
|
||||
public boolean bE() {
|
||||
ItemStack itemstack = ((EntityHuman) this.passenger).bd();
|
||||
|
||||
return itemstack != null && itemstack.getItem() == Items.CARROT_STICK;
|
||||
}
|
||||
@ -64,11 +64,11 @@ public class EntityPig extends EntityAnimal {
|
||||
return "mob.pig.say";
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.pig.say";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "mob.pig.death";
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ public class EntityPig extends EntityAnimal {
|
||||
return itemstack != null && itemstack.getItem() == Items.CARROT;
|
||||
}
|
||||
|
||||
public PathfinderGoalPassengerCarrotStick bY() {
|
||||
public PathfinderGoalPassengerCarrotStick ca() {
|
||||
return this.bp;
|
||||
}
|
||||
|
||||
|
@ -21,14 +21,14 @@ public class EntityPigZombie extends EntityZombie {
|
||||
this.fireProof = true;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(bp).setValue(0.0D);
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.5D);
|
||||
this.getAttributeInstance(GenericAttributes.e).setValue(5.0D);
|
||||
}
|
||||
|
||||
protected boolean bk() {
|
||||
protected boolean bj() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ public class EntityPigZombie extends EntityZombie {
|
||||
|
||||
this.bu = this.target;
|
||||
if (this.soundDelay > 0 && --this.soundDelay == 0) {
|
||||
this.makeSound("mob.zombiepig.zpigangry", this.bf() * 2.0F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 1.8F);
|
||||
this.makeSound("mob.zombiepig.zpigangry", this.be() * 2.0F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 1.8F);
|
||||
}
|
||||
|
||||
super.h();
|
||||
@ -121,11 +121,11 @@ public class EntityPigZombie extends EntityZombie {
|
||||
return "mob.zombiepig.zpig";
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.zombiepig.zpighurt";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "mob.zombiepig.zpigdeath";
|
||||
}
|
||||
|
||||
@ -170,7 +170,7 @@ public class EntityPigZombie extends EntityZombie {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
protected void bA() {
|
||||
protected void bC() {
|
||||
this.setEquipment(0, new ItemStack(Items.GOLD_SWORD));
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
private static final Logger bM = LogManager.getLogger();
|
||||
private static final Logger bL = LogManager.getLogger();
|
||||
private String locale = "en_US";
|
||||
public PlayerConnection playerConnection;
|
||||
public final MinecraftServer server;
|
||||
@ -37,7 +37,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
public double d;
|
||||
public double e;
|
||||
public final List chunkCoordIntPairQueue = new LinkedList();
|
||||
public final List removeQueue = new LinkedList();
|
||||
public final List removeQueue = new LinkedList(); // CraftBukkit - private -> public
|
||||
private final ServerStatisticManager bO;
|
||||
private float bP = Float.MIN_VALUE;
|
||||
private float bQ = -1.0E8F;
|
||||
@ -45,12 +45,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
private boolean bS = true;
|
||||
public int lastSentExp = -99999999; // CraftBukkit - private -> public
|
||||
public int invulnerableTicks = 60; // CraftBukkit - private -> public
|
||||
private int bV;
|
||||
private EnumChatVisibility bW;
|
||||
private boolean bX = true;
|
||||
private long bY = 0L;
|
||||
private EnumChatVisibility bV;
|
||||
private boolean bW = true;
|
||||
private long bX = 0L;
|
||||
private int containerCounter;
|
||||
public boolean h;
|
||||
public boolean g;
|
||||
public int ping;
|
||||
public boolean viewingCredits;
|
||||
// CraftBukkit start
|
||||
@ -68,7 +67,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
super(worldserver, gameprofile);
|
||||
playerinteractmanager.player = this;
|
||||
this.playerInteractManager = playerinteractmanager;
|
||||
this.bV = minecraftserver.getPlayerList().o();
|
||||
ChunkCoordinates chunkcoordinates = worldserver.getSpawn();
|
||||
int i = chunkcoordinates.x;
|
||||
int j = chunkcoordinates.z;
|
||||
@ -84,7 +82,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
this.server = minecraftserver;
|
||||
this.bO = minecraftserver.getPlayerList().i(this.getName());
|
||||
this.X = 0.0F;
|
||||
this.W = 0.0F;
|
||||
this.height = 0.0F;
|
||||
this.setPositionRotation((double) i + 0.5D, (double) k, (double) j + 0.5D, 0.0F, 0.0F);
|
||||
|
||||
@ -230,7 +228,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.bY > 0L && this.server.aq() > 0 && MinecraftServer.ap() - this.bY > (long) (this.server.aq() * 1000 * 60)) {
|
||||
if (this.bX > 0L && this.server.getIdleTimeout() > 0 && MinecraftServer.aq() - this.bX > (long) (this.server.getIdleTimeout() * 1000 * 60)) {
|
||||
this.playerConnection.disconnect("You have been idle for too long!");
|
||||
}
|
||||
}
|
||||
@ -259,8 +257,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.bS = this.foodData.e() == 0.0F;
|
||||
}
|
||||
|
||||
if (this.getHealth() + this.bs() != this.bP) {
|
||||
this.bP = this.getHealth() + this.bs();
|
||||
if (this.getHealth() + this.br() != this.bP) {
|
||||
this.bP = this.getHealth() + this.br();
|
||||
// CraftBukkit - Update ALL the scores!
|
||||
this.world.getServer().getScoreboardManager().updateAllScoresForList(IScoreboardCriteria.f, this.getName(), com.google.common.collect.ImmutableList.of(this));
|
||||
}
|
||||
@ -276,11 +274,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.playerConnection.sendPacket(new PacketPlayOutExperience(this.exp, this.expTotal, this.expLevel));
|
||||
}
|
||||
|
||||
if (this.ticksLived % 20 * 5 == 0 && !this.x().a(AchievementList.L)) {
|
||||
if (this.ticksLived % 20 * 5 == 0 && !this.getStatisticManager().a(AchievementList.L)) {
|
||||
this.j();
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - initialize oldLevel and fire PlayerLevelChangeEvent
|
||||
if (this.oldLevel == -1) {
|
||||
this.oldLevel = this.expLevel;
|
||||
}
|
||||
@ -304,14 +302,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
if (biomebase != null) {
|
||||
String s = biomebase.af;
|
||||
AchievementSet achievementset = (AchievementSet) this.x().b((Statistic) AchievementList.L); // CraftBukkit - fix decompile error
|
||||
AchievementSet achievementset = (AchievementSet) this.getStatisticManager().b((Statistic) AchievementList.L); // CraftBukkit - fix decompile error
|
||||
|
||||
if (achievementset == null) {
|
||||
achievementset = (AchievementSet) this.x().a(AchievementList.L, new AchievementSet());
|
||||
achievementset = (AchievementSet) this.getStatisticManager().a(AchievementList.L, new AchievementSet());
|
||||
}
|
||||
|
||||
achievementset.add(s);
|
||||
if (this.x().b(AchievementList.L) && achievementset.size() == BiomeBase.n.size()) {
|
||||
if (this.getStatisticManager().b(AchievementList.L) && achievementset.size() == BiomeBase.n.size()) {
|
||||
HashSet hashset = Sets.newHashSet(BiomeBase.n);
|
||||
Iterator iterator = achievementset.iterator();
|
||||
|
||||
@ -340,7 +338,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public void die(DamageSource damagesource) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerDeathEvent
|
||||
if (this.dead) {
|
||||
return;
|
||||
}
|
||||
@ -362,7 +360,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
}
|
||||
|
||||
IChatBaseComponent chatmessage = this.aW().b();
|
||||
IChatBaseComponent chatmessage = this.aV().b();
|
||||
|
||||
String deathmessage = chatmessage.c();
|
||||
org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage);
|
||||
@ -401,20 +399,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
scoreboardscore.incrementScore();
|
||||
}
|
||||
|
||||
EntityLiving entityliving = this.aX();
|
||||
EntityLiving entityliving = this.aW();
|
||||
|
||||
if (entityliving != null) {
|
||||
int i = EntityTypes.a(entityliving);
|
||||
MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.a.get(Integer.valueOf(i));
|
||||
MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.eggInfo.get(Integer.valueOf(i));
|
||||
|
||||
if (monsteregginfo != null) {
|
||||
this.a(monsteregginfo.e, 1);
|
||||
}
|
||||
|
||||
entityliving.b(this, this.bb);
|
||||
entityliving.b(this, this.ba);
|
||||
}
|
||||
|
||||
this.a(StatisticList.v, 1);
|
||||
this.aV().g();
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
@ -422,7 +421,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
return false;
|
||||
} else {
|
||||
// CraftBukkit - this.server.getPvP() -> this.world.pvpMode
|
||||
boolean flag = this.server.V() && this.world.pvpMode && "fall".equals(damagesource.translationIndex);
|
||||
boolean flag = this.server.W() && this.world.pvpMode && "fall".equals(damagesource.translationIndex);
|
||||
|
||||
if (!flag && this.invulnerableTicks > 0 && damagesource != DamageSource.OUT_OF_WORLD) {
|
||||
return false;
|
||||
@ -717,14 +716,16 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
MerchantRecipeList merchantrecipelist = imerchant.getOffers(this);
|
||||
|
||||
if (merchantrecipelist != null) {
|
||||
try {
|
||||
PacketDataSerializer packetdataserializer = new PacketDataSerializer(Unpooled.buffer());
|
||||
PacketDataSerializer packetdataserializer = new PacketDataSerializer(Unpooled.buffer());
|
||||
|
||||
try {
|
||||
packetdataserializer.writeInt(this.containerCounter);
|
||||
merchantrecipelist.a(packetdataserializer);
|
||||
this.playerConnection.sendPacket(new PacketPlayOutCustomPayload("MC|TrList", packetdataserializer));
|
||||
} catch (Exception ioexception) { // CraftBukkit - IOException -> Exception
|
||||
bM.error("Couldn\'t send trade list", ioexception);
|
||||
bL.error("Couldn\'t send trade list", ioexception);
|
||||
} finally {
|
||||
packetdataserializer.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -748,7 +749,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
public void a(Container container, int i, ItemStack itemstack) {
|
||||
if (!(container.getSlot(i) instanceof SlotResult)) {
|
||||
if (!this.h) {
|
||||
if (!this.g) {
|
||||
this.playerConnection.sendPacket(new PacketPlayOutSetSlot(container.windowId, i, itemstack));
|
||||
}
|
||||
}
|
||||
@ -779,7 +780,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public void broadcastCarriedItem() {
|
||||
if (!this.h) {
|
||||
if (!this.g) {
|
||||
this.playerConnection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.inventory.getCarried()));
|
||||
}
|
||||
}
|
||||
@ -792,14 +793,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
public void a(float f, float f1, boolean flag, boolean flag1) {
|
||||
if (this.vehicle != null) {
|
||||
if (f >= -1.0F && f <= 1.0F) {
|
||||
this.be = f;
|
||||
this.bd = f;
|
||||
}
|
||||
|
||||
if (f1 >= -1.0F && f1 <= 1.0F) {
|
||||
this.bf = f1;
|
||||
this.be = f1;
|
||||
}
|
||||
|
||||
this.bd = flag;
|
||||
this.bc = flag;
|
||||
this.setSneaking(flag1);
|
||||
}
|
||||
}
|
||||
@ -915,7 +916,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public boolean a(int i, String s) {
|
||||
return "seed".equals(s) && !this.server.V() ? true : (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) ? (this.server.getPlayerList().isOp(this.getName()) ? this.server.l() >= i : false) : true);
|
||||
return "seed".equals(s) && !this.server.W() ? true : (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) ? (this.server.getPlayerList().isOp(this.getName()) ? this.server.l() >= i : false) : true);
|
||||
}
|
||||
|
||||
public String s() {
|
||||
@ -930,13 +931,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.locale = packetplayinsettings.c();
|
||||
int i = 256 >> packetplayinsettings.d();
|
||||
|
||||
if (i > 3 && i < 15) {
|
||||
this.bV = i;
|
||||
if (i > 3 && i < 20) {
|
||||
;
|
||||
}
|
||||
|
||||
this.bW = packetplayinsettings.e();
|
||||
this.bX = packetplayinsettings.f();
|
||||
if (this.server.L() && this.server.K().equals(this.getName())) {
|
||||
this.bV = packetplayinsettings.e();
|
||||
this.bW = packetplayinsettings.f();
|
||||
if (this.server.M() && this.server.L().equals(this.getName())) {
|
||||
this.server.a(packetplayinsettings.g());
|
||||
}
|
||||
|
||||
@ -944,10 +945,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public EnumChatVisibility getChatFlags() {
|
||||
return this.bW;
|
||||
return this.bV;
|
||||
}
|
||||
|
||||
public void a(String s) {
|
||||
public void setResourcePack(String s) {
|
||||
this.playerConnection.sendPacket(new PacketPlayOutCustomPayload("MC|RPack", s.getBytes(Charsets.UTF_8)));
|
||||
}
|
||||
|
||||
@ -955,15 +956,22 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
return new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY + 0.5D), MathHelper.floor(this.locZ));
|
||||
}
|
||||
|
||||
public void w() {
|
||||
this.bY = MinecraftServer.ap();
|
||||
public void v() {
|
||||
this.bX = MinecraftServer.aq();
|
||||
}
|
||||
|
||||
public ServerStatisticManager x() {
|
||||
public ServerStatisticManager getStatisticManager() {
|
||||
return this.bO;
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
public void d(Entity entity) {
|
||||
if (entity instanceof EntityHuman) {
|
||||
this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(new int[] { entity.getId()}));
|
||||
} else {
|
||||
this.removeQueue.add(Integer.valueOf(entity.getId()));
|
||||
}
|
||||
}
|
||||
// CraftBukkit start - Add per-player time and weather.
|
||||
public long timeOffset = 0;
|
||||
public boolean relativeTime = true;
|
||||
|
||||
@ -1029,7 +1037,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.expTotal = this.newTotalExp;
|
||||
this.exp = 0;
|
||||
this.deathTicks = 0;
|
||||
this.aP(); // Should be remapped: removeAllEffects should be remapped to this.
|
||||
this.removeAllEffects();
|
||||
this.updateEffects = true;
|
||||
this.activeContainer = this.defaultContainer;
|
||||
this.killer = null;
|
||||
|
@ -12,7 +12,7 @@ import org.bukkit.entity.LivingEntity;
|
||||
|
||||
public class EntityPotion extends EntityProjectile {
|
||||
|
||||
public ItemStack item; // CraftBukkit private --> public
|
||||
public ItemStack item; // CraftBukkit private -> public
|
||||
|
||||
public EntityPotion(World world) {
|
||||
super(world);
|
||||
@ -76,7 +76,7 @@ public class EntityPotion extends EntityProjectile {
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
EntityLiving entityliving = (EntityLiving) iterator.next();
|
||||
double d0 = this.e(entityliving);
|
||||
double d0 = this.f(entityliving);
|
||||
|
||||
if (d0 < 16.0D) {
|
||||
double d1 = 1.0D - Math.sqrt(d0) / 4.0D;
|
||||
|
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