public void e() { for (int var1 = 0; var1 < this.h; ++var1) { BlockPosition var2 = this.f.shift(this.c, var1); for (int var3 = 0; var3 < this.g; ++var3) { this.a.setTypeAndData( var2.up(var3), Blocks.PORTAL.getBlockData().set(BlockPortal.AXIS, this.b), 2); } } }
public boolean interactWith( ItemStack var1, EntityHuman var2, World var3, BlockPosition var4, EnumDirection var5, float var6, float var7, float var8) { if (var3.isClientSide) { return true; } else if (var5 != EnumDirection.UP) { return false; } else { IBlockData var9 = var3.getType(var4); Block var10 = var9.getBlock(); boolean var11 = var10.a(var3, var4); if (!var11) { var4 = var4.up(); } int var12 = MathHelper.floor((double) (var2.yaw * 4.0F / 360.0F) + 0.5D) & 3; EnumDirection var13 = EnumDirection.fromType2(var12); BlockPosition var14 = var4.shift(var13); if (var2.a(var4, var5, var1) && var2.a(var14, var5, var1)) { boolean var15 = var3.getType(var14).getBlock().a(var3, var14); boolean var16 = var11 || var3.isEmpty(var4); boolean var17 = var15 || var3.isEmpty(var14); if (var16 && var17 && World.a((IBlockAccess) var3, (BlockPosition) var4.down()) && World.a((IBlockAccess) var3, (BlockPosition) var14.down())) { IBlockData var18 = Blocks.BED .getBlockData() .set(BlockBed.OCCUPIED, Boolean.valueOf(false)) .set(BlockBed.FACING, var13) .set(BlockBed.PART, BlockBed.EnumBedPart.FOOT); if (var3.setTypeAndData(var4, var18, 3)) { IBlockData var19 = var18.set(BlockBed.PART, BlockBed.EnumBedPart.HEAD); var3.setTypeAndData(var14, var19, 3); } --var1.count; return true; } else { return false; } } else { return false; } } }
protected int a(BlockPosition var1, EnumDirection var2) { int var3; for (var3 = 0; var3 < 22; ++var3) { BlockPosition var4 = var1.shift(var2, var3); if (!this.a(this.a.getType(var4).getBlock()) || this.a.getType(var4.down()).getBlock() != Blocks.OBSIDIAN) { break; } } Block var5 = this.a.getType(var1.shift(var2, var3)).getBlock(); return var5 == Blocks.OBSIDIAN ? var3 : 0; }
public void b(World var1, BlockPosition var2, IBlockData var3, Random var4) { super.b(var1, var2, var3, var4); if (var1.worldProvider.d() && var1.getGameRules().getBoolean("doMobSpawning") && var4.nextInt(2000) < var1.getDifficulty().a()) { int var5 = var2.getY(); BlockPosition var6; for (var6 = var2; !World.a((IBlockAccess) var1, (BlockPosition) var6) && var6.getY() > 0; var6 = var6.down()) {; } if (var5 > 0 && !var1.getType(var6.up()).getBlock().isOccluding()) { Entity var7 = ItemMonsterEgg.a( var1, 57, (double) var6.getX() + 0.5D, (double) var6.getY() + 1.1D, (double) var6.getZ() + 0.5D); if (var7 != null) { var7.portalCooldown = var7.aq(); } } } }
public boolean interact( World var1, BlockPosition var2, IBlockData var3, EntityHuman var4, EnumUsedHand var5, ItemStack var6, EnumDirection var7, float var8, float var9, float var10) { class_yu var11 = var4.cq(); TileEntity var12 = var1.getTileEntity(var2); if (var11 != null && var12 instanceof TileEntityEnderChest) { if (var1.getType(var2.up()).getBlock().isOccluding()) { return true; } else if (var1.isClientSide) { return true; } else { var11.a((TileEntityEnderChest) var12); var4.openContainer((IInventory) var11); var4.b(StatisticList.V); return true; } } else { return true; } }
protected int c() { int var1; label56: for (this.g = 0; this.g < 21; ++this.g) { for (var1 = 0; var1 < this.h; ++var1) { BlockPosition var2 = this.f.shift(this.c, var1).up(this.g); Block var3 = this.a.getType(var2).getBlock(); if (!this.a(var3)) { break label56; } if (var3 == Blocks.PORTAL) { ++this.e; } if (var1 == 0) { var3 = this.a.getType(var2.shift(this.d)).getBlock(); if (var3 != Blocks.OBSIDIAN) { break label56; } } else if (var1 == this.h - 1) { var3 = this.a.getType(var2.shift(this.c)).getBlock(); if (var3 != Blocks.OBSIDIAN) { break label56; } } } } for (var1 = 0; var1 < this.h; ++var1) { if (this.a.getType(this.f.shift(this.c, var1).up(this.g)).getBlock() != Blocks.OBSIDIAN) { this.g = 0; break; } } if (this.g <= 21 && this.g >= 3) { return this.g; } else { this.f = null; this.h = 0; this.g = 0; return 0; } }
public Shape(World var1, BlockPosition var2, EnumDirection.EnumAxis var3) { this.a = var1; this.b = var3; if (var3 == EnumDirection.EnumAxis.X) { this.d = EnumDirection.EAST; this.c = EnumDirection.WEST; } else { this.d = EnumDirection.NORTH; this.c = EnumDirection.SOUTH; } for (BlockPosition var4 = var2; var2.getY() > var4.getY() - 21 && var2.getY() > 0 && this.a(var1.getType(var2.down()).getBlock()); var2 = var2.down()) {; } int var5 = this.a(var2, this.d) - 1; if (var5 >= 0) { this.f = var2.shift(this.d, var5); this.h = this.a(this.f, this.c); if (this.h < 2 || this.h > 21) { this.f = null; this.h = 0; } } if (this.f != null) { this.g = this.c(); } }
public void a(World var1, Random var2, BlockPosition var3) { super.a(var1, var2, var3); if (var2.nextInt(1000) == 0) { int var4 = var2.nextInt(16) + 8; int var5 = var2.nextInt(16) + 8; BlockPosition var6 = var1.m(var3.add(var4, 0, var5)).up(); (new class_aqg()).b(var1, var2, var6); } }
public void b(World var1, BlockPosition var2, IBlockData var3, Random var4) { super.b(var1, var2, var3, var4); if (var1.getLightLevel(var2.up()) >= 9) { int var5 = ((Integer) var3.get(AGE)).intValue(); if (var5 < 7) { float var6 = a(this, var1, var2); if (var4.nextInt((int) (25.0F / var6) + 1) == 0) { var1.setTypeAndData(var2, var3.set(AGE, Integer.valueOf(var5 + 1)), 2); } } } }
public void b(World var1, BlockPosition var2, IBlockData var3, Random var4) { if (this.material == Material.LAVA) { if (var1.getGameRules().getBoolean("doFireTick")) { int var5 = var4.nextInt(3); if (var5 > 0) { BlockPosition var6 = var2; for (int var7 = 0; var7 < var5; ++var7) { var6 = var6.a(var4.nextInt(3) - 1, 1, var4.nextInt(3) - 1); Block var8 = var1.getType(var6).getBlock(); if (var8.material == Material.AIR) { if (this.f(var1, var6)) { var1.setTypeUpdate(var6, Blocks.FIRE.getBlockData()); return; } } else if (var8.material.isSolid()) { return; } } } else { for (int var9 = 0; var9 < 3; ++var9) { BlockPosition var10 = var2.a(var4.nextInt(3) - 1, 0, var4.nextInt(3) - 1); if (var1.isEmpty(var10.up()) && this.m(var1, var10)) { var1.setTypeUpdate(var10.up(), Blocks.FIRE.getBlockData()); } } } } } }
protected boolean f(World var1, BlockPosition var2) { EnumDirection[] var3 = EnumDirection.values(); int var4 = var3.length; for (int var5 = 0; var5 < var4; ++var5) { EnumDirection var6 = var3[var5]; if (this.m(var1, var2.shift(var6))) { return true; } } return false; }
public boolean interactWith( ItemStack var1, EntityHuman var2, World var3, BlockPosition var4, EnumDirection var5, float var6, float var7, float var8) { if (var5 == EnumDirection.DOWN) { return false; } else if (!var3.getType(var4).getBlock().getMaterial().isBuildable()) { return false; } else { var4 = var4.shift(var5); if (!var2.a(var4, var5, var1)) { return false; } else if (!Blocks.STANDING_SIGN.canPlace(var3, var4)) { return false; } else if (var3.isClientSide) { return true; } else { if (var5 == EnumDirection.UP) { int var9 = MathHelper.floor((double) ((var2.yaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; var3.setTypeAndData( var4, Blocks.STANDING_SIGN .getBlockData() .set(BlockFloorSign.ROTATION, Integer.valueOf(var9)), 3); } else { var3.setTypeAndData( var4, Blocks.WALL_SIGN.getBlockData().set(BlockWallSign.FACING, var5), 3); } --var1.count; TileEntity var10 = var3.getTileEntity(var4); if (var10 instanceof TileEntitySign && !ItemBlock.a(var3, var2, var4, var1)) { var2.openSign((TileEntitySign) var10); } return true; } } }
public boolean f(World var1, BlockPosition var2, IBlockData var3) { return (var1.k(var2) >= 8 || var1.i(var2)) && this.c(var1.getType(var2.down()).getBlock()); }
protected void a(BlockPosition var1, IBlockData var2) { this.fallDistance = 0.0F; Vec3D var3 = this.k(this.locX, this.locY, this.locZ); this.locY = (double) var1.getY(); boolean var4 = false; boolean var5 = false; BlockMinecartTrackAbstract var6 = (BlockMinecartTrackAbstract) var2.getBlock(); if (var6 == Blocks.GOLDEN_RAIL) { var4 = ((Boolean) var2.get(BlockPoweredRail.POWERED)).booleanValue(); var5 = !var4; } double var7 = 0.0078125D; BlockMinecartTrackAbstract.EnumTrackPosition var9 = (BlockMinecartTrackAbstract.EnumTrackPosition) var2.get(var6.n()); switch (EntityMinecartAbstract.SyntheticClass_1.b[var9.ordinal()]) { case 1: this.motX -= 0.0078125D; ++this.locY; break; case 2: this.motX += 0.0078125D; ++this.locY; break; case 3: this.motZ += 0.0078125D; ++this.locY; break; case 4: this.motZ -= 0.0078125D; ++this.locY; } int[][] var10 = matrix[var9.a()]; double var11 = (double) (var10[1][0] - var10[0][0]); double var13 = (double) (var10[1][2] - var10[0][2]); double var15 = Math.sqrt(var11 * var11 + var13 * var13); double var17 = this.motX * var11 + this.motZ * var13; if (var17 < 0.0D) { var11 = -var11; var13 = -var13; } double var19 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ); if (var19 > 2.0D) { var19 = 2.0D; } this.motX = var19 * var11 / var15; this.motZ = var19 * var13 / var15; double var21; double var23; double var25; double var27; if (this.passenger instanceof EntityLiving) { var21 = (double) ((EntityLiving) this.passenger).ba; if (var21 > 0.0D) { var23 = -Math.sin((double) (this.passenger.yaw * 3.1415927F / 180.0F)); var25 = Math.cos((double) (this.passenger.yaw * 3.1415927F / 180.0F)); var27 = this.motX * this.motX + this.motZ * this.motZ; if (var27 < 0.01D) { this.motX += var23 * 0.1D; this.motZ += var25 * 0.1D; var5 = false; } } } if (var5) { var21 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ); if (var21 < 0.03D) { this.motX *= 0.0D; this.motY *= 0.0D; this.motZ *= 0.0D; } else { this.motX *= 0.5D; this.motY *= 0.0D; this.motZ *= 0.5D; } } var21 = 0.0D; var23 = (double) var1.getX() + 0.5D + (double) var10[0][0] * 0.5D; var25 = (double) var1.getZ() + 0.5D + (double) var10[0][2] * 0.5D; var27 = (double) var1.getX() + 0.5D + (double) var10[1][0] * 0.5D; double var29 = (double) var1.getZ() + 0.5D + (double) var10[1][2] * 0.5D; var11 = var27 - var23; var13 = var29 - var25; double var31; double var33; if (var11 == 0.0D) { this.locX = (double) var1.getX() + 0.5D; var21 = this.locZ - (double) var1.getZ(); } else if (var13 == 0.0D) { this.locZ = (double) var1.getZ() + 0.5D; var21 = this.locX - (double) var1.getX(); } else { var31 = this.locX - var23; var33 = this.locZ - var25; var21 = (var31 * var11 + var33 * var13) * 2.0D; } this.locX = var23 + var11 * var21; this.locZ = var25 + var13 * var21; this.setPosition(this.locX, this.locY, this.locZ); var31 = this.motX; var33 = this.motZ; if (this.passenger != null) { var31 *= 0.75D; var33 *= 0.75D; } double var35 = this.m(); var31 = MathHelper.a(var31, -var35, var35); var33 = MathHelper.a(var33, -var35, var35); this.move(var31, 0.0D, var33); if (var10[0][1] != 0 && MathHelper.floor(this.locX) - var1.getX() == var10[0][0] && MathHelper.floor(this.locZ) - var1.getZ() == var10[0][2]) { this.setPosition(this.locX, this.locY + (double) var10[0][1], this.locZ); } else if (var10[1][1] != 0 && MathHelper.floor(this.locX) - var1.getX() == var10[1][0] && MathHelper.floor(this.locZ) - var1.getZ() == var10[1][2]) { this.setPosition(this.locX, this.locY + (double) var10[1][1], this.locZ); } this.o(); Vec3D var37 = this.k(this.locX, this.locY, this.locZ); if (var37 != null && var3 != null) { double var38 = (var3.b - var37.b) * 0.05D; var19 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ); if (var19 > 0.0D) { this.motX = this.motX / var19 * (var19 + var38); this.motZ = this.motZ / var19 * (var19 + var38); } this.setPosition(this.locX, var37.b, this.locZ); } int var44 = MathHelper.floor(this.locX); int var39 = MathHelper.floor(this.locZ); if (var44 != var1.getX() || var39 != var1.getZ()) { var19 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ); this.motX = var19 * (double) (var44 - var1.getX()); this.motZ = var19 * (double) (var39 - var1.getZ()); } if (var4) { double var40 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ); if (var40 > 0.01D) { double var42 = 0.06D; this.motX += this.motX / var40 * var42; this.motZ += this.motZ / var40 * var42; } else if (var9 == BlockMinecartTrackAbstract.EnumTrackPosition.EAST_WEST) { if (this.world.getType(var1.west()).getBlock().isOccluding()) { this.motX = 0.02D; } else if (this.world.getType(var1.east()).getBlock().isOccluding()) { this.motX = -0.02D; } } else if (var9 == BlockMinecartTrackAbstract.EnumTrackPosition.NORTH_SOUTH) { if (this.world.getType(var1.north()).getBlock().isOccluding()) { this.motZ = 0.02D; } else if (this.world.getType(var1.south()).getBlock().isOccluding()) { this.motZ = -0.02D; } } } }
protected static float a(Block var0, World var1, BlockPosition var2) { float var3 = 1.0F; BlockPosition var4 = var2.down(); for (int var5 = -1; var5 <= 1; ++var5) { for (int var6 = -1; var6 <= 1; ++var6) { float var7 = 0.0F; IBlockData var8 = var1.getType(var4.a(var5, 0, var6)); if (var8.getBlock() == Blocks.FARMLAND) { var7 = 1.0F; if (((Integer) var8.get(BlockSoil.MOISTURE)).intValue() > 0) { var7 = 3.0F; } } if (var5 != 0 || var6 != 0) { var7 /= 4.0F; } var3 += var7; } } BlockPosition var12 = var2.north(); BlockPosition var13 = var2.south(); BlockPosition var15 = var2.west(); BlockPosition var14 = var2.east(); boolean var9 = var0 == var1.getType(var15).getBlock() || var0 == var1.getType(var14).getBlock(); boolean var10 = var0 == var1.getType(var12).getBlock() || var0 == var1.getType(var13).getBlock(); if (var9 && var10) { var3 /= 2.0F; } else { boolean var11 = var0 == var1.getType(var15.north()).getBlock() || var0 == var1.getType(var14.north()).getBlock() || var0 == var1.getType(var14.south()).getBlock() || var0 == var1.getType(var15.south()).getBlock(); if (var11) { var3 /= 2.0F; } } return var3; }
public boolean canPlace(World var1, BlockPosition var2) { return var1.getType(var2).getBlock().material.isReplaceable() && World.a((IBlockAccess) var1, (BlockPosition) var2.down()); }
private void f(World var1, BlockPosition var2) { ShapeDetector.ShapeDetectorCollection var3; int var4; int var6; if ((var3 = this.getDetectorSnowGolem().a(var1, var2)) != null) { for (var4 = 0; var4 < this.getDetectorSnowGolem().b(); ++var4) { ShapeDetectorBlock var5 = var3.a(0, var4, 0); var1.setTypeAndData(var5.d(), Blocks.AIR.getBlockData(), 2); } EntitySnowman var9 = new EntitySnowman(var1); BlockPosition var10 = var3.a(0, 2, 0).d(); var9.setPositionRotation( (double) var10.getX() + 0.5D, (double) var10.getY() + 0.05D, (double) var10.getZ() + 0.5D, 0.0F, 0.0F); var1.addEntity(var9); for (var6 = 0; var6 < 120; ++var6) { var1.addParticle( EnumParticle.SNOW_SHOVEL, (double) var10.getX() + var1.random.nextDouble(), (double) var10.getY() + var1.random.nextDouble() * 2.5D, (double) var10.getZ() + var1.random.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]); } for (var6 = 0; var6 < this.getDetectorSnowGolem().b(); ++var6) { ShapeDetectorBlock var7 = var3.a(0, var6, 0); var1.update(var7.d(), Blocks.AIR); } } else if ((var3 = this.getDetectorIronGolem().a(var1, var2)) != null) { for (var4 = 0; var4 < this.getDetectorIronGolem().c(); ++var4) { for (int var12 = 0; var12 < this.getDetectorIronGolem().b(); ++var12) { var1.setTypeAndData(var3.a(var4, var12, 0).d(), Blocks.AIR.getBlockData(), 2); } } BlockPosition var11 = var3.a(1, 2, 0).d(); EntityIronGolem var13 = new EntityIronGolem(var1); var13.setPlayerCreated(true); var13.setPositionRotation( (double) var11.getX() + 0.5D, (double) var11.getY() + 0.05D, (double) var11.getZ() + 0.5D, 0.0F, 0.0F); var1.addEntity(var13); for (var6 = 0; var6 < 120; ++var6) { var1.addParticle( EnumParticle.SNOWBALL, (double) var11.getX() + var1.random.nextDouble(), (double) var11.getY() + var1.random.nextDouble() * 3.9D, (double) var11.getZ() + var1.random.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]); } for (var6 = 0; var6 < this.getDetectorIronGolem().c(); ++var6) { for (int var14 = 0; var14 < this.getDetectorIronGolem().b(); ++var14) { ShapeDetectorBlock var8 = var3.a(var6, var14, 0); var1.update(var8.d(), Blocks.AIR); } } } }
public ShapeDetector.ShapeDetectorCollection f(World var1, BlockPosition var2) { EnumDirection.EnumAxis var3 = EnumDirection.EnumAxis.Z; BlockPortal.Shape var4 = new BlockPortal.Shape(var1, var2, EnumDirection.EnumAxis.X); LoadingCache var5 = ShapeDetector.a(var1, true); if (!var4.d()) { var3 = EnumDirection.EnumAxis.X; var4 = new BlockPortal.Shape(var1, var2, EnumDirection.EnumAxis.Z); } if (!var4.d()) { return new ShapeDetector.ShapeDetectorCollection( var2, EnumDirection.NORTH, EnumDirection.UP, var5, 1, 1, 1); } else { int[] var6 = new int[EnumDirection.EnumAxisDirection.values().length]; EnumDirection var7 = var4.c.f(); BlockPosition var8 = var4.f.up(var4.a() - 1); EnumDirection.EnumAxisDirection[] var9 = EnumDirection.EnumAxisDirection.values(); int var10 = var9.length; int var11; for (var11 = 0; var11 < var10; ++var11) { EnumDirection.EnumAxisDirection var12 = var9[var11]; ShapeDetector.ShapeDetectorCollection var13 = new ShapeDetector.ShapeDetectorCollection( var7.c() == var12 ? var8 : var8.shift(var4.c, var4.b() - 1), EnumDirection.a(var12, var3), EnumDirection.UP, var5, var4.b(), var4.a(), 1); for (int var14 = 0; var14 < var4.b(); ++var14) { for (int var15 = 0; var15 < var4.a(); ++var15) { ShapeDetectorBlock var16 = var13.a(var14, var15, 1); if (var16.a() != null && var16.a().getBlock().getMaterial() != Material.AIR) { ++var6[var12.ordinal()]; } } } } EnumDirection.EnumAxisDirection var17 = EnumDirection.EnumAxisDirection.POSITIVE; EnumDirection.EnumAxisDirection[] var18 = EnumDirection.EnumAxisDirection.values(); var11 = var18.length; for (int var19 = 0; var19 < var11; ++var19) { EnumDirection.EnumAxisDirection var20 = var18[var19]; if (var6[var20.ordinal()] < var6[var17.ordinal()]) { var17 = var20; } } return new ShapeDetector.ShapeDetectorCollection( var7.c() == var17 ? var8 : var8.shift(var4.c, var4.b() - 1), EnumDirection.a(var17, var3), EnumDirection.UP, var5, var4.b(), var4.a(), 1); } }