private static void MakeStreetLight(BlockManager bm, StreetLights slCurrent, int x1, int z1, int x2, int z2) { if (bm.GetID(x1, 63, z1) == City.GroundBlockID && bm.GetData(x1, 63, z1) == City.GroundBlockData && bm.GetID(x1, 64, z1) == BlockInfo.Air.ID && bm.GetID(x1, 65, z1) == BlockInfo.Air.ID) { switch (slCurrent) { case StreetLights.Glowstone: bm.SetID(x1, 64, z1, BlockInfo.Fence.ID); bm.SetID(x1, 65, z1, BlockInfo.Fence.ID); bm.SetID(x1, 66, z1, BlockInfo.Fence.ID); bm.SetID(x1, 67, z1, BlockInfo.Fence.ID); bm.SetID(x1, 68, z1, BlockInfo.Fence.ID); bm.SetID(x2, 68, z2, BlockInfo.Fence.ID); bm.SetID(x2, 67, z2, BlockInfo.Glowstone.ID); break; case StreetLights.Torches: bm.SetID(x1, 64, z1, BlockInfo.Fence.ID); bm.SetID(x1, 65, z1, BlockInfo.Fence.ID); bm.SetID(x1, 66, z1, BlockInfo.Fence.ID); bm.SetID(x1, 67, z1, BlockInfo.Fence.ID); bm.SetID(x1, 68, z1, BlockInfo.Fence.ID); bm.SetID(x2, 68, z2, BlockInfo.Fence.ID); bm.SetID(x2, 67, z2, BlockInfo.WoodPlank.ID); if (z1 == z2) { BlockHelper.MakeTorch(x2, 67, z2 - 1, BlockInfo.WoodPlank.ID, 0); BlockHelper.MakeTorch(x2, 67, z2 + 1, BlockInfo.WoodPlank.ID, 0); } else { BlockHelper.MakeTorch(x2 - 1, 67, z2, BlockInfo.WoodPlank.ID, 0); BlockHelper.MakeTorch(x2 + 1, 67, z2, BlockInfo.WoodPlank.ID, 0); } break; } } }
private static void MakeStreetLight(BlockManager bm, StreetLights slCurrent, int x1, int z1, int x2, int z2) { if (bm.GetID(x1, 63, z1) == BlockType.GRASS && bm.GetID(x1, 64, z1) == BlockType.AIR && bm.GetID(x1, 65, z1) == BlockType.AIR) { switch (slCurrent) { case StreetLights.Glowstone: bm.SetID(x1, 64, z1, BlockType.FENCE); bm.SetID(x1, 65, z1, BlockType.FENCE); bm.SetID(x1, 66, z1, BlockType.FENCE); bm.SetID(x1, 67, z1, BlockType.FENCE); bm.SetID(x1, 68, z1, BlockType.FENCE); bm.SetID(x2, 68, z2, BlockType.FENCE); bm.SetID(x2, 67, z2, BlockType.GLOWSTONE_BLOCK); break; case StreetLights.Torches: bm.SetID(x1, 64, z1, BlockType.FENCE); bm.SetID(x1, 65, z1, BlockType.FENCE); bm.SetID(x1, 66, z1, BlockType.FENCE); bm.SetID(x1, 67, z1, BlockType.FENCE); bm.SetID(x1, 68, z1, BlockType.FENCE); bm.SetID(x2, 68, z2, BlockType.FENCE); bm.SetID(x2, 67, z2, BlockType.WOOD_PLANK); if (z1 == z2) { BlockHelper.MakeTorch(x2, 67, z2 - 1, BlockType.WOOD_PLANK, 0); BlockHelper.MakeTorch(x2, 67, z2 + 1, BlockType.WOOD_PLANK, 0); } else { BlockHelper.MakeTorch(x2 - 1, 67, z2, BlockType.WOOD_PLANK, 0); BlockHelper.MakeTorch(x2 + 1, 67, z2, BlockType.WOOD_PLANK, 0); } break; } } }
private static void MakeStreetLights(BlockManager bm) { StreetLights slCurrent = StreetLights.None; switch (City.StreetLightType.ToLower()) { case "glowstones": slCurrent = StreetLights.Glowstone; break; case "torches": slCurrent = StreetLights.Torches; break; } if (slCurrent == StreetLights.Glowstone || slCurrent == StreetLights.Torches) { for (int a = 2; a <= (City.MapLength / 2) - (City.FarmLength + 16); a += 8) { MakeStreetLight(bm, slCurrent, (City.MapLength / 2) - a, (City.MapLength / 2) - 2, (City.MapLength / 2) - a, (City.MapLength / 2) - 1); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) - a, (City.MapLength / 2) + 2, (City.MapLength / 2) - a, (City.MapLength / 2) + 1); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) + a, (City.MapLength / 2) - 2, (City.MapLength / 2) + a, (City.MapLength / 2) - 1); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) + a, (City.MapLength / 2) + 2, (City.MapLength / 2) + a, (City.MapLength / 2) + 1); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) - 2, (City.MapLength / 2) - a, (City.MapLength / 2) - 1, (City.MapLength / 2) - a); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) + 2, (City.MapLength / 2) - a, (City.MapLength / 2) + 1, (City.MapLength / 2) - a); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) - 2, (City.MapLength / 2) + a, (City.MapLength / 2) - 1, (City.MapLength / 2) + a); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) + 2, (City.MapLength / 2) + a, (City.MapLength / 2) + 1, (City.MapLength / 2) + a); } } }
private static void MakeStreetLights(BlockManager bm) { StreetLights slCurrent = StreetLights.None; switch (City.StreetLightType.ToLower()) { case "glowstones": slCurrent = StreetLights.Glowstone; break; case "torches": slCurrent = StreetLights.Torches; break; } if (slCurrent == StreetLights.Glowstone || slCurrent == StreetLights.Torches) { for (int a = City.PathExtends + 1; a <= (City.MapLength / 2) - (City.EdgeLength + 16); a += 8) { MakeStreetLight(bm, slCurrent, (City.MapLength / 2) - a, (City.MapLength / 2) - (City.PathExtends + 1), (City.MapLength / 2) - a, (City.MapLength / 2) - City.PathExtends); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) - a, (City.MapLength / 2) + (City.PathExtends + 1), (City.MapLength / 2) - a, (City.MapLength / 2) + City.PathExtends); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) + a, (City.MapLength / 2) - (City.PathExtends + 1), (City.MapLength / 2) + a, (City.MapLength / 2) - City.PathExtends); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) + a, (City.MapLength / 2) + (City.PathExtends + 1), (City.MapLength / 2) + a, (City.MapLength / 2) + City.PathExtends); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) - (City.PathExtends + 1), (City.MapLength / 2) - a, (City.MapLength / 2) - City.PathExtends, (City.MapLength / 2) - a); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) + (City.PathExtends + 1), (City.MapLength / 2) - a, (City.MapLength / 2) + City.PathExtends, (City.MapLength / 2) - a); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) - (City.PathExtends + 1), (City.MapLength / 2) + a, (City.MapLength / 2) - City.PathExtends, (City.MapLength / 2) + a); MakeStreetLight(bm, slCurrent, (City.MapLength / 2) + (City.PathExtends + 1), (City.MapLength / 2) + a, (City.MapLength / 2) + City.PathExtends, (City.MapLength / 2) + a); } } }