public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) { int i1 = l & 7; 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); }
public void b(NBTTagCompound nbttagcompound) { nbttagcompound.setShort("xTile", (short) this.e); nbttagcompound.setShort("yTile", (short) this.f); nbttagcompound.setShort("zTile", (short) this.g); nbttagcompound.setByte("inTile", (byte) Block.b(this.h)); nbttagcompound.setByte("inGround", (byte) (this.i ? 1 : 0)); nbttagcompound.set("direction", this.a(new double[] {this.motX, this.motY, this.motZ})); }
private boolean c(int i) { if (i == 0) { return false; } else { Block block = Block.byId[i]; return block.b() && block.material.isSolid(); } }
@Override public void b(World world, int i, int j, int k, EntityHuman entityhuman) { if (entityhuman instanceof EntityPlayer) { SpoutCraftPlayer player = (SpoutCraftPlayer) SpoutManager.getPlayer((Player) ((EntityPlayer) entityhuman).getBukkitEntity()); player.setLastClickedLocation(new Location(player.getWorld(), i, j, k)); } parent.b(world, i, j, k, entityhuman); }
public void b(NBTTagCompound nbttagcompound) { nbttagcompound.setShort("xTile", (short) this.d); nbttagcompound.setShort("yTile", (short) this.e); nbttagcompound.setShort("zTile", (short) this.f); 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); nbttagcompound.setByte("inGround", (byte) (this.inGround ? 1 : 0)); nbttagcompound.setByte("pickup", (byte) this.fromPlayer); nbttagcompound.setDouble("damage", this.damage); }
protected void Z() { int i = MathHelper.floor(this.locX); int j = MathHelper.floor(this.locY - 0.20000000298023224D); int k = MathHelper.floor(this.locZ); BlockPosition blockposition = new BlockPosition(i, j, k); IBlockData iblockdata = this.world.getType(blockposition); Block block = iblockdata.getBlock(); if (block.b() != -1) { this.world.addParticle( EnumParticle.BLOCK_CRACK, this.locX + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, this.getBoundingBox().b + 0.1D, this.locZ + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, -this.motX * 4.0D, 1.5D, -this.motZ * 4.0D, new int[] {Block.getCombinedId(iblockdata)}); } }
@Override public void b(World world, int i, int j, int k, Entity entity) { parent.b(world, i, j, k, entity); }
@Override public boolean b(IBlockAccess iblockaccess, int i, int j, int k, int l) { return parent.b(iblockaccess, i, j, k, l); }
@Override public boolean b() { return parent.b(); }
static { br[Block.b((Block) Blocks.GRASS)] = true; br[Block.b(Blocks.DIRT)] = true; br[Block.b(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; br[Block.b((Block) Blocks.BROWN_MUSHROOM)] = true; br[Block.b((Block) Blocks.RED_MUSHROOM)] = true; br[Block.b(Blocks.TNT)] = true; br[Block.b(Blocks.CACTUS)] = true; br[Block.b(Blocks.CLAY)] = true; br[Block.b(Blocks.PUMPKIN)] = true; br[Block.b(Blocks.MELON)] = true; br[Block.b((Block) Blocks.MYCEL)] = true; }
public void b(NBTTagCompound nbttagcompound) { super.b(nbttagcompound); nbttagcompound.setShort("carried", (short) Block.b(this.getCarried())); nbttagcompound.setShort("carriedData", (short) this.getCarriedData()); }
public void setCarried(Block block) { this.datawatcher.watch(16, Byte.valueOf((byte) (Block.b(block) & 255))); }
public void e() { if (this.L()) { this.damageEntity(DamageSource.DROWN, 1.0F); } if (this.bu != this.target) { AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.d); attributeinstance.b(bq); if (this.target != null) { attributeinstance.a(bq); } } this.bu = this.target; int i; if (!this.world.isStatic && this.world.getGameRules().getBoolean("mobGriefing")) { int j; int k; Block block; if (this.getCarried().getMaterial() == Material.AIR) { if (this.random.nextInt(20) == 0) { i = MathHelper.floor(this.locX - 2.0D + this.random.nextDouble() * 4.0D); j = MathHelper.floor(this.locY + this.random.nextDouble() * 3.0D); k = MathHelper.floor(this.locZ - 2.0D + this.random.nextDouble() * 4.0D); block = this.world.getType(i, j, k); if (br[Block.b(block)]) { this.setCarried(block); this.setCarriedData(this.world.getData(i, j, k)); this.world.setTypeUpdate(i, j, k, Blocks.AIR); } } } else if (this.random.nextInt(2000) == 0) { i = MathHelper.floor(this.locX - 1.0D + this.random.nextDouble() * 2.0D); j = MathHelper.floor(this.locY + this.random.nextDouble() * 2.0D); k = MathHelper.floor(this.locZ - 1.0D + this.random.nextDouble() * 2.0D); block = this.world.getType(i, j, k); Block block1 = this.world.getType(i, j - 1, k); if (block.getMaterial() == Material.AIR && block1.getMaterial() != Material.AIR && block1.d()) { this.world.setTypeAndData(i, j, k, this.getCarried(), this.getCarriedData(), 3); this.setCarried(Blocks.AIR); } } } for (i = 0; i < 2; ++i) { 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) { 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(); } } if (this.L() || this.isBurning()) { this.target = null; this.a(false); this.bv = false; this.bX(); } if (this.cb() && !this.bv && this.random.nextInt(100) == 0) { this.a(false); } this.bd = false; if (this.target != null) { this.a(this.target, 100.0F, 100.0F); } 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(); } this.bs = 0; } else if (this.target.e((Entity) this) > 256.0D && this.bs++ >= 30 && this.c(this.target)) { this.bs = 0; } } else { this.a(false); this.bs = 0; } } super.e(); }
public boolean a(boolean flag) { int i = this.M.size(); if (i != this.L.size()) { throw new IllegalStateException("TickNextTick list out of synch"); } else { if (i > 1000) { // CraftBukkit start - If the server has too much to process over time, try to alleviate // that if (i > 20 * 1000) { i = i / 20; } else { i = 1000; } // CraftBukkit end } this.methodProfiler.a("cleaning"); NextTickListEntry nextticklistentry; for (int j = 0; j < i; ++j) { nextticklistentry = (NextTickListEntry) this.M.first(); if (!flag && nextticklistentry.e > this.worldData.getTime()) { break; } this.M.remove(nextticklistentry); this.L.remove(nextticklistentry); this.U.add(nextticklistentry); } this.methodProfiler.b(); this.methodProfiler.a("ticking"); Iterator iterator = this.U.iterator(); while (iterator.hasNext()) { nextticklistentry = (NextTickListEntry) iterator.next(); iterator.remove(); byte b0 = 0; if (this.e( nextticklistentry.a - b0, nextticklistentry.b - b0, nextticklistentry.c - b0, nextticklistentry.a + b0, nextticklistentry.b + b0, nextticklistentry.c + b0)) { int k = this.getTypeId(nextticklistentry.a, nextticklistentry.b, nextticklistentry.c); if (k > 0 && Block.b(k, nextticklistentry.d)) { try { Block.byId[k].a( this, nextticklistentry.a, nextticklistentry.b, nextticklistentry.c, this.random); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Exception while ticking a block"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Block being ticked"); int l; try { l = this.getData(nextticklistentry.a, nextticklistentry.b, nextticklistentry.c); } catch (Throwable throwable1) { l = -1; } CrashReportSystemDetails.a( crashreportsystemdetails, nextticklistentry.a, nextticklistentry.b, nextticklistentry.c, k, l); throw new ReportedException(crashreport); } } } else { this.a( nextticklistentry.a, nextticklistentry.b, nextticklistentry.c, nextticklistentry.d, 0); } } this.methodProfiler.b(); this.U.clear(); return !this.M.isEmpty(); } }