// Referenced classes of package net.minecraft.src: // WorldGenerator, World, Material, Block public override bool Generate(net.minecraft.src.World world, SharpBukkitLive.SharpBukkit.SharpRandom random , int i, int j, int k) { for (int l = 0; l < 20; l++) { int i1 = (i + random.Next(4)) - random.Next(4); int j1 = j; int k1 = (k + random.Next(4)) - random.Next(4); if (!world.IsAirBlock(i1, j1, k1) || world.GetBlockMaterial(i1 - 1, j1 - 1, k1) != net.minecraft.src.Material.water && world.GetBlockMaterial(i1 + 1, j1 - 1, k1) != net.minecraft.src.Material.water && world.GetBlockMaterial(i1, j1 - 1, k1 - 1 ) != net.minecraft.src.Material.water && world.GetBlockMaterial(i1, j1 - 1, k1 + 1) != net.minecraft.src.Material.water) { continue; } int l1 = 2 + random.Next(random.Next(3) + 1); for (int i2 = 0; i2 < l1; i2++) { if (net.minecraft.src.Block.SUGAR_CANE_BLOCK.CanBlockStay(world, i1, j1 + i2, k1)) { world.SetBlock(i1, j1 + i2, k1, net.minecraft.src.Block.SUGAR_CANE_BLOCK.ID); } } } return(true); }
public static net.minecraft.src.ChunkCoordinates Func_22021_g(net.minecraft.src.World world, int i, int j, int k, int l) { int i1 = world.GetBlockMetadata(i, j, k); int j1 = Func_22019_c(i1); for (int k1 = 0; k1 <= 1; k1++) { int l1 = i - field_22023_a[j1][0] * k1 - 1; int i2 = k - field_22023_a[j1][1] * k1 - 1; int j2 = l1 + 2; int k2 = i2 + 2; for (int l2 = l1; l2 <= j2; l2++) { for (int i3 = i2; i3 <= k2; i3++) { if (!world.IsBlockNormalCube(l2, j - 1, i3) || !world.IsAirBlock(l2, j, i3) || !world .IsAirBlock(l2, j + 1, i3)) { continue; } if (l > 0) { l--; } else { return(new net.minecraft.src.ChunkCoordinates(l2, j, i3)); } } } } return(null); }
// Referenced classes of package net.minecraft.src: // Item, Block, BlockBed, EntityPlayer, // MathHelper, World, ItemStack public override bool OnItemUse(net.minecraft.src.ItemStack itemstack, net.minecraft.src.EntityPlayer entityplayer, net.minecraft.src.World world, int i, int j, int k, int l) { if (l != 1) { return(false); } j++; net.minecraft.src.BlockBed blockbed = (net.minecraft.src.BlockBed)net.minecraft.src.Block .BED; int i1 = net.minecraft.src.MathHelper.Floor_double((double)((entityplayer.rotationYaw * 4F) / 360F) + 0.5D) & 3; byte byte0 = 0; byte byte1 = 0; if (i1 == 0) { byte1 = 1; } if (i1 == 1) { byte0 = unchecked ((byte)(-1)); } if (i1 == 2) { byte1 = unchecked ((byte)(-1)); } if (i1 == 3) { byte0 = 1; } if (world.IsAirBlock(i, j, k) && world.IsAirBlock(i + byte0, j, k + byte1) && world .IsBlockNormalCube(i, j - 1, k) && world.IsBlockNormalCube(i + byte0, j - 1, k + byte1)) { world.SetBlockAndMetadataWithNotify(i, j, k, blockbed.ID, i1); world.SetBlockAndMetadataWithNotify(i + byte0, j, k + byte1, blockbed.ID, i1 + 8); itemstack.stackSize--; return(true); } else { return(false); } }
public override void UpdateTick(net.minecraft.src.World world, int i, int j, int k, SharpBukkitLive.SharpBukkit.SharpRandom random) { if (random.Next(100) == 0) { int l = (i + random.Next(3)) - 1; int i1 = (j + random.Next(2)) - random.Next(2); int j1 = (k + random.Next(3)) - 1; if (world.IsAirBlock(l, i1, j1) && CanBlockStay(world, l, i1, j1)) { i += random.Next(3) - 1; k += random.Next(3) - 1; if (world.IsAirBlock(l, i1, j1) && CanBlockStay(world, l, i1, j1)) { world.SetBlockWithNotify(l, i1, j1, ID); } } } }
// Referenced classes of package net.minecraft.src: // WorldGenerator, World, Block, BlockFire public override bool Generate(net.minecraft.src.World world, SharpBukkitLive.SharpBukkit.SharpRandom random , int i, int j, int k) { for (int l = 0; l < 64; l++) { int i1 = (i + random.Next(8)) - random.Next(8); int j1 = (j + random.Next(4)) - random.Next(4); int k1 = (k + random.Next(8)) - random.Next(8); if (world.IsAirBlock(i1, j1, k1) && world.GetBlockId(i1, j1 - 1, k1) == net.minecraft.src.Block .NETHERRACK.ID) { world.SetBlockWithNotify(i1, j1, k1, net.minecraft.src.Block.FIRE.ID); } } return(true); }
public override bool Generate(net.minecraft.src.World world, SharpBukkitLive.SharpBukkit.SharpRandom random , int i, int j, int k) { for (int l = 0; l < 64; l++) { int i1 = (i + random.Next(8)) - random.Next(8); int j1 = (j + random.Next(4)) - random.Next(4); int k1 = (k + random.Next(8)) - random.Next(8); if (world.IsAirBlock(i1, j1, k1) && ((net.minecraft.src.BlockFlower)net.minecraft.src.Block .blocksList[plantBlockId]).CanBlockStay(world, i1, j1, k1)) { world.SetBlock(i1, j1, k1, plantBlockId); } } return(true); }
// Referenced classes of package net.minecraft.src: // WorldGenerator, World, Block, BlockGrass public override bool Generate(net.minecraft.src.World world, SharpBukkitLive.SharpBukkit.SharpRandom random , int i, int j, int k) { for (int l = 0; l < 64; l++) { int i1 = (i + random.Next(8)) - random.Next(8); int j1 = (j + random.Next(4)) - random.Next(4); int k1 = (k + random.Next(8)) - random.Next(8); if (world.IsAirBlock(i1, j1, k1) && world.GetBlockId(i1, j1 - 1, k1) == net.minecraft.src.Block .GRASS.ID && net.minecraft.src.Block.PUMPKIN.CanPlaceBlockAt(world, i1, j1, k1)) { world.SetBlockAndMetadata(i1, j1, k1, net.minecraft.src.Block.PUMPKIN.ID, random .NextInt(4)); } } return(true); }
public override bool Generate(net.minecraft.src.World world, SharpBukkitLive.SharpBukkit.SharpRandom random , int i, int j, int k) { for (int l = 0; ((l = world.GetBlockId(i, j, k)) == 0 || l == net.minecraft.src.Block .LEAVES.ID) && j > 0; j--) { } for (int i1 = 0; i1 < 128; i1++) { int j1 = (i + random.Next(8)) - random.Next(8); int k1 = (j + random.Next(4)) - random.Next(4); int l1 = (k + random.Next(8)) - random.Next(8); if (world.IsAirBlock(j1, k1, l1) && ((net.minecraft.src.BlockFlower)net.minecraft.src.Block .blocksList[field_28057_a]).CanBlockStay(world, j1, k1, l1)) { world.SetBlockAndMetadata(j1, k1, l1, field_28057_a, field_28056_b); } } return(true); }
private int GetChanceOfNeighborsEncouragingFire(net.minecraft.src.World world, int i, int j, int k) { int l = 0; if (!world.IsAirBlock(i, j, k)) { return(0); } else { l = GetChanceToEncourageFire(world, i + 1, j, k, l); l = GetChanceToEncourageFire(world, i - 1, j, k, l); l = GetChanceToEncourageFire(world, i, j - 1, k, l); l = GetChanceToEncourageFire(world, i, j + 1, k, l); l = GetChanceToEncourageFire(world, i, j, k - 1, l); l = GetChanceToEncourageFire(world, i, j, k + 1, l); return(l); } }
// Referenced classes of package net.minecraft.src: // Item, World, Block, ItemStack, // EntityPlayer public override bool OnItemUse(net.minecraft.src.ItemStack itemstack, net.minecraft.src.EntityPlayer entityplayer, net.minecraft.src.World world, int i, int j, int k, int l) { if (world.GetBlockId(i, j, k) != net.minecraft.src.Block.SNOW.ID) { if (l == 0) { j--; } if (l == 1) { j++; } if (l == 2) { k--; } if (l == 3) { k++; } if (l == 4) { i--; } if (l == 5) { i++; } if (!world.IsAirBlock(i, j, k)) { return(false); } } if (net.minecraft.src.Block.REDSTONE_WIRE.CanPlaceBlockAt(world, i, j, k)) { itemstack.stackSize--; world.SetBlockWithNotify(i, j, k, net.minecraft.src.Block.REDSTONE_WIRE.ID); } return(true); }
public override bool OnItemUse(net.minecraft.src.ItemStack itemstack, net.minecraft.src.EntityPlayer entityplayer, net.minecraft.src.World world, int i, int j, int k, int l) { if (l != 1) { return(false); } int i1 = world.GetBlockId(i, j, k); if (i1 == net.minecraft.src.Block.SOIL.ID && world.IsAirBlock(i, j + 1, k)) { world.SetBlockWithNotify(i, j + 1, k, field_271_a); itemstack.stackSize--; return(true); } else { return(false); } }
// Referenced classes of package net.minecraft.src: // WorldGenerator, World, Block public override bool Generate(net.minecraft.src.World world, SharpBukkitLive.SharpBukkit.SharpRandom random , int i, int j, int k) { for (int l = 0; l < 10; l++) { int i1 = (i + random.Next(8)) - random.Next(8); int j1 = (j + random.Next(4)) - random.Next(4); int k1 = (k + random.Next(8)) - random.Next(8); if (!world.IsAirBlock(i1, j1, k1)) { continue; } int l1 = 1 + random.Next(random.Next(3) + 1); for (int i2 = 0; i2 < l1; i2++) { if (net.minecraft.src.Block.CACTUS.CanBlockStay(world, i1, j1 + i2, k1)) { world.SetBlock(i1, j1 + i2, k1, net.minecraft.src.Block.CACTUS.ID); } } } return(true); }
public override void UpdateTick(net.minecraft.src.World world, int i, int j, int k, SharpBukkitLive.SharpBukkit.SharpRandom random) { if (world.IsAirBlock(i, j + 1, k)) { int l; for (l = 1; world.GetBlockId(i, j - l, k) == ID; l++) { } if (l < 3) { int i1 = world.GetBlockMetadata(i, j, k); if (i1 == 15) { world.SetBlockWithNotify(i, j + 1, k, ID); world.SetBlockMetadataWithNotify(i, j, k, 0); } else { world.SetBlockMetadataWithNotify(i, j, k, i1 + 1); } } } }
public override bool Generate(net.minecraft.src.World world, SharpBukkitLive.SharpBukkit.SharpRandom random , int i, int j, int k) { i -= 8; for (k -= 8; j > 0 && world.IsAirBlock(i, j, k); j--) { } j -= 4; bool[] aflag = new bool[2048]; int l = random.Next(4) + 4; for (int i1 = 0; i1 < l; i1++) { double d = random.NextDouble() * 6D + 3D; double d1 = random.NextDouble() * 4D + 2D; double d2 = random.NextDouble() * 6D + 3D; double d3 = random.NextDouble() * (16D - d - 2D) + 1.0D + d / 2D; double d4 = random.NextDouble() * (8D - d1 - 4D) + 2D + d1 / 2D; double d5 = random.NextDouble() * (16D - d2 - 2D) + 1.0D + d2 / 2D; for (int j4 = 1; j4 < 15; j4++) { for (int k4 = 1; k4 < 15; k4++) { for (int l4 = 1; l4 < 7; l4++) { double d6 = ((double)j4 - d3) / (d / 2D); double d7 = ((double)l4 - d4) / (d1 / 2D); double d8 = ((double)k4 - d5) / (d2 / 2D); double d9 = d6 * d6 + d7 * d7 + d8 * d8; if (d9 < 1.0D) { aflag[(j4 * 16 + k4) * 8 + l4] = true; } } } } } for (int j1 = 0; j1 < 16; j1++) { for (int j2 = 0; j2 < 16; j2++) { for (int j3 = 0; j3 < 8; j3++) { bool flag = !aflag[(j1 * 16 + j2) * 8 + j3] && (j1 < 15 && aflag[((j1 + 1) * 16 + j2) * 8 + j3] || j1 > 0 && aflag[((j1 - 1) * 16 + j2) * 8 + j3] || j2 < 15 && aflag [(j1 * 16 + (j2 + 1)) * 8 + j3] || j2 > 0 && aflag[(j1 * 16 + (j2 - 1)) * 8 + j3 ] || j3 < 7 && aflag[(j1 * 16 + j2) * 8 + (j3 + 1)] || j3 > 0 && aflag[(j1 * 16 + j2) * 8 + (j3 - 1)]); if (!flag) { continue; } net.minecraft.src.Material material = world.GetBlockMaterial(i + j1, j + j3, k + j2); if (j3 >= 4 && material.GetIsLiquid()) { return(false); } if (j3 < 4 && !material.IsSolid() && world.GetBlockId(i + j1, j + j3, k + j2) != field_15005_a) { return(false); } } } } for (int k1 = 0; k1 < 16; k1++) { for (int k2 = 0; k2 < 16; k2++) { for (int k3 = 0; k3 < 8; k3++) { if (aflag[(k1 * 16 + k2) * 8 + k3]) { world.SetBlock(i + k1, j + k3, k + k2, k3 < 4 ? field_15005_a : 0); } } } } for (int l1 = 0; l1 < 16; l1++) { for (int l2 = 0; l2 < 16; l2++) { for (int l3 = 4; l3 < 8; l3++) { if (aflag[(l1 * 16 + l2) * 8 + l3] && world.GetBlockId(i + l1, (j + l3) - 1, k + l2) == net.minecraft.src.Block.DIRT.ID && world.GetSavedLightValue(net.minecraft.src.EnumSkyBlock .Sky, i + l1, j + l3, k + l2) > 0) { world.SetBlock(i + l1, (j + l3) - 1, k + l2, net.minecraft.src.Block.GRASS.ID ); } } } } if (net.minecraft.src.Block.blocksList[field_15005_a].blockMaterial == net.minecraft.src.Material .lava) { for (int i2 = 0; i2 < 16; i2++) { for (int i3 = 0; i3 < 16; i3++) { for (int i4 = 0; i4 < 8; i4++) { bool flag1 = !aflag[(i2 * 16 + i3) * 8 + i4] && (i2 < 15 && aflag[((i2 + 1) * 16 + i3) * 8 + i4] || i2 > 0 && aflag[((i2 - 1) * 16 + i3) * 8 + i4] || i3 < 15 && aflag[(i2 * 16 + (i3 + 1)) * 8 + i4] || i3 > 0 && aflag[(i2 * 16 + (i3 - 1)) * 8 + i4] || i4 < 7 && aflag[(i2 * 16 + i3) * 8 + (i4 + 1)] || i4 > 0 && aflag[(i2 * 16 + i3) * 8 + (i4 - 1)]); if (flag1 && (i4 < 4 || random.Next(2) != 0) && world.GetBlockMaterial(i + i2, j + i4, k + i3).IsSolid()) { world.SetBlock(i + i2, j + i4, k + i3, net.minecraft.src.Block.STONE.ID); } } } } } return(true); }
public override bool Generate(net.minecraft.src.World world, SharpBukkitLive.SharpBukkit.SharpRandom random , int i, int j, int k) { if (world.GetBlockId(i, j + 1, k) != net.minecraft.src.Block.STONE.ID) { return(false); } if (world.GetBlockId(i, j - 1, k) != net.minecraft.src.Block.STONE.ID) { return(false); } if (world.GetBlockId(i, j, k) != 0 && world.GetBlockId(i, j, k) != net.minecraft.src.Block .STONE.ID) { return(false); } int l = 0; if (world.GetBlockId(i - 1, j, k) == net.minecraft.src.Block.STONE.ID) { l++; } if (world.GetBlockId(i + 1, j, k) == net.minecraft.src.Block.STONE.ID) { l++; } if (world.GetBlockId(i, j, k - 1) == net.minecraft.src.Block.STONE.ID) { l++; } if (world.GetBlockId(i, j, k + 1) == net.minecraft.src.Block.STONE.ID) { l++; } int i1 = 0; if (world.IsAirBlock(i - 1, j, k)) { i1++; } if (world.IsAirBlock(i + 1, j, k)) { i1++; } if (world.IsAirBlock(i, j, k - 1)) { i1++; } if (world.IsAirBlock(i, j, k + 1)) { i1++; } if (l == 3 && i1 == 1) { world.SetBlockWithNotify(i, j, k, liquidBlockId); world.scheduledUpdatesAreImmediate = true; net.minecraft.src.Block.blocksList[liquidBlockId].UpdateTick(world, i, j, k, random ); world.scheduledUpdatesAreImmediate = false; } return(true); }
public virtual bool CreateExitLocation(net.minecraft.src.World world, net.minecraft.src.Entity entity) { byte byte0 = 16; double d = -1D; int i = net.minecraft.src.MathHelper.Floor_double(entity.posX); int j = net.minecraft.src.MathHelper.Floor_double(entity.posY); int k = net.minecraft.src.MathHelper.Floor_double(entity.posZ); int l = i; int i1 = j; int j1 = k; int k1 = 0; int l1 = field_28117_a.NextInt(4); for (int i2 = i - byte0; i2 <= i + byte0; i2++) { double d1 = ((double)i2 + 0.5D) - entity.posX; for (int j3 = k - byte0; j3 <= k + byte0; j3++) { double d3 = ((double)j3 + 0.5D) - entity.posZ; for (int k4 = 127; k4 >= 0; k4--) { if (!world.IsAirBlock(i2, k4, j3)) { continue; } for (; k4 > 0 && world.IsAirBlock(i2, k4 - 1, j3); k4--) { } for (int k5 = l1; k5 < l1 + 4; k5++) { int l6 = k5 % 2; int i8 = 1 - l6; if (k5 % 4 >= 2) { l6 = -l6; i8 = -i8; } for (int j9 = 0; j9 < 3; j9++) { for (int k10 = 0; k10 < 4; k10++) { for (int l11 = -1; l11 < 4; l11++) { int j12 = i2 + (k10 - 1) * l6 + j9 * i8; int l12 = k4 + l11; int j13 = (j3 + (k10 - 1) * i8) - j9 * l6; if (l11 < 0 && !world.GetBlockMaterial(j12, l12, j13).IsSolid() || l11 >= 0 && !world .IsAirBlock(j12, l12, j13)) { goto label0_break; } } } } double d5 = ((double)k4 + 0.5D) - entity.posY; double d7 = d1 * d1 + d5 * d5 + d3 * d3; if (d < 0.0D || d7 < d) { d = d7; l = i2; i1 = k4; j1 = j3; k1 = k5 % 4; } label0_continue :; } label0_break :; } } } if (d < 0.0D) { for (int j2 = i - byte0; j2 <= i + byte0; j2++) { double d2 = ((double)j2 + 0.5D) - entity.posX; for (int k3 = k - byte0; k3 <= k + byte0; k3++) { double d4 = ((double)k3 + 0.5D) - entity.posZ; for (int l4 = 127; l4 >= 0; l4--) { if (!world.IsAirBlock(j2, l4, k3)) { continue; } for (; world.IsAirBlock(j2, l4 - 1, k3); l4--) { } for (int l5 = l1; l5 < l1 + 2; l5++) { int i7 = l5 % 2; int j8 = 1 - i7; for (int k9 = 0; k9 < 4; k9++) { for (int l10 = -1; l10 < 4; l10++) { int i12 = j2 + (k9 - 1) * i7; int k12 = l4 + l10; int i13 = k3 + (k9 - 1) * j8; if (l10 < 0 && !world.GetBlockMaterial(i12, k12, i13).IsSolid() || l10 >= 0 && !world .IsAirBlock(i12, k12, i13)) { goto label1_break; } } } double d6 = ((double)l4 + 0.5D) - entity.posY; double d8 = d2 * d2 + d6 * d6 + d4 * d4; if (d < 0.0D || d8 < d) { d = d8; l = j2; i1 = l4; j1 = k3; k1 = l5 % 2; } label1_continue :; } label1_break :; } } } } int k2 = k1; int l2 = l; int i3 = i1; int l3 = j1; int i4 = k2 % 2; int j4 = 1 - i4; if (k2 % 4 >= 2) { i4 = -i4; j4 = -j4; } if (d < 0.0D) { if (i1 < 70) { i1 = 70; } if (i1 > 118) { i1 = 118; } i3 = i1; for (int i5 = -1; i5 <= 1; i5++) { for (int i6 = 1; i6 < 3; i6++) { for (int j7 = -1; j7 < 3; j7++) { int k8 = l2 + (i6 - 1) * i4 + i5 * j4; int l9 = i3 + j7; int i11 = (l3 + (i6 - 1) * j4) - i5 * i4; bool flag = j7 < 0; world.SetBlockWithNotify(k8, l9, i11, flag ? net.minecraft.src.Block.OBSIDIAN.ID : 0); } } } } for (int j5 = 0; j5 < 4; j5++) { world.editingBlocks = true; for (int j6 = 0; j6 < 4; j6++) { for (int k7 = -1; k7 < 4; k7++) { int l8 = l2 + (j6 - 1) * i4; int i10 = i3 + k7; int j11 = l3 + (j6 - 1) * j4; bool flag1 = j6 == 0 || j6 == 3 || k7 == -1 || k7 == 3; world.SetBlockWithNotify(l8, i10, j11, flag1 ? net.minecraft.src.Block.OBSIDIAN.ID : net.minecraft.src.Block.PORTAL.ID); } } world.editingBlocks = false; for (int k6 = 0; k6 < 4; k6++) { for (int l7 = -1; l7 < 4; l7++) { int i9 = l2 + (k6 - 1) * i4; int j10 = i3 + l7; int k11 = l3 + (k6 - 1) * j4; world.NotifyBlocksOfNeighborChange(i9, j10, k11, world.GetBlockId(i9, j10, k11)); } } } return(true); }
// Referenced classes of package net.minecraft.src: // WorldGenerator, World, Material, Block, // TileEntityChest, TileEntityMobSpawner, ItemStack, Item public override bool Generate(net.minecraft.src.World world, SharpBukkitLive.SharpBukkit.SharpRandom random , int i, int j, int k) { byte byte0 = 3; int l = random.Next(2) + 2; int i1 = random.Next(2) + 2; int j1 = 0; for (int k1 = i - l - 1; k1 <= i + l + 1; k1++) { for (int j2 = j - 1; j2 <= j + byte0 + 1; j2++) { for (int i3 = k - i1 - 1; i3 <= k + i1 + 1; i3++) { net.minecraft.src.Material material = world.GetBlockMaterial(k1, j2, i3); if (j2 == j - 1 && !material.IsSolid()) { return(false); } if (j2 == j + byte0 + 1 && !material.IsSolid()) { return(false); } if ((k1 == i - l - 1 || k1 == i + l + 1 || i3 == k - i1 - 1 || i3 == k + i1 + 1) && j2 == j && world.IsAirBlock(k1, j2, i3) && world.IsAirBlock(k1, j2 + 1, i3)) { j1++; } } } } if (j1 < 1 || j1 > 5) { return(false); } for (int l1 = i - l - 1; l1 <= i + l + 1; l1++) { for (int k2 = j + byte0; k2 >= j - 1; k2--) { for (int j3 = k - i1 - 1; j3 <= k + i1 + 1; j3++) { if (l1 == i - l - 1 || k2 == j - 1 || j3 == k - i1 - 1 || l1 == i + l + 1 || k2 == j + byte0 + 1 || j3 == k + i1 + 1) { if (k2 >= 0 && !world.GetBlockMaterial(l1, k2 - 1, j3).IsSolid()) { world.SetBlockWithNotify(l1, k2, j3, 0); continue; } if (!world.GetBlockMaterial(l1, k2, j3).IsSolid()) { continue; } if (k2 == j - 1 && random.Next(4) != 0) { world.SetBlockWithNotify(l1, k2, j3, net.minecraft.src.Block.MOSSY_COBBLESTONE.ID ); } else { world.SetBlockWithNotify(l1, k2, j3, net.minecraft.src.Block.COBBLESTONE.ID); } } else { world.SetBlockWithNotify(l1, k2, j3, 0); } } } } for (int i2 = 0; i2 < 2; i2++) { for (int l2 = 0; l2 < 3; l2++) { int k3 = (i + random.Next(l * 2 + 1)) - l; int l3 = j; int i4 = (k + random.Next(i1 * 2 + 1)) - i1; if (!world.IsAirBlock(k3, l3, i4)) { continue; } int j4 = 0; if (world.GetBlockMaterial(k3 - 1, l3, i4).IsSolid()) { j4++; } if (world.GetBlockMaterial(k3 + 1, l3, i4).IsSolid()) { j4++; } if (world.GetBlockMaterial(k3, l3, i4 - 1).IsSolid()) { j4++; } if (world.GetBlockMaterial(k3, l3, i4 + 1).IsSolid()) { j4++; } if (j4 != 1) { continue; } world.SetBlockWithNotify(k3, l3, i4, net.minecraft.src.Block.CHEST.ID); net.minecraft.src.TileEntityChest tileentitychest = (net.minecraft.src.TileEntityChest )world.GetBlockTileEntity(k3, l3, i4); int k4 = 0; do { if (k4 >= 8) { goto label0_break; } net.minecraft.src.ItemStack itemstack = PickCheckLootItem(random); if (itemstack != null) { tileentitychest.SetInventorySlotContents(random.Next(tileentitychest.GetSizeInventory ()), itemstack); } k4++; }while (true); label0_continue :; } label0_break :; } world.SetBlockWithNotify(i, j, k, net.minecraft.src.Block.MOB_SPAWNER.ID); net.minecraft.src.TileEntityMobSpawner tileentitymobspawner = (net.minecraft.src.TileEntityMobSpawner )world.GetBlockTileEntity(i, j, k); tileentitymobspawner.SetMobID(PickMobSpawner(random)); return(true); }
// Referenced classes of package net.minecraft.src: // WorldGenerator, World, Block public override bool Generate(net.minecraft.src.World world, SharpBukkitLive.SharpBukkit.SharpRandom random , int i, int j, int k) { if (!world.IsAirBlock(i, j, k)) { return(false); } if (world.GetBlockId(i, j + 1, k) != net.minecraft.src.Block.NETHERRACK.ID) { return(false); } world.SetBlockWithNotify(i, j, k, net.minecraft.src.Block.GLOWSTONE.ID); for (int l = 0; l < 1500; l++) { int i1 = (i + random.Next(8)) - random.Next(8); int j1 = j - random.Next(12); int k1 = (k + random.Next(8)) - random.Next(8); if (world.GetBlockId(i1, j1, k1) != 0) { continue; } int l1 = 0; for (int i2 = 0; i2 < 6; i2++) { int j2 = 0; if (i2 == 0) { j2 = world.GetBlockId(i1 - 1, j1, k1); } if (i2 == 1) { j2 = world.GetBlockId(i1 + 1, j1, k1); } if (i2 == 2) { j2 = world.GetBlockId(i1, j1 - 1, k1); } if (i2 == 3) { j2 = world.GetBlockId(i1, j1 + 1, k1); } if (i2 == 4) { j2 = world.GetBlockId(i1, j1, k1 - 1); } if (i2 == 5) { j2 = world.GetBlockId(i1, j1, k1 + 1); } if (j2 == net.minecraft.src.Block.GLOWSTONE.ID) { l1++; } } if (l1 == 1) { world.SetBlockWithNotify(i1, j1, k1, net.minecraft.src.Block.GLOWSTONE.ID); } } return(true); }
public override net.minecraft.src.ItemStack OnItemRightClick(net.minecraft.src.ItemStack itemstack, net.minecraft.src.World world, net.minecraft.src.EntityPlayer entityplayer ) { float f = 1.0F; float f1 = entityplayer.prevRotationPitch + (entityplayer.rotationPitch - entityplayer .prevRotationPitch) * f; float f2 = entityplayer.prevRotationYaw + (entityplayer.rotationYaw - entityplayer .prevRotationYaw) * f; double d = entityplayer.prevPosX + (entityplayer.posX - entityplayer.prevPosX) * (double)f; double d1 = (entityplayer.prevPosY + (entityplayer.posY - entityplayer.prevPosY) * (double)f + 1.6200000000000001D) - (double)entityplayer.yOffset; double d2 = entityplayer.prevPosZ + (entityplayer.posZ - entityplayer.prevPosZ) * (double)f; net.minecraft.src.Vec3D vec3d = net.minecraft.src.Vec3D.CreateVector(d, d1, d2); float f3 = net.minecraft.src.MathHelper.Cos(-f2 * 0.01745329F - 3.141593F); float f4 = net.minecraft.src.MathHelper.Sin(-f2 * 0.01745329F - 3.141593F); float f5 = -net.minecraft.src.MathHelper.Cos(-f1 * 0.01745329F); float f6 = net.minecraft.src.MathHelper.Sin(-f1 * 0.01745329F); float f7 = f4 * f5; float f8 = f6; float f9 = f3 * f5; double d3 = 5D; net.minecraft.src.Vec3D vec3d1 = vec3d.AddVector((double)f7 * d3, (double)f8 * d3 , (double)f9 * d3); net.minecraft.src.MovingObjectPosition movingobjectposition = world.RayTraceBlocks_do (vec3d, vec3d1, isFull == 0); if (movingobjectposition == null) { return(itemstack); } if (movingobjectposition.typeOfHit == net.minecraft.src.EnumMovingObjectType.TILE) { int i = movingobjectposition.blockX; int j = movingobjectposition.blockY; int k = movingobjectposition.blockZ; if (!world.CanMineBlock(entityplayer, i, j, k)) { return(itemstack); } if (isFull == 0) { if (world.GetBlockMaterial(i, j, k) == net.minecraft.src.Material.water && world. GetBlockMetadata(i, j, k) == 0) { world.SetBlockWithNotify(i, j, k, 0); return(new net.minecraft.src.ItemStack(net.minecraft.src.Item.WATER_BUCKET)); } if (world.GetBlockMaterial(i, j, k) == net.minecraft.src.Material.lava && world.GetBlockMetadata (i, j, k) == 0) { world.SetBlockWithNotify(i, j, k, 0); return(new net.minecraft.src.ItemStack(net.minecraft.src.Item.LAVA_BUCKET)); } } else { if (isFull < 0) { return(new net.minecraft.src.ItemStack(net.minecraft.src.Item.BUCKET)); } if (movingobjectposition.sideHit == 0) { j--; } if (movingobjectposition.sideHit == 1) { j++; } if (movingobjectposition.sideHit == 2) { k--; } if (movingobjectposition.sideHit == 3) { k++; } if (movingobjectposition.sideHit == 4) { i--; } if (movingobjectposition.sideHit == 5) { i++; } if (world.IsAirBlock(i, j, k) || !world.GetBlockMaterial(i, j, k).IsSolid()) { if (world.worldProvider.isHellWorld && isFull == net.minecraft.src.Block.WATER .ID) { world.PlaySoundEffect(d + 0.5D, d1 + 0.5D, d2 + 0.5D, "random.fizz", 0.5F, 2.6F + (world.rand.NextFloat() - world.rand.NextFloat()) * 0.8F); for (int l = 0; l < 8; l++) { world.SpawnParticle("largesmoke", (double)i + SharpRandom.NextDouble(), (double)j + SharpRandom.NextDouble(), (double)k + SharpRandom.NextDouble(), 0.0D, 0.0D, 0.0D); } } else { world.SetBlockAndMetadataWithNotify(i, j, k, isFull, 0); } return(new net.minecraft.src.ItemStack(net.minecraft.src.Item.BUCKET)); } } } else { if (isFull == 0 && (movingobjectposition.entityHit is net.minecraft.src.EntityCow )) { return(new net.minecraft.src.ItemStack(net.minecraft.src.Item.MILK_BUCKET)); } } return(itemstack); }