示例#1
0
        private static void MakeHelperChest(BlockManager bm, int x, int y, int z)
        {
            TileEntityChest tec = new TileEntityChest();

            tec.Items[0]  = BlockHelper.MakeItem(ItemInfo.DiamondSword.ID);
            tec.Items[1]  = BlockHelper.MakeItem(ItemInfo.DiamondPickaxe.ID);
            tec.Items[2]  = BlockHelper.MakeItem(ItemInfo.DiamondShovel.ID);
            tec.Items[3]  = BlockHelper.MakeItem(ItemInfo.DiamondAxe.ID);
            tec.Items[4]  = BlockHelper.MakeItem((int)BlockType.LADDER, 64);
            tec.Items[5]  = BlockHelper.MakeItem((int)BlockType.DIRT, 64);
            tec.Items[6]  = BlockHelper.MakeItem((int)BlockType.SAND, 64);
            tec.Items[7]  = BlockHelper.MakeItem((int)BlockType.CRAFTING_TABLE, 64);
            tec.Items[8]  = BlockHelper.MakeItem((int)BlockType.FURNACE, 64);
            tec.Items[9]  = BlockHelper.MakeItem(ItemInfo.Bread.ID, 64);
            tec.Items[10] = BlockHelper.MakeItem((int)BlockType.TORCH, 64);
            tec.Items[11] = BlockHelper.MakeItem((int)BlockType.STONE, 64);
            tec.Items[12] = BlockHelper.MakeItem((int)BlockType.CHEST, 64);
            tec.Items[13] = BlockHelper.MakeItem((int)BlockType.GLASS, 64);
            tec.Items[14] = BlockHelper.MakeItem((int)BlockType.WOOD, 64);
            tec.Items[15] = BlockHelper.MakeItem(ItemInfo.Cookie.ID, 64);
            tec.Items[16] = BlockHelper.MakeItem(ItemInfo.RedstoneDust.ID, 64);
            tec.Items[17] = BlockHelper.MakeItem((int)BlockType.IRON_BLOCK, 64);
            tec.Items[18] = BlockHelper.MakeItem((int)BlockType.DIAMOND_BLOCK, 64);
            tec.Items[19] = BlockHelper.MakeItem((int)BlockType.GOLD_BLOCK, 64);
            bm.SetID(x, y, z, (int)BlockType.CHEST);
            bm.SetTileEntity(x, y, z, tec);
        }
示例#2
0
        private static void MakeHelperChest(BlockManager bm, int x, int y, int z)
        {
            TileEntityChest tec = new TileEntityChest();

            tec.Items[0]  = BlockHelper.MakeItem(ItemInfo.DiamondSword.ID, 1);
            tec.Items[1]  = BlockHelper.MakeItem(ItemInfo.DiamondPickaxe.ID, 1);
            tec.Items[2]  = BlockHelper.MakeItem(ItemInfo.DiamondShovel.ID, 1);
            tec.Items[3]  = BlockHelper.MakeItem(ItemInfo.DiamondAxe.ID, 1);
            tec.Items[4]  = BlockHelper.MakeItem(BlockInfo.Ladder.ID, 64);
            tec.Items[5]  = BlockHelper.MakeItem(BlockInfo.Dirt.ID, 64);
            tec.Items[6]  = BlockHelper.MakeItem(BlockInfo.Sand.ID, 64);
            tec.Items[7]  = BlockHelper.MakeItem(BlockInfo.CraftTable.ID, 64);
            tec.Items[8]  = BlockHelper.MakeItem(BlockInfo.Furnace.ID, 64);
            tec.Items[9]  = BlockHelper.MakeItem(ItemInfo.Bread.ID, 64);
            tec.Items[10] = BlockHelper.MakeItem(BlockInfo.Torch.ID, 64);
            tec.Items[11] = BlockHelper.MakeItem(BlockInfo.Stone.ID, 64);
            tec.Items[12] = BlockHelper.MakeItem(BlockInfo.Chest.ID, 64);
            tec.Items[13] = BlockHelper.MakeItem(BlockInfo.Glass.ID, 64);
            tec.Items[14] = BlockHelper.MakeItem(BlockInfo.Wood.ID, 64);
            tec.Items[15] = BlockHelper.MakeItem(ItemInfo.Cookie.ID, 64);
            tec.Items[16] = BlockHelper.MakeItem(ItemInfo.RedstoneDust.ID, 64);
            tec.Items[17] = BlockHelper.MakeItem(BlockInfo.IronBlock.ID, 64);
            tec.Items[18] = BlockHelper.MakeItem(BlockInfo.DiamondBlock.ID, 64);
            tec.Items[19] = BlockHelper.MakeItem(BlockInfo.GoldBlock.ID, 64);
            bm.SetID(x, y, z, BlockInfo.Chest.ID);
            bm.SetTileEntity(x, y, z, tec);
        }
示例#3
0
        private static void MakeGuardChest(BlockManager bm, int x, int y, int z)
        {
            TileEntityChest tec = new TileEntityChest();

            if (City.HasItemsInChests)
            {
                for (int a = 0; a < 5; a++)
                {
                    tec.Items[a] = BlockHelper.MakeItem(RNG.RandomItem(ItemInfo.IronSword.ID,
                                                                       ItemInfo.WoodenSword.ID,
                                                                       ItemInfo.StoneSword.ID), 1);
                }
                tec.Items[6] = BlockHelper.MakeItem(ItemInfo.Bow.ID, 1);
                tec.Items[7] = BlockHelper.MakeItem(ItemInfo.Arrow.ID, 64);
                int intArmourStartID = RNG.RandomItem(ItemInfo.LeatherCap.ID,
                                                      ItemInfo.ChainHelmet.ID,
                                                      ItemInfo.IronHelmet.ID);
                for (int a = 9; a < 18; a++)
                {
                    // random armour
                    tec.Items[a] = BlockHelper.MakeItem(intArmourStartID + RNG.Next(4), 1);
                }
            }
            bm.SetID(x, y, z, BlockInfo.Chest.ID);
            bm.SetTileEntity(x, y, z, tec);
        }
示例#4
0
        private static void MakeChestItems(BlockManager bm, int x, int y, int z, int[] intResourceChances, string[] strResourceNames)
        {
            string strResource = strResourceNames[RandomHelper.RandomWeightedNumber(intResourceChances)];
            string strAmount;

            _dictResourceAmounts.TryGetValue(strResource.ToLower(), out strAmount);
            strAmount = strAmount ?? "1,1";
            int intAmount = RandomHelper.Next(Convert.ToInt32(strAmount.Split(',')[0]),
                                              Convert.ToInt32(strAmount.Split(',')[1]) + 1);
            string strBlockID;

            _dictResourceIDs.TryGetValue(strResource.ToLower(), out strBlockID);
            TileEntityChest tec     = new TileEntityChest();
            int             intSlot = 0;

            do
            {
                if (intAmount > MINECRAFT_ITEM_STACK_AMOUNT)
                {
                    tec.Items[intSlot++] = BlockHelper.MakeItem(Convert.ToInt32(strBlockID),
                                                                MINECRAFT_ITEM_STACK_AMOUNT);
                }
                else
                {
                    tec.Items[intSlot++] = BlockHelper.MakeItem(Convert.ToInt32(strBlockID), intAmount);
                }
                intAmount -= MINECRAFT_ITEM_STACK_AMOUNT;
            } while (intAmount > 0);

            bm.SetTileEntity(x, y, z, tec);
        }
示例#5
0
        private static void MakeSewerEntrance(BlockManager bm, int x, int z, int intPlotSize)
        {
            // path
            BlockShapes.MakeHollowLayers(x, x + 8, 63, 63, z, z + intPlotSize, (int)BlockType.DOUBLE_SLAB);
            // building
            BlockShapes.MakeHollowBox(x + 2, x + 6, 63, 67, z + 2, z + 6, (int)BlockType.STONE);
            // doorway
            BlockShapes.MakeSolidBox(x + 4, x + 4, 64, 65, z + 2, z + 2, (int)BlockType.AIR);
            // tunnel down
            BlockShapes.MakeSolidBox(x + 4, x + 4, 55, 63, z + 4, z + 4, (int)BlockType.AIR);
            // ladder back
            BlockShapes.MakeSolidBox(x + 4, x + 4, 52, 55, z + 5, z + 5, (int)BlockType.STONE);
            // ladder rungs
            BlockHelper.MakeLadder(x + 4, 52, 63, z + 4);
            // hatch
            bm.SetID(x + 4, 64, z + 4, (int)BlockType.TRAPDOOR);
            bm.SetData(x + 4, 64, z + 4, 2);
            // chest with torches
            bm.SetID(x + 5, 64, z + 5, (int)BlockType.CHEST);
            TileEntityChest tec = new TileEntityChest();

            tec.Items[0] = BlockHelper.MakeItem((int)BlockType.REDSTONE_TORCH_ON, 64);
            tec.Items[1] = BlockHelper.MakeItem((int)BlockType.TORCH, 32);
            bm.SetTileEntity(x + 5, 64, z + 5, tec);
            // sign
            BlockHelper.MakeSign(x + 4, 66, z + 1, "Sewers||Currently|empty!", (int)BlockType.STONE);
        }
示例#6
0
        private static TileEntityChest MakeHouseChest()
        {
            TileEntityChest tec = new TileEntityChest();

            for (int intItems = RandomHelper.Next(4, 8); intItems >= 0; intItems--)
            {
                tec.Items[intItems] = BlockHelper.MakeItem(RandomHelper.RandomNumber(
                                                               ItemInfo.Apple.ID,
                                                               ItemInfo.Book.ID,
                                                               ItemInfo.Bowl.ID,
                                                               ItemInfo.Bread.ID,
                                                               ItemInfo.Cake.ID,
                                                               ItemInfo.Clock.ID,
                                                               ItemInfo.Compass.ID,
                                                               ItemInfo.Cookie.ID,
                                                               ItemInfo.Diamond.ID,
                                                               ItemInfo.Egg.ID,
                                                               ItemInfo.Feather.ID,
                                                               ItemInfo.FishingRod.ID,
                                                               ItemInfo.GoldMusicDisc.ID,
                                                               ItemInfo.GreenMusicDisc.ID,
                                                               ItemInfo.Paper.ID,
                                                               ItemInfo.Saddle.ID,
                                                               ItemInfo.String.ID,
                                                               ItemInfo.GoldIngot.ID,
                                                               ItemInfo.IronIngot.ID,
                                                               BlockType.TORCH,
                                                               ItemInfo.FlintAndSteel.ID,
                                                               ItemInfo.Bow.ID,
                                                               ItemInfo.IronSword.ID,
                                                               ItemInfo.Shears.ID), 1);
            }
            return(tec);
        }
示例#7
0
 public static void MakeDrawbridges(BlockManager bm, int intFarmSize, int intMapSize,
                                    bool booIncludeMoat, bool booIncludeWalls)
 {
     if (booIncludeWalls)
     {
         // drawbridge
         int intBridgeEnd = booIncludeMoat ? -2 : 5;
         BlockShapes.MakeSolidBox((intMapSize / 2) - 2, intMapSize / 2, 63, 63,
                                  intFarmSize + intBridgeEnd, intFarmSize + 13, (int)BlockType.STONE, 2);
         // carve out the entrance/exit
         BlockShapes.MakeSolidBox((intMapSize / 2) - 2, intMapSize / 2, 64, 67,
                                  intFarmSize + 6, intFarmSize + 10, (int)BlockType.AIR, 2);
         // add the bottom of a portcullis
         BlockShapes.MakeSolidBox((intMapSize / 2) - 2, intMapSize / 2, 67, 67,
                                  intFarmSize + 6, intFarmSize + 6, (int)BlockType.FENCE, 2);
         // add room for murder holes
         BlockShapes.MakeSolidBox((intMapSize / 2) - 2, (intMapSize / 2) + 2, 69, 71,
                                  intFarmSize + 8, intFarmSize + 9, (int)BlockType.AIR, 2);
         BlockShapes.MakeSolidBox(intMapSize / 2, intMapSize / 2, 69, 72,
                                  intFarmSize + 8, intFarmSize + 9, (int)BlockType.AIR, 2);
         BlockHelper.MakeLadder(intMapSize / 2, 69, 72, intFarmSize + 9, 2, (int)BlockType.STONE);
         BlockShapes.MakeSolidBox(intMapSize / 2, intMapSize / 2, 72, 72,
                                  intFarmSize + 8, intFarmSize + 8, (int)BlockType.STONE, 2);
         // murder holes
         BlockShapes.MakeSolidBox((intMapSize / 2) - 2, (intMapSize / 2) - 2, 68, 68,
                                  intFarmSize + 8, intFarmSize + 8, (int)BlockType.AIR, 2);
         BlockShapes.MakeSolidBox(intMapSize / 2, intMapSize / 2, 68, 68,
                                  intFarmSize + 8, intFarmSize + 8, (int)BlockType.AIR, 2);
         BlockShapes.MakeSolidBox((intMapSize / 2) + 2, (intMapSize / 2) + 2, 68, 68,
                                  intFarmSize + 8, intFarmSize + 8, (int)BlockType.AIR, 2);
         // chests
         BlockShapes.MakeBlock((intMapSize / 2) - 4, 69, intFarmSize + 9, (int)BlockType.GRAVEL, 2, 100, -1);
         BlockShapes.MakeBlock((intMapSize / 2) + 4, 69, intFarmSize + 9, (int)BlockType.GRAVEL, 2, 100, -1);
         BlockShapes.MakeBlock((intMapSize / 2) - 3, 70, intFarmSize + 9, (int)BlockType.AIR, 2, 100, -1);
         BlockShapes.MakeBlock((intMapSize / 2) + 3, 70, intFarmSize + 9, (int)BlockType.AIR, 2, 100, -1);
         TileEntityChest tec = new TileEntityChest();
         tec.Items[0] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1);
         tec.Items[1] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1);
         tec.Items[2] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1);
         BlockHelper.MakeChest((intMapSize / 2) - 3, 69, intFarmSize + 9, (int)BlockType.GRAVEL, tec, 2);
         // add torches
         BlockHelper.MakeTorch((intMapSize / 2) - 1, 70, intFarmSize + 9, (int)BlockType.STONE, 2);
         BlockHelper.MakeTorch((intMapSize / 2) + 1, 70, intFarmSize + 9, (int)BlockType.STONE, 2);
         // link to main roads
         //BlockShapes.MakeSolidBox((intMapSize / 2) - 1, (intMapSize / 2) + 1, 63, 63,
         //                         intFarmSize + 11, intFarmSize + 13, (int)BlockType.DOUBLE_SLAB, 0);
     }
     else if (booIncludeMoat)
     {
         BlockShapes.MakeSolidBox((intMapSize / 2) - 2, intMapSize / 2, 63, 63,
                                  intFarmSize - 2, intFarmSize + 6, (int)BlockType.STONE, 2);
     }
 }
示例#8
0
        private static void MakeChestItems(BlockManager bm, int x, int y, int z)
        {
            string strResource = strResourceNames[RandomHelper.RandomWeightedNumber(intResourceChances)];
            string strAmount;

            dictResourceAmounts.TryGetValue(strResource.ToLower(), out strAmount);
            strAmount = strAmount ?? "1,1";
            int intAmount = RandomHelper.Next(Convert.ToInt32(strAmount.Split(',')[0]),
                                              Convert.ToInt32(strAmount.Split(',')[1]) + 1);
            string strBlockID;

            dictResourceIDs.TryGetValue(strResource.ToLower(), out strBlockID);
            TileEntityChest tec = new TileEntityChest();

            tec.Items[0] = BlockHelper.MakeItem(Convert.ToInt32(strBlockID), intAmount);
            bm.SetTileEntity(x, y, z, tec);
        }
示例#9
0
        private static void MakeGuardChest(BlockManager bm, int x, int y, int z)
        {
            TileEntityChest tec = new TileEntityChest();

            for (int a = 0; a < 5; a++)
            {
                tec.Items[a] = BlockHelper.MakeItem(RandomHelper.RandomNumber(ItemInfo.IronSword.ID,
                                                                              ItemInfo.WoodenSword.ID,
                                                                              ItemInfo.StoneSword.ID), 1);
            }
            tec.Items[6] = BlockHelper.MakeItem(ItemInfo.Bow.ID, 1);
            tec.Items[7] = BlockHelper.MakeItem(ItemInfo.Arrow.ID, 64);
            int intArmourStartID = RandomHelper.RandomNumber(ItemInfo.LeatherCap.ID, ItemInfo.ChainHelmet.ID,
                                                             ItemInfo.IronHelmet.ID);

            for (int a = 9; a < 18; a++)
            {
                tec.Items[a] = BlockHelper.MakeItem(intArmourStartID + rand.Next(4), 1); // random armour
            }
            bm.SetID(x, y, z, (int)BlockType.CHEST);
            bm.SetTileEntity(x, y, z, tec);
        }
示例#10
0
        private static TileEntityChest MakeTreasureChest()
        {
            TileEntityChest tec = new TileEntityChest();

            for (int intItems = RandomHelper.Next(5, 7); intItems >= 2; intItems--)
            {
                tec.Items[intItems] = BlockHelper.MakeItem(RandomHelper.RandomNumber(
                                                               ItemInfo.GoldenApple.ID,
                                                               ItemInfo.GoldIngot.ID,
                                                               ItemInfo.Diamond.ID,
                                                               ItemInfo.GoldMusicDisc.ID,
                                                               ItemInfo.GreenMusicDisc.ID,
                                                               ItemInfo.IronIngot.ID,
                                                               ItemInfo.Saddle.ID,
                                                               ItemInfo.Compass.ID,
                                                               ItemInfo.Clock.ID,
                                                               ItemInfo.Cake.ID,
                                                               ItemInfo.Cookie.ID
                                                               ), 1);
            }
            tec.Items[0] = BlockHelper.MakeItem(ItemInfo.GetRandomItem().ID, 1);
            tec.Items[1] = BlockHelper.MakeItem(ItemInfo.GetRandomItem().ID, 1);
            return(tec);
        }
示例#11
0
 public static void MakeDrawbridges(BlockManager bm)
 {
     if (City.HasWalls)
     {
         // drawbridge
         int intBridgeEnd = City.HasMoat ? -2 : 5;
         if (City.MoatType == "Lava" || City.MoatType == "Fire")
         {
             BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 63, 63,
                                      City.FarmLength + intBridgeEnd, City.FarmLength + 13, BlockInfo.Stone.ID, 2);
         }
         else
         {
             BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 63, 63,
                                      City.FarmLength + intBridgeEnd, City.FarmLength + 13, BlockInfo.WoodPlank.ID, 2);
         }
         BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 64, 64,
                                  City.FarmLength + intBridgeEnd, City.FarmLength + 13, BlockInfo.Air.ID, 2);
         // carve out the entrance/exit
         BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 64, 67,
                                  City.FarmLength + intBridgeEnd, City.FarmLength + 10, BlockInfo.Air.ID, 2);
         if (Utils.IsValidSign(City.Name))
         {
             BlockHelper.MakeSign((City.MapLength / 2) - 3, 65, City.FarmLength + 5,
                                  Utils.ConvertStringToSignText(City.Name.Replace("City of ", "City of~")),
                                  City.WallMaterialID, 2);
         }
         // add the bottom of a portcullis
         BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 67, 67,
                                  City.FarmLength + 6, City.FarmLength + 6, BlockInfo.Fence.ID, 2);
         // add room for murder holes
         BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, (City.MapLength / 2) + 2, 69, 71,
                                  City.FarmLength + 8, City.FarmLength + 9, BlockInfo.Air.ID, 2);
         BlockShapes.MakeSolidBox(City.MapLength / 2, City.MapLength / 2, 69, 72,
                                  City.FarmLength + 8, City.FarmLength + 9, BlockInfo.Air.ID, 2);
         BlockHelper.MakeLadder(City.MapLength / 2, 69, 72, City.FarmLength + 9, 2, City.WallMaterialID);
         BlockShapes.MakeSolidBoxWithData(City.MapLength / 2, City.MapLength / 2, 72, 72,
                                          City.FarmLength + 8, City.FarmLength + 8,
                                          City.WallMaterialID, 2, City.WallMaterialData);
         // murder holes
         BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, (City.MapLength / 2) - 2, 68, 68,
                                  City.FarmLength + 8, City.FarmLength + 8, BlockInfo.Air.ID, 2);
         BlockShapes.MakeSolidBox(City.MapLength / 2, City.MapLength / 2, 68, 68,
                                  City.FarmLength + 8, City.FarmLength + 8, BlockInfo.Air.ID, 2);
         BlockShapes.MakeSolidBox((City.MapLength / 2) + 2, (City.MapLength / 2) + 2, 68, 68,
                                  City.FarmLength + 8, City.FarmLength + 8, BlockInfo.Air.ID, 2);
         // chests
         BlockShapes.MakeBlock((City.MapLength / 2) - 4, 69, City.FarmLength + 9, BlockInfo.Gravel.ID, 2, 100, -1);
         BlockShapes.MakeBlock((City.MapLength / 2) + 4, 69, City.FarmLength + 9, BlockInfo.Gravel.ID, 2, 100, -1);
         BlockShapes.MakeBlock((City.MapLength / 2) - 3, 70, City.FarmLength + 9, BlockInfo.Air.ID, 2, 100, -1);
         BlockShapes.MakeBlock((City.MapLength / 2) + 3, 70, City.FarmLength + 9, BlockInfo.Air.ID, 2, 100, -1);
         TileEntityChest tec = new TileEntityChest();
         if (City.HasItemsInChests)
         {
             tec.Items[0] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1);
             tec.Items[1] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1);
             tec.Items[2] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1);
         }
         BlockHelper.MakeChest((City.MapLength / 2) - 3, 69, City.FarmLength + 9, BlockInfo.Gravel.ID, tec, 2);
         // add torches
         BlockHelper.MakeTorch((City.MapLength / 2) - 1, 70, City.FarmLength + 9, City.WallMaterialID, 2);
         BlockHelper.MakeTorch((City.MapLength / 2) + 1, 70, City.FarmLength + 9, City.WallMaterialID, 2);
         // link to main roads
         //BlockShapes.MakeSolidBox((City.intMapLength / 2) - 1, (City.intMapLength / 2) + 1, 63, 63,
         //                         City.intFarmSize + 11, City.intFarmSize + 13, BlockType.DOUBLE_SLAB, 0);
     }
     else if (City.HasMoat)
     {
         BlockShapes.MakeSolidBox((City.MapLength / 2) - 2, City.MapLength / 2, 63, 63,
                                  City.FarmLength - 2, City.FarmLength + 6, BlockInfo.Stone.ID, 2);
     }
 }
示例#12
0
        private static TileEntityChest MakeHouseChest()
        {
            TileEntityChest tec = new TileEntityChest();

            for (int intItems = RandomHelper.Next(4, 8); intItems >= 0; intItems--)
            {
                switch (RandomHelper.Next(0, 17))
                {
                case 0:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.Apple.ID, 1);
                    break;

                case 1:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.Book.ID, 1);
                    break;

                case 2:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.Bowl.ID, 1);
                    break;

                case 3:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.Bread.ID, 1);
                    break;

                case 4:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.Cake.ID, 1);
                    break;

                case 5:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.Clock.ID, 1);
                    break;

                case 6:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.Compass.ID, 1);
                    break;

                case 7:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.Cookie.ID, 1);
                    break;

                case 8:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.Diamond.ID, 1);
                    break;

                case 9:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.Egg.ID, 1);
                    break;

                case 10:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.Feather.ID, 1);
                    break;

                case 11:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.FishingRod.ID, 1);
                    break;

                case 12:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.GoldMusicDisc.ID, 1);
                    break;

                case 13:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.GreenMusicDisc.ID, 1);
                    break;

                case 14:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.Paper.ID, 1);
                    break;

                case 15:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.Saddle.ID, 1);
                    break;

                case 16:
                    tec.Items[intItems] = BlockHelper.MakeItem(ItemInfo.String.ID, 1);
                    break;
                }
            }
            return(tec);
        }
示例#13
0
 public static void MakeDrawbridges(BlockManager bm, int intFarmLength, int intMapLength,
                                    bool booIncludeMoat, bool booIncludeWalls, bool booIncludeItemsInChests,
                                    int intWallMaterial, string strMoatType, string strCityName)
 {
     if (booIncludeWalls)
     {
         // drawbridge
         int intBridgeEnd = booIncludeMoat ? -2 : 5;
         if (strMoatType == "Lava" || strMoatType == "Fire")
         {
             BlockShapes.MakeSolidBox((intMapLength / 2) - 2, intMapLength / 2, 63, 63,
                                      intFarmLength + intBridgeEnd, intFarmLength + 13, BlockType.STONE, 2);
         }
         else
         {
             BlockShapes.MakeSolidBox((intMapLength / 2) - 2, intMapLength / 2, 63, 63,
                                      intFarmLength + intBridgeEnd, intFarmLength + 13, BlockType.WOOD_PLANK, 2);
         }
         BlockShapes.MakeSolidBox((intMapLength / 2) - 2, intMapLength / 2, 64, 64,
                                  intFarmLength + intBridgeEnd, intFarmLength + 13, BlockType.AIR, 2);
         // carve out the entrance/exit
         BlockShapes.MakeSolidBox((intMapLength / 2) - 2, intMapLength / 2, 64, 67,
                                  intFarmLength + 6, intFarmLength + 10, BlockType.AIR, 2);
         if (Utils.IsValidSign(strCityName))
         {
             BlockHelper.MakeSign((intMapLength / 2) - 3, 65, intFarmLength + 5, Utils.ConvertStringToSignText(strCityName.Replace("City of ", "City of~")), intWallMaterial, 2);
         }
         // add the bottom of a portcullis
         BlockShapes.MakeSolidBox((intMapLength / 2) - 2, intMapLength / 2, 67, 67,
                                  intFarmLength + 6, intFarmLength + 6, BlockType.FENCE, 2);
         // add room for murder holes
         BlockShapes.MakeSolidBox((intMapLength / 2) - 2, (intMapLength / 2) + 2, 69, 71,
                                  intFarmLength + 8, intFarmLength + 9, BlockType.AIR, 2);
         BlockShapes.MakeSolidBox(intMapLength / 2, intMapLength / 2, 69, 72,
                                  intFarmLength + 8, intFarmLength + 9, BlockType.AIR, 2);
         BlockHelper.MakeLadder(intMapLength / 2, 69, 72, intFarmLength + 9, 2, intWallMaterial);
         BlockShapes.MakeSolidBox(intMapLength / 2, intMapLength / 2, 72, 72,
                                  intFarmLength + 8, intFarmLength + 8, intWallMaterial, 2);
         // murder holes
         BlockShapes.MakeSolidBox((intMapLength / 2) - 2, (intMapLength / 2) - 2, 68, 68,
                                  intFarmLength + 8, intFarmLength + 8, BlockType.AIR, 2);
         BlockShapes.MakeSolidBox(intMapLength / 2, intMapLength / 2, 68, 68,
                                  intFarmLength + 8, intFarmLength + 8, BlockType.AIR, 2);
         BlockShapes.MakeSolidBox((intMapLength / 2) + 2, (intMapLength / 2) + 2, 68, 68,
                                  intFarmLength + 8, intFarmLength + 8, BlockType.AIR, 2);
         // chests
         BlockShapes.MakeBlock((intMapLength / 2) - 4, 69, intFarmLength + 9, BlockType.GRAVEL, 2, 100, -1);
         BlockShapes.MakeBlock((intMapLength / 2) + 4, 69, intFarmLength + 9, BlockType.GRAVEL, 2, 100, -1);
         BlockShapes.MakeBlock((intMapLength / 2) - 3, 70, intFarmLength + 9, BlockType.AIR, 2, 100, -1);
         BlockShapes.MakeBlock((intMapLength / 2) + 3, 70, intFarmLength + 9, BlockType.AIR, 2, 100, -1);
         TileEntityChest tec = new TileEntityChest();
         if (booIncludeItemsInChests)
         {
             tec.Items[0] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1);
             tec.Items[1] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1);
             tec.Items[2] = BlockHelper.MakeItem(ItemInfo.LavaBucket.ID, 1);
         }
         BlockHelper.MakeChest((intMapLength / 2) - 3, 69, intFarmLength + 9, BlockType.GRAVEL, tec, 2);
         // add torches
         BlockHelper.MakeTorch((intMapLength / 2) - 1, 70, intFarmLength + 9, intWallMaterial, 2);
         BlockHelper.MakeTorch((intMapLength / 2) + 1, 70, intFarmLength + 9, intWallMaterial, 2);
         // link to main roads
         //BlockShapes.MakeSolidBox((intMapLength / 2) - 1, (intMapLength / 2) + 1, 63, 63,
         //                         intFarmLength + 11, intFarmLength + 13, BlockType.DOUBLE_SLAB, 0);
     }
     else if (booIncludeMoat)
     {
         BlockShapes.MakeSolidBox((intMapLength / 2) - 2, intMapLength / 2, 63, 63,
                                  intFarmLength - 2, intFarmLength + 6, BlockType.STONE, 2);
     }
 }