diff --git a/.gitignore b/.gitignore index da50a65..d06ac50 100644 --- a/.gitignore +++ b/.gitignore @@ -1,220 +1,9 @@ -################# -## Eclipse -################# +/* -*.pydevproject -.project -.metadata -common/bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.classpath -.settings/ -.loadpath - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# CDT-specific -.cproject - -# PDT-specific -.buildpath - - -################# -## Visual Studio -################# - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates - -# Build results - -[Dd]ebug/ -[Rr]elease/ -x64/ -build/ -[Bb]in/ -[Oo]bj/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.log -*.scc - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -*.ncrunch* -.*crunch*.local.xml - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.Publish.xml -*.pubxml - -# NuGet Packages Directory -## TODO: If you have NuGet Package Restore enabled, uncomment the next line -#packages/ - -# Windows Azure Build Output -csx -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -sql/ -*.Cache -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.[Pp]ublish.xml -*.pfx -*.publishsettings - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -App_Data/*.mdf -App_Data/*.ldf - -############# -## Windows detritus -############# - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Mac crap -.DS_Store - - -############# -## Python -############# - -*.py[co] - -# Packages -*.egg -*.egg-info -dist/ -build/ -eggs/ -parts/ -var/ -sdist/ -develop-eggs/ -.installed.cfg - -# Installer logs -pip-log.txt - -# Unit test / coverage reports -.coverage -.tox - -#Translations -*.mo - -#Mr Developer -.mr.developer.cfg - -/mcp/* -/eclipse/* -/api/* -/releases/* +!/common/assets/ +!/common/mysticores/ +!/common/mysticruins/ +!/common/mysticstones/ +!/common/mysticworld/ +!/common/mcmod.info +!/common/build.gradle \ No newline at end of file diff --git a/common/MysticMods.eml b/common/MysticMods.eml new file mode 100644 index 0000000..70f162e --- /dev/null +++ b/common/MysticMods.eml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/common/MysticMods_common.iml b/common/MysticMods_common.iml index 4b56e6c..8627346 100644 --- a/common/MysticMods_common.iml +++ b/common/MysticMods_common.iml @@ -8,14 +8,49 @@ - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/MysticOres/Blocks/BlockBase.java b/common/MysticOres/Blocks/BlockBase.java index 77301d9..86fd526 100644 --- a/common/MysticOres/Blocks/BlockBase.java +++ b/common/MysticOres/Blocks/BlockBase.java @@ -7,25 +7,30 @@ import mysticores.MysticOres; import mysticores.items.Items; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.common.util.ForgeDirection; public class BlockBase extends Block { - Icon[] textures; + IIcon[] textures; - public BlockBase(int ID) { - super(ID, Material.rock); - setCreativeTab(MysticOres.MysticOresTab); + public BlockBase() { + super(Material.rock); + setCreativeTab(MysticOres.MysticOresTab); + setHarvestLevel("pickaxe", 2); + setHarvestLevel("pickaxe", 3, 0); + setHarvestLevel("pickaxe", 3, 2); + setHarvestLevel("pickaxe", 1, 6); } @Override @@ -74,7 +79,7 @@ public class BlockBase extends Block { @Override @SideOnly(Side.CLIENT) - public Icon getIcon(int side, int meta) { + public IIcon getIcon(int side, int meta) { return textures[meta]; } @@ -95,14 +100,14 @@ public class BlockBase extends Block { @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(int i, CreativeTabs tab, List list) { - for (int meta = 0; meta < ItemBase.BLOCK_NAMES.length; meta++) { + public void getSubBlocks(Item i, CreativeTabs tab, List list) { + for (int meta = 0; meta < BlockHandler.BLOCK_NAMES.size(); meta++) { list.add(new ItemStack(i, 1, meta)); } } @Override - public int idDropped(int par1, Random random, int par3) { + public Item getItemDropped(int par1, Random random, int par3) { switch (par1) { case 1: case 2: @@ -111,7 +116,7 @@ public class BlockBase extends Block { case 7: case 11: case 12: - return Items.Resource.itemID; + return Items.Resource; case 8: return BlackSoulstoneDrops(par1, random, par3); case 9: @@ -119,17 +124,12 @@ public class BlockBase extends Block { case 10: return RedSoulstoneDrops(par1, random, par3); default: - return blockID; + return super.getItemDropped(par1, random, par3); } } @Override - public int idPicked(World world, int x, int y, int z) { - return this.blockID; - } - - @Override - public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side) { + public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) { int meta = world.getBlockMetadata(x, y, z); if (meta == 12) return false; @@ -138,9 +138,9 @@ public class BlockBase extends Block { } @Override - public boolean isOpaqueCube() { - return false; - } + public boolean isOpaqueCube(){ + return false; + } @Override public int quantityDropped(int meta, int fortune, Random random) { @@ -164,79 +164,73 @@ public class BlockBase extends Block { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister register) { - textures = new Icon[16]; - for (int i = 0; i < ItemBase.BLOCK_NAMES.length; i++) { - textures[i] = register.registerIcon("mysticores:" + ItemBase.BLOCK_NAMES[i]); + public void registerBlockIcons(IIconRegister register) { + textures = new IIcon[16]; + for (int i = 0; i < BlockHandler.BLOCK_NAMES.size(); i++) { + textures[i] = register.registerIcon("mysticores:" + BlockHandler.BLOCK_NAMES.get(i)); } } @Override - public boolean renderAsNormalBlock() { - return false; - } + public boolean renderAsNormalBlock(){ + return false; + } @Override @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int par) { int meta = world.getBlockMetadata(x, y, z); - int blockID = world.getBlockId(x, y, z); - if (meta == 12 && blockID == this.blockID) + Block blockID = world.getBlock(x, y, z); + if (meta == 12 && blockID == this) return false; else return true; } - @Override - protected boolean canSilkHarvest() { - return true; - } - - public static int BlackSoulstoneDrops(int par1, Random random, int par3) { + public static Item BlackSoulstoneDrops(int par1, Random random, int par3) { int rand = random.nextInt(2); switch (rand) { case 0: - return Item.coal.itemID; + return net.minecraft.init.Items.coal; case 1: - return Item.gunpowder.itemID; + return net.minecraft.init.Items.gunpowder; default: - return Item.sugar.itemID; + return net.minecraft.init.Items.sugar; } } - public static int BlueSoulstoneDrops(int par1, Random random, int par3) { + public static Item BlueSoulstoneDrops(int par1, Random random, int par3) { int rand = random.nextInt(5); switch (rand) { case 0: - return Item.diamond.itemID; + return net.minecraft.init.Items.diamond; case 1: - return Block.obsidian.blockID; + return Item.getItemFromBlock(Blocks.obsidian); case 2: - return Item.gunpowder.itemID; + return net.minecraft.init.Items.gunpowder; case 3: - return Item.glowstone.itemID; + return net.minecraft.init.Items.glowstone_dust; case 4: - return Item.blazeRod.itemID; + return net.minecraft.init.Items.blaze_rod; case 5: - return Item.emerald.itemID; default: - return Item.emerald.itemID; + return net.minecraft.init.Items.emerald; } } - public static int RedSoulstoneDrops(int par1, Random random, int par3) { + public static Item RedSoulstoneDrops(int par1, Random random, int par3) { int rand = random.nextInt(4); switch (rand) { case 0: - return Item.glowstone.itemID; + return net.minecraft.init.Items.glowstone_dust; case 1: - return Item.gunpowder.itemID; + return net.minecraft.init.Items.gunpowder; case 2: - return Item.redstone.itemID; + return net.minecraft.init.Items.redstone; case 3: - return Block.obsidian.blockID; + return Item.getItemFromBlock(Blocks.obsidian); default: - return Item.blazePowder.itemID; + return net.minecraft.init.Items.blaze_powder; } } } \ No newline at end of file diff --git a/common/MysticOres/Blocks/BlockHandler.java b/common/MysticOres/Blocks/BlockHandler.java index 3cde9ab..c2d29f0 100644 --- a/common/MysticOres/Blocks/BlockHandler.java +++ b/common/MysticOres/Blocks/BlockHandler.java @@ -1,31 +1,18 @@ package mysticores.blocks; import net.minecraft.block.Block; -import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.registry.GameRegistry; +import java.util.ArrayList; +import java.util.Arrays; + public class BlockHandler { + public static ArrayList BLOCK_NAMES = new ArrayList(Arrays.asList("Adamantine Ore", "Amethyst Ore", "Iridium Ore", "Mithril Ore", "Tourmaline Ore", "Topaz Ore", "Verdite Ore", "Bloodstone", "Black Soulstone", + "Blue Soulstone", "Red Soulstone", "Agate Ore", "Tempered Glass")); public static Block BlockBase; - public static int BASEID = 540; public static void initialize() { - BlockBase = new BlockBase(BASEID).setStepSound(Block.soundStoneFootstep); - GameRegistry.registerBlock(BlockBase, ItemBase.class, "Base Blocks"); - setBlockHarvestLevels(); - } - - private static void setBlockHarvestLevels() { - MinecraftForge.setBlockHarvestLevel(BlockBase, 0, "pickaxe", 3); - MinecraftForge.setBlockHarvestLevel(BlockBase, 1, "pickaxe", 2); - MinecraftForge.setBlockHarvestLevel(BlockBase, 2, "pickaxe", 3); - MinecraftForge.setBlockHarvestLevel(BlockBase, 3, "pickaxe", 2); - MinecraftForge.setBlockHarvestLevel(BlockBase, 4, "pickaxe", 2); - MinecraftForge.setBlockHarvestLevel(BlockBase, 5, "pickaxe", 2); - MinecraftForge.setBlockHarvestLevel(BlockBase, 6, "pickaxe", 1); - MinecraftForge.setBlockHarvestLevel(BlockBase, 7, "pickaxe", 2); - MinecraftForge.setBlockHarvestLevel(BlockBase, 8, "pickaxe", 2); - MinecraftForge.setBlockHarvestLevel(BlockBase, 9, "pickaxe", 2); - MinecraftForge.setBlockHarvestLevel(BlockBase, 10, "pickaxe", 2); - MinecraftForge.setBlockHarvestLevel(BlockBase, 11, "pickaxe", 2); + BlockBase = new BlockBase().setStepSound(Block.soundTypeStone); + GameRegistry.registerBlock(BlockBase, ItemBase.class, "Base Blocks", "mysticores", BLOCK_NAMES); } } diff --git a/common/MysticOres/Blocks/ItemBase.java b/common/MysticOres/Blocks/ItemBase.java index f512101..6d11b8d 100644 --- a/common/MysticOres/Blocks/ItemBase.java +++ b/common/MysticOres/Blocks/ItemBase.java @@ -1,36 +1,22 @@ package mysticores.blocks; -import net.minecraft.item.ItemBlock; +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlockWithMetadata; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -public class ItemBase extends ItemBlock { - public static String[] BLOCK_NAMES = new String[] { "Adamantine Ore", "Amethyst Ore", "Iridium Ore", "Mithril Ore", "Tourmaline Ore", "Topaz Ore", "Verdite Ore", "Bloodstone", "Black Soulstone", - "Blue Soulstone", "Red Soulstone", "Agate Ore", "Tempered Glass" }; +import java.util.ArrayList; - public ItemBase(int par1) { - super(par1); - setMaxDamage(0); - setHasSubtypes(true); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int par1) { - return BlockHandler.BlockBase.getIcon(2, par1); - } - - @Override - public int getMetadata(int par1) { - return par1; +public class ItemBase extends ItemBlockWithMetadata { + public final ArrayList names; + public ItemBase(Block block, ArrayList names) { + super(block, block); + this.names = names; } @Override public String getUnlocalizedName(ItemStack itemStack) { - int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BLOCK_NAMES.length); - return BLOCK_NAMES[meta]; + int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, names.size()); + return names.get(meta); } } diff --git a/common/MysticOres/Items/EnumTools.java b/common/MysticOres/Items/EnumTools.java index f2cc33c..5388c45 100644 --- a/common/MysticOres/Items/EnumTools.java +++ b/common/MysticOres/Items/EnumTools.java @@ -1,23 +1,22 @@ package mysticores.items; -import net.minecraft.block.Block; -import net.minecraft.item.EnumToolMaterial; +import net.minecraft.init.Blocks; import net.minecraft.item.Item; -import net.minecraftforge.common.EnumHelper; +import net.minecraftforge.common.util.EnumHelper; public class EnumTools { - static EnumToolMaterial verditeToolMaterial = EnumHelper.addToolMaterial("Verdite", 1, 262, 5.0F, 1, 5); - static EnumToolMaterial mithrilToolMaterial = EnumHelper.addToolMaterial("Mithril", 2, 500, 7.0F, 2, 9); - static EnumToolMaterial adamantineToolMaterial = EnumHelper.addToolMaterial("Adamantine", 3, 3000, 10.0F, 5, 13); - static EnumToolMaterial iridiumToolMaterial = EnumHelper.addToolMaterial("Iridium", 3, 4000, 12.0F, 7, 15); - static EnumToolMaterial obsidianToolMaterial = EnumHelper.addToolMaterial("Obsidian", 2, 100, 4.0F, 6, 11); - static EnumToolMaterial bloodstoneToolMaterial = EnumHelper.addToolMaterial("Bloodstone", 3, 200, 16.0F, 8, 12); + static Item.ToolMaterial verditeToolMaterial = EnumHelper.addToolMaterial("Verdite", 1, 262, 5.0F, 1, 5); + static Item.ToolMaterial mithrilToolMaterial = EnumHelper.addToolMaterial("Mithril", 2, 500, 7.0F, 2, 9); + static Item.ToolMaterial adamantineToolMaterial = EnumHelper.addToolMaterial("Adamantine", 3, 3000, 10.0F, 5, 13); + static Item.ToolMaterial iridiumToolMaterial = EnumHelper.addToolMaterial("Iridium", 3, 4000, 12.0F, 7, 15); + static Item.ToolMaterial obsidianToolMaterial = EnumHelper.addToolMaterial("Obsidian", 2, 100, 4.0F, 6, 11); + static Item.ToolMaterial bloodstoneToolMaterial = EnumHelper.addToolMaterial("Bloodstone", 3, 200, 16.0F, 8, 12); - static { verditeToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; } - static { mithrilToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; } - static { adamantineToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; } - static { iridiumToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; } - static { obsidianToolMaterial.customCraftingMaterial = Item.itemsList[Block.obsidian.blockID]; } - static { bloodstoneToolMaterial.customCraftingMaterial = Item.itemsList[Items.Resource.itemID]; } + static { verditeToolMaterial.customCraftingMaterial = Items.Resource; } + static { mithrilToolMaterial.customCraftingMaterial = Items.Resource; } + static { adamantineToolMaterial.customCraftingMaterial = Items.Resource; } + static { iridiumToolMaterial.customCraftingMaterial = Items.Resource; } + static { obsidianToolMaterial.customCraftingMaterial = Item.getItemFromBlock(Blocks.obsidian); } + static { bloodstoneToolMaterial.customCraftingMaterial = Items.Resource; } } diff --git a/common/MysticOres/Items/ItemResource.java b/common/MysticOres/Items/ItemResource.java index b19eb4f..431d94a 100644 --- a/common/MysticOres/Items/ItemResource.java +++ b/common/MysticOres/Items/ItemResource.java @@ -3,36 +3,36 @@ package mysticores.items; import java.util.List; import mysticores.MysticOres; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemResource extends Item { - private Icon[] icons; + private IIcon[] icons; private static final String[] RESOURCE_TYPES = new String[] { "Verdite Ingot", "Mithril Ingot", "Adamantine Ingot", "Iridium Ingot", "Iridium Nugget", "Tourmaline Gem", "Agate Gem", "Topaz Gem", "Amethyst Gem", "Mystic Powder", "Bloodstone Shard", "Glass Shard", "Obsidian Shard", "Obsidian Rod" }; - public ItemResource(int id) { - super(id); + public ItemResource() { + super(); this.setHasSubtypes(true); this.setCreativeTab(MysticOres.MysticOresTab); } @Override @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int meta) { + public IIcon getIconFromDamage(int meta) { int j = MathHelper.clamp_int(meta, 0, RESOURCE_TYPES.length); return icons[j]; } @Override @SideOnly(Side.CLIENT) - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { + public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { for (int var4 = 0; var4 < RESOURCE_TYPES.length; var4++) par3List.add(new ItemStack(par1, 1, var4)); } @@ -45,8 +45,8 @@ public class ItemResource extends Item { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - icons = new Icon[RESOURCE_TYPES.length]; + public void registerIcons(IIconRegister iconRegister) { + icons = new IIcon[RESOURCE_TYPES.length]; for (int i = 0; i < RESOURCE_TYPES.length; ++i) icons[i] = iconRegister.registerIcon("mysticores:" + RESOURCE_TYPES[i]); } diff --git a/common/MysticOres/Items/ItemSatchel.java b/common/MysticOres/Items/ItemSatchel.java index 754b242..a68d3c8 100644 --- a/common/MysticOres/Items/ItemSatchel.java +++ b/common/MysticOres/Items/ItemSatchel.java @@ -9,15 +9,15 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemSatchel extends Item { - public ItemSatchel(int par1) { - super(par1); + public ItemSatchel() { + super(); setCreativeTab(MysticOres.MysticOresTab); setMaxStackSize(1); } @Override @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack par1ItemStack) { + public boolean hasEffect(ItemStack par1ItemStack, int i) { return true; } diff --git a/common/MysticOres/Items/Items.java b/common/MysticOres/Items/Items.java index eff09e7..e4b069c 100644 --- a/common/MysticOres/Items/Items.java +++ b/common/MysticOres/Items/Items.java @@ -4,11 +4,8 @@ import java.lang.reflect.Field; import cpw.mods.fml.common.registry.GameRegistry; import mysticores.MysticOres; -import mysticores.lib.ItemID; import net.minecraft.item.Item; -import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemHoe; -import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemSword; @@ -23,62 +20,62 @@ public class Items { public static Item Satchel; public static void initialize() { - Resource = new ItemResource(ItemID.RESOURCES); - VerditeSword = new ItemSword(ItemID.VERDITESWORD, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeSword").setTextureName("mysticores:VerditeSword") + Resource = new ItemResource(); + VerditeSword = new ItemSword(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeSword").setTextureName("mysticores:VerditeSword") .setCreativeTab(MysticOres.MysticOresTab); - VerditePickaxe = new ItemPickaxe(ItemID.VERDITEPICKAXE, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditePickaxe").setTextureName("mysticores:VerditePickaxe") + VerditePickaxe = new ItemPick(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditePickaxe").setTextureName("mysticores:VerditePickaxe") .setCreativeTab(MysticOres.MysticOresTab); - VerditeShovel = new ItemSpade(ItemID.VERDITESHOVEL, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeShovel").setTextureName("mysticores:VerditeShovel") + VerditeShovel = new ItemSpade(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeShovel").setTextureName("mysticores:VerditeShovel") .setCreativeTab(MysticOres.MysticOresTab); - VerditeAxe = new ItemAxe(ItemID.VERDITEAXE, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeAxe").setTextureName("mysticores:VerditeAxe").setCreativeTab(MysticOres.MysticOresTab); - VerditeHoe = new ItemHoe(ItemID.VERDITEHOE, EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeHoe").setTextureName("mysticores:VerditeHoe").setCreativeTab(MysticOres.MysticOresTab); - MithrilSword = new ItemSword(ItemID.MITHRILSWORD, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilSword").setTextureName("mysticores:MithrilSword") + VerditeAxe = new ItemHatchet(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeAxe").setTextureName("mysticores:VerditeAxe").setCreativeTab(MysticOres.MysticOresTab); + VerditeHoe = new ItemHoe(EnumTools.verditeToolMaterial).setUnlocalizedName("VerditeHoe").setTextureName("mysticores:VerditeHoe").setCreativeTab(MysticOres.MysticOresTab); + MithrilSword = new ItemSword(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilSword").setTextureName("mysticores:MithrilSword") .setCreativeTab(MysticOres.MysticOresTab); - MithrilPickaxe = new ItemPickaxe(ItemID.MITHRILPICKAXE, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilPickaxe").setTextureName("mysticores:MithrilPickaxe") + MithrilPickaxe = new ItemPick(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilPickaxe").setTextureName("mysticores:MithrilPickaxe") .setCreativeTab(MysticOres.MysticOresTab); - MithrilShovel = new ItemSpade(ItemID.MITHRILSHOVEL, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilShovel").setTextureName("mysticores:MithrilShovel") + MithrilShovel = new ItemSpade(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilShovel").setTextureName("mysticores:MithrilShovel") .setCreativeTab(MysticOres.MysticOresTab); - MithrilAxe = new ItemAxe(ItemID.MITHRILAXE, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilAxe").setTextureName("mysticores:MithrilAxe").setCreativeTab(MysticOres.MysticOresTab); - MithrilHoe = new ItemHoe(ItemID.MITHRILHOE, EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilHoe").setTextureName("mysticores:MithrilHoe").setCreativeTab(MysticOres.MysticOresTab); - AdamantineSword = new ItemSword(ItemID.ADAMANTINESWORD, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineSword").setTextureName("mysticores:AdamantineSword") + MithrilAxe = new ItemHatchet(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilAxe").setTextureName("mysticores:MithrilAxe").setCreativeTab(MysticOres.MysticOresTab); + MithrilHoe = new ItemHoe(EnumTools.mithrilToolMaterial).setUnlocalizedName("MithrilHoe").setTextureName("mysticores:MithrilHoe").setCreativeTab(MysticOres.MysticOresTab); + AdamantineSword = new ItemSword(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineSword").setTextureName("mysticores:AdamantineSword") .setCreativeTab(MysticOres.MysticOresTab); - AdamantinePickaxe = new ItemPickaxe(ItemID.ADAMANTINEPICKAXE, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantinePickaxe").setTextureName("mysticores:AdamantinePickaxe") + AdamantinePickaxe = new ItemPick(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantinePickaxe").setTextureName("mysticores:AdamantinePickaxe") .setCreativeTab(MysticOres.MysticOresTab); - AdamantineShovel = new ItemSpade(ItemID.ADAMANTINESHOVEL, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineShovel").setTextureName("mysticores:AdamantineShovel") + AdamantineShovel = new ItemSpade(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineShovel").setTextureName("mysticores:AdamantineShovel") .setCreativeTab(MysticOres.MysticOresTab); - AdamantineAxe = new ItemAxe(ItemID.ADAMANTINEAXE, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineAxe").setTextureName("mysticores:AdamantineAxe") + AdamantineAxe = new ItemHatchet(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineAxe").setTextureName("mysticores:AdamantineAxe") .setCreativeTab(MysticOres.MysticOresTab); - AdamantineHoe = new ItemHoe(ItemID.ADAMANTINEHOE, EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineHoe").setTextureName("mysticores:AdamantineHoe") + AdamantineHoe = new ItemHoe(EnumTools.adamantineToolMaterial).setUnlocalizedName("AdamantineHoe").setTextureName("mysticores:AdamantineHoe") .setCreativeTab(MysticOres.MysticOresTab); - IridiumSword = new ItemSword(ItemID.IRIDIUMSWORD, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumSword").setTextureName("mysticores:IridiumSword") + IridiumSword = new ItemSword(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumSword").setTextureName("mysticores:IridiumSword") .setCreativeTab(MysticOres.MysticOresTab); - IridiumPickaxe = new ItemPickaxe(ItemID.IRIDIUMPICKAXE, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumPickaxe").setTextureName("mysticores:IridiumPickaxe") + IridiumPickaxe = new ItemPick(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumPickaxe").setTextureName("mysticores:IridiumPickaxe") .setCreativeTab(MysticOres.MysticOresTab); - IridiumShovel = new ItemSpade(ItemID.IRIDIUMSHOVEL, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumShovel").setTextureName("mysticores:IridiumShovel") + IridiumShovel = new ItemSpade(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumShovel").setTextureName("mysticores:IridiumShovel") .setCreativeTab(MysticOres.MysticOresTab); - IridiumAxe = new ItemAxe(ItemID.IRIDIUMAXE, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumAxe").setTextureName("mysticores:IridiumAxe").setCreativeTab(MysticOres.MysticOresTab); - IridiumHoe = new ItemHoe(ItemID.IRIDIUMHOE, EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumHoe").setTextureName("mysticores:IridiumHoe").setCreativeTab(MysticOres.MysticOresTab); - BloodstoneSword = new ItemSword(ItemID.BLOODSTONESWORD, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneSword").setTextureName("mysticores:BloodstoneSword") + IridiumAxe = new ItemHatchet(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumAxe").setTextureName("mysticores:IridiumAxe").setCreativeTab(MysticOres.MysticOresTab); + IridiumHoe = new ItemHoe(EnumTools.iridiumToolMaterial).setUnlocalizedName("IridiumHoe").setTextureName("mysticores:IridiumHoe").setCreativeTab(MysticOres.MysticOresTab); + BloodstoneSword = new ItemSword(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneSword").setTextureName("mysticores:BloodstoneSword") .setCreativeTab(MysticOres.MysticOresTab); - BloodstonePickaxe = new ItemPickaxe(ItemID.BLOODSTONEPICKAXE, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstonePickaxe").setTextureName("mysticores:BloodstonePickaxe") + BloodstonePickaxe = new ItemPick(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstonePickaxe").setTextureName("mysticores:BloodstonePickaxe") .setCreativeTab(MysticOres.MysticOresTab); - BloodstoneShovel = new ItemSpade(ItemID.BLOODSTONESHOVEL, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneShovel").setTextureName("mysticores:BloodstoneShovel") + BloodstoneShovel = new ItemSpade(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneShovel").setTextureName("mysticores:BloodstoneShovel") .setCreativeTab(MysticOres.MysticOresTab); - BloodstoneAxe = new ItemAxe(ItemID.BLOODSTONEAXE, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneAxe").setTextureName("mysticores:BloodstoneAxe") + BloodstoneAxe = new ItemHatchet(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneAxe").setTextureName("mysticores:BloodstoneAxe") .setCreativeTab(MysticOres.MysticOresTab); - BloodstoneHoe = new ItemHoe(ItemID.BLOODSTONEHOE, EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneHoe").setTextureName("mysticores:BloodstoneHoe") + BloodstoneHoe = new ItemHoe(EnumTools.bloodstoneToolMaterial).setUnlocalizedName("BloodstoneHoe").setTextureName("mysticores:BloodstoneHoe") .setCreativeTab(MysticOres.MysticOresTab); - ObsidianSword = new ItemSword(ItemID.OBSIDIANSWORD, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianSword").setTextureName("mysticores:ObsidianSword") + ObsidianSword = new ItemSword(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianSword").setTextureName("mysticores:ObsidianSword") .setCreativeTab(MysticOres.MysticOresTab); - ObsidianPickaxe = new ItemPickaxe(ItemID.OBSIDIANPICKAXE, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianPickaxe").setTextureName("mysticores:ObsidianPickaxe") + ObsidianPickaxe = new ItemPick(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianPickaxe").setTextureName("mysticores:ObsidianPickaxe") .setCreativeTab(MysticOres.MysticOresTab); - ObsidianShovel = new ItemSpade(ItemID.OBSIDIANSHOVEL, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianShovel").setTextureName("mysticores:ObsidianShovel") + ObsidianShovel = new ItemSpade(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianShovel").setTextureName("mysticores:ObsidianShovel") .setCreativeTab(MysticOres.MysticOresTab); - ObsidianAxe = new ItemAxe(ItemID.OBSIDIANAXE, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianAxe").setTextureName("mysticores:ObsidianAxe") + ObsidianAxe = new ItemHatchet(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianAxe").setTextureName("mysticores:ObsidianAxe") .setCreativeTab(MysticOres.MysticOresTab); - ObsidianHoe = new ItemHoe(ItemID.OBSIDIANHOE, EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianHoe").setTextureName("mysticores:ObsidianHoe") + ObsidianHoe = new ItemHoe(EnumTools.obsidianToolMaterial).setUnlocalizedName("ObsidianHoe").setTextureName("mysticores:ObsidianHoe") .setCreativeTab(MysticOres.MysticOresTab); - Satchel = new ItemSatchel(ItemID.SATCHEL).setUnlocalizedName("Satchel"); + Satchel = new ItemSatchel().setUnlocalizedName("Satchel"); try { for(Field f:Items.class.getFields()){ Item it = (Item) f.get(null); diff --git a/common/MysticOres/Lib/ItemID.java b/common/MysticOres/Lib/ItemID.java deleted file mode 100644 index 98a37ea..0000000 --- a/common/MysticOres/Lib/ItemID.java +++ /dev/null @@ -1,12 +0,0 @@ -package mysticores.lib; - -public class ItemID { - public static int VERDITESWORD = 7050, VERDITEPICKAXE = 7051, VERDITESHOVEL = 7052, VERDITEAXE = 7053, VERDITEHOE = 7054; - public static int MITHRILSWORD = 7055, MITHRILPICKAXE = 7056, MITHRILSHOVEL = 7057, MITHRILAXE = 7058, MITHRILHOE = 7059; - public static int ADAMANTINESWORD = 7060, ADAMANTINEPICKAXE = 7061, ADAMANTINESHOVEL = 7062, ADAMANTINEAXE = 7063, ADAMANTINEHOE = 7064; - public static int IRIDIUMSWORD = 7065, IRIDIUMPICKAXE = 7066, IRIDIUMSHOVEL = 7067, IRIDIUMAXE = 7068, IRIDIUMHOE = 7069; - public static int OBSIDIANSWORD = 7070, OBSIDIANPICKAXE = 7071, OBSIDIANSHOVEL = 7072, OBSIDIANAXE = 7073, OBSIDIANHOE = 7074; - public static int BLOODSTONESWORD = 7075, BLOODSTONEPICKAXE = 7076, BLOODSTONESHOVEL = 7077, BLOODSTONEAXE = 7078, BLOODSTONEHOE = 7079; - public static int SATCHEL = 7080; - public static int RESOURCES = 7081; -} diff --git a/common/MysticOres/MysticOres.java b/common/MysticOres/MysticOres.java index 725f328..47921ca 100644 --- a/common/MysticOres/MysticOres.java +++ b/common/MysticOres/MysticOres.java @@ -1,5 +1,7 @@ package mysticores; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import mysticores.blocks.BlockHandler; import mysticores.items.Items; import mysticores.util.ConfigurationManager; @@ -7,30 +9,38 @@ import mysticores.util.OreDictManager; import mysticores.util.RecipeManager; import mysticores.worldgen.GeneratorManager; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.IFuelHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "mysticores", name = "Mystic Ores", version = "0.1") -@NetworkMod(clientSideRequired = true) public class MysticOres implements IFuelHandler { @Instance("mysticores") public static MysticOres instance; + public boolean ENABLE = true; public static final CreativeTabs MysticOresTab = new CreativeTabs("MysticOresTab") { - @Override - public ItemStack getIconItemStack() { - return new ItemStack(BlockHandler.BlockBase, 1, 7); - } - }; + + @Override + public Item getTabIconItem() { + return Item.getItemFromBlock(BlockHandler.BlockBase); + } + + @Override + @SideOnly(Side.CLIENT) + public int func_151243_f() + { + return 7; + } + }; @Override public int getBurnTime(ItemStack fuel) { - if (fuel.getItem().itemID == Items.Resource.itemID && fuel.getItemDamage() == 4) + if (fuel.getItem() == Items.Resource && fuel.getItemDamage() == 4) return 12800; else return 0; @@ -39,11 +49,13 @@ public class MysticOres implements IFuelHandler { @EventHandler public void preInit(FMLPreInitializationEvent event) { ConfigurationManager.initialize(event.getSuggestedConfigurationFile()); - BlockHandler.initialize(); - Items.initialize(); - OreDictManager.initialize(); - RecipeManager.initialize(); - GeneratorManager.initialize(); - GameRegistry.registerFuelHandler(this); + if(ENABLE){ + BlockHandler.initialize(); + Items.initialize(); + OreDictManager.initialize(); + RecipeManager.initialize(); + GeneratorManager.initialize(); + GameRegistry.registerFuelHandler(this); + } } } \ No newline at end of file diff --git a/common/MysticOres/Util/ConfigurationManager.java b/common/MysticOres/Util/ConfigurationManager.java index bcae963..caad19a 100644 --- a/common/MysticOres/Util/ConfigurationManager.java +++ b/common/MysticOres/Util/ConfigurationManager.java @@ -2,47 +2,14 @@ package mysticores.util; import java.io.File; -import mysticores.blocks.BlockHandler; -import mysticores.lib.ItemID; +import mysticores.MysticOres; import mysticores.lib.Rarity; -import net.minecraftforge.common.Configuration; +import net.minecraftforge.common.config.Configuration; public class ConfigurationManager { public static void initialize(File file) { Configuration config = new Configuration(file); - ItemID.RESOURCES = config.getItem("Resource Items", ItemID.RESOURCES).getInt(); - ItemID.VERDITESWORD = config.getItem("Tools", "Verdite Sword", ItemID.VERDITESWORD).getInt(); - ItemID.VERDITEPICKAXE = config.getItem("Tools", "Verdite Pickaxe", ItemID.VERDITEPICKAXE).getInt(); - ItemID.VERDITESHOVEL = config.getItem("Tools", "Verdite Shovel", ItemID.VERDITESHOVEL).getInt(); - ItemID.VERDITEAXE = config.getItem("Tools", "Verdite Axe", ItemID.VERDITEAXE).getInt(); - ItemID.VERDITEHOE = config.getItem("Tools", "Verdite Hoe", ItemID.VERDITEHOE).getInt(); - ItemID.MITHRILSWORD = config.getItem("Tools", "Mithril Sword", ItemID.MITHRILSWORD).getInt(); - ItemID.MITHRILPICKAXE = config.getItem("Tools", "Mithril Pickaxe", ItemID.MITHRILPICKAXE).getInt(); - ItemID.MITHRILSHOVEL = config.getItem("Tools", "Mithril Shovel", ItemID.MITHRILSHOVEL).getInt(); - ItemID.MITHRILAXE = config.getItem("Tools", "Mithril Axe", ItemID.MITHRILAXE).getInt(); - ItemID.MITHRILHOE = config.getItem("Tools", "Mithril Hoe", ItemID.MITHRILHOE).getInt(); - ItemID.ADAMANTINESWORD = config.getItem("Tools", "Adamantine Sword", ItemID.ADAMANTINESWORD).getInt(); - ItemID.ADAMANTINEPICKAXE = config.getItem("Tools", "Adamantine Pickaxe", ItemID.ADAMANTINEPICKAXE).getInt(); - ItemID.ADAMANTINESHOVEL = config.getItem("Tools", "Adamantine Shovel", ItemID.ADAMANTINESHOVEL).getInt(); - ItemID.ADAMANTINEAXE = config.getItem("Tools", "Adamantine Axe", ItemID.ADAMANTINEAXE).getInt(); - ItemID.ADAMANTINEHOE = config.getItem("Tools", "Adamantine Hoe", ItemID.ADAMANTINEHOE).getInt(); - ItemID.IRIDIUMSWORD = config.getItem("Tools", "Iridium Sword", ItemID.IRIDIUMSWORD).getInt(); - ItemID.IRIDIUMPICKAXE = config.getItem("Tools", "Iridium Pickaxe", ItemID.IRIDIUMPICKAXE).getInt(); - ItemID.IRIDIUMSHOVEL = config.getItem("Tools", "Iridium Shovel", ItemID.IRIDIUMSHOVEL).getInt(); - ItemID.IRIDIUMAXE = config.getItem("Tools", "Iridium Axe", ItemID.IRIDIUMAXE).getInt(); - ItemID.IRIDIUMHOE = config.getItem("Tools", "Iridium Hoe", ItemID.IRIDIUMHOE).getInt(); - ItemID.BLOODSTONESWORD = config.getItem("Tools", "Bloodstone Sword", ItemID.BLOODSTONESWORD).getInt(); - ItemID.BLOODSTONEPICKAXE = config.getItem("Tools", "Bloodstone Pickaxe", ItemID.BLOODSTONEPICKAXE).getInt(); - ItemID.BLOODSTONESHOVEL = config.getItem("Tools", "Bloodstone Shovel", ItemID.BLOODSTONESHOVEL).getInt(); - ItemID.BLOODSTONEAXE = config.getItem("Tools", "Bloodstone Axe", ItemID.BLOODSTONEAXE).getInt(); - ItemID.BLOODSTONEHOE = config.getItem("Tools", "Bloodstone Hoe", ItemID.BLOODSTONEHOE).getInt(); - ItemID.OBSIDIANSWORD = config.getItem("Tools", "Obsidian Sword", ItemID.OBSIDIANSWORD).getInt(); - ItemID.OBSIDIANPICKAXE = config.getItem("Tools", "Obsidian Pickaxe", ItemID.OBSIDIANPICKAXE).getInt(); - ItemID.OBSIDIANSHOVEL = config.getItem("Tools", "Obsidian Shovel", ItemID.OBSIDIANSHOVEL).getInt(); - ItemID.OBSIDIANAXE = config.getItem("Tools", "Obsidian Axe", ItemID.OBSIDIANAXE).getInt(); - ItemID.OBSIDIANHOE = config.getItem("Tools", "Obsidian Hoe", ItemID.OBSIDIANHOE).getInt(); - ItemID.SATCHEL = config.getItem("Satchel ID", ItemID.SATCHEL).getInt(); - BlockHandler.BASEID = config.getBlock("Base Block ID", BlockHandler.BASEID).getInt(); + MysticOres.instance.ENABLE = config.get("General", "Enable", true).getBoolean(true); Rarity.VERDITE = config.get("Ore Rarity", "Verdite Ore", Rarity.VERDITE).getInt(); Rarity.MITHRIL = config.get("Ore Rarity", "Mithril Ore", Rarity.MITHRIL).getInt(); Rarity.ADAMANTINE = config.get("Ore Rarity", "Adamantine Ore", Rarity.ADAMANTINE).getInt(); diff --git a/common/MysticOres/Util/RecipeManager.java b/common/MysticOres/Util/RecipeManager.java index ee5db71..4e8488b 100644 --- a/common/MysticOres/Util/RecipeManager.java +++ b/common/MysticOres/Util/RecipeManager.java @@ -2,8 +2,7 @@ package mysticores.util; import mysticores.blocks.BlockHandler; import mysticores.items.Items; -import net.minecraft.block.Block; -import net.minecraft.item.Item; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraftforge.oredict.ShapedOreRecipe; @@ -19,31 +18,31 @@ public class RecipeManager { } private static void powderRecipes() { - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreGold, 2), OreDictManager.INGOTS[9], "oreGold")); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreIron, 2), OreDictManager.INGOTS[9], "oreIron")); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.gold_ore, 2), OreDictManager.INGOTS[9], "oreGold")); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.iron_ore, 2), OreDictManager.INGOTS[9], "oreIron")); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 2, 10), OreDictManager.INGOTS[9], OreDictManager.INGOTS[10])); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.gunpowder, 2), OreDictManager.INGOTS[9], Item.gunpowder)); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(net.minecraft.init.Items.gunpowder, 2), OreDictManager.INGOTS[9], net.minecraft.init.Items.gunpowder)); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 2, 4), OreDictManager.INGOTS[9], OreDictManager.INGOTS[4])); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreCoal, 2), OreDictManager.INGOTS[9], Block.oreCoal)); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreIron, 3), OreDictManager.INGOTS[9], "oreIron")); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreGold, 3), OreDictManager.INGOTS[9], "oreGold")); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreRedstone, 2), OreDictManager.INGOTS[9], "oreRedstone")); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreLapis, 2), OreDictManager.INGOTS[9], "oreLapis")); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.oreDiamond, 2), OreDictManager.INGOTS[9], "oreDiamond")); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.sugar, 18), OreDictManager.INGOTS[9], Item.sugar)); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.redstone, 12), OreDictManager.INGOTS[9], Item.redstone)); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.glowstone, 6), OreDictManager.INGOTS[9], Item.glowstone)); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Item.gunpowder, 3), OreDictManager.INGOTS[9], Item.gunpowder)); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.coal_ore, 2), OreDictManager.INGOTS[9], Blocks.coal_ore)); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.iron_ore, 3), OreDictManager.INGOTS[9], "oreIron")); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.gold_ore, 3), OreDictManager.INGOTS[9], "oreGold")); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.redstone_ore, 2), OreDictManager.INGOTS[9], "oreRedstone")); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.lapis_ore, 2), OreDictManager.INGOTS[9], "oreLapis")); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.diamond_ore, 2), OreDictManager.INGOTS[9], "oreDiamond")); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(net.minecraft.init.Items.sugar, 18), OreDictManager.INGOTS[9], net.minecraft.init.Items.sugar)); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(net.minecraft.init.Items.redstone, 12), OreDictManager.INGOTS[9], net.minecraft.init.Items.redstone)); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(net.minecraft.init.Items.glowstone_dust, 6), OreDictManager.INGOTS[9], net.minecraft.init.Items.glowstone_dust)); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(net.minecraft.init.Items.gunpowder, 3), OreDictManager.INGOTS[9], net.minecraft.init.Items.gunpowder)); } private static void recipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Block.glass, 1), "##", "##", '#', OreDictManager.INGOTS[11])); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Block.obsidian, 1), "##", "##", '#', OreDictManager.INGOTS[12])); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 7), "XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.glass, 1), "##", "##", '#', OreDictManager.INGOTS[11])); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.obsidian, 1), "##", "##", '#', OreDictManager.INGOTS[12])); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 7), "XXX", "XOX", "XXX", Character.valueOf('X'), Blocks.dirt, Character.valueOf('O'), OreDictManager.INGOTS[6])); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 16, 7), "XXX", "XOX", "XXX", Character.valueOf('X'), OreDictManager.ORES[3], Character.valueOf('O'), OreDictManager.INGOTS[6])); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 3), "XXX", "XOX", "XXX", Character.valueOf('X'), Block.dirt, Character.valueOf('O'), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 3), "XXX", "XOX", "XXX", Character.valueOf('X'), Blocks.dirt, Character.valueOf('O'), OreDictManager.INGOTS[8])); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 8, 12), "###", "#D#", "###", '#', OreDictManager.INGOTS[11], 'D', OreDictManager.INGOTS[12])); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockHandler.BlockBase, 1, 7), "##", "##", '#', OreDictManager.INGOTS[10])); @@ -52,21 +51,21 @@ public class RecipeManager { GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(BlockHandler.BlockBase, 2, 0), OreDictManager.INGOTS[9], OreDictManager.ORES[0])); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.Resource, 2, 13), "#", "#", '#', OreDictManager.INGOTS[12])); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.Resource, 1, 3), "###", "#O#", "###", '#', OreDictManager.INGOTS[4], 'O', OreDictManager.INGOTS[2])); - GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 11), Block.glass); - GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 12), Block.obsidian); + GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 11), Blocks.glass); + GameRegistry.addShapelessRecipe(new ItemStack(Items.Resource, 4, 12), Blocks.obsidian); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.Resource, 8, 9), OreDictManager.INGOTS[5], OreDictManager.INGOTS[7], OreDictManager.INGOTS[8], OreDictManager.INGOTS[6])); } private static void smelting() { - FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 6, new ItemStack(Items.Resource, 1, 0), 0.4F); - FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 3, new ItemStack(Items.Resource, 1, 1), 0.7F); - FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 0, new ItemStack(Items.Resource, 1, 2), 0.9F); - FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 2, new ItemStack(Items.Resource, 1, 4), 0.4F); - FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 4, new ItemStack(Items.Resource, 1, 5), 0.4F); - FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 11, new ItemStack(Items.Resource, 1, 6), 0.4F); - FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 5, new ItemStack(Items.Resource, 1, 7), 0.4F); - FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 1, new ItemStack(Items.Resource, 1, 8), 0.4F); - FurnaceRecipes.smelting().addSmelting(BlockHandler.BlockBase.blockID, 7, new ItemStack(Items.Resource, 1, 10), 0.4F); + FurnaceRecipes.smelting().func_151394_a(new ItemStack(BlockHandler.BlockBase,1, 6), new ItemStack(Items.Resource, 1, 0), 0.4F); + FurnaceRecipes.smelting().func_151394_a(new ItemStack(BlockHandler.BlockBase,1, 3), new ItemStack(Items.Resource, 1, 1), 0.7F); + FurnaceRecipes.smelting().func_151394_a(new ItemStack(BlockHandler.BlockBase,1, 0), new ItemStack(Items.Resource, 1, 2), 0.9F); + FurnaceRecipes.smelting().func_151394_a(new ItemStack(BlockHandler.BlockBase,1, 2), new ItemStack(Items.Resource, 1, 4), 0.4F); + FurnaceRecipes.smelting().func_151394_a(new ItemStack(BlockHandler.BlockBase,1, 4), new ItemStack(Items.Resource, 1, 5), 0.4F); + FurnaceRecipes.smelting().func_151394_a(new ItemStack(BlockHandler.BlockBase,1, 11), new ItemStack(Items.Resource, 1, 6), 0.4F); + FurnaceRecipes.smelting().func_151394_a(new ItemStack(BlockHandler.BlockBase,1, 5), new ItemStack(Items.Resource, 1, 7), 0.4F); + FurnaceRecipes.smelting().func_151394_a(new ItemStack(BlockHandler.BlockBase,1, 1), new ItemStack(Items.Resource, 1, 8), 0.4F); + FurnaceRecipes.smelting().func_151394_a(new ItemStack(BlockHandler.BlockBase,1, 7), new ItemStack(Items.Resource, 1, 10), 0.4F); } private static void toolRecipes() { @@ -95,16 +94,16 @@ public class RecipeManager { ToolRecipes.AdvancedShovelRecipe(Items.IridiumShovel, OreDictManager.INGOTS[3]); ToolRecipes.AdvancedAxeRecipe(Items.IridiumAxe, OreDictManager.INGOTS[3]); ToolRecipes.AdvancedHoeRecipe(Items.IridiumHoe, OreDictManager.INGOTS[3]); - ToolRecipes.AdvancedSwordRecipe(Items.ObsidianSword, new ItemStack(Block.obsidian)); - ToolRecipes.AdvancedPickaxeRecipe(Items.ObsidianPickaxe, new ItemStack(Block.obsidian)); - ToolRecipes.AdvancedShovelRecipe(Items.ObsidianShovel, new ItemStack(Block.obsidian)); - ToolRecipes.AdvancedAxeRecipe(Items.ObsidianAxe, new ItemStack(Block.obsidian)); - ToolRecipes.AdvancedHoeRecipe(Items.ObsidianHoe, new ItemStack(Block.obsidian)); + ToolRecipes.AdvancedSwordRecipe(Items.ObsidianSword, new ItemStack(Blocks.obsidian)); + ToolRecipes.AdvancedPickaxeRecipe(Items.ObsidianPickaxe, new ItemStack(Blocks.obsidian)); + ToolRecipes.AdvancedShovelRecipe(Items.ObsidianShovel, new ItemStack(Blocks.obsidian)); + ToolRecipes.AdvancedAxeRecipe(Items.ObsidianAxe, new ItemStack(Blocks.obsidian)); + ToolRecipes.AdvancedHoeRecipe(Items.ObsidianHoe, new ItemStack(Blocks.obsidian)); ToolRecipes.AdvancedSwordRecipe(Items.BloodstoneSword, OreDictManager.ORES[7]); ToolRecipes.AdvancedPickaxeRecipe(Items.BloodstonePickaxe, OreDictManager.ORES[7]); ToolRecipes.AdvancedShovelRecipe(Items.BloodstoneShovel, OreDictManager.ORES[7]); ToolRecipes.AdvancedAxeRecipe(Items.BloodstoneAxe, OreDictManager.ORES[7]); ToolRecipes.AdvancedHoeRecipe(Items.BloodstoneHoe, OreDictManager.ORES[7]); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.Satchel, 1), "#$#", "$%$", "#$#", '#', Item.silk, '$', OreDictManager.INGOTS[9], '%', Block.enderChest)); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.Satchel, 1), "#$#", "$%$", "#$#", '#', net.minecraft.init.Items.string, '$', OreDictManager.INGOTS[9], '%', Blocks.ender_chest)); } } diff --git a/common/MysticOres/Worldgen/GeneratorManager.java b/common/MysticOres/Worldgen/GeneratorManager.java index 3b8c57f..2db2afe 100644 --- a/common/MysticOres/Worldgen/GeneratorManager.java +++ b/common/MysticOres/Worldgen/GeneratorManager.java @@ -6,10 +6,10 @@ import cpw.mods.fml.common.registry.GameRegistry; public class GeneratorManager { public static void initialize() { - GameRegistry.registerWorldGenerator(new WorldGenOres()); - GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase.blockID, 7, Rarity.BLOODSTONE + 1)); - GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase.blockID, 8, Rarity.BLACKSOULSTONE + 1)); - GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase.blockID, 9, Rarity.BLUESOULSTONE + 1)); - GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase.blockID, 10, Rarity.REDSOULSTONE)); + GameRegistry.registerWorldGenerator(new WorldGenOres(), 100); + GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase, 7, Rarity.BLOODSTONE + 1), 100); + GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase, 8, Rarity.BLACKSOULSTONE + 1), 100); + GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase, 9, Rarity.BLUESOULSTONE + 1), 100); + GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase, 10, Rarity.REDSOULSTONE), 100); } } diff --git a/common/MysticOres/Worldgen/NetherGenHelper.java b/common/MysticOres/Worldgen/NetherGenHelper.java index 9e1957b..0358251 100644 --- a/common/MysticOres/Worldgen/NetherGenHelper.java +++ b/common/MysticOres/Worldgen/NetherGenHelper.java @@ -3,21 +3,22 @@ package mysticores.worldgen; import java.util.Random; import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; public class NetherGenHelper extends WorldGenerator { - private int minableBlockId; + private Block minableBlockId; private int minableBlockMeta = 0; private int numberOfBlocks; - public NetherGenHelper(int par1, int par2) { + public NetherGenHelper(Block par1, int par2) { this.minableBlockId = par1; this.numberOfBlocks = par2; } - public NetherGenHelper(int id, int meta, int number) { + public NetherGenHelper(Block id, int meta, int number) { this(id, number); minableBlockMeta = meta; } @@ -52,8 +53,8 @@ public class NetherGenHelper extends WorldGenerator { if (var39 * var39 + var42 * var42 < 1.0D) { for (int var44 = var34; var44 <= var37; ++var44) { double var45 = (var44 + 0.5D - var24) / (var28 / 2.0D); - int blocktoreplace = par1World.getBlockId(var38, var41, var44); - if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && blocktoreplace == Block.netherrack.blockID) { + Block blocktoreplace = par1World.getBlock(var38, var41, var44); + if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && blocktoreplace == Blocks.netherrack) { par1World.setBlock(var38, var41, var44, this.minableBlockId, minableBlockMeta, 3); } } diff --git a/common/MysticOres/Worldgen/NetherGenMineable.java b/common/MysticOres/Worldgen/NetherGenMineable.java index 0bc93a2..ca516da 100644 --- a/common/MysticOres/Worldgen/NetherGenMineable.java +++ b/common/MysticOres/Worldgen/NetherGenMineable.java @@ -2,6 +2,7 @@ package mysticores.worldgen; import java.util.Random; +import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenerator; @@ -10,11 +11,11 @@ import cpw.mods.fml.common.IWorldGenerator; public class NetherGenMineable implements IWorldGenerator { private WorldGenerator helper; - public NetherGenMineable(int blockId, int numBlocks) { + public NetherGenMineable(Block blockId, int numBlocks) { helper = new NetherGenHelper(blockId, numBlocks); } - public NetherGenMineable(int blockId, int meta, int numBlocks) { + public NetherGenMineable(Block blockId, int meta, int numBlocks) { helper = new NetherGenHelper(blockId, meta, numBlocks); } diff --git a/common/MysticRuins/Config.java b/common/MysticRuins/Config.java index 61c41c1..e8df56e 100644 --- a/common/MysticRuins/Config.java +++ b/common/MysticRuins/Config.java @@ -8,13 +8,14 @@ import java.util.List; import java.util.Random; import java.util.Set; +import cpw.mods.fml.common.registry.GameData; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.WeightedRandom; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.Configuration; +import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.DungeonHooks.DungeonMob; public class Config { @@ -25,10 +26,8 @@ public class Config { public static final String[] allows = { "Ruin allowed dimension id", "Dungeon allowed dimension id", "Ruin allowed biome id", "Dungeon allowed biome id" }; public static Set[] allowType = new HashSet[2]; public static List dungeonMobs = new ArrayList(); - public static final String commonItems = Item.pickaxeIron.itemID + "," + Item.axeIron.itemID + "," + Item.swordIron.itemID + "," + Item.shovelIron.itemID + "," + Item.ingotGold.itemID + "," - + Item.ingotIron.itemID; - public static final String rareItems = Item.enderPearl.itemID + ":4," + Item.diamond.itemID + "," + Item.emerald.itemID + "," + Item.appleGold.itemID + "," + Item.ingotGold.itemID + "," - + Item.ingotIron.itemID; + public static final String commonItems = "iron_pickaxe,iron_axe,iron_sword,iron_shovel,gold_ingot,iron_ingot"; + public static final String rareItems = "ender_pearl:4,diamond,emerald,golden_apple,gold_ingot,iron_ingot"; public static void addDungeonMob(String name, int rarity) { for (DungeonMob mob : dungeonMobs) { @@ -50,7 +49,7 @@ public class Config { public static void initialize(File file) { config = new Configuration(file); - config.load(); + MysticRuins.ENABLE = config.get("General", "Enable", true).getBoolean(true); String[] mobs = config.get("DungeonMobs", "Spawner Type & Relative Chance", "Skeleton-50,Spider-50,Zombie-20,Cavepider-10,Blaze-1", "MobName-RelativeWeight").getString().split(","); String[] mob; for (String txt : mobs) { @@ -121,12 +120,12 @@ public class Config { int j = Integer.parseInt(txt.trim()); allowId[i].add(j); if (i > 1) { - allowType[i - 2].addAll(Arrays.asList(BiomeDictionary.getTypesForBiome(BiomeGenBase.biomeList[j]))); + allowType[i - 2].addAll(Arrays.asList(BiomeDictionary.getTypesForBiome(BiomeGenBase.getBiomeGenArray()[j]))); } } catch (NumberFormatException e) { if (i > 1) { if (txt.equals("*") || txt.equalsIgnoreCase("ALL")) { - for (int j = 0; j < BiomeGenBase.biomeList.length; j++) { + for (int j = 0; j < BiomeGenBase.getBiomeGenArray().length; j++) { allowId[i].add(j); } for (Type t : Type.values()) { @@ -151,11 +150,12 @@ public class Config { } private static void setChest(String type, String list, List valuables) { - String[] items = config.get("Chests", type, list, "itemid:stacksize:damage").getString().split(","); + String[] items = config.get("Chests", type, list, "itemname:stacksize:damage").getString().split(","); String[] item; for (String txt : items) { item = txt.split(":"); - int id = -1, amount = 1, data = 0; + Item id = null; + int amount = 1, data = 0; try { switch (item.length) { case 3: @@ -163,7 +163,7 @@ public class Config { case 2: amount = Integer.parseInt(item[1]); case 1: - id = Integer.parseInt(item[0]); + id = GameData.itemRegistry.get(item[0]); break; default: continue; @@ -171,7 +171,7 @@ public class Config { } catch (NumberFormatException n) { continue; } - if (id > 0 && amount > 0 && data >= 0) { + if (id != null && amount > 0 && data >= 0) { valuables.add(new ItemStack(id, amount, data)); } } diff --git a/common/MysticRuins/MysticRuins.java b/common/MysticRuins/MysticRuins.java index de65ea6..9825303 100644 --- a/common/MysticRuins/MysticRuins.java +++ b/common/MysticRuins/MysticRuins.java @@ -1,25 +1,17 @@ package mysticruins; -import java.io.File; - import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "MysticRuins", name = "Mystic Ruins", version = "0.1") public class MysticRuins { - public static File file; - - @EventHandler - public void modsLoaded(FMLPostInitializationEvent event) { - Config.initialize(file); - } - + public static boolean ENABLE = true; @EventHandler public void preInit(FMLPreInitializationEvent event) { - file = event.getSuggestedConfigurationFile(); - GameRegistry.registerWorldGenerator(new WorldGenMystic()); + Config.initialize(event.getSuggestedConfigurationFile()); + if(ENABLE) + GameRegistry.registerWorldGenerator(new WorldGenMystic(), 20); } } diff --git a/common/MysticRuins/StructureMysticDungeon.java b/common/MysticRuins/StructureMysticDungeon.java index 25f5122..57b7edd 100644 --- a/common/MysticRuins/StructureMysticDungeon.java +++ b/common/MysticRuins/StructureMysticDungeon.java @@ -3,6 +3,7 @@ package mysticruins; import java.util.Random; import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; @@ -21,73 +22,73 @@ public class StructureMysticDungeon extends WorldGenerator { return false; } if (world.isAirBlock(j1 - 1, k1 + 1, l1) && world.isAirBlock(j1 - 1, k1 + 1, l1 + 1) && world.isAirBlock(j1 - 1, k1 + 2, l1) && world.isAirBlock(j1 - 1, k1 + 2, l1 + 1) - && world.getBlockId(j1, k1, l1) == Block.stone.blockID && world.getBlockId(j1, k1, l1 + 1) == Block.stone.blockID && world.getBlockId(j1 - 1, k1, l1) == Block.stone.blockID - && world.getBlockId(j1 - 1, k1, l1 + 1) == Block.stone.blockID && world.getBlockId(j1, k1 + 1, l1) == Block.stone.blockID - && world.getBlockId(j1, k1 + 1, l1 + 1) == Block.stone.blockID) + && world.getBlock(j1, k1, l1) == Blocks.stone && world.getBlock(j1, k1, l1 + 1) == Blocks.stone && world.getBlock(j1 - 1, k1, l1) == Blocks.stone + && world.getBlock(j1 - 1, k1, l1 + 1) == Blocks.stone && world.getBlock(j1, k1 + 1, l1) == Blocks.stone + && world.getBlock(j1, k1 + 1, l1 + 1) == Blocks.stone) flag = true; if (!flag) { return false; } - setBlock(world, j1, k1 + 1, l1, 0); - setBlock(world, j1, k1 + 2, l1, 0); - setBlock(world, j1 - 1, k1 + 1, l1 + 2, 0); - setBlock(world, j1 - 1, k1 + 1, l1 + 3, 0); - setBlock(world, j1 - 1, k1 + 2, l1 + 2, 0); + setBlock(world, j1, k1 + 1, l1); + setBlock(world, j1, k1 + 2, l1); + setBlock(world, j1 - 1, k1 + 1, l1 + 2); + setBlock(world, j1 - 1, k1 + 1, l1 + 3); + setBlock(world, j1 - 1, k1 + 2, l1 + 2); for (int y = k1 + 1; y < k1 + 4; y++) { for (int x = 1; x < 6; x++) { - setBlock(world, j1 - x, y, l1, 0); - setBlock(world, j1 - x, y, l1 + 1, 0); - setBlock(world, j1 - x, y, l1 - 1, 0); + setBlock(world, j1 - x, y, l1); + setBlock(world, j1 - x, y, l1 + 1); + setBlock(world, j1 - x, y, l1 - 1); } } - setBlock(world, j1 - 2, k1 + 1, l1 + 2, 0); + setBlock(world, j1 - 2, k1 + 1, l1 + 2); for (int x = 6; x < 17; x++) { for (int y = 1; y < 5; y++) { - setBlock(world, j1 - x, k1 + y, l1, 0); + setBlock(world, j1 - x, k1 + y, l1); } } - setBlock(world, j1 - 15, k1 + 14, l1, 0); + setBlock(world, j1 - 15, k1 + 14, l1); int i2 = random.nextInt(100); if (i2 <= 40) { for (int z = 1; z < 9; z++) { - setBlock(world, j1 - 16, k1 + 11, l1 - z, 0); - setBlock(world, j1 - 16, k1 + 12, l1 - z, 0); + setBlock(world, j1 - 16, k1 + 11, l1 - z); + setBlock(world, j1 - 16, k1 + 12, l1 - z); } - setBlock(world, j1 - 16, k1 + 13, l1 - 8, 0); - setBlock(world, j1 - 16, k1 + 14, l1 - 8, 0); + setBlock(world, j1 - 16, k1 + 13, l1 - 8); + setBlock(world, j1 - 16, k1 + 14, l1 - 8); for (int z = 0; z < 5; z++) { for (int y = 12; y < 16; y++) { - setBlock(world, j1 - 16, k1 + y + z, l1 - 9 + z, 0); + setBlock(world, j1 - 16, k1 + y + z, l1 - 9 + z); } } - setBlock(world, j1 - 16, k1 + 20, l1 - 13, 0); + setBlock(world, j1 - 16, k1 + 20, l1 - 13); int j2 = random.nextInt(100); if (j2 <= 20) { for (int x = 0; x < 3; x++) { for (int z = 15; z < 18; z++) { - setBlock(world, j1 - 15 - x, k1 + 17, l1 - z, 0); - setBlock(world, j1 - 15 - x, k1 + 18, l1 - z, 0); + setBlock(world, j1 - 15 - x, k1 + 17, l1 - z); + setBlock(world, j1 - 15 - x, k1 + 18, l1 - z); } } - setBlock(world, j1 - 16, k1 + 16, l1 - 15, Block.blockLapis.blockID); + setBlock(world, j1 - 16, k1 + 16, l1 - 15, Blocks.lapis_block); setBlock(world, j1 - 16, k1 + 16, l1 - 16, pickBlock(random)); - setBlock(world, j1 - 16, k1 + 16, l1 - 17, Block.blockLapis.blockID); + setBlock(world, j1 - 16, k1 + 16, l1 - 17, Blocks.lapis_block); for (int z = 15; z < 18; z++) { - setBlock(world, j1 - 15, k1 + 16, l1 - z, Block.blockLapis.blockID); - setBlock(world, j1 - 17, k1 + 16, l1 - z, Block.blockLapis.blockID); + setBlock(world, j1 - 15, k1 + 16, l1 - z, Blocks.lapis_block); + setBlock(world, j1 - 17, k1 + 16, l1 - z, Blocks.lapis_block); } - setBlock(world, j1 - 16, k1 + 17, l1 - 16, Block.chest.blockID); - ChestFiller.fillWithRares(world.getBlockTileEntity(j1 - 16, k1 + 17, l1 - 16)); + setBlock(world, j1 - 16, k1 + 17, l1 - 16, Blocks.chest); + ChestFiller.fillWithRares(world.getTileEntity(j1 - 16, k1 + 17, l1 - 16)); } } for (int z = 0; z < 12; z++) { for (int y = k1 + 12 + z; y < k1 + 16 + z; y++) { - setBlock(world, j1 - 16, y, l1 + 1 + z, 0); + setBlock(world, j1 - 16, y, l1 + 1 + z); } } - setBlock(world, j1 - 16, k1 + 24, l1 + 9, 0); - setBlock(world, j1, k1 + 1, l1, 0); - setBlock(world, j1, k1 + 2, l1, 0); + setBlock(world, j1 - 16, k1 + 24, l1 + 9); + setBlock(world, j1, k1 + 1, l1); + setBlock(world, j1, k1 + 2, l1); setBlock(world, j1, k1, l1, pickBlock(random)); setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); @@ -100,19 +101,19 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 + 3, l1, pickBlock(random)); int k2 = random.nextInt(100); if (k2 <= 40) { - setBlock(world, j1 - 1, k1 + 3, l1, Block.vine.blockID); - setBlock(world, j1 - 1, k1 + 3, l1 + 1, Block.vine.blockID); - setBlock(world, j1 - 2, k1 + 3, l1 - 1, Block.vine.blockID); - setBlock(world, j1 - 3, k1 + 3, l1 + 2, Block.vine.blockID); + setBlock(world, j1 - 1, k1 + 3, l1, Blocks.vine); + setBlock(world, j1 - 1, k1 + 3, l1 + 1, Blocks.vine); + setBlock(world, j1 - 2, k1 + 3, l1 - 1, Blocks.vine); + setBlock(world, j1 - 3, k1 + 3, l1 + 2, Blocks.vine); } j1++; setBlock(world, j1, k1, l1, pickBlock(random)); setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); for (int y = 1; y < 4; y++) { - setBlock(world, j1, k1 + y, l1, 0); - setBlock(world, j1, k1 + y, l1 + 1, 0); - setBlock(world, j1, k1 + y, l1 - 1, 0); + setBlock(world, j1, k1 + y, l1); + setBlock(world, j1, k1 + y, l1 + 1); + setBlock(world, j1, k1 + y, l1 - 1); } setBlock(world, j1, k1 + 1, l1 - 2, pickBlock(random)); j1++; @@ -120,9 +121,9 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); for (int y = 1; y < 4; y++) { - setBlock(world, j1, k1 + y, l1, 0); - setBlock(world, j1, k1 + y, l1 + 1, 0); - setBlock(world, j1, k1 + y, l1 - 1, 0); + setBlock(world, j1, k1 + y, l1); + setBlock(world, j1, k1 + y, l1 + 1); + setBlock(world, j1, k1 + y, l1 - 1); } setBlock(world, j1, k1 + 2, l1 + 2, pickBlock(random)); setBlock(world, j1, k1 + 3, l1 + 2, pickBlock(random)); @@ -131,18 +132,18 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); for (int y = 1; y < 4; y++) { - setBlock(world, j1, k1 + y, l1, 0); - setBlock(world, j1, k1 + y, l1 + 1, 0); - setBlock(world, j1, k1 + y, l1 - 1, 0); + setBlock(world, j1, k1 + y, l1); + setBlock(world, j1, k1 + y, l1 + 1); + setBlock(world, j1, k1 + y, l1 - 1); } j1++; setBlock(world, j1, k1, l1, pickBlock(random)); setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); for (int y = 1; y < 4; y++) { - setBlock(world, j1, k1 + y, l1, 0); - setBlock(world, j1, k1 + y, l1 + 1, 0); - setBlock(world, j1, k1 + y, l1 - 1, 0); + setBlock(world, j1, k1 + y, l1); + setBlock(world, j1, k1 + y, l1 + 1); + setBlock(world, j1, k1 + y, l1 - 1); } setBlock(world, j1, k1 + 1, l1 + 2, pickBlock(random)); j1++; @@ -150,9 +151,9 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); for (int y = 1; y < 4; y++) { - setBlock(world, j1, k1 + y, l1, 0); - setBlock(world, j1, k1 + y, l1 + 1, 0); - setBlock(world, j1, k1 + y, l1 - 1, 0); + setBlock(world, j1, k1 + y, l1); + setBlock(world, j1, k1 + y, l1 + 1); + setBlock(world, j1, k1 + y, l1 - 1); } setBlock(world, j1, k1 + 1, l1 - 2, pickBlock(random)); setBlock(world, j1, k1 + 2, l1 - 2, pickBlock(random)); @@ -161,52 +162,52 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); for (int y = 1; y < 4; y++) { - setBlock(world, j1, k1 + y, l1, 0); - setBlock(world, j1, k1 + y, l1 + 1, 0); - setBlock(world, j1, k1 + y, l1 - 1, 0); + setBlock(world, j1, k1 + y, l1); + setBlock(world, j1, k1 + y, l1 + 1); + setBlock(world, j1, k1 + y, l1 - 1); } int l2 = random.nextInt(100); if (l2 <= 30) { - setBlock(world, j1 - 1, k1 + 3, l1, Block.vine.blockID); - setBlock(world, j1 - 1, k1 + 3, l1 + 2, Block.vine.blockID); - setBlock(world, j1 - 2, k1 + 3, l1 - 1, Block.vine.blockID); - setBlock(world, j1 - 3, k1 + 3, l1 + 1, Block.vine.blockID); - setBlock(world, j1 - 5, k1 + 3, l1, Block.vine.blockID); + setBlock(world, j1 - 1, k1 + 3, l1, Blocks.vine); + setBlock(world, j1 - 1, k1 + 3, l1 + 2, Blocks.vine); + setBlock(world, j1 - 2, k1 + 3, l1 - 1, Blocks.vine); + setBlock(world, j1 - 3, k1 + 3, l1 + 1, Blocks.vine); + setBlock(world, j1 - 5, k1 + 3, l1, Blocks.vine); } int i3 = random.nextInt(100); if (i3 <= 40) { for (int z = 2; z < 10; z++) { - setBlock(world, j1, k1 + 1, l1 - z, 0); - setBlock(world, j1, k1 + 2, l1 - z, 0); + setBlock(world, j1, k1 + 1, l1 - z); + setBlock(world, j1, k1 + 2, l1 - z); } for (int z = 0; z < 14; z++) { for (int y = k1 + 1 + z; y < k + 5 + z; y++) { - setBlock(world, j1, y, l1 - 10 - z, 0); + setBlock(world, j1, y, l1 - 10 - z); } } - setBlock(world, j1, k1 + 15, l1 - 20, 0); - setBlock(world, j1, k1 + 16, l1 - 21, 0); + setBlock(world, j1, k1 + 15, l1 - 20); + setBlock(world, j1, k1 + 16, l1 - 21); int j3 = random.nextInt(100); if (j3 <= 20) { for (int x = -1; x < 2; x++) { - setBlock(world, j1 + x, k1 + 15, l1 - 25, 0); - setBlock(world, j1 + x, k1 + 16, l1 - 25, 0); - setBlock(world, j1 + x, k1 + 15, l1 - 26, 0); - setBlock(world, j1 + x, k1 + 16, l1 - 26, 0); - setBlock(world, j1 + x, k1 + 15, l1 - 27, 0); - setBlock(world, j1 + x, k1 + 16, l1 - 27, 0); + setBlock(world, j1 + x, k1 + 15, l1 - 25); + setBlock(world, j1 + x, k1 + 16, l1 - 25); + setBlock(world, j1 + x, k1 + 15, l1 - 26); + setBlock(world, j1 + x, k1 + 16, l1 - 26); + setBlock(world, j1 + x, k1 + 15, l1 - 27); + setBlock(world, j1 + x, k1 + 16, l1 - 27); } - setBlock(world, j1 - 16, k1 + 14, l1 - 15, 0); + setBlock(world, j1 - 16, k1 + 14, l1 - 15); setBlock(world, j1 - 16, k1 + 14, l1 - 16, pickBlock(random)); - setBlock(world, j1 - 16, k1 + 14, l1 - 17, 0); - setBlock(world, j1 - 15, k1 + 14, l1 - 15, 0); - setBlock(world, j1 - 15, k1 + 14, l1 - 16, 0); - setBlock(world, j1 - 15, k1 + 14, l1 - 17, 0); - setBlock(world, j1 - 17, k1 + 14, l1 - 15, 0); - setBlock(world, j1 - 17, k1 + 14, l1 - 16, 0); - setBlock(world, j1 - 17, k1 + 14, l1 - 17, 0); - setBlock(world, j1 - 16, k1 + 15, l1 - 16, Block.chest.blockID); - ChestFiller.fillWithValuables(world.getBlockTileEntity(j1 - 16, k1 + 15, l1 - 16)); + setBlock(world, j1 - 16, k1 + 14, l1 - 17); + setBlock(world, j1 - 15, k1 + 14, l1 - 15); + setBlock(world, j1 - 15, k1 + 14, l1 - 16); + setBlock(world, j1 - 15, k1 + 14, l1 - 17); + setBlock(world, j1 - 17, k1 + 14, l1 - 15); + setBlock(world, j1 - 17, k1 + 14, l1 - 16); + setBlock(world, j1 - 17, k1 + 14, l1 - 17); + setBlock(world, j1 - 16, k1 + 15, l1 - 16, Blocks.chest); + ChestFiller.fillWithValuables(world.getTileEntity(j1 - 16, k1 + 15, l1 - 16)); } } j1++; @@ -214,9 +215,9 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); for (int y = 1; y < 4; y++) { - setBlock(world, j1, k1 + y, l1, 0); - setBlock(world, j1, k1 + y, l1 + 1, 0); - setBlock(world, j1, k1 + y, l1 - 1, 0); + setBlock(world, j1, k1 + y, l1); + setBlock(world, j1, k1 + y, l1 + 1); + setBlock(world, j1, k1 + y, l1 - 1); } setBlock(world, j1, k1 + 1, l1 + 2, pickBlock(random)); j1++; @@ -224,18 +225,18 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); for (int y = 1; y < 4; y++) { - setBlock(world, j1, k1 + y, l1, 0); - setBlock(world, j1, k1 + y, l1 + 1, 0); - setBlock(world, j1, k1 + y, l1 - 1, 0); + setBlock(world, j1, k1 + y, l1); + setBlock(world, j1, k1 + y, l1 + 1); + setBlock(world, j1, k1 + y, l1 - 1); } j1++; setBlock(world, j1, k1, l1, pickBlock(random)); setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); for (int y = 1; y < 4; y++) { - setBlock(world, j1, k1 + y, l1, 0); - setBlock(world, j1, k1 + y, l1 + 1, 0); - setBlock(world, j1, k1 + y, l1 - 1, 0); + setBlock(world, j1, k1 + y, l1); + setBlock(world, j1, k1 + y, l1 + 1); + setBlock(world, j1, k1 + y, l1 - 1); } setBlock(world, j1, k1 + 3, l1 + 2, pickBlock(random)); setBlock(world, j1, k1 + 1, l1 - 2, pickBlock(random)); @@ -244,30 +245,30 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); for (int y = 1; y < 4; y++) { - setBlock(world, j1, k1 + y, l1, 0); - setBlock(world, j1, k1 + y, l1 + 1, 0); - setBlock(world, j1, k1 + y, l1 - 1, 0); + setBlock(world, j1, k1 + y, l1); + setBlock(world, j1, k1 + y, l1 + 1); + setBlock(world, j1, k1 + y, l1 - 1); } - setBlock(world, j1, k1 + 1, l1 + 2, 0); - setBlock(world, j1, k1 + 1, l1 - 2, 0); - setBlock(world, j1, k1 + 2, l1 + 2, 0); + setBlock(world, j1, k1 + 1, l1 + 2); + setBlock(world, j1, k1 + 1, l1 - 2); + setBlock(world, j1, k1 + 2, l1 + 2); j1++; setBlock(world, j1, k1, l1, pickBlock(random)); setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); for (int y = 1; y < 4; y++) { for (int z = -2; z < 3; z++) { - setBlock(world, j1, k1 + y, l1 + z, 0); + setBlock(world, j1, k1 + y, l1 + z); } } - setBlock(world, j1, k1 + 1, l1 + 3, 0); - setBlock(world, j1, k1 + 3, l1 - 3, 0); + setBlock(world, j1, k1 + 1, l1 + 3); + setBlock(world, j1, k1 + 3, l1 - 3); setBlock(world, j1, k1 + 1, l1 + 2, pickBlock(random)); setBlock(world, j1, k1 + 2, l1 + 2, pickBlock(random)); setBlock(world, j1, k1 + 1, l1 - 2, pickBlock(random)); j1++; - setBlock(world, j1, k1 + 1, l1, 0); - setBlock(world, j1, k1 + 2, l1, 0); + setBlock(world, j1, k1 + 1, l1); + setBlock(world, j1, k1 + 2, l1); setBlock(world, j1, k1, l1, pickBlock(random)); setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); @@ -293,7 +294,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 4, pickBlock(random)); for (int y = 1; y < 5; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 + y, l1 + z, 0); + setBlock(world, j1, k1 + y, l1 + z); } } setBlock(world, j1, k1 + 1, l1 + 5, pickBlock(random)); @@ -311,8 +312,8 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 4, pickBlock(random)); for (int u = 0; u < 5; u++) { for (int y = 1; y < 5; y++) { - setBlock(world, j1, k1 + y, l1 + u, 0); - setBlock(world, j1, k1 + y, l1 - u, 0); + setBlock(world, j1, k1 + y, l1 + u); + setBlock(world, j1, k1 + y, l1 - u); } } setBlock(world, j1, k1 + 1, l1 + 5, pickBlock(random)); @@ -324,19 +325,19 @@ public class StructureMysticDungeon extends WorldGenerator { int k4 = random.nextInt(100); if (k4 <= 60) { for (int u = 1; u < 4; u++) { - setBlock(world, j1, k1 + u, l1 + u, Block.bookShelf.blockID); + setBlock(world, j1, k1 + u, l1 + u, Blocks.bookshelf); } } } if (l3 == 2) { int l4 = random.nextInt(100); if (l4 <= 40) { - setBlock(world, j1, k1 + 1, l1 + 1, Block.blockIron.blockID); - setBlock(world, j1, k1 + 2, l1 + 1, Block.blockIron.blockID); - setBlock(world, j1, k1 + 1, l1 + 2, Block.blockIron.blockID); - setBlock(world, j1, k1 + 2, l1 + 2, 0); - setBlock(world, j1, k1 + 3, l1 + 2, 0); - setBlock(world, j1, k1 + 1, l1 + 3, 0); + setBlock(world, j1, k1 + 1, l1 + 1, Blocks.iron_block); + setBlock(world, j1, k1 + 2, l1 + 1, Blocks.iron_block); + setBlock(world, j1, k1 + 1, l1 + 2, Blocks.iron_block); + setBlock(world, j1, k1 + 2, l1 + 2); + setBlock(world, j1, k1 + 3, l1 + 2); + setBlock(world, j1, k1 + 1, l1 + 3); } } j1++; @@ -351,8 +352,8 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 4, pickBlock(random)); for (int u = 0; u < 5; u++) { for (int y = 1; y < 5; y++) { - setBlock(world, j1, k1 + y, l1 + u, 0); - setBlock(world, j1, k1 + y, l1 - u, 0); + setBlock(world, j1, k1 + y, l1 + u); + setBlock(world, j1, k1 + y, l1 - u); } } setBlock(world, j1, k1 + 2, l1 + 5, pickBlock(random)); @@ -361,10 +362,10 @@ public class StructureMysticDungeon extends WorldGenerator { if (l3 == 2) { int i5 = random.nextInt(100); if (i5 <= 40) { - setBlock(world, j1, k1 + 1, l1 + 1, Block.blockIron.blockID); - setBlock(world, j1, k1 + 1, l1 + 2, Block.blockIron.blockID); - setBlock(world, j1, k1 + 2, l1 + 2, 0); - setBlock(world, j1, k1 + 1, l1 + 3, 0); + setBlock(world, j1, k1 + 1, l1 + 1, Blocks.iron_block); + setBlock(world, j1, k1 + 1, l1 + 2, Blocks.iron_block); + setBlock(world, j1, k1 + 2, l1 + 2); + setBlock(world, j1, k1 + 1, l1 + 3); } } j1++; @@ -379,8 +380,8 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 4, pickBlock(random)); for (int u = 0; u < 5; u++) { for (int y = 1; y < 5; y++) { - setBlock(world, j1, k1 + y, l1 + u, 0); - setBlock(world, j1, k1 + y, l1 - u, 0); + setBlock(world, j1, k1 + y, l1 + u); + setBlock(world, j1, k1 + y, l1 - u); } } setBlock(world, j1, k1 + 1, l1 + 5, pickBlock(random)); @@ -390,27 +391,27 @@ public class StructureMysticDungeon extends WorldGenerator { if (l3 == 1) { int j5 = random.nextInt(100); if (j5 <= 15) { - setBlock(world, j1, k1 + 1, l1 + 1, Block.mobSpawner.blockID); - TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getBlockTileEntity(j1, k1 + 1, l1 + 1); + setBlock(world, j1, k1 + 1, l1 + 1, Blocks.mob_spawner); + TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(j1, k1 + 1, l1 + 1); if (spawner != null) { - spawner.getSpawnerLogic().setMobID(Config.getRandomDungeonMob(random)); + spawner.func_145881_a().setEntityName(Config.getRandomDungeonMob(random)); } - setBlock(world, j1, k1 + 2, l1 + 1, Block.chest.blockID); - ChestFiller.fillWithRares(world.getBlockTileEntity(j1, k1 + 2, l1 + 1)); - setBlock(world, j1, k1 + 3, l1 + 1, Block.mobSpawner.blockID); - spawner = (TileEntityMobSpawner) world.getBlockTileEntity(j1, k1 + 3, l1 + 1); + setBlock(world, j1, k1 + 2, l1 + 1, Blocks.chest); + ChestFiller.fillWithRares(world.getTileEntity(j1, k1 + 2, l1 + 1)); + setBlock(world, j1, k1 + 3, l1 + 1, Blocks.mob_spawner); + spawner = (TileEntityMobSpawner) world.getTileEntity(j1, k1 + 3, l1 + 1); if (spawner != null) { - spawner.getSpawnerLogic().setMobID(Config.getRandomDungeonMob(random)); + spawner.func_145881_a().setEntityName(Config.getRandomDungeonMob(random)); } - setBlock(world, j1, k1 + 1, l1 + 2, 0); - setBlock(world, j1, k1 + 2, l1 + 2, 0); - setBlock(world, j1, k1 + 3, l1 + 2, 0); - setBlock(world, j1, k1 + 1, l1 + 3, 0); - setBlock(world, j1, k1 + 2, l1 + 3, 0); - setBlock(world, j1, k1 + 3, l1 + 3, 0); + setBlock(world, j1, k1 + 1, l1 + 2); + setBlock(world, j1, k1 + 2, l1 + 2); + setBlock(world, j1, k1 + 3, l1 + 2); + setBlock(world, j1, k1 + 1, l1 + 3); + setBlock(world, j1, k1 + 2, l1 + 3); + setBlock(world, j1, k1 + 3, l1 + 3); } - setBlock(world, j1, k1 + 1, l1 - 2, Block.planks.blockID); - setBlock(world, j1, k1 + 1, l1 - 3, Block.planks.blockID); + setBlock(world, j1, k1 + 1, l1 - 2, Blocks.planks); + setBlock(world, j1, k1 + 1, l1 - 3, Blocks.planks); } j1++; setBlock(world, j1, k1, l1, pickBlock(random)); @@ -424,27 +425,27 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 4, pickBlock(random)); for (int u = 0; u < 5; u++) { for (int y = 1; y < 5; y++) { - setBlock(world, j1, k1 + y, l1 + u, 0); - setBlock(world, j1, k1 + y, l1 - u, 0); + setBlock(world, j1, k1 + y, l1 + u); + setBlock(world, j1, k1 + y, l1 - u); } } setBlock(world, j1, k1 + 1, l1 + 5, pickBlock(random)); setBlock(world, j1, k1 + 2, l1 + 5, pickBlock(random)); setBlock(world, j1, k1 + 1, l1 - 5, pickBlock(random)); if (l3 == 1) { - setBlock(world, j1, k1 + 1, l1 - 2, Block.planks.blockID); - setBlock(world, j1, k1 + 1, l1 - 3, Block.planks.blockID); + setBlock(world, j1, k1 + 1, l1 - 2, Blocks.planks); + setBlock(world, j1, k1 + 1, l1 - 3, Blocks.planks); } if (l3 == 2) { int k5 = random.nextInt(100); if (k5 <= 30) { - setBlock(world, j1, k1 + 1, l1 + 1, Block.blockIron.blockID); - setBlock(world, j1, k1 + 1, l1 + 2, Block.blockIron.blockID); - setBlock(world, j1, k1 + 2, l1 + 2, Block.blockIron.blockID); - setBlock(world, j1, k1 + 1, l1 + 3, Block.mobSpawner.blockID); - TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getBlockTileEntity(j1, k1 + 1, l1 + 3); + setBlock(world, j1, k1 + 1, l1 + 1, Blocks.iron_block); + setBlock(world, j1, k1 + 1, l1 + 2, Blocks.iron_block); + setBlock(world, j1, k1 + 2, l1 + 2, Blocks.iron_block); + setBlock(world, j1, k1 + 1, l1 + 3, Blocks.mob_spawner); + TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(j1, k1 + 1, l1 + 3); if (spawner != null) { - spawner.getSpawnerLogic().setMobID(Config.getRandomDungeonMob(random)); + spawner.func_145881_a().setEntityName(Config.getRandomDungeonMob(random)); } } } @@ -460,8 +461,8 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 4, pickBlock(random)); for (int u = 0; u < 5; u++) { for (int y = 1; y < 5; y++) { - setBlock(world, j1, k1 + y, l1 + u, 0); - setBlock(world, j1, k1 + y, l1 - u, 0); + setBlock(world, j1, k1 + y, l1 + u); + setBlock(world, j1, k1 + y, l1 - u); } } setBlock(world, j1, k1 + 1, l1 + 5, pickBlock(random)); @@ -470,31 +471,31 @@ public class StructureMysticDungeon extends WorldGenerator { if (l3 == 1) { int l5 = random.nextInt(100); if (l5 <= 60) { - setBlock(world, j1, k1 + 1, l1 + 1, Block.bookShelf.blockID); - setBlock(world, j1, k1 + 2, l1 + 1, Block.bookShelf.blockID); - setBlock(world, j1, k1 + 3, l1 + 1, Block.bookShelf.blockID); - setBlock(world, j1, k1 + 1, l1 + 2, Block.bookShelf.blockID); - setBlock(world, j1, k1 + 2, l1 + 2, Block.mobSpawner.blockID); - TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getBlockTileEntity(j1, k1 + 2, l1 + 2); + setBlock(world, j1, k1 + 1, l1 + 1, Blocks.bookshelf); + setBlock(world, j1, k1 + 2, l1 + 1, Blocks.bookshelf); + setBlock(world, j1, k1 + 3, l1 + 1, Blocks.bookshelf); + setBlock(world, j1, k1 + 1, l1 + 2, Blocks.bookshelf); + setBlock(world, j1, k1 + 2, l1 + 2, Blocks.mob_spawner); + TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(j1, k1 + 2, l1 + 2); if (spawner != null) { - spawner.getSpawnerLogic().setMobID(Config.getRandomDungeonMob(random)); + spawner.func_145881_a().setEntityName(Config.getRandomDungeonMob(random)); } - setBlock(world, j1, k1 + 3, l1 + 2, Block.bookShelf.blockID); - setBlock(world, j1, k1 + 1, l1 + 3, Block.bookShelf.blockID); - setBlock(world, j1, k1 + 2, l1 + 3, Block.bookShelf.blockID); - setBlock(world, j1, k1 + 3, l1 + 3, Block.bookShelf.blockID); + setBlock(world, j1, k1 + 3, l1 + 2, Blocks.bookshelf); + setBlock(world, j1, k1 + 1, l1 + 3, Blocks.bookshelf); + setBlock(world, j1, k1 + 2, l1 + 3, Blocks.bookshelf); + setBlock(world, j1, k1 + 3, l1 + 3, Blocks.bookshelf); } - setBlock(world, j1, k1 + 1, l1 - 2, Block.planks.blockID); - setBlock(world, j1, k1 + 1, l1 - 3, Block.planks.blockID); + setBlock(world, j1, k1 + 1, l1 - 2, Blocks.planks); + setBlock(world, j1, k1 + 1, l1 - 3, Blocks.planks); } int i6 = random.nextInt(100); if (i6 <= 30) { - setBlock(world, j1 - 1, k1 + 4, l1 + 3, Block.vine.blockID); - setBlock(world, j1 - 1, k1 + 4, l1 + 2, Block.vine.blockID); - setBlock(world, j1 - 3, k1 + 4, l1 - 1, Block.vine.blockID); - setBlock(world, j1 - 3, k1 + 4, l1 + 1, Block.vine.blockID); - setBlock(world, j1 - 3, k1 + 4, l1, Block.vine.blockID); - setBlock(world, j1 - 3, k1 + 4, l1 - 3, Block.vine.blockID); + setBlock(world, j1 - 1, k1 + 4, l1 + 3, Blocks.vine); + setBlock(world, j1 - 1, k1 + 4, l1 + 2, Blocks.vine); + setBlock(world, j1 - 3, k1 + 4, l1 - 1, Blocks.vine); + setBlock(world, j1 - 3, k1 + 4, l1 + 1, Blocks.vine); + setBlock(world, j1 - 3, k1 + 4, l1, Blocks.vine); + setBlock(world, j1 - 3, k1 + 4, l1 - 3, Blocks.vine); } j1++; setBlock(world, j1, k1, l1, pickBlock(random)); @@ -508,8 +509,8 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 4, pickBlock(random)); for (int u = 0; u < 5; u++) { for (int y = 1; y < 5; y++) { - setBlock(world, j1, k1 + y, l1 + u, 0); - setBlock(world, j1, k1 + y, l1 - u, 0); + setBlock(world, j1, k1 + y, l1 + u); + setBlock(world, j1, k1 + y, l1 - u); } } setBlock(world, j1, k1 + 1, l1 + 5, pickBlock(random)); @@ -519,13 +520,13 @@ public class StructureMysticDungeon extends WorldGenerator { if (l3 == 2) { int l6 = random.nextInt(100); if (l6 <= 30) { - setBlock(world, j1, k1 + 1, l1 + 1, Block.blockGold.blockID); - setBlock(world, j1, k1 + 1, l1 + 2, Block.mobSpawner.blockID); - TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getBlockTileEntity(j1, k1 + 1, l1 + 2); + setBlock(world, j1, k1 + 1, l1 + 1, Blocks.gold_block); + setBlock(world, j1, k1 + 1, l1 + 2, Blocks.mob_spawner); + TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(j1, k1 + 1, l1 + 2); if (spawner != null) { - spawner.getSpawnerLogic().setMobID(Config.getRandomDungeonMob(random)); + spawner.func_145881_a().setEntityName(Config.getRandomDungeonMob(random)); } - setBlock(world, j1, k1 + 1, l1 + 3, Block.blockGold.blockID); + setBlock(world, j1, k1 + 1, l1 + 3, Blocks.gold_block); } } j1++; @@ -540,8 +541,8 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 4, pickBlock(random)); for (int u = 0; u < 5; u++) { for (int y = 1; y < 5; y++) { - setBlock(world, j1, k1 + y, l1 + u, 0); - setBlock(world, j1, k1 + y, l1 - u, 0); + setBlock(world, j1, k1 + y, l1 + u); + setBlock(world, j1, k1 + y, l1 - u); } } setBlock(world, j1, k1 + 1, l1 + 5, pickBlock(random)); @@ -553,7 +554,7 @@ public class StructureMysticDungeon extends WorldGenerator { if (i7 <= 60) { for (int y = 1; y < 4; y++) { for (int z = 1; z < 4; z++) { - setBlock(world, j1, k1 + y, l1 + z, Block.bookShelf.blockID); + setBlock(world, j1, k1 + y, l1 + z, Blocks.bookshelf); } } } @@ -561,40 +562,40 @@ public class StructureMysticDungeon extends WorldGenerator { if (l3 == 2) { int j7 = random.nextInt(100); if (j7 <= 20) { - setBlock(world, j1, k1 + 1, l1 + 1, Block.blockGold.blockID); - setBlock(world, j1, k1 + 2, l1 + 1, Block.blockGold.blockID); - setBlock(world, j1, k1 + 1, l1 + 2, Block.blockGold.blockID); - setBlock(world, j1, k1 + 2, l1 + 2, Block.blockGold.blockID); - setBlock(world, j1, k1 + 1, l1 + 3, Block.blockGold.blockID); + setBlock(world, j1, k1 + 1, l1 + 1, Blocks.gold_block); + setBlock(world, j1, k1 + 2, l1 + 1, Blocks.gold_block); + setBlock(world, j1, k1 + 1, l1 + 2, Blocks.gold_block); + setBlock(world, j1, k1 + 2, l1 + 2, Blocks.gold_block); + setBlock(world, j1, k1 + 1, l1 + 3, Blocks.gold_block); } int j8 = random.nextInt(100); if (j8 <= 30) { - setBlock(world, j1, k1 + 1, l1 - 1, 0); - setBlock(world, j1, k1 + 2, l1 - 1, Block.mobSpawner.blockID); - TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getBlockTileEntity(j1, k1 + 2, l1 - 1); + setBlock(world, j1, k1 + 1, l1 - 1); + setBlock(world, j1, k1 + 2, l1 - 1, Blocks.mob_spawner); + TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(j1, k1 + 2, l1 - 1); if (spawner != null) { - spawner.getSpawnerLogic().setMobID(Config.getRandomDungeonMob(random)); + spawner.func_145881_a().setEntityName(Config.getRandomDungeonMob(random)); } - setBlock(world, j1, k1 + 1, l1 - 2, 0); - setBlock(world, j1, k1 + 2, l1 - 2, 0); - setBlock(world, j1 - 1, k1 + 1, l1 - 1, 0); - setBlock(world, j1 - 1, k1 + 2, l1 - 2, 0); - setBlock(world, j1 - 1, k1 + 1, l1 - 2, 0); + setBlock(world, j1, k1 + 1, l1 - 2); + setBlock(world, j1, k1 + 2, l1 - 2); + setBlock(world, j1 - 1, k1 + 1, l1 - 1); + setBlock(world, j1 - 1, k1 + 2, l1 - 2); + setBlock(world, j1 - 1, k1 + 1, l1 - 2); } int j9 = random.nextInt(100); if (j9 <= 10) { - setBlock(world, j1 - 3, k1 + 1, l1 - 1, Block.blockDiamond.blockID); - setBlock(world, j1 - 3, k1 + 1, l1 - 2, Block.blockDiamond.blockID); + setBlock(world, j1 - 3, k1 + 1, l1 - 1, Blocks.diamond_block); + setBlock(world, j1 - 3, k1 + 1, l1 - 2, Blocks.diamond_block); } int j10 = random.nextInt(100); if (j10 <= 10) { - setBlock(world, j1 - 3, k1 + 1, l1 - 2, Block.blockDiamond.blockID); + setBlock(world, j1 - 3, k1 + 1, l1 - 2, Blocks.diamond_block); } int j11 = random.nextInt(100); if (j11 <= 15) { - setBlock(world, j1 - 5, k1 + 1, l1 - 2, Block.chest.blockID); - ChestFiller.fillWithValuables(world.getBlockTileEntity(j1 - 5, k1 + 1, l1 - 2)); - setBlock(world, j1 - 5, k1 + 1, l1 - 3, 0); + setBlock(world, j1 - 5, k1 + 1, l1 - 2, Blocks.chest); + ChestFiller.fillWithValuables(world.getTileEntity(j1 - 5, k1 + 1, l1 - 2)); + setBlock(world, j1 - 5, k1 + 1, l1 - 3); } } j1++; @@ -609,48 +610,48 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 4, pickBlock(random)); for (int u = 0; u < 5; u++) { for (int y = 1; y < 5; y++) { - setBlock(world, j1, k1 + y, l1 + u, 0); - setBlock(world, j1, k1 + y, l1 - u, 0); + setBlock(world, j1, k1 + y, l1 + u); + setBlock(world, j1, k1 + y, l1 - u); } } setBlock(world, j1, k1 + 2, l1 - 5, pickBlock(random)); int k7 = random.nextInt(100); if (k7 <= 30) { - setBlock(world, j1 - 2, k1 + 5, l1 - 3, 0); - setBlock(world, j1 - 2, k1 + 5, l1 - 2, 0); - setBlock(world, j1 - 2, k1 + 5, l1 - 1, 0); - setBlock(world, j1 - 1, k1 + 5, l1 - 2, 0); - setBlock(world, j1 - 3, k1 + 5, l1 - 2, 0); - setBlock(world, j1 - 5, k1 + 5, l1 - 2, 0); - setBlock(world, j1 - 2, k1 + 6, l1 - 2, 0); - setBlock(world, j1 - 2, k1 + 6, l1 - 1, 0); - setBlock(world, j1 - 1, k1 + 6, l1 - 2, 0); - setBlock(world, j1 - 3, k1 + 6, l1 - 2, 0); - setBlock(world, j1 - 2, k1 + 7, l1 - 2, 0); - setBlock(world, j1 - 2, k1 + 7, l1 - 1, 0); - setBlock(world, j1 - 1, k1 + 7, l1 - 2, 0); - setBlock(world, j1 - 3, k1 + 7, l1 - 2, 0); - setBlock(world, j1 - 2, k1 + 8, l1 - 2, 0); - setBlock(world, j1 - 2, k1 + 8, l1 - 1, 0); - setBlock(world, j1 - 1, k1 + 8, l1 - 2, 0); - setBlock(world, j1 - 2, k1 + 9, l1 - 2, 0); - setBlock(world, j1 - 2, k1 + 9, l1 - 1, 0); - setBlock(world, j1 - 1, k1 + 9, l1 - 2, 0); - setBlock(world, j1 - 2, k1 + 10, l1 - 1, 0); - setBlock(world, j1 - 1, k1 + 10, l1 - 2, 0); - setBlock(world, j1 - 2, k1 + 1, l1 - 2, Block.stone.blockID); - setBlock(world, j1 - 2, k1 + 1, l1 - 3, Block.gravel.blockID); - setBlock(world, j1 - 1, k1 + 1, l1 - 2, Block.stone.blockID); - setBlock(world, j1 - 1, k1 + 1, l1 - 3, Block.gravel.blockID); - setBlock(world, j1 - 2, k1 + 1, l1 - 1, Block.stone.blockID); - setBlock(world, j1 - 3, k1 + 1, l1 - 2, Block.stone.blockID); - setBlock(world, j1 - 2, k1 + 2, l1 - 2, Block.stone.blockID); - setBlock(world, j1 - 2, k1 + 2, l1 - 1, Block.gravel.blockID); - setBlock(world, j1 - 2, k1 + 3, l1 - 2, Block.stone.blockID); - setBlock(world, j1 - 2, k1 + 3, l1 - 1, Block.stone.blockID); - setBlock(world, j1 - 4, k1 + 3, l1 - 1, Block.gravel.blockID); - setBlock(world, j1 - 2, k1 + 3, l1, Block.gravel.blockID); - setBlock(world, j1 - 1, k1 + 3, l1 - 3, Block.stone.blockID); + setBlock(world, j1 - 2, k1 + 5, l1 - 3); + setBlock(world, j1 - 2, k1 + 5, l1 - 2); + setBlock(world, j1 - 2, k1 + 5, l1 - 1); + setBlock(world, j1 - 1, k1 + 5, l1 - 2); + setBlock(world, j1 - 3, k1 + 5, l1 - 2); + setBlock(world, j1 - 5, k1 + 5, l1 - 2); + setBlock(world, j1 - 2, k1 + 6, l1 - 2); + setBlock(world, j1 - 2, k1 + 6, l1 - 1); + setBlock(world, j1 - 1, k1 + 6, l1 - 2); + setBlock(world, j1 - 3, k1 + 6, l1 - 2); + setBlock(world, j1 - 2, k1 + 7, l1 - 2); + setBlock(world, j1 - 2, k1 + 7, l1 - 1); + setBlock(world, j1 - 1, k1 + 7, l1 - 2); + setBlock(world, j1 - 3, k1 + 7, l1 - 2); + setBlock(world, j1 - 2, k1 + 8, l1 - 2); + setBlock(world, j1 - 2, k1 + 8, l1 - 1); + setBlock(world, j1 - 1, k1 + 8, l1 - 2); + setBlock(world, j1 - 2, k1 + 9, l1 - 2); + setBlock(world, j1 - 2, k1 + 9, l1 - 1); + setBlock(world, j1 - 1, k1 + 9, l1 - 2); + setBlock(world, j1 - 2, k1 + 10, l1 - 1); + setBlock(world, j1 - 1, k1 + 10, l1 - 2); + setBlock(world, j1 - 2, k1 + 1, l1 - 2, Blocks.stone); + setBlock(world, j1 - 2, k1 + 1, l1 - 3, Blocks.gravel); + setBlock(world, j1 - 1, k1 + 1, l1 - 2, Blocks.stone); + setBlock(world, j1 - 1, k1 + 1, l1 - 3, Blocks.gravel); + setBlock(world, j1 - 2, k1 + 1, l1 - 1, Blocks.stone); + setBlock(world, j1 - 3, k1 + 1, l1 - 2, Blocks.stone); + setBlock(world, j1 - 2, k1 + 2, l1 - 2, Blocks.stone); + setBlock(world, j1 - 2, k1 + 2, l1 - 1, Blocks.gravel); + setBlock(world, j1 - 2, k1 + 3, l1 - 2, Blocks.stone); + setBlock(world, j1 - 2, k1 + 3, l1 - 1, Blocks.stone); + setBlock(world, j1 - 4, k1 + 3, l1 - 1, Blocks.gravel); + setBlock(world, j1 - 2, k1 + 3, l1, Blocks.gravel); + setBlock(world, j1 - 1, k1 + 3, l1 - 3, Blocks.stone); } } if (k3 == 2) { @@ -673,8 +674,8 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 8, pickBlock(random)); for (int u = 0; u < 9; u++) { for (int y = 1; y < 6; y++) { - setBlock(world, j1, k1 + y, l1 + u, 0); - setBlock(world, j1, k1 + y, l1 - u, 0); + setBlock(world, j1, k1 + y, l1 + u); + setBlock(world, j1, k1 + y, l1 - u); } } setBlock(world, j1, k1 + 1, l1 + 9, pickBlock(random)); @@ -685,44 +686,44 @@ public class StructureMysticDungeon extends WorldGenerator { int i4 = random.nextInt(100); if (i4 <= 60) { for (int y = 0; y < 15; y++) { - setBlock(world, j1 + 7, k1 - y, l1, 0); + setBlock(world, j1 + 7, k1 - y, l1); } - setBlock(world, j1, k1 - 13, l1 + 1, 0); - setBlock(world, j1, k1 - 13, l1 - 1, 0); - setBlock(world, j1, k1 - 14, l1 + 1, 0); - setBlock(world, j1, k1 - 14, l1 - 1, 0); - setBlock(world, j1 + 1, k1 - 13, l1 + 1, 0); - setBlock(world, j1 + 1, k1 - 13, l1 - 1, 0); - setBlock(world, j1 + 1, k1 - 14, l1 + 1, 0); - setBlock(world, j1 + 1, k1 - 14, l1 - 1, 0); + setBlock(world, j1, k1 - 13, l1 + 1); + setBlock(world, j1, k1 - 13, l1 - 1); + setBlock(world, j1, k1 - 14, l1 + 1); + setBlock(world, j1, k1 - 14, l1 - 1); + setBlock(world, j1 + 1, k1 - 13, l1 + 1); + setBlock(world, j1 + 1, k1 - 13, l1 - 1); + setBlock(world, j1 + 1, k1 - 14, l1 + 1); + setBlock(world, j1 + 1, k1 - 14, l1 - 1); } int j6 = random.nextInt(100); if (j6 <= 70) { for (int y = 0; y < 13; y++) { - setBlock(world, j1 + 7, k1 - y, l1 + 6, 0); + setBlock(world, j1 + 7, k1 - y, l1 + 6); } - setBlock(world, j1, k1 - 11, l1 + 7, 0); - setBlock(world, j1, k1 - 11, l1 + 5, 0); - setBlock(world, j1, k1 - 12, l1 + 7, 0); - setBlock(world, j1, k1 - 12, l1 + 5, 0); - setBlock(world, j1 + 1, k1 - 11, l1 + 7, 0); - setBlock(world, j1 + 1, k1 - 11, l1 + 5, 0); - setBlock(world, j1 + 1, k1 - 12, l1 + 7, 0); - setBlock(world, j1 + 1, k1 - 12, l1 + 5, 0); + setBlock(world, j1, k1 - 11, l1 + 7); + setBlock(world, j1, k1 - 11, l1 + 5); + setBlock(world, j1, k1 - 12, l1 + 7); + setBlock(world, j1, k1 - 12, l1 + 5); + setBlock(world, j1 + 1, k1 - 11, l1 + 7); + setBlock(world, j1 + 1, k1 - 11, l1 + 5); + setBlock(world, j1 + 1, k1 - 12, l1 + 7); + setBlock(world, j1 + 1, k1 - 12, l1 + 5); } int l7 = random.nextInt(100); if (l7 <= 50) { for (int y = 0; y < 17; y++) { - setBlock(world, j1 + 7, k1 - y, l1 - 4, 0); + setBlock(world, j1 + 7, k1 - y, l1 - 4); } - setBlock(world, j1 + 7, k1 - 15, l1 - 5, 0); - setBlock(world, j1 + 7, k1 - 15, l1 - 3, 0); - setBlock(world, j1 + 7, k1 - 16, l1 - 5, 0); - setBlock(world, j1 + 7, k1 - 16, l1 - 3, 0); - setBlock(world, j1 + 8, k1 - 15, l1 - 5, 0); - setBlock(world, j1 + 8, k1 - 15, l1 - 3, 0); - setBlock(world, j1 + 8, k1 - 16, l1 - 5, 0); - setBlock(world, j1 + 8, k1 - 16, l1 - 3, 0); + setBlock(world, j1 + 7, k1 - 15, l1 - 5); + setBlock(world, j1 + 7, k1 - 15, l1 - 3); + setBlock(world, j1 + 7, k1 - 16, l1 - 5); + setBlock(world, j1 + 7, k1 - 16, l1 - 3); + setBlock(world, j1 + 8, k1 - 15, l1 - 5); + setBlock(world, j1 + 8, k1 - 15, l1 - 3); + setBlock(world, j1 + 8, k1 - 16, l1 - 5); + setBlock(world, j1 + 8, k1 - 16, l1 - 3); } j1++; setBlock(world, j1, k1, l1, pickBlock(random)); @@ -742,18 +743,18 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 6, pickBlock(random)); setBlock(world, j1, k1, l1 - 7, pickBlock(random)); setBlock(world, j1, k1, l1 - 8, pickBlock(random)); - setBlock(world, j1, k1 + 6, l1, 0); - setBlock(world, j1, k1 + 6, l1 + 1, 0); - setBlock(world, j1, k1 + 6, l1 - 1, 0); - setBlock(world, j1, k1 + 6, l1 + 2, 0); - setBlock(world, j1, k1 + 6, l1 - 2, 0); - setBlock(world, j1, k1 + 7, l1 + 1, 0); - setBlock(world, j1, k1 + 7, l1, 0); - setBlock(world, j1, k1 + 7, l1 - 1, 0); - setBlock(world, j1, k1 + 8, l1, 0); + setBlock(world, j1, k1 + 6, l1); + setBlock(world, j1, k1 + 6, l1 + 1); + setBlock(world, j1, k1 + 6, l1 - 1); + setBlock(world, j1, k1 + 6, l1 + 2); + setBlock(world, j1, k1 + 6, l1 - 2); + setBlock(world, j1, k1 + 7, l1 + 1); + setBlock(world, j1, k1 + 7, l1); + setBlock(world, j1, k1 + 7, l1 - 1); + setBlock(world, j1, k1 + 8, l1); for (int y = 1; y < 6; y++) { for (int z = -8; z < 9; z++) { - setBlock(world, j1, k1 + y, l1 + 1, 0); + setBlock(world, j1, k1 + y, l1 + 1); } } setBlock(world, j1, k1 + 1, l1 + 9, pickBlock(random)); @@ -762,8 +763,8 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 + 1, l1 - 9, pickBlock(random)); setBlock(world, j1, k1 + 2, l1 - 9, pickBlock(random)); for (int y = 1; y < 6; y++) { - setBlockAndMetadata(world, j1, k1 + y, l1 + 6, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1, k1 + y, l1 - 6, Block.blockNetherQuartz.blockID, 2); + setBlockAndMetadata(world, j1, k1 + y, l1 + 6, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1, k1 + y, l1 - 6, Blocks.quartz_block, 2); } j1++; setBlock(world, j1, k1, l1, pickBlock(random)); @@ -783,36 +784,36 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 6, pickBlock(random)); setBlock(world, j1, k1, l1 - 7, pickBlock(random)); setBlock(world, j1, k1, l1 - 8, pickBlock(random)); - setBlock(world, j1, k1 + 1, l1, 0); - setBlock(world, j1, k1 + 2, l1, 0); - setBlock(world, j1, k1 + 3, l1, 0); - setBlock(world, j1, k1 + 4, l1, 0); - setBlock(world, j1, k1 + 5, l1, 0); - setBlock(world, j1, k1 + 6, l1, 0); - setBlock(world, j1, k1 + 7, l1, 0); - setBlock(world, j1, k1 + 6, l1 + 1, 0); - setBlock(world, j1, k1 + 6, l1 - 1, 0); - setBlock(world, j1, k1 + 6, l1 + 2, 0); - setBlock(world, j1, k1 + 6, l1 - 2, 0); - setBlock(world, j1, k1 + 7, l1 + 1, 0); - setBlock(world, j1, k1 + 7, l1 - 1, 0); - setBlock(world, j1, k1 + 8, l1, 0); + setBlock(world, j1, k1 + 1, l1); + setBlock(world, j1, k1 + 2, l1); + setBlock(world, j1, k1 + 3, l1); + setBlock(world, j1, k1 + 4, l1); + setBlock(world, j1, k1 + 5, l1); + setBlock(world, j1, k1 + 6, l1); + setBlock(world, j1, k1 + 7, l1); + setBlock(world, j1, k1 + 6, l1 + 1); + setBlock(world, j1, k1 + 6, l1 - 1); + setBlock(world, j1, k1 + 6, l1 + 2); + setBlock(world, j1, k1 + 6, l1 - 2); + setBlock(world, j1, k1 + 7, l1 + 1); + setBlock(world, j1, k1 + 7, l1 - 1); + setBlock(world, j1, k1 + 8, l1); for (int u = 1; u < 9; u++) { for (int y = 1; y < 6; y++) { - setBlock(world, j1, k1 + y, l1 + u, 0); - setBlock(world, j1, k1 + y, l1 - u, 0); + setBlock(world, j1, k1 + y, l1 + u); + setBlock(world, j1, k1 + y, l1 - u); } } setBlock(world, j1, k1 + 2, l1 + 9, pickBlock(random)); setBlock(world, j1, k1 + 1, l1 - 9, pickBlock(random)); setBlock(world, j1, k1 + 2, l1 - 9, pickBlock(random)); - setBlock(world, j1, k1 + 1, l1, Block.stoneSingleSlab.blockID); - setBlock(world, j1, k1 + 1, l1 + 1, Block.stoneSingleSlab.blockID); - setBlock(world, j1, k1 + 1, l1 + 2, Block.stoneSingleSlab.blockID); - setBlock(world, j1, k1 + 1, l1 + 3, Block.stoneSingleSlab.blockID); - setBlock(world, j1, k1 + 1, l1 - 1, Block.stoneSingleSlab.blockID); - setBlock(world, j1, k1 + 1, l1 - 2, Block.stoneSingleSlab.blockID); - setBlock(world, j1, k1 + 1, l1 - 3, Block.stoneSingleSlab.blockID); + setBlock(world, j1, k1 + 1, l1, Blocks.stone_slab); + setBlock(world, j1, k1 + 1, l1 + 1, Blocks.stone_slab); + setBlock(world, j1, k1 + 1, l1 + 2, Blocks.stone_slab); + setBlock(world, j1, k1 + 1, l1 + 3, Blocks.stone_slab); + setBlock(world, j1, k1 + 1, l1 - 1, Blocks.stone_slab); + setBlock(world, j1, k1 + 1, l1 - 2, Blocks.stone_slab); + setBlock(world, j1, k1 + 1, l1 - 3, Blocks.stone_slab); j1++; setBlock(world, j1, k1, l1, pickBlock(random)); setBlock(world, j1, k1, l1 + 1, pickBlock(random)); @@ -831,18 +832,18 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 6, pickBlock(random)); setBlock(world, j1, k1, l1 - 7, pickBlock(random)); setBlock(world, j1, k1, l1 - 8, pickBlock(random)); - setBlock(world, j1, k1 + 6, l1, 0); - setBlock(world, j1, k1 + 6, l1 + 1, 0); - setBlock(world, j1, k1 + 6, l1 - 1, 0); - setBlock(world, j1, k1 + 6, l1 + 2, 0); - setBlock(world, j1, k1 + 6, l1 - 2, 0); - setBlock(world, j1, k1 + 7, l1, 0); - setBlock(world, j1, k1 + 7, l1 + 1, 0); - setBlock(world, j1, k1 + 7, l1 - 1, 0); - setBlock(world, j1, k1 + 8, l1, 0); + setBlock(world, j1, k1 + 6, l1); + setBlock(world, j1, k1 + 6, l1 + 1); + setBlock(world, j1, k1 + 6, l1 - 1); + setBlock(world, j1, k1 + 6, l1 + 2); + setBlock(world, j1, k1 + 6, l1 - 2); + setBlock(world, j1, k1 + 7, l1); + setBlock(world, j1, k1 + 7, l1 + 1); + setBlock(world, j1, k1 + 7, l1 - 1); + setBlock(world, j1, k1 + 8, l1); for (int y = 1; y < 6; y++) { for (int z = -8; z < 9; z++) { - setBlock(world, j1, k1 + y, l1 + 1, 0); + setBlock(world, j1, k1 + y, l1 + 1); } } setBlock(world, j1, k1 + 1, l1 + 9, pickBlock(random)); @@ -850,21 +851,21 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 + 3, l1 + 9, pickBlock(random)); setBlock(world, j1, k1 + 1, l1 - 9, pickBlock(random)); setBlock(world, j1, k1 + 2, l1 - 9, pickBlock(random)); - setBlock(world, j1, k1 + 1, l1 + 3, Block.stoneSingleSlab.blockID); + setBlock(world, j1, k1 + 1, l1 + 3, Blocks.stone_slab); for (int z = -2; z < 3; z++) { - setBlock(world, j1, k1, l1 + z, Block.obsidian.blockID); - setBlock(world, j1, k1 + 1, l1 + z, Block.obsidian.blockID); - setBlock(world, j1, k1 + 2, l1 + z, Block.obsidian.blockID); + setBlock(world, j1, k1, l1 + z, Blocks.obsidian); + setBlock(world, j1, k1 + 1, l1 + z, Blocks.obsidian); + setBlock(world, j1, k1 + 2, l1 + z, Blocks.obsidian); } - setBlock(world, j1, k1 + 1, l1 - 3, Block.stoneSingleSlab.blockID); + setBlock(world, j1, k1 + 1, l1 - 3, Blocks.stone_slab); for (int y = 1; y < 6; y++) { - setBlockAndMetadata(world, j1, k1 + y, l1 + 6, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1, k1 + y, l1 - 6, Block.blockNetherQuartz.blockID, 2); + setBlockAndMetadata(world, j1, k1 + y, l1 + 6, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1, k1 + y, l1 - 6, Blocks.quartz_block, 2); } int k8 = random.nextInt(100); if (k8 <= 15) { - setBlock(world, j1, k1 + 1, l1 - 7, Block.chest.blockID); - ChestFiller.fillWithValuables(world.getBlockTileEntity(j1, k1 + 1, l1 - 7)); + setBlock(world, j1, k1 + 1, l1 - 7, Blocks.chest); + ChestFiller.fillWithValuables(world.getTileEntity(j1, k1 + 1, l1 - 7)); } j1++; setBlock(world, j1, k1, l1, pickBlock(random)); @@ -884,18 +885,18 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 6, pickBlock(random)); setBlock(world, j1, k1, l1 - 7, pickBlock(random)); setBlock(world, j1, k1, l1 - 8, pickBlock(random)); - setBlock(world, j1, k1 + 6, l1, 0); - setBlock(world, j1, k1 + 6, l1 + 1, 0); - setBlock(world, j1, k1 + 6, l1 - 1, 0); - setBlock(world, j1, k1 + 6, l1 + 2, 0); - setBlock(world, j1, k1 + 6, l1 - 2, 0); - setBlock(world, j1, k1 + 7, l1, 0); - setBlock(world, j1, k1 + 7, l1 + 1, 0); - setBlock(world, j1, k1 + 7, l1 - 1, 0); - setBlock(world, j1, k1 + 8, l1, 0); + setBlock(world, j1, k1 + 6, l1); + setBlock(world, j1, k1 + 6, l1 + 1); + setBlock(world, j1, k1 + 6, l1 - 1); + setBlock(world, j1, k1 + 6, l1 + 2); + setBlock(world, j1, k1 + 6, l1 - 2); + setBlock(world, j1, k1 + 7, l1); + setBlock(world, j1, k1 + 7, l1 + 1); + setBlock(world, j1, k1 + 7, l1 - 1); + setBlock(world, j1, k1 + 8, l1); for (int y = 1; y < 6; y++) { for (int z = -8; z < 9; z++) { - setBlock(world, j1, k1 + y, l1 + 1, 0); + setBlock(world, j1, k1 + y, l1 + 1); } } setBlock(world, j1, k1 + 2, l1 + 9, pickBlock(random)); @@ -903,30 +904,30 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 + 1, l1 - 9, pickBlock(random)); setBlock(world, j1, k1 + 2, l1 - 9, pickBlock(random)); setBlock(world, j1, k1 + 4, l1 - 9, pickBlock(random)); - setBlock(world, j1, k1 + 1, l1 + 3, Block.stoneSingleSlab.blockID); - setBlock(world, j1, k1 + 1, l1, Block.chest.blockID); - ChestFiller.fillWithValuables(world.getBlockTileEntity(j1, k1 + 1, l1)); + setBlock(world, j1, k1 + 1, l1 + 3, Blocks.stone_slab); + setBlock(world, j1, k1 + 1, l1, Blocks.chest); + ChestFiller.fillWithValuables(world.getTileEntity(j1, k1 + 1, l1)); for (int z = -2; z < 3; z++) { - setBlock(world, j1, k1, l1 + z, Block.obsidian.blockID); + setBlock(world, j1, k1, l1 + z, Blocks.obsidian); if (z != 0) - setBlock(world, j1, k1 + 1, l1 + z, Block.obsidian.blockID); - setBlock(world, j1, k1 + 2, l1 + z, Block.obsidian.blockID); + setBlock(world, j1, k1 + 1, l1 + z, Blocks.obsidian); + setBlock(world, j1, k1 + 2, l1 + z, Blocks.obsidian); } - setBlock(world, j1, k1 + 1, l1 - 3, Block.stoneSingleSlab.blockID); + setBlock(world, j1, k1 + 1, l1 - 3, Blocks.stone_slab); int k9 = random.nextInt(100); if (k9 <= 75) { - setBlock(world, j1, k1 + 1, l1, 0); - setBlock(world, j1, k1 + 2, l1, 0); - setBlock(world, j1, k1 + 1, l1 + 1, 0); - setBlock(world, j1, k1 + 2, l1 + 1, 0); - setBlock(world, j1, k1 + 1, l1 - 1, 0); - setBlock(world, j1, k1 + 1, l1, 0); - setBlock(world, j1 - 1, k1 + 1, l1, 0); - setBlock(world, j1 - 1, k1 + 2, l1, 0); - setBlock(world, j1 - 1, k1 + 2, l1 - 1, 0); - setBlock(world, j1 - 3, k1 + 1, l1 + 2, Block.obsidian.blockID); - setBlock(world, j1 - 2, k1 + 1, l1, Block.obsidian.blockID); - setBlock(world, j1 - 3, k1 + 1, l1 - 3, Block.obsidian.blockID); + setBlock(world, j1, k1 + 1, l1); + setBlock(world, j1, k1 + 2, l1); + setBlock(world, j1, k1 + 1, l1 + 1); + setBlock(world, j1, k1 + 2, l1 + 1); + setBlock(world, j1, k1 + 1, l1 - 1); + setBlock(world, j1, k1 + 1, l1); + setBlock(world, j1 - 1, k1 + 1, l1); + setBlock(world, j1 - 1, k1 + 2, l1); + setBlock(world, j1 - 1, k1 + 2, l1 - 1); + setBlock(world, j1 - 3, k1 + 1, l1 + 2, Blocks.obsidian); + setBlock(world, j1 - 2, k1 + 1, l1, Blocks.obsidian); + setBlock(world, j1 - 3, k1 + 1, l1 - 3, Blocks.obsidian); } j1++; setBlock(world, j1, k1, l1, pickBlock(random)); @@ -946,54 +947,54 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 6, pickBlock(random)); setBlock(world, j1, k1, l1 - 7, pickBlock(random)); setBlock(world, j1, k1, l1 - 8, pickBlock(random)); - setBlock(world, j1, k1 + 6, l1, 0); - setBlock(world, j1, k1 + 6, l1 + 1, 0); - setBlock(world, j1, k1 + 6, l1 - 1, 0); - setBlock(world, j1, k1 + 6, l1 + 2, 0); - setBlock(world, j1, k1 + 6, l1 - 2, 0); - setBlock(world, j1, k1 + 7, l1, 0); - setBlock(world, j1, k1 + 7, l1 + 1, 0); - setBlock(world, j1, k1 + 7, l1 - 1, 0); - setBlock(world, j1, k1 + 8, l1, 0); + setBlock(world, j1, k1 + 6, l1); + setBlock(world, j1, k1 + 6, l1 + 1); + setBlock(world, j1, k1 + 6, l1 - 1); + setBlock(world, j1, k1 + 6, l1 + 2); + setBlock(world, j1, k1 + 6, l1 - 2); + setBlock(world, j1, k1 + 7, l1); + setBlock(world, j1, k1 + 7, l1 + 1); + setBlock(world, j1, k1 + 7, l1 - 1); + setBlock(world, j1, k1 + 8, l1); for (int y = 1; y < 6; y++) { for (int z = -8; z < 9; z++) { - setBlock(world, j1, k1 + y, l1 + 1, 0); + setBlock(world, j1, k1 + y, l1 + 1); } } setBlock(world, j1, k1 + 1, l1 + 9, pickBlock(random)); setBlock(world, j1, k1 + 1, l1 - 9, pickBlock(random)); setBlock(world, j1, k1 + 2, l1 - 9, pickBlock(random)); - setBlock(world, j1, k1 + 1, l1 + 3, Block.stoneSingleSlab.blockID); + setBlock(world, j1, k1 + 1, l1 + 3, Blocks.stone_slab); for (int z = -2; z < 3; z++) { - setBlock(world, j1, k1, l1 + z, Block.obsidian.blockID); - setBlock(world, j1, k1 + 1, l1 + z, Block.obsidian.blockID); - setBlock(world, j1, k1 + 2, l1 + z, Block.obsidian.blockID); + setBlock(world, j1, k1, l1 + z, Blocks.obsidian); + setBlock(world, j1, k1 + 1, l1 + z, Blocks.obsidian); + setBlock(world, j1, k1 + 2, l1 + z, Blocks.obsidian); } - setBlock(world, j1, k1 + 1, l1 - 3, Block.stoneSingleSlab.blockID); + setBlock(world, j1, k1 + 1, l1 - 3, Blocks.stone_slab); for (int y = 1; y < 6; y++) { - setBlockAndMetadata(world, j1, k1 + y, l1 + 6, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1, k1 + y, l1 - 6, Block.blockNetherQuartz.blockID, 2); + setBlockAndMetadata(world, j1, k1 + y, l1 + 6, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1, k1 + y, l1 - 6, Blocks.quartz_block, 2); } int k10 = random.nextInt(100); if (k10 <= 50) { - setBlockAndMetadata(world, j1, k1 + 1, l1 + 7, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 2, k1 + 1, l1 + 8, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 1, k1 + 1, l1 + 5, Block.blockNetherQuartz.blockID, 2); - setBlock(world, j1, k1 + 2, l1 + 6, 0); - setBlock(world, j1, k1 + 3, l1 + 6, 0); - setBlock(world, j1, k1 + 4, l1 + 6, 0); + setBlockAndMetadata(world, j1, k1 + 1, l1 + 7, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 2, k1 + 1, l1 + 8, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 1, k1 + 1, l1 + 5, Blocks.quartz_block, 2); + setBlock(world, j1, k1 + 2, l1 + 6); + setBlock(world, j1, k1 + 3, l1 + 6); + setBlock(world, j1, k1 + 4, l1 + 6); } int k11 = random.nextInt(100); if (k11 <= 30) { - setBlock(world, j1 + 1, k1 + 5, l1 + 3, Block.vine.blockID); - setBlock(world, j1 - 1, k1 + 5, l1 + 3, Block.vine.blockID); - setBlock(world, j1 - 1, k1 + 6, l1 + 2, Block.vine.blockID); - setBlock(world, j1 - 1, k1 + 5, l1 + 2, Block.vine.blockID); - setBlock(world, j1 - 2, k1 + 7, l1 - 1, Block.vine.blockID); - setBlock(world, j1 - 2, k1 + 7, l1 + 1, Block.vine.blockID); - setBlock(world, j1 - 2, k1 + 6, l1 + 1, Block.vine.blockID); - setBlock(world, j1 - 3, k1 + 8, l1, Block.vine.blockID); - setBlock(world, j1 + 1, k1 + 5, l1 - 3, Block.vine.blockID); + setBlock(world, j1 + 1, k1 + 5, l1 + 3, Blocks.vine); + setBlock(world, j1 - 1, k1 + 5, l1 + 3, Blocks.vine); + setBlock(world, j1 - 1, k1 + 6, l1 + 2, Blocks.vine); + setBlock(world, j1 - 1, k1 + 5, l1 + 2, Blocks.vine); + setBlock(world, j1 - 2, k1 + 7, l1 - 1, Blocks.vine); + setBlock(world, j1 - 2, k1 + 7, l1 + 1, Blocks.vine); + setBlock(world, j1 - 2, k1 + 6, l1 + 1, Blocks.vine); + setBlock(world, j1 - 3, k1 + 8, l1, Blocks.vine); + setBlock(world, j1 + 1, k1 + 5, l1 - 3, Blocks.vine); } j1++; setBlock(world, j1, k1, l1, pickBlock(random)); @@ -1013,18 +1014,18 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 6, pickBlock(random)); setBlock(world, j1, k1, l1 - 7, pickBlock(random)); setBlock(world, j1, k1, l1 - 8, pickBlock(random)); - setBlock(world, j1, k1 + 6, l1, 0); - setBlock(world, j1, k1 + 6, l1 + 1, 0); - setBlock(world, j1, k1 + 6, l1 - 1, 0); - setBlock(world, j1, k1 + 6, l1 + 2, 0); - setBlock(world, j1, k1 + 6, l1 - 2, 0); - setBlock(world, j1, k1 + 7, l1, 0); - setBlock(world, j1, k1 + 7, l1 + 1, 0); - setBlock(world, j1, k1 + 7, l1 - 1, 0); - setBlock(world, j1, k1 + 8, l1, 0); + setBlock(world, j1, k1 + 6, l1); + setBlock(world, j1, k1 + 6, l1 + 1); + setBlock(world, j1, k1 + 6, l1 - 1); + setBlock(world, j1, k1 + 6, l1 + 2); + setBlock(world, j1, k1 + 6, l1 - 2); + setBlock(world, j1, k1 + 7, l1); + setBlock(world, j1, k1 + 7, l1 + 1); + setBlock(world, j1, k1 + 7, l1 - 1); + setBlock(world, j1, k1 + 8, l1); for (int y = 1; y < 6; y++) { for (int z = -8; z < 9; z++) { - setBlock(world, j1, k1 + y, l1 + 1, 0); + setBlock(world, j1, k1 + y, l1 + 1); } } setBlock(world, j1, k1 + 1, l1 + 9, pickBlock(random)); @@ -1034,7 +1035,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 + 2, l1 - 9, pickBlock(random)); setBlock(world, j1, k1 + 3, l1 - 9, pickBlock(random)); for (int z = -3; z < 4; z++) { - setBlock(world, j1, k1 + 1, l1 + z, Block.stoneSingleSlab.blockID); + setBlock(world, j1, k1 + 1, l1 + z, Blocks.stone_slab); } j1++; setBlock(world, j1, k1, l1, pickBlock(random)); @@ -1054,18 +1055,18 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 6, pickBlock(random)); setBlock(world, j1, k1, l1 - 7, pickBlock(random)); setBlock(world, j1, k1, l1 - 8, pickBlock(random)); - setBlock(world, j1, k1 + 6, l1, 0); - setBlock(world, j1, k1 + 6, l1 + 1, 0); - setBlock(world, j1, k1 + 6, l1 - 1, 0); - setBlock(world, j1, k1 + 6, l1 + 2, 0); - setBlock(world, j1, k1 + 6, l1 - 2, 0); - setBlock(world, j1, k1 + 7, l1, 0); - setBlock(world, j1, k1 + 7, l1 + 1, 0); - setBlock(world, j1, k1 + 7, l1 - 1, 0); - setBlock(world, j1, k1 + 8, l1, 0); + setBlock(world, j1, k1 + 6, l1); + setBlock(world, j1, k1 + 6, l1 + 1); + setBlock(world, j1, k1 + 6, l1 - 1); + setBlock(world, j1, k1 + 6, l1 + 2); + setBlock(world, j1, k1 + 6, l1 - 2); + setBlock(world, j1, k1 + 7, l1); + setBlock(world, j1, k1 + 7, l1 + 1); + setBlock(world, j1, k1 + 7, l1 - 1); + setBlock(world, j1, k1 + 8, l1); for (int y = 1; y < 6; y++) { for (int z = -8; z < 9; z++) { - setBlock(world, j1, k1 + y, l1 + 1, 0); + setBlock(world, j1, k1 + y, l1 + 1); } } setBlock(world, j1, k1 + 1, l1 + 9, pickBlock(random)); @@ -1073,17 +1074,17 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 + 1, l1 - 9, pickBlock(random)); setBlock(world, j1, k1 + 2, l1 - 9, pickBlock(random)); for (int y = 1; y < 6; y++) { - setBlockAndMetadata(world, j1, k1 + y, l1 + 6, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1, k1 + y, l1 - 6, Block.blockNetherQuartz.blockID, 2); + setBlockAndMetadata(world, j1, k1 + y, l1 + 6, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1, k1 + y, l1 - 6, Blocks.quartz_block, 2); } int j12 = random.nextInt(100); if (j12 <= 50) { - setBlockAndMetadata(world, j1, k1 + 1, l1 - 7, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 1, k1 + 1, l1 - 8, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 3, k1 + 1, l1 - 5, Block.blockNetherQuartz.blockID, 2); - setBlock(world, j1, k1 + 3, l1 - 6, 0); - setBlock(world, j1, k1 + 4, l1 - 6, 0); - setBlock(world, j1, k1 + 5, l1 - 6, 0); + setBlockAndMetadata(world, j1, k1 + 1, l1 - 7, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 1, k1 + 1, l1 - 8, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 3, k1 + 1, l1 - 5, Blocks.quartz_block, 2); + setBlock(world, j1, k1 + 3, l1 - 6); + setBlock(world, j1, k1 + 4, l1 - 6); + setBlock(world, j1, k1 + 5, l1 - 6); } j1++; setBlock(world, j1, k1, l1, pickBlock(random)); @@ -1103,18 +1104,18 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1, l1 - 6, pickBlock(random)); setBlock(world, j1, k1, l1 - 7, pickBlock(random)); setBlock(world, j1, k1, l1 - 8, pickBlock(random)); - setBlock(world, j1, k1 + 6, l1, 0); - setBlock(world, j1, k1 + 6, l1 + 1, 0); - setBlock(world, j1, k1 + 6, l1 - 1, 0); - setBlock(world, j1, k1 + 6, l1 + 2, 0); - setBlock(world, j1, k1 + 6, l1 - 2, 0); - setBlock(world, j1, k1 + 7, l1, 0); - setBlock(world, j1, k1 + 7, l1 + 1, 0); - setBlock(world, j1, k1 + 7, l1 - 1, 0); - setBlock(world, j1, k1 + 8, l1, 0); + setBlock(world, j1, k1 + 6, l1); + setBlock(world, j1, k1 + 6, l1 + 1); + setBlock(world, j1, k1 + 6, l1 - 1); + setBlock(world, j1, k1 + 6, l1 + 2); + setBlock(world, j1, k1 + 6, l1 - 2); + setBlock(world, j1, k1 + 7, l1); + setBlock(world, j1, k1 + 7, l1 + 1); + setBlock(world, j1, k1 + 7, l1 - 1); + setBlock(world, j1, k1 + 8, l1); for (int y = 1; y < 6; y++) { for (int z = -8; z < 9; z++) { - setBlock(world, j1, k1 + y, l1 + 1, 0); + setBlock(world, j1, k1 + y, l1 + 1); } } setBlock(world, j1, k1 + 1, l1 + 9, pickBlock(random)); @@ -1124,8 +1125,8 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 + 3, l1 - 9, pickBlock(random)); } j1++; - setBlock(world, j1, k1 + 1, l1, 0); - setBlock(world, j1, k1 + 2, l1, 0); + setBlock(world, j1, k1 + 1, l1); + setBlock(world, j1, k1 + 2, l1); setBlock(world, j1, k1, l1, pickBlock(random)); setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); @@ -1141,7 +1142,7 @@ public class StructureMysticDungeon extends WorldGenerator { j1++; for (int y = 1; y < 4; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 + y, l1 + z, 0); + setBlock(world, j1, k1 + y, l1 + z); } } setBlock(world, j1, k1, l1, pickBlock(random)); @@ -1150,134 +1151,134 @@ public class StructureMysticDungeon extends WorldGenerator { j1++; for (int y = 1; y < 4; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 + y, l1 + z, 0); + setBlock(world, j1, k1 + y, l1 + z); } } setBlock(world, j1, k1, l1, pickBlock(random)); setBlock(world, j1, k1, l1 + 1, pickBlock(random)); setBlock(world, j1, k1, l1 - 1, pickBlock(random)); j1++; - setBlock(world, j1, k1, l1, 0); - setBlock(world, j1, k1 + 1, l1, 0); - setBlock(world, j1, k1 + 2, l1, 0); - setBlock(world, j1, k1 + 3, l1, 0); + setBlock(world, j1, k1, l1); + setBlock(world, j1, k1 + 1, l1); + setBlock(world, j1, k1 + 2, l1); + setBlock(world, j1, k1 + 3, l1); j1++; - setBlock(world, j1, k1 - 1, l1, 0); - setBlock(world, j1, k1, l1, 0); - setBlock(world, j1, k1 + 1, l1, 0); - setBlock(world, j1, k1 + 2, l1, 0); + setBlock(world, j1, k1 - 1, l1); + setBlock(world, j1, k1, l1); + setBlock(world, j1, k1 + 1, l1); + setBlock(world, j1, k1 + 2, l1); j1++; - setBlock(world, j1, k1 - 2, l1, 0); - setBlock(world, j1, k1 - 1, l1, 0); - setBlock(world, j1, k1, l1, 0); - setBlock(world, j1, k1 + 1, l1, 0); + setBlock(world, j1, k1 - 2, l1); + setBlock(world, j1, k1 - 1, l1); + setBlock(world, j1, k1, l1); + setBlock(world, j1, k1 + 1, l1); j1++; - setBlock(world, j1, k1 - 3, l1, 0); - setBlock(world, j1, k1 - 2, l1, 0); - setBlock(world, j1, k1 - 1, l1, 0); - setBlock(world, j1, k1, l1, 0); + setBlock(world, j1, k1 - 3, l1); + setBlock(world, j1, k1 - 2, l1); + setBlock(world, j1, k1 - 1, l1); + setBlock(world, j1, k1, l1); j1++; - setBlock(world, j1, k1 - 4, l1, 0); - setBlock(world, j1, k1 - 3, l1, 0); - setBlock(world, j1, k1 - 2, l1, 0); - setBlock(world, j1, k1 - 1, l1, 0); + setBlock(world, j1, k1 - 4, l1); + setBlock(world, j1, k1 - 3, l1); + setBlock(world, j1, k1 - 2, l1); + setBlock(world, j1, k1 - 1, l1); j1++; - setBlock(world, j1, k1 - 5, l1, 0); - setBlock(world, j1, k1 - 4, l1, 0); - setBlock(world, j1, k1 - 3, l1, 0); - setBlock(world, j1, k1 - 2, l1, 0); + setBlock(world, j1, k1 - 5, l1); + setBlock(world, j1, k1 - 4, l1); + setBlock(world, j1, k1 - 3, l1); + setBlock(world, j1, k1 - 2, l1); j1++; - setBlock(world, j1, k1 - 5, l1, 0); - setBlock(world, j1, k1 - 4, l1, 0); + setBlock(world, j1, k1 - 5, l1); + setBlock(world, j1, k1 - 4, l1); j1++; - setBlock(world, j1, k1 - 5, l1, 0); - setBlock(world, j1, k1 - 4, l1, 0); + setBlock(world, j1, k1 - 5, l1); + setBlock(world, j1, k1 - 4, l1); j1++; - setBlock(world, j1, k1 - 5, l1, 0); - setBlock(world, j1, k1 - 4, l1, 0); + setBlock(world, j1, k1 - 5, l1); + setBlock(world, j1, k1 - 4, l1); j1++; - setBlock(world, j1, k1 - 5, l1, 0); - setBlock(world, j1, k1 - 4, l1, 0); + setBlock(world, j1, k1 - 5, l1); + setBlock(world, j1, k1 - 4, l1); j1++; - setBlock(world, j1, k1 - 5, l1, 0); - setBlock(world, j1, k1 - 4, l1, 0); + setBlock(world, j1, k1 - 5, l1); + setBlock(world, j1, k1 - 4, l1); j1++; - setBlock(world, j1, k1 - 5, l1, 0); - setBlock(world, j1, k1 - 4, l1, 0); + setBlock(world, j1, k1 - 5, l1); + setBlock(world, j1, k1 - 4, l1); j1++; - setBlock(world, j1, k1 - 5, l1, 0); - setBlock(world, j1, k1 - 4, l1, 0); + setBlock(world, j1, k1 - 5, l1); + setBlock(world, j1, k1 - 4, l1); j1++; for (int z = 0; z < 21; z++) { - setBlock(world, j1, k1 - 5, l1, 0); - setBlock(world, j1, k1 - 4, l1, 0); + setBlock(world, j1, k1 - 5, l1); + setBlock(world, j1, k1 - 4, l1); } - setBlock(world, j1, k1 - 4, l1 + 21, 0); - setBlock(world, j1, k1 - 5, l1 + 21, 0); - setBlock(world, j1, k1 - 6, l1 + 21, 0); + setBlock(world, j1, k1 - 4, l1 + 21); + setBlock(world, j1, k1 - 5, l1 + 21); + setBlock(world, j1, k1 - 6, l1 + 21); for (int z = 0; z < 8; z++) { for (int y = 4; y < 7; y++) { - setBlock(world, j1, k1 - y - z, l1 + 22 + z, 0); + setBlock(world, j1, k1 - y - z, l1 + 22 + z); } } int j4 = random.nextInt(100); if (j4 <= 20) { for (int x = -1; x < 2; x++) { - setBlock(world, j1 + x, k1 - 12, l1 + 31, 0); - setBlock(world, j1 + x, k1 - 13, l1 + 31, 0); - setBlock(world, j1 + x, k1 - 12, l1 + 32, 0); - setBlock(world, j1 + x, k1 - 13, l1 + 32, 0); - setBlock(world, j1 + x, k1 - 12, l1 + 33, 0); - setBlock(world, j1 + x, k1 - 13, l1 + 33, 0); + setBlock(world, j1 + x, k1 - 12, l1 + 31); + setBlock(world, j1 + x, k1 - 13, l1 + 31); + setBlock(world, j1 + x, k1 - 12, l1 + 32); + setBlock(world, j1 + x, k1 - 13, l1 + 32); + setBlock(world, j1 + x, k1 - 12, l1 + 33); + setBlock(world, j1 + x, k1 - 13, l1 + 33); } - setBlock(world, j1, k1 - 10, l1 + 31, Block.blockLapis.blockID); + setBlock(world, j1, k1 - 10, l1 + 31, Blocks.lapis_block); setBlock(world, j1, k1 - 10, l1 + 32, pickBlock(random)); - setBlock(world, j1, k1 - 10, l1 + 33, Block.blockLapis.blockID); - setBlock(world, j1 + 1, k1 - 10, l1 + 31, Block.blockLapis.blockID); - setBlock(world, j1 + 1, k1 - 10, l1 + 32, Block.blockLapis.blockID); - setBlock(world, j1 + 1, k1 - 10, l1 + 33, Block.blockLapis.blockID); - setBlock(world, j1 - 1, k1 - 10, l1 + 31, Block.blockLapis.blockID); - setBlock(world, j1 - 1, k1 - 10, l1 + 32, Block.blockLapis.blockID); - setBlock(world, j1 - 1, k1 - 10, l1 + 33, Block.blockLapis.blockID); - setBlock(world, j1, k1 - 11, l1 + 32, Block.chest.blockID); - ChestFiller.fillWithRares(world.getBlockTileEntity(j1, k1 - 11, l1 + 32)); + setBlock(world, j1, k1 - 10, l1 + 33, Blocks.lapis_block); + setBlock(world, j1 + 1, k1 - 10, l1 + 31, Blocks.lapis_block); + setBlock(world, j1 + 1, k1 - 10, l1 + 32, Blocks.lapis_block); + setBlock(world, j1 + 1, k1 - 10, l1 + 33, Blocks.lapis_block); + setBlock(world, j1 - 1, k1 - 10, l1 + 31, Blocks.lapis_block); + setBlock(world, j1 - 1, k1 - 10, l1 + 32, Blocks.lapis_block); + setBlock(world, j1 - 1, k1 - 10, l1 + 33, Blocks.lapis_block); + setBlock(world, j1, k1 - 11, l1 + 32, Blocks.chest); + ChestFiller.fillWithRares(world.getTileEntity(j1, k1 - 11, l1 + 32)); } j1++; - setBlock(world, j1, k1 - 4, l1, 0); - setBlock(world, j1, k1 - 5, l1, 0); - setBlock(world, j1, k1 - 6, l1, 0); + setBlock(world, j1, k1 - 4, l1); + setBlock(world, j1, k1 - 5, l1); + setBlock(world, j1, k1 - 6, l1); j1++; - setBlock(world, j1, k1 - 4, l1, 0); - setBlock(world, j1, k1 - 5, l1, 0); - setBlock(world, j1, k1 - 6, l1, 0); - setBlock(world, j1, k1 - 7, l1, 0); + setBlock(world, j1, k1 - 4, l1); + setBlock(world, j1, k1 - 5, l1); + setBlock(world, j1, k1 - 6, l1); + setBlock(world, j1, k1 - 7, l1); j1++; - setBlock(world, j1, k1 - 5, l1, 0); - setBlock(world, j1, k1 - 6, l1, 0); - setBlock(world, j1, k1 - 7, l1, 0); - setBlock(world, j1, k1 - 8, l1, 0); + setBlock(world, j1, k1 - 5, l1); + setBlock(world, j1, k1 - 6, l1); + setBlock(world, j1, k1 - 7, l1); + setBlock(world, j1, k1 - 8, l1); j1++; - setBlock(world, j1, k1 - 6, l1, 0); - setBlock(world, j1, k1 - 7, l1, 0); - setBlock(world, j1, k1 - 8, l1, 0); - setBlock(world, j1, k1 - 9, l1, 0); + setBlock(world, j1, k1 - 6, l1); + setBlock(world, j1, k1 - 7, l1); + setBlock(world, j1, k1 - 8, l1); + setBlock(world, j1, k1 - 9, l1); j1++; - setBlock(world, j1, k1 - 7, l1, 0); - setBlock(world, j1, k1 - 8, l1, 0); - setBlock(world, j1, k1 - 9, l1, 0); - setBlock(world, j1, k1 - 10, l1, 0); + setBlock(world, j1, k1 - 7, l1); + setBlock(world, j1, k1 - 8, l1); + setBlock(world, j1, k1 - 9, l1); + setBlock(world, j1, k1 - 10, l1); j1++; - setBlock(world, j1, k1 - 9, l1, 0); - setBlock(world, j1, k1 - 10, l1, 0); + setBlock(world, j1, k1 - 9, l1); + setBlock(world, j1, k1 - 10, l1); j1++; - setBlock(world, j1, k1 - 9, l1, 0); - setBlock(world, j1, k1 - 10, l1, 0); + setBlock(world, j1, k1 - 9, l1); + setBlock(world, j1, k1 - 10, l1); j1++; - setBlock(world, j1, k1 - 9, l1, 0); - setBlock(world, j1, k1 - 10, l1, 0); + setBlock(world, j1, k1 - 9, l1); + setBlock(world, j1, k1 - 10, l1); j1++; - setBlock(world, j1, k1 - 9, l1, 0); - setBlock(world, j1, k1 - 10, l1, 0); + setBlock(world, j1, k1 - 9, l1); + setBlock(world, j1, k1 - 10, l1); setBlock(world, j1, k1 - 8, l1 + 1, pickBlock(random)); setBlock(world, j1, k1 - 9, l1 + 1, pickBlock(random)); setBlock(world, j1, k1 - 9, l1 - 1, pickBlock(random)); @@ -1290,7 +1291,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 - 2, pickBlock(random)); @@ -1300,7 +1301,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 2, pickBlock(random)); @@ -1312,7 +1313,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 2, pickBlock(random)); @@ -1324,7 +1325,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 2, pickBlock(random)); @@ -1334,7 +1335,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 2, pickBlock(random)); @@ -1346,7 +1347,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 2, pickBlock(random)); @@ -1358,10 +1359,10 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } - setBlock(world, j1, k1 - 10, l1 + 2, Block.stone.blockID); + setBlock(world, j1, k1 - 10, l1 + 2, Blocks.stone); setBlock(world, j1, k1 - 10, l1 - 2, pickBlock(random)); setBlock(world, j1, k1 - 9, l1 - 2, pickBlock(random)); j1++; @@ -1370,7 +1371,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 2, pickBlock(random)); @@ -1382,7 +1383,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 2, pickBlock(random)); @@ -1393,7 +1394,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 2, pickBlock(random)); @@ -1405,7 +1406,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 2, pickBlock(random)); @@ -1415,7 +1416,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 2, pickBlock(random)); @@ -1425,7 +1426,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 2, pickBlock(random)); @@ -1437,7 +1438,7 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 - 2, pickBlock(random)); @@ -1447,14 +1448,14 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); for (int y = 0; y < 3; y++) { for (int z = -1; z < 2; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 2, pickBlock(random)); setBlock(world, j1, k1 - 9, l1 + 2, pickBlock(random)); j1++; - setBlock(world, j1, k1 - 10, l1, 0); - setBlock(world, j1, k1 - 9, l1, 0); + setBlock(world, j1, k1 - 10, l1); + setBlock(world, j1, k1 - 9, l1); setBlock(world, j1, k1 - 11, l1, pickBlock(random)); setBlock(world, j1, k1 - 11, l1 + 1, pickBlock(random)); setBlock(world, j1, k1 - 11, l1 - 1, pickBlock(random)); @@ -1467,11 +1468,11 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1, k1 - 8, l1, pickBlock(random)); int k6 = random.nextInt(100); if (k6 <= 30) { - setBlock(world, j1 - 1, k1 - 8, l1 + 3, Block.vine.blockID); - setBlock(world, j1 - 2, k1 - 8, l1, Block.vine.blockID); - setBlock(world, j1 - 2, k1 - 9, l1, Block.vine.blockID); - setBlock(world, j1 - 4, k1 - 8, l1 + 2, Block.vine.blockID); - setBlock(world, j1 - 6, k1 - 8, l1 - 1, Block.vine.blockID); + setBlock(world, j1 - 1, k1 - 8, l1 + 3, Blocks.vine); + setBlock(world, j1 - 2, k1 - 8, l1, Blocks.vine); + setBlock(world, j1 - 2, k1 - 9, l1, Blocks.vine); + setBlock(world, j1 - 4, k1 - 8, l1 + 2, Blocks.vine); + setBlock(world, j1 - 6, k1 - 8, l1 - 1, Blocks.vine); } j1++; for (int z = -4; z < 5; z++) { @@ -1479,7 +1480,7 @@ public class StructureMysticDungeon extends WorldGenerator { } for (int y = 0; y < 4; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 5, pickBlock(random)); @@ -1493,7 +1494,7 @@ public class StructureMysticDungeon extends WorldGenerator { } for (int y = 0; y < 4; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 5, pickBlock(random)); @@ -1505,7 +1506,7 @@ public class StructureMysticDungeon extends WorldGenerator { } for (int y = 0; y < 4; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 5, pickBlock(random)); @@ -1519,7 +1520,7 @@ public class StructureMysticDungeon extends WorldGenerator { } for (int y = 0; y < 4; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 5, pickBlock(random)); @@ -1533,7 +1534,7 @@ public class StructureMysticDungeon extends WorldGenerator { } for (int y = 0; y < 4; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 5, pickBlock(random)); @@ -1547,7 +1548,7 @@ public class StructureMysticDungeon extends WorldGenerator { } for (int y = 0; y < 4; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 5, pickBlock(random)); @@ -1559,7 +1560,7 @@ public class StructureMysticDungeon extends WorldGenerator { } for (int y = 0; y < 4; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 5, pickBlock(random)); @@ -1572,7 +1573,7 @@ public class StructureMysticDungeon extends WorldGenerator { } for (int y = 0; y < 4; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 5, pickBlock(random)); @@ -1584,7 +1585,7 @@ public class StructureMysticDungeon extends WorldGenerator { } for (int y = 0; y < 4; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 5, pickBlock(random)); @@ -1598,7 +1599,7 @@ public class StructureMysticDungeon extends WorldGenerator { } for (int y = 0; y < 4; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 5, pickBlock(random)); @@ -1611,7 +1612,7 @@ public class StructureMysticDungeon extends WorldGenerator { } for (int y = 0; y < 4; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 5, pickBlock(random)); @@ -1623,7 +1624,7 @@ public class StructureMysticDungeon extends WorldGenerator { } for (int y = 0; y < 4; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 5, pickBlock(random)); @@ -1633,7 +1634,7 @@ public class StructureMysticDungeon extends WorldGenerator { } for (int y = 0; y < 4; y++) { for (int z = -4; z < 5; z++) { - setBlock(world, j1, k1 - 10 - y, l1 + z, 0); + setBlock(world, j1, k1 - 10 - y, l1 + z); } } setBlock(world, j1, k1 - 10, l1 + 5, pickBlock(random)); @@ -1648,91 +1649,91 @@ public class StructureMysticDungeon extends WorldGenerator { } int l8 = random.nextInt(100); if (l8 <= 50) { - setBlock(world, j1 - 1, k1 - 10, l1 + 2, Block.stoneDoubleSlab.blockID); - setBlock(world, j1 - 1, k1 - 9, l1 + 2, Block.stoneDoubleSlab.blockID); - setBlock(world, j1 - 1, k1 - 8, l1 + 2, Block.stoneDoubleSlab.blockID); - setBlock(world, j1 - 1, k1 - 10, l1 + 3, Block.stoneDoubleSlab.blockID); - setBlock(world, j1 - 1, k1 - 9, l1 + 3, Block.stoneDoubleSlab.blockID); - setBlock(world, j1 - 1, k1 - 8, l1 + 3, Block.stoneDoubleSlab.blockID); + setBlock(world, j1 - 1, k1 - 10, l1 + 2, Blocks.double_stone_slab); + setBlock(world, j1 - 1, k1 - 9, l1 + 2, Blocks.double_stone_slab); + setBlock(world, j1 - 1, k1 - 8, l1 + 2, Blocks.double_stone_slab); + setBlock(world, j1 - 1, k1 - 10, l1 + 3, Blocks.double_stone_slab); + setBlock(world, j1 - 1, k1 - 9, l1 + 3, Blocks.double_stone_slab); + setBlock(world, j1 - 1, k1 - 8, l1 + 3, Blocks.double_stone_slab); } int l9 = random.nextInt(100); if (l9 <= 60) { - setBlock(world, j1 - 2, k1 - 10, l1 + 2, Block.stoneDoubleSlab.blockID); - setBlock(world, j1 - 2, k1 - 9, l1 + 2, Block.stoneDoubleSlab.blockID); - setBlock(world, j1 - 2, k1 - 8, l1 + 2, Block.stoneDoubleSlab.blockID); - setBlock(world, j1 - 2, k1 - 10, l1 + 3, Block.stoneDoubleSlab.blockID); - setBlock(world, j1 - 2, k1 - 9, l1 + 3, Block.stoneDoubleSlab.blockID); + setBlock(world, j1 - 2, k1 - 10, l1 + 2, Blocks.double_stone_slab); + setBlock(world, j1 - 2, k1 - 9, l1 + 2, Blocks.double_stone_slab); + setBlock(world, j1 - 2, k1 - 8, l1 + 2, Blocks.double_stone_slab); + setBlock(world, j1 - 2, k1 - 10, l1 + 3, Blocks.double_stone_slab); + setBlock(world, j1 - 2, k1 - 9, l1 + 3, Blocks.double_stone_slab); } int l10 = random.nextInt(100); if (l10 <= 70) { - setBlock(world, j1 - 3, k1 - 10, l1 + 2, Block.stoneDoubleSlab.blockID); - setBlock(world, j1 - 3, k1 - 9, l1 + 2, Block.stoneDoubleSlab.blockID); - setBlock(world, j1 - 3, k1 - 10, l1 + 3, Block.stoneDoubleSlab.blockID); - setBlock(world, j1 - 3, k1 - 9, l1 + 3, Block.stoneDoubleSlab.blockID); + setBlock(world, j1 - 3, k1 - 10, l1 + 2, Blocks.double_stone_slab); + setBlock(world, j1 - 3, k1 - 9, l1 + 2, Blocks.double_stone_slab); + setBlock(world, j1 - 3, k1 - 10, l1 + 3, Blocks.double_stone_slab); + setBlock(world, j1 - 3, k1 - 9, l1 + 3, Blocks.double_stone_slab); } int l11 = random.nextInt(100); if (l11 <= 40) { - setBlock(world, j1 - 1, k1 - 10, l1 - 2, Block.brick.blockID); - setBlock(world, j1 - 1, k1 - 9, l1 - 2, Block.brick.blockID); - setBlock(world, j1 - 1, k1 - 8, l1 - 2, Block.brick.blockID); - setBlock(world, j1 - 1, k1 - 10, l1 - 3, Block.brick.blockID); - setBlock(world, j1 - 1, k1 - 9, l1 - 3, Block.brick.blockID); + setBlock(world, j1 - 1, k1 - 10, l1 - 2, Blocks.stonebrick); + setBlock(world, j1 - 1, k1 - 9, l1 - 2, Blocks.stonebrick); + setBlock(world, j1 - 1, k1 - 8, l1 - 2, Blocks.stonebrick); + setBlock(world, j1 - 1, k1 - 10, l1 - 3, Blocks.stonebrick); + setBlock(world, j1 - 1, k1 - 9, l1 - 3, Blocks.stonebrick); } int k12 = random.nextInt(100); if (k12 <= 50) { - setBlock(world, j1 - 2, k1 - 10, l1 - 2, Block.brick.blockID); - setBlock(world, j1 - 2, k1 - 9, l1 - 2, Block.brick.blockID); - setBlock(world, j1 - 2, k1 - 8, l1 - 2, Block.brick.blockID); - setBlock(world, j1 - 2, k1 - 10, l1 - 3, Block.brick.blockID); - setBlock(world, j1 - 2, k1 - 9, l1 - 3, Block.brick.blockID); - setBlock(world, j1 - 2, k1 - 8, l1 - 3, Block.brick.blockID); + setBlock(world, j1 - 2, k1 - 10, l1 - 2, Blocks.stonebrick); + setBlock(world, j1 - 2, k1 - 9, l1 - 2, Blocks.stonebrick); + setBlock(world, j1 - 2, k1 - 8, l1 - 2, Blocks.stonebrick); + setBlock(world, j1 - 2, k1 - 10, l1 - 3, Blocks.stonebrick); + setBlock(world, j1 - 2, k1 - 9, l1 - 3, Blocks.stonebrick); + setBlock(world, j1 - 2, k1 - 8, l1 - 3, Blocks.stonebrick); } int l12 = random.nextInt(100); if (l12 <= 40) { - setBlock(world, j1 - 4, k1 - 10, l1 - 2, Block.netherBrick.blockID); - setBlock(world, j1 - 4, k1 - 9, l1 - 2, Block.netherBrick.blockID); - setBlock(world, j1 - 4, k1 - 10, l1 - 3, Block.netherBrick.blockID); - setBlock(world, j1 - 4, k1 - 9, l1 - 3, Block.netherBrick.blockID); + setBlock(world, j1 - 4, k1 - 10, l1 - 2, Blocks.nether_brick); + setBlock(world, j1 - 4, k1 - 9, l1 - 2, Blocks.nether_brick); + setBlock(world, j1 - 4, k1 - 10, l1 - 3, Blocks.nether_brick); + setBlock(world, j1 - 4, k1 - 9, l1 - 3, Blocks.nether_brick); } int i13 = random.nextInt(100); if (i13 <= 40) { - setBlock(world, j1 - 5, k1 - 10, l1 - 2, Block.netherBrick.blockID); - setBlock(world, j1 - 5, k1 - 9, l1 - 2, Block.netherBrick.blockID); - setBlock(world, j1 - 5, k1 - 10, l1 - 3, Block.netherBrick.blockID); - setBlock(world, j1 - 5, k1 - 9, l1 - 3, Block.netherBrick.blockID); - setBlock(world, j1 - 6, k1 - 10, l1 - 2, Block.netherBrick.blockID); - setBlock(world, j1 - 6, k1 - 9, l1 - 2, Block.netherBrick.blockID); - setBlock(world, j1 - 6, k1 - 10, l1 - 3, Block.netherBrick.blockID); + setBlock(world, j1 - 5, k1 - 10, l1 - 2, Blocks.nether_brick); + setBlock(world, j1 - 5, k1 - 9, l1 - 2, Blocks.nether_brick); + setBlock(world, j1 - 5, k1 - 10, l1 - 3, Blocks.nether_brick); + setBlock(world, j1 - 5, k1 - 9, l1 - 3, Blocks.nether_brick); + setBlock(world, j1 - 6, k1 - 10, l1 - 2, Blocks.nether_brick); + setBlock(world, j1 - 6, k1 - 9, l1 - 2, Blocks.nether_brick); + setBlock(world, j1 - 6, k1 - 10, l1 - 3, Blocks.nether_brick); } int j13 = random.nextInt(100); if (j13 <= 15) { - setBlock(world, j1 - 9, k1 - 10, l1 + 2, Block.chest.blockID); - ChestFiller.fillWithValuables(world.getBlockTileEntity(j1 - 9, k1 - 10, l1 + 2)); + setBlock(world, j1 - 9, k1 - 10, l1 + 2, Blocks.chest); + ChestFiller.fillWithValuables(world.getTileEntity(j1 - 9, k1 - 10, l1 + 2)); } if (j13 >= 85) { - setBlock(world, j1 - 9, k1 - 10, l1 - 2, Block.chest.blockID); - ChestFiller.fillWithRares(world.getBlockTileEntity(j1 - 9, k1 - 10, l1 - 2)); + setBlock(world, j1 - 9, k1 - 10, l1 - 2, Blocks.chest); + ChestFiller.fillWithRares(world.getTileEntity(j1 - 9, k1 - 10, l1 - 2)); } } if (i8 != 2) { return true; } for (int y = 0; y < 4; y++) { - setBlockAndMetadata(world, j1 - 1, k1 - 10 - y, l1, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 1, k1 - 10 - y, l1 + 3, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 1, k1 - 10 - y, l1 - 3, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 3, k1 - 10 - y, l1, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 3, k1 - 10 - y, l1 + 3, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 3, k1 - 10 - y, l1 - 3, Block.blockNetherQuartz.blockID, 2); + setBlockAndMetadata(world, j1 - 1, k1 - 10 - y, l1, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 1, k1 - 10 - y, l1 + 3, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 1, k1 - 10 - y, l1 - 3, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 3, k1 - 10 - y, l1, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 3, k1 - 10 - y, l1 + 3, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 3, k1 - 10 - y, l1 - 3, Blocks.quartz_block, 2); } - setBlock(world, j1 - 4, k1 - 10, l1, Block.mobSpawner.blockID); - TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getBlockTileEntity(j1 - 4, k1 - 10, l1); + setBlock(world, j1 - 4, k1 - 10, l1, Blocks.mob_spawner); + TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(j1 - 4, k1 - 10, l1); if (spawner != null) { - spawner.getSpawnerLogic().setMobID(Config.getRandomDungeonMob(random)); + spawner.func_145881_a().setEntityName(Config.getRandomDungeonMob(random)); } - setBlock(world, j1 - 8, k1 - 10, l1, Block.stoneSingleSlab.blockID); - setBlock(world, j1 - 8, k1 - 10, l1 + 1, Block.stoneSingleSlab.blockID); - setBlock(world, j1 - 8, k1 - 10, l1 - 1, Block.stoneSingleSlab.blockID); + setBlock(world, j1 - 8, k1 - 10, l1, Blocks.stone_slab); + setBlock(world, j1 - 8, k1 - 10, l1 + 1, Blocks.stone_slab); + setBlock(world, j1 - 8, k1 - 10, l1 - 1, Blocks.stone_slab); setBlock(world, j1 - 5, k1 - 10, l1, pickBlock(random)); setBlock(world, j1 - 5, k1 - 10, l1 + 1, pickBlock(random)); setBlock(world, j1 - 5, k1 - 10, l1 - 1, pickBlock(random)); @@ -1746,48 +1747,60 @@ public class StructureMysticDungeon extends WorldGenerator { setBlock(world, j1 - 7, k1 - 10, l1 - 1, pickBlock(random)); int i9 = random.nextInt(100); if (i9 <= 30) { - setBlock(world, j1 - 6, k1 - 9, l1, Block.chest.blockID); - ChestFiller.fillWithValuables(world.getBlockTileEntity(j1 - 6, k1 - 9, l1)); + setBlock(world, j1 - 6, k1 - 9, l1, Blocks.chest); + ChestFiller.fillWithValuables(world.getTileEntity(j1 - 6, k1 - 9, l1)); } if (i9 <= 10) { - setBlock(world, j1 - 6, k1 - 9, l1, Block.chest.blockID); - ChestFiller.fillWithRares(world.getBlockTileEntity(j1 - 6, k1 - 9, l1)); + setBlock(world, j1 - 6, k1 - 9, l1, Blocks.chest); + ChestFiller.fillWithRares(world.getTileEntity(j1 - 6, k1 - 9, l1)); } for (int y = 0; y < 4; y++) { - setBlockAndMetadata(world, j1 - 9, k1 - 10 - y, l1, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 9, k1 - 10 - y, l1 + 3, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 9, k1 - 10 - y, l1 - 3, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 11, k1 - 10 - y, l1, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 11, k1 - 10 - y, l1 + 3, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 11, k1 - 10 - y, l1 - 3, Block.blockNetherQuartz.blockID, 2); + setBlockAndMetadata(world, j1 - 9, k1 - 10 - y, l1, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 9, k1 - 10 - y, l1 + 3, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 9, k1 - 10 - y, l1 - 3, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 11, k1 - 10 - y, l1, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 11, k1 - 10 - y, l1 + 3, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 11, k1 - 10 - y, l1 - 3, Blocks.quartz_block, 2); } int i10 = random.nextInt(100); if (i10 <= 20) { - setBlock(world, j1 - 2, k1 - 10, l1 + 4, Block.chest.blockID); - ChestFiller.fillWithValuables(world.getBlockTileEntity(j1 - 2, k1 - 10, l1 + 4)); + setBlock(world, j1 - 2, k1 - 10, l1 + 4, Blocks.chest); + ChestFiller.fillWithValuables(world.getTileEntity(j1 - 2, k1 - 10, l1 + 4)); } int i11 = random.nextInt(100); if (i11 <= 40) { - setBlock(world, j1 - 3, k1 - 9, l1 + 3, 0); - setBlock(world, j1 - 3, k1 - 8, l1 + 3, 0); - setBlock(world, j1 - 3, k1 - 7, l1 + 3, 0); - setBlockAndMetadata(world, j1 - 1, k1 - 10, l1 + 4, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 2, k1 - 10, l1 + 4, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1, k1 - 10, l1 + 2, Block.blockNetherQuartz.blockID, 2); + setBlock(world, j1 - 3, k1 - 9, l1 + 3); + setBlock(world, j1 - 3, k1 - 8, l1 + 3); + setBlock(world, j1 - 3, k1 - 7, l1 + 3); + setBlockAndMetadata(world, j1 - 1, k1 - 10, l1 + 4, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 2, k1 - 10, l1 + 4, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1, k1 - 10, l1 + 2, Blocks.quartz_block, 2); } int i12 = random.nextInt(100); if (i12 <= 40) { - setBlock(world, j1 - 9, k1 - 9, l1 - 3, 0); - setBlock(world, j1 - 9, k1 - 8, l1 - 3, 0); - setBlock(world, j1 - 9, k1 - 7, l1 - 3, 0); - setBlockAndMetadata(world, j1 - 7, k1 - 10, l1 - 2, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 8, k1 - 10, l1 - 4, Block.blockNetherQuartz.blockID, 2); - setBlockAndMetadata(world, j1 - 8, k1 - 10, l1 - 2, Block.blockNetherQuartz.blockID, 2); + setBlock(world, j1 - 9, k1 - 9, l1 - 3); + setBlock(world, j1 - 9, k1 - 8, l1 - 3); + setBlock(world, j1 - 9, k1 - 7, l1 - 3); + setBlockAndMetadata(world, j1 - 7, k1 - 10, l1 - 2, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 8, k1 - 10, l1 - 4, Blocks.quartz_block, 2); + setBlockAndMetadata(world, j1 - 8, k1 - 10, l1 - 2, Blocks.quartz_block, 2); } return true; } - private static int pickBlock(Random random) { - return random.nextBoolean() ? Block.cobblestone.blockID : Block.cobblestoneMossy.blockID; + private static Block pickBlock(Random random) { + return random.nextBoolean() ? Blocks.cobblestone : Blocks.mossy_cobblestone; } + + private void setBlock(World w, int x, int y, int z){ + func_150515_a(w, x, y, z, Blocks.air); + } + + private void setBlock(World w, int x, int y, int z, Block bl){ + func_150515_a(w, x, y, z, bl); + } + + private void setBlockAndMetadata(World w, int x, int y, int z, Block bl, int meta){ + setBlockAndNotifyAdequately(w, x, y, z, bl, meta); + } } diff --git a/common/MysticRuins/StructureRuin$1.java b/common/MysticRuins/StructureRuin$1.java index d57b407..4886e2a 100644 --- a/common/MysticRuins/StructureRuin$1.java +++ b/common/MysticRuins/StructureRuin$1.java @@ -3,6 +3,7 @@ package mysticruins; import java.util.Random; import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; @@ -20,7 +21,7 @@ public class StructureRuin$1 extends WorldGenerator { if (k1 <= 0) { return false; } - if (!world.isAirBlock(j1, k1, l1) || world.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || !Block.pumpkin.canPlaceBlockAt(world, j1, k1, l1)) { + if (!world.isAirBlock(j1, k1, l1) || world.getBlock(j1, k1 - 1, l1) != Blocks.grass || !Blocks.pumpkin.canPlaceBlockAt(world, j1, k1, l1)) { return false; } int i2 = random.nextInt(3) + 1; @@ -39,81 +40,81 @@ public class StructureRuin$1 extends WorldGenerator { } else { j5 = random.nextInt(4) + 5; } - setBlock(world, j1, k1 - j5, l1, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1, (k1 - j5) + 1, l1, Block.stoneBrick.blockID, 1); - setBlock(world, j1, (k1 - j5) + 2, l1, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1, (k1 - j5) + 2, l1 + 1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1, (k1 - j5) + 3, l1 + 1, Block.stoneBrick.blockID, 1); - setBlock(world, j1, (k1 - j5) + 4, l1 + 1, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1, (k1 - j5) + 5, l1 + 1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1, (k1 - j5) + 2, l1 + 2, Block.stoneBrick.blockID, 1); - setBlock(world, j1, (k1 - j5) + 3, l1 + 2, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1, (k1 - j5) + 4, l1 + 2, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1, k1 - j5, l1 + 3, Block.stoneBrick.blockID, 1); - setBlock(world, j1, (k1 - j5) + 1, l1 + 3, Block.stoneBrick.blockID); - setBlock(world, j1, (k1 - j5) + 2, l1 + 3, Block.stoneBrick.blockID); - setBlock(world, j1, k1 - j5 - k4 - 1, l1 + 2, Block.dirt.blockID); - setBlock(world, j1, k1 - j5 - k4, l1 + 2, Block.chest.blockID); - ChestFiller.fillWithValuables(world.getBlockTileEntity(j1, k1 - j5 - k4, l1 + 2)); + setBlock(world, j1, k1 - j5, l1, Blocks.stonebrick); + setBlockAndMetadata(world, j1, (k1 - j5) + 1, l1, Blocks.stonebrick, 1); + setBlock(world, j1, (k1 - j5) + 2, l1, Blocks.stonebrick); + setBlockAndMetadata(world, j1, (k1 - j5) + 2, l1 + 1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1, (k1 - j5) + 3, l1 + 1, Blocks.stonebrick, 1); + setBlock(world, j1, (k1 - j5) + 4, l1 + 1, Blocks.stonebrick); + setBlockAndMetadata(world, j1, (k1 - j5) + 5, l1 + 1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1, (k1 - j5) + 2, l1 + 2, Blocks.stonebrick, 1); + setBlock(world, j1, (k1 - j5) + 3, l1 + 2, Blocks.stonebrick); + setBlockAndMetadata(world, j1, (k1 - j5) + 4, l1 + 2, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1, k1 - j5, l1 + 3, Blocks.stonebrick, 1); + setBlock(world, j1, (k1 - j5) + 1, l1 + 3, Blocks.stonebrick); + setBlock(world, j1, (k1 - j5) + 2, l1 + 3, Blocks.stonebrick); + setBlock(world, j1, k1 - j5 - k4 - 1, l1 + 2, Blocks.dirt); + setBlock(world, j1, k1 - j5 - k4, l1 + 2, Blocks.chest); + ChestFiller.fillWithValuables(world.getTileEntity(j1, k1 - j5 - k4, l1 + 2)); l6 = 1; i6 = 0; flag = false; do { if (world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) - || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) == Block.waterStill.blockID || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) == Block.waterStill.blockID - || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) == Block.waterStill.blockID) { + || world.getBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) == Blocks.water || world.getBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) == Blocks.water + || world.getBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) == Blocks.water) { i6++; } else { flag = true; } } while (!flag && l6++ < 12); - setBlock(world, j1 + l3, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + l3 + 1, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + l3 + 1, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + l3 + 2, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + l3 + 3, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + l3 + 4, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + l3 + 5, k1 - j5 - i6, l1 + l3 + 4, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + l3, k1 - j5 - i6, l1 + l3 + 5, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 5, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 6, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 3) - i6, l1 + l3 + 6, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + l3, k1 - j5 - i6, l1 + l3 + 7, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 7, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 7, Block.stoneBrick.blockID, 1); + setBlock(world, j1 + l3, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + l3 + 1, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + l3 + 1, ((k1 - j5) + 1) - i6, l1 + l3 + 4, Blocks.stonebrick, 1); + setBlock(world, j1 + l3 + 2, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + l3 + 3, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + l3 + 4, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick, 1); + setBlock(world, j1 + l3 + 5, k1 - j5 - i6, l1 + l3 + 4, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + l3, k1 - j5 - i6, l1 + l3 + 5, Blocks.stonebrick, 1); + setBlock(world, j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 5, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 6, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 3) - i6, l1 + l3 + 6, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + l3, k1 - j5 - i6, l1 + l3 + 7, Blocks.stonebrick, 1); + setBlock(world, j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 7, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 7, Blocks.stonebrick, 1); k7 = random.nextInt(100); if (k7 <= 30) { - setBlock(world, j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5, Block.mobSpawner.blockID); - TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getBlockTileEntity(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5); + setBlock(world, j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5, Blocks.mob_spawner); + TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5); if (spawner != null) { - spawner.getSpawnerLogic().setMobID(DungeonHooks.getRandomDungeonMob(random)); + spawner.func_145881_a().setEntityName(DungeonHooks.getRandomDungeonMob(random)); } - setBlock(world, j1 + l3, k1 - j5 - i6 - k4 - 1, l1 + l3 + 5, Block.dirt.blockID); + setBlock(world, j1 + l3, k1 - j5 - i6 - k4 - 1, l1 + l3 + 5, Blocks.dirt); } l6 = 1; i6 = 0; flag = false; do { if (world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 4) || world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 5) || world.isAirBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) - || world.getBlockId(j1 - i3, k1 - j5 - l6, l1 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - i3, k1 - j5 - l6, l1 - 5) == Block.waterStill.blockID - || world.getBlockId(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) == Block.waterStill.blockID) { + || world.getBlock(j1 - i3, k1 - j5 - l6, l1 - 4) == Blocks.water || world.getBlock(j1 - i3, k1 - j5 - l6, l1 - 5) == Blocks.water + || world.getBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) == Blocks.water) { i6++; } else { flag = true; } } while (!flag && l6++ < 12); - setBlock(world, j1 - i3, k1 - j5 - i6, l1 - 4, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 - i3, ((k1 - j5) + 1) - i6, l1 - 4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - i3, k1 - j5 - i6, l1 - 5, Block.stoneBrick.blockID, 1); - setBlock(world, j1 - i3 - 1, k1 - j5 - i6, l1 - 5, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 - i3 - 1, ((k1 - j5) + 1) - i6, l1 - 5, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - i3 - 1, ((k1 - j5) + 2) - i6, l1 - 5, Block.stoneBrick.blockID, 1); - setBlock(world, j1 - i3 - 2, k1 - j5 - i6, l1 - 5, Block.stoneBrick.blockID); + setBlock(world, j1 - i3, k1 - j5 - i6, l1 - 4, Blocks.stonebrick); + setBlockAndMetadata(world, j1 - i3, ((k1 - j5) + 1) - i6, l1 - 4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - i3, k1 - j5 - i6, l1 - 5, Blocks.stonebrick, 1); + setBlock(world, j1 - i3 - 1, k1 - j5 - i6, l1 - 5, Blocks.stonebrick); + setBlockAndMetadata(world, j1 - i3 - 1, ((k1 - j5) + 1) - i6, l1 - 5, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - i3 - 1, ((k1 - j5) + 2) - i6, l1 - 5, Blocks.stonebrick, 1); + setBlock(world, j1 - i3 - 2, k1 - j5 - i6, l1 - 5, Blocks.stonebrick); k7 = random.nextInt(100); if (k7 <= 60) { - setBlock(world, j1 - i3 - 1, k1 - j5 - i6 - k4, l1 - 5, Block.dirt.blockID); - setBlock(world, j1 - i3 - 1, k1 - j5 - i6 - k4 - 1, l1 - 5, Block.dirt.blockID); + setBlock(world, j1 - i3 - 1, k1 - j5 - i6 - k4, l1 - 5, Blocks.dirt); + setBlock(world, j1 - i3 - 1, k1 - j5 - i6 - k4 - 1, l1 - 5, Blocks.dirt); } } if (i2 == 2) { @@ -132,143 +133,143 @@ public class StructureRuin$1 extends WorldGenerator { } else { k5 = random.nextInt(4) + 5; } - setBlock(world, j1, k1 - k5, l1, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1, k1 - k5, l1 + 1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1, k1 - k5, l1 + 2, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1, k1 - k5, l1 + 3, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1, k1 - k5, l1 + 4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1, (k1 - k5) + 1, l1 + 2, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1, (k1 - k5) + 2, l1 + 2, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1, (k1 - k5) + 3, l1 + 2, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1, (k1 - k5) + 1, l1 + 1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + 1, k1 - k5, l1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + 2, k1 - k5, l1, Block.stoneBrick.blockID, 1); - setBlock(world, j1, k1 - k5 - l4, l1 + 2, Block.dirt.blockID); - setBlock(world, j1, k1 - k5 - l4 - 1, l1 + 2, Block.dirt.blockID); + setBlock(world, j1, k1 - k5, l1, Blocks.stonebrick); + setBlockAndMetadata(world, j1, k1 - k5, l1 + 1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1, k1 - k5, l1 + 2, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1, k1 - k5, l1 + 3, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1, k1 - k5, l1 + 4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1, (k1 - k5) + 1, l1 + 2, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1, (k1 - k5) + 2, l1 + 2, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1, (k1 - k5) + 3, l1 + 2, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1, (k1 - k5) + 1, l1 + 1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + 1, k1 - k5, l1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + 2, k1 - k5, l1, Blocks.stonebrick, 1); + setBlock(world, j1, k1 - k5 - l4, l1 + 2, Blocks.dirt); + setBlock(world, j1, k1 - k5 - l4 - 1, l1 + 2, Blocks.dirt); i7 = 1; j6 = 0; flag1 = false; do { if (world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 4) || world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 5) || world.isAirBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) - || world.getBlockId(j1 - k2, k1 - k5 - i7, l1 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - k2, k1 - k5 - i7, l1 - 5) == Block.waterStill.blockID - || world.getBlockId(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) == Block.waterStill.blockID) { + || world.getBlock(j1 - k2, k1 - k5 - i7, l1 - 4) == Blocks.water || world.getBlock(j1 - k2, k1 - k5 - i7, l1 - 5) == Blocks.water + || world.getBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) == Blocks.water) { j6++; } else { flag1 = true; } } while (!flag1 && i7++ < 12); - setBlock(world, j1 - k2, k1 - k5 - j6, l1 - 3, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 - k2, k1 - k5 - j6, l1 - 4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 1) - j6, l1 - 4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 2) - j6, l1 - 4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - k2, k1 - k5 - j6, l1 - 5, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 1) - j6, l1 - 5, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 2) - j6, l1 - 5, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 3) - j6, l1 - 5, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 4) - j6, l1 - 5, Block.stoneBrick.blockID, 1); - setBlock(world, j1 - k2 - 1, k1 - k5 - j6, l1 - 5, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 - k2 - 1, ((k1 - k5) + 1) - j6, l1 - 5, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - k2 - 1, ((k1 - k5) + 2) - j6, l1 - 5, Block.stoneBrick.blockID, 1); - setBlock(world, j1 - k2 - 2, k1 - k5 - j6, l1 - 5, Block.stoneBrick.blockID); + setBlock(world, j1 - k2, k1 - k5 - j6, l1 - 3, Blocks.stonebrick); + setBlockAndMetadata(world, j1 - k2, k1 - k5 - j6, l1 - 4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 1) - j6, l1 - 4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 2) - j6, l1 - 4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - k2, k1 - k5 - j6, l1 - 5, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 1) - j6, l1 - 5, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 2) - j6, l1 - 5, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 3) - j6, l1 - 5, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - k2, ((k1 - k5) + 4) - j6, l1 - 5, Blocks.stonebrick, 1); + setBlock(world, j1 - k2 - 1, k1 - k5 - j6, l1 - 5, Blocks.stonebrick); + setBlockAndMetadata(world, j1 - k2 - 1, ((k1 - k5) + 1) - j6, l1 - 5, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - k2 - 1, ((k1 - k5) + 2) - j6, l1 - 5, Blocks.stonebrick, 1); + setBlock(world, j1 - k2 - 2, k1 - k5 - j6, l1 - 5, Blocks.stonebrick); l7 = random.nextInt(100); if (l7 <= 30) { - setBlock(world, j1 - k2 - 1, k1 - k5 - j6 - l4, l1 - 5, Block.dirt.blockID); - setBlock(world, j1 - k2 - 1, k1 - k5 - j6 - l4 - 1, l1 - 5, Block.dirt.blockID); + setBlock(world, j1 - k2 - 1, k1 - k5 - j6 - l4, l1 - 5, Blocks.dirt); + setBlock(world, j1 - k2 - 1, k1 - k5 - j6 - l4 - 1, l1 - 5, Blocks.dirt); } i7 = 1; j6 = 0; flag1 = false; do { if (world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 4) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 6) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 8) - || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 4) == Block.waterStill.blockID || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 6) == Block.waterStill.blockID - || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 8) == Block.waterStill.blockID) { + || world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 4) == Blocks.water || world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 6) == Blocks.water + || world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 8) == Blocks.water) { j6++; } else { flag1 = true; } } while (!flag1 && i7++ < 12); - setBlock(world, j1 + i4, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + i4 + 1, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + i4 + 1, ((k1 - k5) + 1) - j6, l1 + 4, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + i4 + 2, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID); - setBlock(world, j1 + i4 + 3, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID); - setBlock(world, j1 + i4 + 3, ((k1 - k5) + 1) - j6, l1 + 4, Block.stoneBrick.blockID); - setBlock(world, j1 + i4 + 4, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID); - setBlock(world, j1 + i4 + 5, k1 - k5 - j6, l1 + 4, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + i4, k1 - k5 - j6, l1 + 5, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 5, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 2) - j6, l1 + 6, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + i4, k1 - k5 - j6, l1 + 7, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 7, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 2) - j6, l1 + 7, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + i4, k1 - k5 - j6, l1 + 8, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 8, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + i4, k1 - k5 - j6, l1 + 9, Block.stoneBrick.blockID, 1); + setBlock(world, j1 + i4, k1 - k5 - j6, l1 + 4, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + i4 + 1, k1 - k5 - j6, l1 + 4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + i4 + 1, ((k1 - k5) + 1) - j6, l1 + 4, Blocks.stonebrick, 1); + setBlock(world, j1 + i4 + 2, k1 - k5 - j6, l1 + 4, Blocks.stonebrick); + setBlock(world, j1 + i4 + 3, k1 - k5 - j6, l1 + 4, Blocks.stonebrick); + setBlock(world, j1 + i4 + 3, ((k1 - k5) + 1) - j6, l1 + 4, Blocks.stonebrick); + setBlock(world, j1 + i4 + 4, k1 - k5 - j6, l1 + 4, Blocks.stonebrick); + setBlock(world, j1 + i4 + 5, k1 - k5 - j6, l1 + 4, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + i4, k1 - k5 - j6, l1 + 5, Blocks.stonebrick, 1); + setBlock(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 5, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 2) - j6, l1 + 6, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + i4, k1 - k5 - j6, l1 + 7, Blocks.stonebrick, 1); + setBlock(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 7, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 2) - j6, l1 + 7, Blocks.stonebrick, 1); + setBlock(world, j1 + i4, k1 - k5 - j6, l1 + 8, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + i4, ((k1 - k5) + 1) - j6, l1 + 8, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + i4, k1 - k5 - j6, l1 + 9, Blocks.stonebrick, 1); l7 = random.nextInt(100); if (l7 <= 60) { - setBlock(world, j1 + i4, k1 - k5 - j6 - l4, l1 + 7, Block.dirt.blockID); - setBlock(world, j1 + i4, k1 - k5 - j6 - l4 - 1, l1 + 7, Block.dirt.blockID); + setBlock(world, j1 + i4, k1 - k5 - j6 - l4, l1 + 7, Blocks.dirt); + setBlock(world, j1 + i4, k1 - k5 - j6 - l4 - 1, l1 + 7, Blocks.dirt); } i7 = 1; j6 = 0; flag1 = false; do { if (world.isAirBlock(j1 - j3, k1 - k5 - i7, l1 + i4) || world.isAirBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) || world.isAirBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) - || world.getBlockId(j1 - j3, k1 - k5 - i7, l1 + i4) == Block.waterStill.blockID || world.getBlockId(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) == Block.waterStill.blockID - || world.getBlockId((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) == Block.waterStill.blockID) { + || world.getBlock(j1 - j3, k1 - k5 - i7, l1 + i4) == Blocks.water || world.getBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) == Blocks.water + || world.getBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) == Blocks.water) { j6++; } else { flag1 = true; } } while (!flag1 && i7++ < 12); - setBlock(world, (j1 - j3) + 1, k1 - k5 - j6, l1 + i4, Block.stoneBrick.blockID); - setBlockAndMetadata(world, (j1 - j3) + 1, ((k1 - k5) + 1) - j6, l1 + i4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, (j1 - j3) + 1, ((k1 - k5) + 2) - j6, l1 + i4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, (j1 - j3) + 2, k1 - k5 - j6, l1 + i4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - j3, k1 - k5 - j6, (l1 + i4) - 1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 1, Block.stoneBrick.blockID, 1); - setBlock(world, j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 1, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 1, Block.stoneBrick.blockID, 1); - setBlock(world, j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 2, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 2, Block.stoneBrick.blockID, 1); - setBlock(world, j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 2, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 5) - j6, (l1 + i4) - 2, Block.stoneBrick.blockID, 1); - setBlock(world, j1 - j3, k1 - k5 - j6, (l1 + i4) - 3, Block.stoneBrick.blockID); - setBlock(world, j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 3, Block.stoneBrick.blockID); - setBlock(world, j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 3, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 3, Block.stoneBrick.blockID, 1); + setBlock(world, (j1 - j3) + 1, k1 - k5 - j6, l1 + i4, Blocks.stonebrick); + setBlockAndMetadata(world, (j1 - j3) + 1, ((k1 - k5) + 1) - j6, l1 + i4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, (j1 - j3) + 1, ((k1 - k5) + 2) - j6, l1 + i4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, (j1 - j3) + 2, k1 - k5 - j6, l1 + i4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - j3, k1 - k5 - j6, (l1 + i4) - 1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 1, Blocks.stonebrick, 1); + setBlock(world, j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 1, Blocks.stonebrick); + setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 1, Blocks.stonebrick, 1); + setBlock(world, j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 2, Blocks.stonebrick); + setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 2, Blocks.stonebrick, 1); + setBlock(world, j1 - j3, ((k1 - k5) + 4) - j6, (l1 + i4) - 2, Blocks.stonebrick); + setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 5) - j6, (l1 + i4) - 2, Blocks.stonebrick, 1); + setBlock(world, j1 - j3, k1 - k5 - j6, (l1 + i4) - 3, Blocks.stonebrick); + setBlock(world, j1 - j3, ((k1 - k5) + 1) - j6, (l1 + i4) - 3, Blocks.stonebrick); + setBlock(world, j1 - j3, ((k1 - k5) + 2) - j6, (l1 + i4) - 3, Blocks.stonebrick); + setBlockAndMetadata(world, j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 3, Blocks.stonebrick, 1); l7 = random.nextInt(100); if (l7 <= 30) { - setBlock(world, j1 - j3, k1 - k5 - j6 - l4, (l1 + i4) - 2, Block.dirt.blockID); - setBlock(world, j1 - j3, k1 - k5 - j6 - l4 - 1, (l1 + i4) - 2, Block.dirt.blockID); + setBlock(world, j1 - j3, k1 - k5 - j6 - l4, (l1 + i4) - 2, Blocks.dirt); + setBlock(world, j1 - j3, k1 - k5 - j6 - l4 - 1, (l1 + i4) - 2, Blocks.dirt); } i7 = 1; j6 = 0; flag1 = false; do { if (world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) || world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) || world.isAirBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) - || world.getBlockId(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) == Block.waterStill.blockID || world.getBlockId(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) == Block.waterStill.blockID - || world.getBlockId(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) == Block.waterStill.blockID) { + || world.getBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) == Blocks.water || world.getBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) == Blocks.water + || world.getBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) == Blocks.water) { j6++; } else { flag1 = true; } } while (!flag1 && i7++ < 12); - setBlock(world, j1 + j3 + 4, k1 - k5 - j6, l1 - 6, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 6, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + j3 + 4, ((k1 - k5) + 2) - j6, l1 - 6, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + j3 + 4, k1 - k5 - j6, l1 - 7, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 7, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + j3 + 5, k1 - k5 - j6, l1 - 7, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + j3 + 5, ((k1 - k5) + 1) - j6, l1 - 7, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + j3 + 5, ((k1 - k5) + 2) - j6, l1 - 7, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + j3 + 6, k1 - k5 - j6, l1 - 7, Block.stoneBrick.blockID); + setBlock(world, j1 + j3 + 4, k1 - k5 - j6, l1 - 6, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 6, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + j3 + 4, ((k1 - k5) + 2) - j6, l1 - 6, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + j3 + 4, k1 - k5 - j6, l1 - 7, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + j3 + 4, ((k1 - k5) + 1) - j6, l1 - 7, Blocks.stonebrick, 1); + setBlock(world, j1 + j3 + 5, k1 - k5 - j6, l1 - 7, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + j3 + 5, ((k1 - k5) + 1) - j6, l1 - 7, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + j3 + 5, ((k1 - k5) + 2) - j6, l1 - 7, Blocks.stonebrick, 1); + setBlock(world, j1 + j3 + 6, k1 - k5 - j6, l1 - 7, Blocks.stonebrick); l7 = random.nextInt(100); if (l7 <= 30) { - setBlock(world, j1 + j3 + 4, k1 - k5 - j6 - l4, l1 - 7, Block.dirt.blockID); - setBlock(world, j1 + j3 + 4, k1 - k5 - j6 - l4 - 1, l1 - 7, Block.dirt.blockID); + setBlock(world, j1 + j3 + 4, k1 - k5 - j6 - l4, l1 - 7, Blocks.dirt); + setBlock(world, j1 + j3 + 4, k1 - k5 - j6 - l4 - 1, l1 - 7, Blocks.dirt); } } if (i2 != 3) { @@ -289,142 +290,154 @@ public class StructureRuin$1 extends WorldGenerator { } else { l5 = random.nextInt(4) + 5; } - setBlock(world, j1, k1 - l5, l1, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 - 1, k1 - l5, l1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - 1, (k1 - l5) + 1, l1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - 1, (k1 - l5) + 2, l1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - 1, (k1 - l5) + 3, l1, Block.stoneBrick.blockID, 1); - setBlock(world, j1, (k1 - l5) + 1, l1, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1, (k1 - l5) + 2, l1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1, (k1 - l5) + 3, l1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1, (k1 - l5) + 4, l1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1, (k1 - l5) + 5, l1, Block.stoneBrick.blockID, 1); - setBlock(world, j1, k1 - l5, l1 + 1, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1, (k1 - l5) + 2, l1 + 1, Block.stoneBrick.blockID, 1); - setBlock(world, j1, k1 - l5, l1 + 2, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1, (k1 - l5) + 1, l1 + 2, Block.stoneBrick.blockID, 1); - setBlock(world, j1, k1 - l5 - i5, l1 + 1, Block.dirt.blockID); - setBlock(world, j1, k1 - l5 - i5 - 1, l1 + 1, Block.dirt.blockID); + setBlock(world, j1, k1 - l5, l1, Blocks.stonebrick); + setBlockAndMetadata(world, j1 - 1, k1 - l5, l1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - 1, (k1 - l5) + 1, l1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - 1, (k1 - l5) + 2, l1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - 1, (k1 - l5) + 3, l1, Blocks.stonebrick, 1); + setBlock(world, j1, (k1 - l5) + 1, l1, Blocks.stonebrick); + setBlockAndMetadata(world, j1, (k1 - l5) + 2, l1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1, (k1 - l5) + 3, l1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1, (k1 - l5) + 4, l1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1, (k1 - l5) + 5, l1, Blocks.stonebrick, 1); + setBlock(world, j1, k1 - l5, l1 + 1, Blocks.stonebrick); + setBlockAndMetadata(world, j1, (k1 - l5) + 2, l1 + 1, Blocks.stonebrick, 1); + setBlock(world, j1, k1 - l5, l1 + 2, Blocks.stonebrick); + setBlockAndMetadata(world, j1, (k1 - l5) + 1, l1 + 2, Blocks.stonebrick, 1); + setBlock(world, j1, k1 - l5 - i5, l1 + 1, Blocks.dirt); + setBlock(world, j1, k1 - l5 - i5 - 1, l1 + 1, Blocks.dirt); j7 = 1; k6 = 0; flag2 = false; do { if (world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) - || world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) == Block.waterStill.blockID || world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) == Block.waterStill.blockID - || world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) == Block.waterStill.blockID) { + || world.getBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) == Blocks.water || world.getBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) == Blocks.water + || world.getBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) == Blocks.water) { k6++; } else { flag2 = true; } } while (!flag2 && j7++ < 12); - setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + k3 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + k3 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + k3 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + k3 + l2 + 3, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 1, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 3) - k6, l1 + j4 + 1, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 2, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 2, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 3, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 3, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 4, Block.stoneBrick.blockID); - setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 6, Block.stoneBrick.blockID); + setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + k3 + l2 + 1, k1 - l5 - k6, l1 + j4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + k3 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + k3 + l2 + 2, k1 - l5 - k6, l1 + j4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + k3 + l2 + 3, k1 - l5 - k6, l1 + j4, Blocks.stonebrick, 1); + setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 1, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 3) - k6, l1 + j4 + 1, Blocks.stonebrick, 1); + setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 2, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 2) - k6, l1 + j4 + 2, Blocks.stonebrick, 1); + setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 3, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 3, Blocks.stonebrick, 1); + setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 4, Blocks.stonebrick); + setBlock(world, j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 6, Blocks.stonebrick); i8 = random.nextInt(100); if (i8 <= 30) { - setBlock(world, j1 + k3 + l2, k1 - l5 - k6 - i5, l1 + j4 + 1, Block.dirt.blockID); - setBlock(world, j1 + k3 + l2, k1 - l5 - k6 - i5 - 1, l1 + j4 + 1, Block.dirt.blockID); + setBlock(world, j1 + k3 + l2, k1 - l5 - k6 - i5, l1 + j4 + 1, Blocks.dirt); + setBlock(world, j1 + k3 + l2, k1 - l5 - k6 - i5 - 1, l1 + j4 + 1, Blocks.dirt); } j7 = 1; k6 = 0; flag2 = false; do { if (world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) || world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) || world.isAirBlock(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) - || world.getBlockId(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) == Block.waterStill.blockID || world.getBlockId(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) == Block.waterStill.blockID - || world.getBlockId(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) == Block.waterStill.blockID) { + || world.getBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) == Blocks.water || world.getBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) == Blocks.water + || world.getBlock(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) == Blocks.water) { k6++; } else { flag2 = true; } } while (!flag2 && j7++ < 12); - setBlock(world, j1 - k3, k1 - l5 - k6, l1 - l2 - 1, Block.stoneBrick.blockID); - setBlock(world, j1 - k3, (k1 - l5 - k6) + 1, l1 - l2 - 1, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 - k3, (k1 - l5 - k6) + 2, l1 - l2 - 1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - k3, k1 - l5 - k6, l1 - l2 - 2, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 2, Block.stoneBrick.blockID, 1); - setBlock(world, j1 - k3, k1 - l5 - k6, l1 - l2 - 3, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 3, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - k3, k1 - l5 - k6, l1 - l2 - 4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - k3 - 1, k1 - l5 - k6, l1 - l2 - 6, Block.stoneBrick.blockID, 1); - setBlock(world, j1 - k3 - 2, k1 - l5 - k6, l1 - l2 - 6, Block.stoneBrick.blockID); - setBlock(world, j1 - k3 - 2, ((k1 - l5) + 1) - k6, l1 - l2 - 6, Block.stoneBrick.blockID); - setBlock(world, j1 - k3 - 3, k1 - l5 - k6, l1 - l2 - 6, Block.stoneBrick.blockID); + setBlock(world, j1 - k3, k1 - l5 - k6, l1 - l2 - 1, Blocks.stonebrick); + setBlock(world, j1 - k3, (k1 - l5 - k6) + 1, l1 - l2 - 1, Blocks.stonebrick); + setBlockAndMetadata(world, j1 - k3, (k1 - l5 - k6) + 2, l1 - l2 - 1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - k3, k1 - l5 - k6, l1 - l2 - 2, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 2, Blocks.stonebrick, 1); + setBlock(world, j1 - k3, k1 - l5 - k6, l1 - l2 - 3, Blocks.stonebrick); + setBlockAndMetadata(world, j1 - k3, ((k1 - l5) + 1) - k6, l1 - l2 - 3, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - k3, k1 - l5 - k6, l1 - l2 - 4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - k3 - 1, k1 - l5 - k6, l1 - l2 - 6, Blocks.stonebrick, 1); + setBlock(world, j1 - k3 - 2, k1 - l5 - k6, l1 - l2 - 6, Blocks.stonebrick); + setBlock(world, j1 - k3 - 2, ((k1 - l5) + 1) - k6, l1 - l2 - 6, Blocks.stonebrick); + setBlock(world, j1 - k3 - 3, k1 - l5 - k6, l1 - l2 - 6, Blocks.stonebrick); i8 = random.nextInt(100); if (i8 <= 60) { - setBlock(world, j1 - k3 - 1, k1 - l5 - k6 - i5, l1 - l2 - 6, Block.dirt.blockID); - setBlock(world, j1 - k3 - 1, k1 - l5 - k6 - i5 - 1, l1 - l2 - 6, Block.dirt.blockID); + setBlock(world, j1 - k3 - 1, k1 - l5 - k6 - i5, l1 - l2 - 6, Blocks.dirt); + setBlock(world, j1 - k3 - 1, k1 - l5 - k6 - i5 - 1, l1 - l2 - 6, Blocks.dirt); } j7 = 1; k6 = 0; flag2 = false; do { if (world.isAirBlock(j1 + l2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) - || world.getBlockId(j1 + l2, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID || world.getBlockId(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID - || world.getBlockId(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID) { + || world.getBlock(j1 + l2, k1 - l5 - j7, l1 + j4) == Blocks.water || world.getBlock(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) == Blocks.water + || world.getBlock(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) == Blocks.water) { k6++; } else { flag2 = true; } } while (!flag2 && j7++ < 12); - setBlock(world, j1 + l2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + l2 + 1, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + l2 + 1, ((k1 - l5) + 2) - k6, l1 + j4, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + l2 + 1, ((k1 - l5) + 3) - k6, l1 + j4, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + l2 + 2, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID); - setBlock(world, j1 + l2 + 2, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + l2 + 2, ((k1 - l5) + 2) - k6, l1 + j4, Block.stoneBrick.blockID, 1); - setBlock(world, j1 + l2 + 3, ((k1 - l5) + 2) - k6, l1 + j4, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 + l2 + 4, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + l2 + 4, ((k1 - l5) + 1) - k6, l1 + j4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 + l2 + 5, k1 - l5 - k6, l1 + j4, Block.stoneBrick.blockID, 1); + setBlock(world, j1 + l2, k1 - l5 - k6, l1 + j4, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + l2 + 1, k1 - l5 - k6, l1 + j4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + l2 + 1, ((k1 - l5) + 1) - k6, l1 + j4, Blocks.stonebrick, 1); + setBlock(world, j1 + l2 + 1, ((k1 - l5) + 2) - k6, l1 + j4, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + l2 + 1, ((k1 - l5) + 3) - k6, l1 + j4, Blocks.stonebrick, 1); + setBlock(world, j1 + l2 + 2, k1 - l5 - k6, l1 + j4, Blocks.stonebrick); + setBlock(world, j1 + l2 + 2, ((k1 - l5) + 1) - k6, l1 + j4, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + l2 + 2, ((k1 - l5) + 2) - k6, l1 + j4, Blocks.stonebrick, 1); + setBlock(world, j1 + l2 + 3, ((k1 - l5) + 2) - k6, l1 + j4, Blocks.stonebrick); + setBlockAndMetadata(world, j1 + l2 + 4, k1 - l5 - k6, l1 + j4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + l2 + 4, ((k1 - l5) + 1) - k6, l1 + j4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 + l2 + 5, k1 - l5 - k6, l1 + j4, Blocks.stonebrick, 1); i8 = random.nextInt(100); if (i8 <= 30) { - setBlock(world, j1 + l2 + 2, k1 - l5 - k6 - i5, l1 + j4, Block.dirt.blockID); - setBlock(world, j1 + l2 + 2, k1 - l5 - k6 - i5 - 1, l1 + j4, Block.dirt.blockID); + setBlock(world, j1 + l2 + 2, k1 - l5 - k6 - i5, l1 + j4, Blocks.dirt); + setBlock(world, j1 + l2 + 2, k1 - l5 - k6 - i5 - 1, l1 + j4, Blocks.dirt); } j7 = 1; k6 = 0; flag2 = false; do { if (world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) - || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) == Block.waterStill.blockID || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) == Block.waterStill.blockID - || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) == Block.waterStill.blockID) { + || world.getBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) == Blocks.water || world.getBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) == Blocks.water + || world.getBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) == Blocks.water) { k6++; } else { flag2 = true; } } while (!flag2 && j7++ < 12); - setBlock(world, j1 - 3, k1 - l5 - k6, l1 + k3, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 1, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - 3, k1 - l5 - k6, l1 + k3 + 2, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 2, Block.stoneBrick.blockID, 1); - setBlock(world, j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 2, Block.stoneBrick.blockID); - setBlock(world, j1 - 3, k1 - l5 - k6, l1 + k3 + 3, Block.stoneBrick.blockID); - setBlock(world, j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 3, Block.stoneBrick.blockID); - setBlock(world, j1 - 3, k1 - l5 - k6, l1 + k3 + 4, Block.stoneBrick.blockID); - setBlockAndMetadata(world, j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 4, Block.stoneBrick.blockID, 1); - setBlockAndMetadata(world, j1 - 3, k1 - l5 - k6, l1 + k3 + 5, Block.stoneBrick.blockID, 1); + setBlock(world, j1 - 3, k1 - l5 - k6, l1 + k3, Blocks.stonebrick); + setBlockAndMetadata(world, j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 1, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - 3, k1 - l5 - k6, l1 + k3 + 2, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 2, Blocks.stonebrick, 1); + setBlock(world, j1 - 3, ((k1 - l5) + 2) - k6, l1 + k3 + 2, Blocks.stonebrick); + setBlock(world, j1 - 3, k1 - l5 - k6, l1 + k3 + 3, Blocks.stonebrick); + setBlock(world, j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 3, Blocks.stonebrick); + setBlock(world, j1 - 3, k1 - l5 - k6, l1 + k3 + 4, Blocks.stonebrick); + setBlockAndMetadata(world, j1 - 3, ((k1 - l5) + 1) - k6, l1 + k3 + 4, Blocks.stonebrick, 1); + setBlockAndMetadata(world, j1 - 3, k1 - l5 - k6, l1 + k3 + 5, Blocks.stonebrick, 1); i8 = random.nextInt(100); if (i8 <= 30) { - setBlock(world, j1 - 3, k1 - l5 - k6 - i5 - 1, l1 + k3 + 3, Block.dirt.blockID); - setBlock(world, j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3, Block.chest.blockID); - ChestFiller.fillWithRares(world.getBlockTileEntity(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3)); + setBlock(world, j1 - 3, k1 - l5 - k6 - i5 - 1, l1 + k3 + 3, Blocks.dirt); + setBlock(world, j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3, Blocks.chest); + ChestFiller.fillWithRares(world.getTileEntity(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3)); } return true; } + + private void setBlock(World w, int x, int y, int z){ + func_150515_a(w, x, y, z, Blocks.air); + } + + private void setBlock(World w, int x, int y, int z, Block bl){ + func_150515_a(w, x, y, z, bl); + } + + private void setBlockAndMetadata(World w, int x, int y, int z, Block bl, int meta){ + setBlockAndNotifyAdequately(w, x, y, z, bl, meta); + } } diff --git a/common/MysticRuins/StructureRuin.java b/common/MysticRuins/StructureRuin.java index 98536c3..a1171f7 100644 --- a/common/MysticRuins/StructureRuin.java +++ b/common/MysticRuins/StructureRuin.java @@ -3,6 +3,7 @@ package mysticruins; import java.util.Random; import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; @@ -20,7 +21,7 @@ public class StructureRuin extends WorldGenerator { if (k1 <= 0) { return false; } - if (!world.isAirBlock(j1, k1, l1) || world.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || !Block.pumpkin.canPlaceBlockAt(world, j1, k1, l1)) { + if (!world.isAirBlock(j1, k1, l1) || world.getBlock(j1, k1 - 1, l1) != Blocks.grass || !Blocks.pumpkin.canPlaceBlockAt(world, j1, k1, l1)) { return false; } int i2 = random.nextInt(3) + 1; @@ -28,11 +29,7 @@ public class StructureRuin extends WorldGenerator { int i3 = random.nextInt(8) + 5; int l3 = random.nextInt(8) + 5; int k4 = random.nextInt(4) + 3; - int j5 = 1; - int i6 = 0; - int l6 = 1; - boolean flag = false; - int k7 = random.nextInt(100); + int j5; int j8 = random.nextInt(100); if (j8 <= 20) { j5 = 0; @@ -50,16 +47,16 @@ public class StructureRuin extends WorldGenerator { } } setBlock(world,j1, (k1 - j5) + 5, l1 + 1, pickBlock(random)); - setBlock(world,j1, k1 - j5 - k4 - 1, l1 + 2, Block.dirt.blockID); - setBlock(world,j1, k1 - j5 - k4, l1 + 2, Block.chest.blockID); - ChestFiller.fillWithValuables(world.getBlockTileEntity(j1, k1 - j5 - k4, l1 + 2)); - l6 = 1; - i6 = 0; - flag = false; + setBlock(world,j1, k1 - j5 - k4 - 1, l1 + 2, Blocks.dirt); + setBlock(world,j1, k1 - j5 - k4, l1 + 2, Blocks.chest); + ChestFiller.fillWithValuables(world.getTileEntity(j1, k1 - j5 - k4, l1 + 2)); + int l6 = 1; + int i6 = 0; + boolean flag = false; do { if (world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) || world.isAirBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) - || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) == Block.waterStill.blockID || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) == Block.waterStill.blockID - || world.getBlockId(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) == Block.waterStill.blockID) { + || world.getBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 4) == Blocks.water || world.getBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 5) == Blocks.water + || world.getBlock(j1 + l3, k1 - j5 - l6, l1 + l3 + 6) == Blocks.water) { i6++; } else { flag = true; @@ -80,22 +77,22 @@ public class StructureRuin extends WorldGenerator { setBlock(world,j1 + l3, k1 - j5 - i6, l1 + l3 + 7, pickBlock(random)); setBlock(world,j1 + l3, ((k1 - j5) + 1) - i6, l1 + l3 + 7, pickBlock(random)); setBlock(world,j1 + l3, ((k1 - j5) + 2) - i6, l1 + l3 + 7, pickBlock(random)); - k7 = random.nextInt(100); + int k7 = random.nextInt(100); if (k7 <= 30) { - setBlock(world,j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5, Block.mobSpawner.blockID); - TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getBlockTileEntity(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5); + setBlock(world,j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5, Blocks.mob_spawner); + TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(j1 + l3, k1 - j5 - i6 - k4, l1 + l3 + 5); if (spawner != null) { - spawner.getSpawnerLogic().setMobID(DungeonHooks.getRandomDungeonMob(random)); + spawner.func_145881_a().setEntityName(DungeonHooks.getRandomDungeonMob(random)); } - setBlock(world,j1 + l3, k1 - j5 - i6 - k4 - 1, l1 + l3 + 5, Block.dirt.blockID); + setBlock(world,j1 + l3, k1 - j5 - i6 - k4 - 1, l1 + l3 + 5, Blocks.dirt); } l6 = 1; i6 = 0; flag = false; do { if (world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 4) || world.isAirBlock(j1 - i3, k1 - j5 - l6, l1 - 5) || world.isAirBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) - || world.getBlockId(j1 - i3, k1 - j5 - l6, l1 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - i3, k1 - j5 - l6, l1 - 5) == Block.waterStill.blockID - || world.getBlockId(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) == Block.waterStill.blockID) { + || world.getBlock(j1 - i3, k1 - j5 - l6, l1 - 4) == Blocks.water || world.getBlock(j1 - i3, k1 - j5 - l6, l1 - 5) == Blocks.water + || world.getBlock(j1 - i3 - 1, k1 - j5 - l6, l1 - 5) == Blocks.water) { i6++; } else { flag = true; @@ -110,19 +107,15 @@ public class StructureRuin extends WorldGenerator { setBlock(world,j1 - i3 - 2, k1 - j5 - i6, l1 - 5, pickBlock(random)); k7 = random.nextInt(100); if (k7 <= 60) { - setBlock(world,j1 - i3 - 1, k1 - j5 - i6 - k4, l1 - 5, Block.dirt.blockID); - setBlock(world,j1 - i3 - 1, k1 - j5 - i6 - k4 - 1, l1 - 5, Block.dirt.blockID); + setBlock(world,j1 - i3 - 1, k1 - j5 - i6 - k4, l1 - 5, Blocks.dirt); + setBlock(world,j1 - i3 - 1, k1 - j5 - i6 - k4 - 1, l1 - 5, Blocks.dirt); } } else if (i2 == 2) { int k2 = random.nextInt(8) + 5; int j3 = random.nextInt(8) + 5; int i4 = random.nextInt(8) + 5; int l4 = random.nextInt(4) + 3; - int k5 = 1; - int j6 = 0; - int i7 = 1; - boolean flag1 = false; - int l7 = random.nextInt(100); + int k5; int k8 = random.nextInt(100); if (k8 <= 20) { k5 = 0; @@ -140,15 +133,15 @@ public class StructureRuin extends WorldGenerator { setBlock(world,j1, (k1 - k5) + 1, l1 + 1, pickBlock(random)); setBlock(world,j1 + 1, k1 - k5, l1, pickBlock(random)); setBlock(world,j1 + 2, k1 - k5, l1, pickBlock(random)); - setBlock(world,j1, k1 - k5 - l4, l1 + 2, Block.dirt.blockID); - setBlock(world,j1, k1 - k5 - l4 - 1, l1 + 2, Block.dirt.blockID); - i7 = 1; - j6 = 0; - flag1 = false; + setBlock(world,j1, k1 - k5 - l4, l1 + 2, Blocks.dirt); + setBlock(world,j1, k1 - k5 - l4 - 1, l1 + 2, Blocks.dirt); + int i7 = 1; + int j6 = 0; + boolean flag1 = false; do { if (world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 4) || world.isAirBlock(j1 - k2, k1 - k5 - i7, l1 - 5) || world.isAirBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) - || world.getBlockId(j1 - k2, k1 - k5 - i7, l1 - 4) == Block.waterStill.blockID || world.getBlockId(j1 - k2, k1 - k5 - i7, l1 - 5) == Block.waterStill.blockID - || world.getBlockId(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) == Block.waterStill.blockID) { + || world.getBlock(j1 - k2, k1 - k5 - i7, l1 - 4) == Blocks.water || world.getBlock(j1 - k2, k1 - k5 - i7, l1 - 5) == Blocks.water + || world.getBlock(j1 - k2 - 1, k1 - k5 - i7, l1 - 5) == Blocks.water) { j6++; } else { flag1 = true; @@ -167,18 +160,18 @@ public class StructureRuin extends WorldGenerator { setBlock(world,j1 - k2 - 1, ((k1 - k5) + 1) - j6, l1 - 5, pickBlock(random)); setBlock(world,j1 - k2 - 1, ((k1 - k5) + 2) - j6, l1 - 5, pickBlock(random)); setBlock(world,j1 - k2 - 2, k1 - k5 - j6, l1 - 5, pickBlock(random)); - l7 = random.nextInt(100); + int l7 = random.nextInt(100); if (l7 <= 30) { - setBlock(world,j1 - k2 - 1, k1 - k5 - j6 - l4, l1 - 5, Block.dirt.blockID); - setBlock(world,j1 - k2 - 1, k1 - k5 - j6 - l4 - 1, l1 - 5, Block.dirt.blockID); + setBlock(world,j1 - k2 - 1, k1 - k5 - j6 - l4, l1 - 5, Blocks.dirt); + setBlock(world,j1 - k2 - 1, k1 - k5 - j6 - l4 - 1, l1 - 5, Blocks.dirt); } i7 = 1; j6 = 0; flag1 = false; do { if (world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 4) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 6) || world.isAirBlock(j1 + i4, k1 - k5 - i7, l1 + 8) - || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 4) == Block.waterStill.blockID || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 6) == Block.waterStill.blockID - || world.getBlockId(j1 + i4, k1 - k5 - i7, l1 + 8) == Block.waterStill.blockID) { + || world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 4) == Blocks.water || world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 6) == Blocks.water + || world.getBlock(j1 + i4, k1 - k5 - i7, l1 + 8) == Blocks.water) { j6++; } else { flag1 = true; @@ -204,16 +197,16 @@ public class StructureRuin extends WorldGenerator { setBlock(world,j1 + i4, k1 - k5 - j6, l1 + 9, pickBlock(random)); l7 = random.nextInt(100); if (l7 <= 60) { - setBlock(world,j1 + i4, k1 - k5 - j6 - l4, l1 + 7, Block.dirt.blockID); - setBlock(world,j1 + i4, k1 - k5 - j6 - l4 - 1, l1 + 7, Block.dirt.blockID); + setBlock(world,j1 + i4, k1 - k5 - j6 - l4, l1 + 7, Blocks.dirt); + setBlock(world,j1 + i4, k1 - k5 - j6 - l4 - 1, l1 + 7, Blocks.dirt); } i7 = 1; j6 = 0; flag1 = false; do { if (world.isAirBlock(j1 - j3, k1 - k5 - i7, l1 + i4) || world.isAirBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) || world.isAirBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) - || world.getBlockId(j1 - j3, k1 - k5 - i7, l1 + i4) == Block.waterStill.blockID || world.getBlockId(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) == Block.waterStill.blockID - || world.getBlockId((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) == Block.waterStill.blockID) { + || world.getBlock(j1 - j3, k1 - k5 - i7, l1 + i4) == Blocks.water || world.getBlock(j1 - j3, k1 - k5 - i7, (l1 + i4) - 2) == Blocks.water + || world.getBlock((j1 - j3) + 1, k1 - k5 - i7, l1 + i4) == Blocks.water) { j6++; } else { flag1 = true; @@ -238,16 +231,16 @@ public class StructureRuin extends WorldGenerator { setBlock(world,j1 - j3, ((k1 - k5) + 3) - j6, (l1 + i4) - 3, pickBlock(random)); l7 = random.nextInt(100); if (l7 <= 30) { - setBlock(world,j1 - j3, k1 - k5 - j6 - l4, (l1 + i4) - 2, Block.dirt.blockID); - setBlock(world,j1 - j3, k1 - k5 - j6 - l4 - 1, (l1 + i4) - 2, Block.dirt.blockID); + setBlock(world,j1 - j3, k1 - k5 - j6 - l4, (l1 + i4) - 2, Blocks.dirt); + setBlock(world,j1 - j3, k1 - k5 - j6 - l4 - 1, (l1 + i4) - 2, Blocks.dirt); } i7 = 1; j6 = 0; flag1 = false; do { if (world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) || world.isAirBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) || world.isAirBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) - || world.getBlockId(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) == Block.waterStill.blockID || world.getBlockId(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) == Block.waterStill.blockID - || world.getBlockId(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) == Block.waterStill.blockID) { + || world.getBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 6) == Blocks.water || world.getBlock(j1 + j3 + 4, k1 - k5 - i7, l1 - 7) == Blocks.water + || world.getBlock(j1 + j3 + 5, k1 - k5 - i7, l1 - 7) == Blocks.water) { j6++; } else { flag1 = true; @@ -264,8 +257,8 @@ public class StructureRuin extends WorldGenerator { setBlock(world,j1 + j3 + 6, k1 - k5 - j6, l1 - 7, pickBlock(random)); l7 = random.nextInt(100); if (l7 <= 30) { - setBlock(world,j1 + j3 + 4, k1 - k5 - j6 - l4, l1 - 7, Block.dirt.blockID); - setBlock(world,j1 + j3 + 4, k1 - k5 - j6 - l4 - 1, l1 - 7, Block.dirt.blockID); + setBlock(world,j1 + j3 + 4, k1 - k5 - j6 - l4, l1 - 7, Blocks.dirt); + setBlock(world,j1 + j3 + 4, k1 - k5 - j6 - l4 - 1, l1 - 7, Blocks.dirt); } } if (i2 != 3) { @@ -275,11 +268,7 @@ public class StructureRuin extends WorldGenerator { int k3 = random.nextInt(8) + 5; int j4 = random.nextInt(8) + 5; int i5 = random.nextInt(4) + 3; - int l5 = 1; - int k6 = 0; - int j7 = 1; - boolean flag2 = false; - int i8 = random.nextInt(100); + int l5; int l8 = random.nextInt(100); if (l8 <= 20) { l5 = 0; @@ -300,15 +289,15 @@ public class StructureRuin extends WorldGenerator { setBlock(world,j1, (k1 - l5) + 2, l1 + 1, pickBlock(random)); setBlock(world,j1, k1 - l5, l1 + 2, pickBlock(random)); setBlock(world,j1, (k1 - l5) + 1, l1 + 2, pickBlock(random)); - setBlock(world,j1, k1 - l5 - i5, l1 + 1, Block.dirt.blockID); - setBlock(world,j1, k1 - l5 - i5 - 1, l1 + 1, Block.dirt.blockID); - j7 = 1; - k6 = 0; - flag2 = false; + setBlock(world,j1, k1 - l5 - i5, l1 + 1, Blocks.dirt); + setBlock(world,j1, k1 - l5 - i5 - 1, l1 + 1, Blocks.dirt); + int j7 = 1; + int k6 = 0; + boolean flag2 = false; do { if (world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) || world.isAirBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) - || world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) == Block.waterStill.blockID || world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) == Block.waterStill.blockID - || world.getBlockId(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) == Block.waterStill.blockID) { + || world.getBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 2) == Blocks.water || world.getBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 3) == Blocks.water + || world.getBlock(j1 + k3 + l2, k1 - l5 - j7, l1 + j4 + 4) == Blocks.water) { k6++; } else { flag2 = true; @@ -330,18 +319,18 @@ public class StructureRuin extends WorldGenerator { setBlock(world,j1 + k3 + l2, ((k1 - l5) + 1) - k6, l1 + j4 + 3, pickBlock(random)); setBlock(world,j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 4, pickBlock(random)); setBlock(world,j1 + k3 + l2, k1 - l5 - k6, l1 + j4 + 6, pickBlock(random)); - i8 = random.nextInt(100); + int i8 = random.nextInt(100); if (i8 <= 30) { - setBlock(world,j1 + k3 + l2, k1 - l5 - k6 - i5, l1 + j4 + 1, Block.dirt.blockID); - setBlock(world,j1 + k3 + l2, k1 - l5 - k6 - i5 - 1, l1 + j4 + 1, Block.dirt.blockID); + setBlock(world,j1 + k3 + l2, k1 - l5 - k6 - i5, l1 + j4 + 1, Blocks.dirt); + setBlock(world,j1 + k3 + l2, k1 - l5 - k6 - i5 - 1, l1 + j4 + 1, Blocks.dirt); } j7 = 1; k6 = 0; flag2 = false; do { if (world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) || world.isAirBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) || world.isAirBlock(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) - || world.getBlockId(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) == Block.waterStill.blockID || world.getBlockId(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) == Block.waterStill.blockID - || world.getBlockId(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) == Block.waterStill.blockID) { + || world.getBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 2) == Blocks.water || world.getBlock(j1 - k3, k1 - l5 - j7, l1 - l2 - 4) == Blocks.water + || world.getBlock(j1 - k3 - 2, k1 - l5 - j7, l1 - l2 - 6) == Blocks.water) { k6++; } else { flag2 = true; @@ -361,16 +350,16 @@ public class StructureRuin extends WorldGenerator { setBlock(world,j1 - k3 - 3, k1 - l5 - k6, l1 - l2 - 6, pickBlock(random)); i8 = random.nextInt(100); if (i8 <= 60) { - setBlock(world,j1 - k3 - 1, k1 - l5 - k6 - i5, l1 - l2 - 6, Block.dirt.blockID); - setBlock(world,j1 - k3 - 1, k1 - l5 - k6 - i5 - 1, l1 - l2 - 6, Block.dirt.blockID); + setBlock(world,j1 - k3 - 1, k1 - l5 - k6 - i5, l1 - l2 - 6, Blocks.dirt); + setBlock(world,j1 - k3 - 1, k1 - l5 - k6 - i5 - 1, l1 - l2 - 6, Blocks.dirt); } j7 = 1; k6 = 0; flag2 = false; do { if (world.isAirBlock(j1 + l2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) || world.isAirBlock(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) - || world.getBlockId(j1 + l2, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID || world.getBlockId(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID - || world.getBlockId(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) == Block.waterStill.blockID) { + || world.getBlock(j1 + l2, k1 - l5 - j7, l1 + j4) == Blocks.water || world.getBlock(j1 + l2 + 2, k1 - l5 - j7, l1 + j4) == Blocks.water + || world.getBlock(j1 + l2 + 4, k1 - l5 - j7, l1 + j4) == Blocks.water) { k6++; } else { flag2 = true; @@ -390,16 +379,16 @@ public class StructureRuin extends WorldGenerator { setBlock(world,j1 + l2 + 5, k1 - l5 - k6, l1 + j4, pickBlock(random)); i8 = random.nextInt(100); if (i8 <= 30) { - setBlock(world,j1 + l2 + 2, k1 - l5 - k6 - i5, l1 + j4, Block.dirt.blockID); - setBlock(world,j1 + l2 + 2, k1 - l5 - k6 - i5 - 1, l1 + j4, Block.dirt.blockID); + setBlock(world,j1 + l2 + 2, k1 - l5 - k6 - i5, l1 + j4, Blocks.dirt); + setBlock(world,j1 + l2 + 2, k1 - l5 - k6 - i5 - 1, l1 + j4, Blocks.dirt); } j7 = 1; k6 = 0; flag2 = false; do { if (world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) || world.isAirBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) - || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) == Block.waterStill.blockID || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) == Block.waterStill.blockID - || world.getBlockId(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) == Block.waterStill.blockID) { + || world.getBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 1) == Blocks.water || world.getBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 3) == Blocks.water + || world.getBlock(j1 - 3, k1 - l5 - j7, l1 + k3 + 4) == Blocks.water) { k6++; } else { flag2 = true; @@ -418,14 +407,26 @@ public class StructureRuin extends WorldGenerator { setBlock(world,j1 - 3, k1 - l5 - k6, l1 + k3 + 5, pickBlock(random)); i8 = random.nextInt(100); if (i8 <= 30) { - setBlock(world,j1 - 3, k1 - l5 - k6 - i5 - 1, l1 + k3 + 3, Block.dirt.blockID); - setBlock(world,j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3, Block.chest.blockID); - ChestFiller.fillWithRares(world.getBlockTileEntity(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3)); + setBlock(world,j1 - 3, k1 - l5 - k6 - i5 - 1, l1 + k3 + 3, Blocks.dirt); + setBlock(world,j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3, Blocks.chest); + ChestFiller.fillWithRares(world.getTileEntity(j1 - 3, k1 - l5 - k6 - i5, l1 + k3 + 3)); } return true; } - private static int pickBlock(Random random) { - return random.nextBoolean() ? Block.cobblestone.blockID : Block.cobblestoneMossy.blockID; + private static Block pickBlock(Random random) { + return random.nextBoolean() ? Blocks.cobblestone : Blocks.mossy_cobblestone; } + + private void setBlock(World w, int x, int y, int z){ + func_150515_a(w, x, y, z, Blocks.air); + } + + private void setBlock(World w, int x, int y, int z, Block bl){ + func_150515_a(w, x, y, z, bl); + } + + private void setBlockAndMetadata(World w, int x, int y, int z, Block bl, int meta){ + setBlockAndNotifyAdequately(w, x, y, z, bl, meta); + } } diff --git a/common/MysticStones/Blocks/BlockPlanks.java b/common/MysticStones/Blocks/BlockPlanks.java index f7bd63a..a9dd918 100644 --- a/common/MysticStones/Blocks/BlockPlanks.java +++ b/common/MysticStones/Blocks/BlockPlanks.java @@ -1,27 +1,28 @@ package mysticstones.blocks; +import mysticstones.MysticStones; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.util.Icon; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockPlanks extends BlockMulti { - public BlockPlanks(int ID) { - super(ID, Material.wood); - setHardness(2.5F); - setResistance(10F); - setUnlocalizedName("BlockMysticPlanks"); - setStepSound(Block.soundWoodFootstep); + public BlockPlanks() { + super(Material.wood); + setHardness(2.5F); + setResistance(10F); + setBlockName("BlockMysticPlanks"); + setStepSound(Block.soundTypeWood); } @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - textures = new Icon[ItemPlanks.PLANK_TYPE.length]; + public void registerBlockIcons(IIconRegister iconRegister) { + textures = new IIcon[MysticStones.PLANK_TYPE.size()]; for (int i = 0; i < textures.length; i++) { - textures[i] = iconRegister.registerIcon("mysticstones:" + ItemPlanks.PLANK_TYPE[i]); + textures[i] = iconRegister.registerIcon("mysticstones:" + MysticStones.PLANK_TYPE.get(i)); } } } diff --git a/common/MysticStones/Blocks/BlockReinforced.java b/common/MysticStones/Blocks/BlockReinforced.java index 59bb11d..4f71d13 100644 --- a/common/MysticStones/Blocks/BlockReinforced.java +++ b/common/MysticStones/Blocks/BlockReinforced.java @@ -2,32 +2,32 @@ package mysticstones.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.util.Icon; -import net.minecraft.world.World; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockReinforced extends BlockMulti { - public BlockReinforced(int ID) { - super(ID, Material.iron); - setHardness(4F); - setResistance(2000F); - setUnlocalizedName("BlockMysticReinforcedBrick"); - setStepSound(Block.soundMetalFootstep); + public BlockReinforced() { + super(Material.iron); + setHardness(4F); + setResistance(2000F); + setBlockName("BlockMysticReinforcedBrick"); + setStepSound(Block.soundTypeMetal); } @Override - public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) { + public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) { return true; } @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - textures = new Icon[ItemReinforced.BRICK_TYPE.length]; + public void registerBlockIcons(IIconRegister iconRegister) { + textures = new IIcon[ItemReinforced.BRICK_TYPE.size()]; for (int i = 0; i < textures.length; i++) { - textures[i] = iconRegister.registerIcon("mysticstones:" + ItemReinforced.BRICK_TYPE[i]); + textures[i] = iconRegister.registerIcon("mysticstones:" + ItemReinforced.BRICK_TYPE.get(i)); } } } diff --git a/common/MysticStones/Blocks/BlockStoneBricks.java b/common/MysticStones/Blocks/BlockStoneBricks.java index d1bdce0..3ed7f4a 100644 --- a/common/MysticStones/Blocks/BlockStoneBricks.java +++ b/common/MysticStones/Blocks/BlockStoneBricks.java @@ -1,27 +1,28 @@ package mysticstones.blocks; +import mysticstones.MysticStones; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.util.Icon; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockStoneBricks extends BlockMulti { - public BlockStoneBricks(int ID) { - super(ID, Material.rock); - setHardness(2F); - setResistance(5F); - setUnlocalizedName("BlockMysticStoneBricks"); - setStepSound(Block.soundStoneFootstep); + public BlockStoneBricks() { + super(Material.rock); + setHardness(2F); + setResistance(5F); + setBlockName("BlockMysticStoneBricks"); + setStepSound(Block.soundTypeStone); } @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - textures = new Icon[ItemStoneBricks.STONEBRICK_TYPES.length]; + public void registerBlockIcons(IIconRegister iconRegister) { + textures = new IIcon[MysticStones.STONEBRICK_TYPES.size()]; for (int i = 0; i < textures.length; i++) { - textures[i] = iconRegister.registerIcon("mysticstones:" + ItemStoneBricks.STONEBRICK_TYPES[i]); + textures[i] = iconRegister.registerIcon("mysticstones:" + MysticStones.STONEBRICK_TYPES.get(i)); } } } diff --git a/common/MysticStones/Blocks/BlockStones.java b/common/MysticStones/Blocks/BlockStones.java index 54f5c50..80735dd 100644 --- a/common/MysticStones/Blocks/BlockStones.java +++ b/common/MysticStones/Blocks/BlockStones.java @@ -1,22 +1,23 @@ package mysticstones.blocks; +import mysticstones.MysticStones; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockStones extends BlockMulti { - public BlockStones(int ID) { - super(ID, Material.rock); - setHardness(1F); - setResistance(5F); - setUnlocalizedName("BlockMysticStones"); - setStepSound(Block.soundStoneFootstep); + public BlockStones() { + super(Material.rock); + setHardness(1F); + setResistance(5F); + setBlockName("BlockMysticStones"); + setStepSound(Block.soundTypeStone); } @Override @@ -48,15 +49,10 @@ public class BlockStones extends BlockMulti { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - textures = new Icon[ItemStones.STONE_TYPES.length]; + public void registerBlockIcons(IIconRegister iconRegister) { + textures = new IIcon[MysticStones.STONE_TYPES.size()]; for (int i = 0; i < textures.length; i++) { - textures[i] = iconRegister.registerIcon("mysticstones:" + ItemStones.STONE_TYPES[i]); + textures[i] = iconRegister.registerIcon("mysticstones:" + MysticStones.STONE_TYPES.get(i)); } } - - @Override - protected boolean canSilkHarvest() { - return true; - } } diff --git a/common/MysticStones/Blocks/ItemPlanks.java b/common/MysticStones/Blocks/ItemPlanks.java deleted file mode 100644 index 4559d12..0000000 --- a/common/MysticStones/Blocks/ItemPlanks.java +++ /dev/null @@ -1,11 +0,0 @@ -package mysticstones.blocks; - -import mysticstones.MysticStones; - -public class ItemPlanks extends ItemBlockMulti { - public static final String[] PLANK_TYPE = new String[] { "Purple Planks", "Green Planks", "Black Planks", "Orange Planks", "Red Planks", "Blue Planks", "Yellow Planks" }; - - public ItemPlanks(int par1) { - super(par1, MysticStones.planks, PLANK_TYPE); - } -} diff --git a/common/MysticStones/Blocks/ItemReinforced.java b/common/MysticStones/Blocks/ItemReinforced.java index 4a22a00..c97c0da 100644 --- a/common/MysticStones/Blocks/ItemReinforced.java +++ b/common/MysticStones/Blocks/ItemReinforced.java @@ -1,24 +1,27 @@ package mysticstones.blocks; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import mysticstones.MysticStones; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemReinforced extends ItemBlockMulti { - public static final String[] BRICK_TYPE = new String[] { "Mithril Bricks", "Verdite Bricks", "Iridium Bricks", "Adamantine Bricks", "Tourmaline Bricks", "Topaz Bricks", "Amethyst Bricks", - "Agate Bricks" }; + public static final ArrayList BRICK_TYPE = new ArrayList(Arrays.asList("Mithril Bricks", "Verdite Bricks", "Iridium Bricks", "Adamantine Bricks", "Tourmaline Bricks", "Topaz Bricks", "Amethyst Bricks", + "Agate Bricks")); - public ItemReinforced(int par1) { - super(par1, MysticStones.reinforcedBricks, BRICK_TYPE); + public ItemReinforced(Block block) { + super(block, BRICK_TYPE); } @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { + super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); if (par4) { par3List.add("Works As A Beacon Block Too!"); } diff --git a/common/MysticStones/Blocks/ItemStoneBricks.java b/common/MysticStones/Blocks/ItemStoneBricks.java deleted file mode 100644 index 972f08e..0000000 --- a/common/MysticStones/Blocks/ItemStoneBricks.java +++ /dev/null @@ -1,12 +0,0 @@ -package mysticstones.blocks; - -import mysticstones.MysticStones; - -public class ItemStoneBricks extends ItemBlockMulti { - public static final String[] STONEBRICK_TYPES = new String[] { "Anorthosite Bricks", "Limestone Bricks", "Marble Bricks", "Migmatite Bricks", "Orthogneiss Bricks", "Slate Bricks", - "Travertine Bricks" }; - - public ItemStoneBricks(int par1) { - super(par1, MysticStones.stoneBricks, STONEBRICK_TYPES); - } -} diff --git a/common/MysticStones/Blocks/ItemStones.java b/common/MysticStones/Blocks/ItemStones.java deleted file mode 100644 index 2d644c6..0000000 --- a/common/MysticStones/Blocks/ItemStones.java +++ /dev/null @@ -1,12 +0,0 @@ -package mysticstones.blocks; - -import mysticstones.MysticStones; - -public class ItemStones extends ItemBlockMulti { - public static final String[] STONE_TYPES = new String[] { "Smooth Anorthosite", "Anorthosite", "Smooth Limestone", "Limestone", "Smooth Marble", "Marble", "Smooth Migmatite", "Migmatite", - "Smooth Orthogneiss", "Orthogneiss", "Smooth Slate", "Slate", "Smooth Travertine", "Travertine" }; - - public ItemStones(int par1) { - super(par1, MysticStones.stones, STONE_TYPES); - } -} diff --git a/common/MysticStones/MysticStones.java b/common/MysticStones/MysticStones.java index 66303fe..c8503fe 100644 --- a/common/MysticStones/MysticStones.java +++ b/common/MysticStones/MysticStones.java @@ -1,54 +1,65 @@ package mysticstones; -import mysticstones.blocks.BlockPlanks; -import mysticstones.blocks.BlockReinforced; -import mysticstones.blocks.BlockStoneBricks; -import mysticstones.blocks.BlockStones; -import mysticstones.blocks.ItemPlanks; -import mysticstones.blocks.ItemReinforced; -import mysticstones.blocks.ItemStoneBricks; -import mysticstones.blocks.ItemStones; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import mysticstones.blocks.*; import mysticstones.util.Config; import mysticstones.util.RecipeHandler; import mysticstones.worldgen.WorldGeneratorStones; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; -@Mod(modid = "mysticstones", name = "Mystic Stones", version = "0.1") -@NetworkMod(clientSideRequired = true) +import java.util.ArrayList; +import java.util.Arrays; + +@Mod(modid = "mysticstones", name = "Mystic Stones", version = "0.2") public class MysticStones { @Instance("mysticstones") public static MysticStones instance; + public static boolean ENABLE = true; public static Block planks, stones, stoneBricks, reinforcedBricks; public static final CreativeTabs MysticStonesTab = new CreativeTabs("MysticStonesTab") { @Override - public ItemStack getIconItemStack() { - return new ItemStack(MysticStones.reinforcedBricks, 1, 4); - } - }; + @SideOnly(Side.CLIENT) + public int func_151243_f() + { + return 4; + } + @Override + public Item getTabIconItem() { + return Item.getItemFromBlock(MysticStones.reinforcedBricks); + } + }; + public static final ArrayList PLANK_TYPE = new ArrayList(Arrays.asList("Purple Planks", "Green Planks", "Black Planks", "Orange Planks", "Red Planks", "Blue Planks", "Yellow Planks")); + public static final ArrayList STONEBRICK_TYPES = new ArrayList(Arrays.asList("Anorthosite Bricks", "Limestone Bricks", "Marble Bricks", "Migmatite Bricks", "Orthogneiss Bricks", "Slate Bricks", + "Travertine Bricks")); + public static final ArrayList STONE_TYPES = new ArrayList(Arrays.asList("Smooth Anorthosite", "Anorthosite", "Smooth Limestone", "Limestone", "Smooth Marble", "Marble", "Smooth Migmatite", "Migmatite", + "Smooth Orthogneiss", "Orthogneiss", "Smooth Slate", "Slate", "Smooth Travertine", "Travertine")); - @EventHandler + + @EventHandler public void preInit(FMLPreInitializationEvent event) { Config.initialize(event.getSuggestedConfigurationFile()); - planks = new BlockPlanks(Config.planksID); - stones = new BlockStones(Config.stonesID); - stoneBricks = new BlockStoneBricks(Config.stoneBricksID); - reinforcedBricks = new BlockReinforced(Config.reinforcedBricksID); - GameRegistry.registerBlock(planks, ItemPlanks.class, "Planks"); - GameRegistry.registerBlock(stones, ItemStones.class, "Stones"); - GameRegistry.registerBlock(stoneBricks, ItemStoneBricks.class, "StoneBricks"); - GameRegistry.registerBlock(reinforcedBricks, ItemReinforced.class, "Reinforcedbricks"); - RecipeHandler.craftPlanks(); - RecipeHandler.craftStoneBricks(); - RecipeHandler.craftReinforced(); - RecipeHandler.craftElse(); - GameRegistry.registerWorldGenerator(new WorldGeneratorStones()); + if(ENABLE){ + planks = new BlockPlanks(); + stones = new BlockStones(); + stoneBricks = new BlockStoneBricks(); + reinforcedBricks = new BlockReinforced(); + GameRegistry.registerBlock(planks, ItemBlockMulti.class, "Planks", "mysticstones", PLANK_TYPE); + GameRegistry.registerBlock(stones, ItemBlockMulti.class, "Stones", "mysticstones", STONE_TYPES); + GameRegistry.registerBlock(stoneBricks, ItemBlockMulti.class, "StoneBricks", "mysticstones", STONEBRICK_TYPES); + GameRegistry.registerBlock(reinforcedBricks, ItemReinforced.class, "Reinforcedbricks", "mysticstones"); + RecipeHandler.craftPlanks(); + RecipeHandler.craftStoneBricks(); + RecipeHandler.craftReinforced(); + RecipeHandler.craftElse(); + GameRegistry.registerWorldGenerator(new WorldGeneratorStones(), 1); + } } } diff --git a/common/MysticStones/Util/Config.java b/common/MysticStones/Util/Config.java index 7250ba7..26b6ca0 100644 --- a/common/MysticStones/Util/Config.java +++ b/common/MysticStones/Util/Config.java @@ -4,24 +4,17 @@ import java.util.List; import java.io.File; import java.util.ArrayList; -import net.minecraftforge.common.Configuration; +import mysticstones.MysticStones; +import net.minecraftforge.common.config.Configuration; public class Config { public static final String[] keys = { "anorthosite", "limestone", "marble", "migmatite", "orthogneiss", "slate", "travertine" }; - public static int planksID; - public static int stonesID; - public static int stoneBricksID; - public static int reinforcedBricksID; public static int[] rare = new int[keys.length]; public static List allowed = new ArrayList(); public static void initialize(File file) { Configuration config = new Configuration(file); - config.load(); - planksID = config.getBlock("Plank IDs", 509).getInt(); - stonesID = config.getBlock("Stone IDs", 510).getInt(); - stoneBricksID = config.getBlock("Stone Brick IDs", 511).getInt(); - reinforcedBricksID = config.getBlock("Reinforced Brick IDs", 512).getInt(); + MysticStones.ENABLE = config.get("General", "Enable", true).getBoolean(true); for (int i = 0; i < rare.length; i++) { rare[i] = config.get("Generation", "Rarity of " + keys[i], 3).getInt(); } diff --git a/common/MysticStones/Util/RecipeHandler.java b/common/MysticStones/Util/RecipeHandler.java index 31d720b..030be19 100644 --- a/common/MysticStones/Util/RecipeHandler.java +++ b/common/MysticStones/Util/RecipeHandler.java @@ -17,7 +17,7 @@ public class RecipeHandler { public static void craftElse() { //smelting for (int i = 1; i < 14; i += 2) { - FurnaceRecipes.smelting().addSmelting(MysticStones.stones.blockID, i, new ItemStack(MysticStones.stones, 1, i - 1), 0.1F); + FurnaceRecipes.smelting().func_151394_a(new ItemStack(MysticStones.stones, 1, i), new ItemStack(MysticStones.stones, 1, i - 1), 0.1F); } } diff --git a/common/MysticWorld/Biome/BiomeGenBasic.java b/common/MysticWorld/Biome/BiomeGenBasic.java index ebf150e..bbb927b 100644 --- a/common/MysticWorld/Biome/BiomeGenBasic.java +++ b/common/MysticWorld/Biome/BiomeGenBasic.java @@ -1,12 +1,13 @@ package mysticworld.biome; +import net.minecraft.block.Block; import net.minecraft.world.biome.BiomeGenBase; public class BiomeGenBasic extends BiomeGenBase { - public BiomeGenBasic(int id, int blockTop, int blockFiller) { + public BiomeGenBasic(int id, Block blockTop, Block blockFiller) { super(id); - this.topBlock = (byte) blockTop; - this.fillerBlock = (byte) blockFiller; + this.topBlock = blockTop; + this.fillerBlock = blockFiller; } public BiomeGenBasic(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk) { @@ -17,9 +18,9 @@ public class BiomeGenBasic extends BiomeGenBase { this.theBiomeDecorator.reedsPerChunk = reedsChunk; } - public BiomeGenBasic(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, int blockTop, int blockFiller) { + public BiomeGenBasic(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, Block blockTop, Block blockFiller) { this(id, treesChunk, grassChunk, flowerChunk, reedsChunk); - this.topBlock = (byte) blockTop; - this.fillerBlock = (byte) blockFiller; + this.topBlock = blockTop; + this.fillerBlock = blockFiller; } } diff --git a/common/MysticWorld/Biome/BiomeGenGlacier.java b/common/MysticWorld/Biome/BiomeGenGlacier.java index 2e46237..b220fcd 100644 --- a/common/MysticWorld/Biome/BiomeGenGlacier.java +++ b/common/MysticWorld/Biome/BiomeGenGlacier.java @@ -1,7 +1,9 @@ package mysticworld.biome; +import net.minecraft.block.Block; + public class BiomeGenGlacier extends BiomeGenTundra { - public BiomeGenGlacier(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, int blockTop, int blockFiller) { + public BiomeGenGlacier(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, Block blockTop, Block blockFiller) { super(id, treesChunk, grassChunk, flowerChunk, reedsChunk, blockTop, blockFiller); this.waterColorMultiplier = 15397370; } diff --git a/common/MysticWorld/Biome/BiomeGenJungle.java b/common/MysticWorld/Biome/BiomeGenJungle.java index c9f62dc..56899b0 100644 --- a/common/MysticWorld/Biome/BiomeGenJungle.java +++ b/common/MysticWorld/Biome/BiomeGenJungle.java @@ -1,18 +1,20 @@ package mysticworld.biome; import java.util.Random; + +import net.minecraft.world.gen.feature.WorldGenAbstractTree; import net.minecraft.world.gen.feature.WorldGenHugeTrees; +import net.minecraft.world.gen.feature.WorldGenMegaJungle; import net.minecraft.world.gen.feature.WorldGenTrees; -import net.minecraft.world.gen.feature.WorldGenerator; public class BiomeGenJungle extends net.minecraft.world.biome.BiomeGenJungle { public BiomeGenJungle(int par1) { - super(par1); + super(par1, false); } @Override - public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { - return par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : (par1Random.nextInt(2) == 0 ? new WorldGenHugeTrees(false, 10 + par1Random.nextInt(20), 3, 3) : new WorldGenTrees(false, + public WorldGenAbstractTree func_150567_a(Random par1Random) { + return par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : (par1Random.nextInt(2) == 0 ? new WorldGenMegaJungle(false, 10, 20, 3, 3) : new WorldGenTrees(false, 4 + par1Random.nextInt(7), 3, 3, true)); } } diff --git a/common/MysticWorld/Biome/BiomeGenTundra.java b/common/MysticWorld/Biome/BiomeGenTundra.java index 746f303..4a0fc0e 100644 --- a/common/MysticWorld/Biome/BiomeGenTundra.java +++ b/common/MysticWorld/Biome/BiomeGenTundra.java @@ -1,9 +1,9 @@ package mysticworld.biome; -import net.minecraft.world.biome.SpawnListEntry; +import net.minecraft.block.Block; public class BiomeGenTundra extends BiomeGenBasic { - public BiomeGenTundra(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, int blockTop, int blockFiller) { + public BiomeGenTundra(int id, int treesChunk, int grassChunk, int flowerChunk, int reedsChunk, Block blockTop, Block blockFiller) { super(id, treesChunk, grassChunk, flowerChunk, reedsChunk, blockTop, blockFiller); this.spawnableCreatureList.clear(); this.spawnableMonsterList.clear(); diff --git a/common/MysticWorld/Biome/BiomeHandler.java b/common/MysticWorld/Biome/BiomeHandler.java index ac316b9..f5d2b78 100644 --- a/common/MysticWorld/Biome/BiomeHandler.java +++ b/common/MysticWorld/Biome/BiomeHandler.java @@ -1,10 +1,9 @@ package mysticworld.biome; import mysticworld.lib.Booleans; -import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.BiomeManager; -import cpw.mods.fml.common.registry.GameRegistry; public class BiomeHandler { public static BiomeGenBase Mountain; @@ -13,48 +12,33 @@ public class BiomeHandler { public static BiomeGenBase Glacier; public static BiomeGenBase Jungle; - public static void init() { - initializeBiomes(); - registerBiomes(); - } - - public static void initializeBiomes() { - Mountain = new BiomeGenBasic(23, Block.stone.blockID, Block.stone.blockID).setColor(9286496).setBiomeName("Mountain").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F) - .setMinMaxHeight(0.5F, 1.0F); - Tundra = new BiomeGenTundra(24, 0, 0, 0, 0, Block.blockSnow.blockID, Block.blockSnow.blockID).setColor(9286496).setBiomeName("Tundra").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F) - .setMinMaxHeight(0.8F, 0.4F); - Steppe = new BiomeGenBasic(25, 0, 2, 2, 3, Block.grass.blockID, Block.dirt.blockID).setColor(5470985).setBiomeName("Steppe").setMinMaxHeight(0.1F, 0.1F); - Glacier = new BiomeGenGlacier(26, 0, 0, 0, 0, Block.ice.blockID, Block.ice.blockID).setColor(9474208).setBiomeName("Glacier").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F) - .setMinMaxHeight(0.5F, 0.7F); - Jungle = new BiomeGenJungle(27).setColor(5470985).setBiomeName("Jungle").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setMinMaxHeight(0.2F, 0.4F); - } - - public static void registerBiomes() { + public static void init(){ if (Booleans.ENABLE_JUNGLE_REWRITE) { - GameRegistry.removeBiome(BiomeGenBase.jungle); - GameRegistry.removeBiome(BiomeGenBase.jungleHills); - GameRegistry.addBiome(Jungle); + Jungle = new BiomeGenJungle(21).setColor(5470985).setBiomeName("Jungle").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setHeight(new BiomeGenBase.Height(0.2F, 0.4F)); BiomeManager.addSpawnBiome(Jungle); BiomeManager.addStrongholdBiome(Jungle); } - if (Booleans.ENABLE_GLACIER_GEN) { - GameRegistry.addBiome(Glacier); - BiomeManager.addStrongholdBiome(Glacier); - } if (Booleans.ENABLE_MOUNTAIN_GEN) { - GameRegistry.addBiome(Mountain); + Mountain = new BiomeGenBasic(53, Blocks.stone, Blocks.stone).setColor(9286496).setBiomeName("Mountain").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F) + .setHeight(new BiomeGenBase.Height(0.5F, 1.0F)); BiomeManager.addSpawnBiome(Mountain); BiomeManager.addStrongholdBiome(Mountain); } if (Booleans.ENABLE_TUNDRA_GEN) { - GameRegistry.addBiome(Tundra); + Tundra = new BiomeGenTundra(54, 0, 0, 0, 0, Blocks.snow, Blocks.snow).setColor(9286496).setBiomeName("Tundra").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F) + .setHeight(new BiomeGenBase.Height(0.8F, 0.4F)); BiomeManager.addStrongholdBiome(Tundra); } if (Booleans.ENABLE_STEPPE_GEN) { - GameRegistry.addBiome(Steppe); + Steppe = new BiomeGenBasic(55, 0, 2, 2, 3, Blocks.grass, Blocks.dirt).setColor(5470985).setBiomeName("Steppe").setHeight(new BiomeGenBase.Height(0.1F, 0.1F)); BiomeManager.addSpawnBiome(Steppe); BiomeManager.addVillageBiome(Steppe, true); BiomeManager.addStrongholdBiome(Steppe); } + if (Booleans.ENABLE_GLACIER_GEN) { + Glacier = new BiomeGenGlacier(56, 0, 0, 0, 0, Blocks.ice, Blocks.ice).setColor(9474208).setBiomeName("Glacier").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F) + .setHeight(new BiomeGenBase.Height(0.5F, 0.7F)); + BiomeManager.addStrongholdBiome(Glacier); + } } } diff --git a/common/MysticWorld/Blocks/BlockHandler.java b/common/MysticWorld/Blocks/BlockHandler.java index 4e36807..3f9c8e8 100644 --- a/common/MysticWorld/Blocks/BlockHandler.java +++ b/common/MysticWorld/Blocks/BlockHandler.java @@ -1,38 +1,26 @@ package mysticworld.blocks; -import mysticworld.lib.BlockIds; import mysticworld.lib.Strings; +import mysticworld.util.Reference; import net.minecraft.block.Block; import cpw.mods.fml.common.registry.GameRegistry; +import java.util.ArrayList; +import java.util.Arrays; + public class BlockHandler { - public static Block oreImbuedStone; - public static Block bush; - public static Block lightCube; - public static Block pillarPlatform; - public static Block pillar; - public static Block pillarInsert; + public static final ArrayList IMBUED_STONE_TYPE = new ArrayList(Arrays.asList(Strings.IMBUED_STONE_NAME+"Fire", Strings.IMBUED_STONE_NAME+"Water", Strings.IMBUED_STONE_NAME+"Earth", Strings.IMBUED_STONE_NAME+"Air", Strings.IMBUED_STONE_NAME+"Energy")); + public static final ArrayList BUSH_TYPES = new ArrayList(Arrays.asList(Strings.BUSH_NAME, Strings.POISON_BUSH_NAME, Strings.WEAKNESS_BUSH_NAME, Strings.SLOWNESS_BUSH_NAME, Strings.HARMING_BUSH_NAME, + Strings.WITHER_BUSH_NAME, Strings.HEALTH_BUSH_NAME, Strings.SPEED_BUSH_NAME, Strings.FIRE_RESISTANCE_BUSH_NAME, Strings.REGEN_BUSH_NAME, Strings.NIGHT_VISION_BUSH_NAME, + Strings.INVISIBILITY_BUSH_NAME)); + public static Block oreImbuedStone, bush, lightCube, pillarPlatform, pillar, pillarInsert; public static void init() { - oreImbuedStone = new BlockImbuedStone(BlockIds.ORE_STONE_1).setUnlocalizedName(Strings.IMBUED_STONE_NAME); - bush = new BlockBush(BlockIds.BUSH).setUnlocalizedName(Strings.BUSH_NAME); - lightCube = new BlockLightCube(BlockIds.LIGHT_CUBE).setUnlocalizedName(Strings.LIGHT_CUBE_NAME).setTextureName("mysticworld:lightCube"); - pillarPlatform = new BlockPlatform(BlockIds.PLATFORM).setUnlocalizedName(Strings.PLATFORM_NAME).setTextureName("mysticworld:Platform"); - pillar = new BlockPillar(BlockIds.PILLAR).setUnlocalizedName(Strings.PILLAR_NAME).setTextureName("mysticworld:Pillar"); - pillarInsert = new BlockPillarInsert(BlockIds.PILLAR_INSERT).setUnlocalizedName(Strings.PILLAR_INSERT_NAME); - registerBlocks(); - setBlockHarvestLevels(); - } - - private static void registerBlocks() { - GameRegistry.registerBlock(oreImbuedStone, ItemImbuedStone.class, Strings.IMBUED_STONE_NAME); - GameRegistry.registerBlock(bush, ItemBush.class, Strings.BUSH_NAME); - GameRegistry.registerBlock(lightCube, Strings.LIGHT_CUBE_NAME); - GameRegistry.registerBlock(pillarPlatform, Strings.PLATFORM_NAME); - GameRegistry.registerBlock(pillar, Strings.PILLAR_NAME); - GameRegistry.registerBlock(pillarInsert, Strings.PILLAR_INSERT_NAME); - } - - private static void setBlockHarvestLevels() { + oreImbuedStone = GameRegistry.registerBlock(new BlockImbuedStone().setBlockName(Strings.IMBUED_STONE_NAME), ItemBlockMulti.class, Strings.IMBUED_STONE_NAME, Reference.MOD_ID, IMBUED_STONE_TYPE); + bush = GameRegistry.registerBlock(new BlockBushes().setBlockName(Strings.BUSH_NAME), ItemBlockMulti.class, Strings.BUSH_NAME, Reference.MOD_ID, BUSH_TYPES); + lightCube = GameRegistry.registerBlock(new BlockLightCube().setBlockName(Strings.LIGHT_CUBE_NAME).setBlockTextureName("mysticworld:lightCube"), Strings.LIGHT_CUBE_NAME); + pillarPlatform = GameRegistry.registerBlock(new BlockPlatform().setBlockName(Strings.PLATFORM_NAME).setBlockTextureName("mysticworld:Platform"), Strings.PLATFORM_NAME); + pillar = GameRegistry.registerBlock(new BlockPillar().setBlockName(Strings.PILLAR_NAME).setBlockTextureName("mysticworld:Pillar"), Strings.PILLAR_NAME); + pillarInsert = GameRegistry.registerBlock(new BlockPillarInsert().setBlockName(Strings.PILLAR_INSERT_NAME), Strings.PILLAR_INSERT_NAME); } } diff --git a/common/MysticWorld/Blocks/BlockImbuedStone.java b/common/MysticWorld/Blocks/BlockImbuedStone.java index 25912fe..63a465a 100644 --- a/common/MysticWorld/Blocks/BlockImbuedStone.java +++ b/common/MysticWorld/Blocks/BlockImbuedStone.java @@ -8,29 +8,30 @@ import mysticworld.items.ItemHandler; import net.minecraft.block.Block; import net.minecraft.block.BlockFence; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockImbuedStone extends Block { - Icon[] textures; + IIcon[] textures; - public BlockImbuedStone(int ID) { - super(ID, Material.rock); - setHardness(0.5F); - setResistance(5F); + public BlockImbuedStone() { + super(Material.rock); + setHardness(0.5F); + setResistance(5F); setCreativeTab(MysticWorld.MysticWorldTab); - setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.125F, 0.75F); - setLightValue(0.625f); + setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.125F, 0.75F); + setLightLevel(0.625f); } @Override public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { - return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); + return World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4); } @Override @@ -44,25 +45,20 @@ public class BlockImbuedStone extends Block { } @Override - public Icon getIcon(int side, int meta) { + public IIcon getIcon(int side, int meta) { return textures[meta]; } @Override - public void getSubBlocks(int i, CreativeTabs tab, List list) { + public void getSubBlocks(Item i, CreativeTabs tab, List list) { for (int j = 0; j < 5; j++) { list.add(new ItemStack(i, 1, j)); } } @Override - public int idDropped(int par1, Random par2Random, int par3) { - return ItemHandler.imbuedShard.itemID; - } - - @Override - public boolean isOpaqueCube() { - return false; + public Item getItemDropped(int par1, Random par2Random, int par3) { + return ItemHandler.imbuedShard; } @Override @@ -71,9 +67,9 @@ public class BlockImbuedStone extends Block { } @Override - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { + public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) { boolean flag = false; - if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4))) { + if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) && !BlockFence.func_149825_a(par1World.getBlock(par2, par3 - 1, par4))) { flag = true; } if (flag) { @@ -84,24 +80,24 @@ public class BlockImbuedStone extends Block { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - textures = new Icon[16]; + public void registerBlockIcons(IIconRegister iconRegister) { + textures = new IIcon[16]; for (int i = 0; i < 5; i++) { - textures[i] = iconRegister.registerIcon("mysticworld:" + ItemImbuedStone.IMBUED_STONE_TYPE[i] + " Imbued Stone"); + textures[i] = iconRegister.registerIcon("mysticworld:" + BlockHandler.IMBUED_STONE_TYPE.get(i).substring(11) + " Imbued Stone"); } } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean renderAsNormalBlock(){ + return false; + } + + @Override + public boolean isOpaqueCube(){ + return false; + } public int xpDropAmount(int j) { return 5; } - - @Override - protected boolean canSilkHarvest() { - return true; - } } \ No newline at end of file diff --git a/common/MysticWorld/Blocks/BlockLightCube.java b/common/MysticWorld/Blocks/BlockLightCube.java index 64f528f..8548e95 100644 --- a/common/MysticWorld/Blocks/BlockLightCube.java +++ b/common/MysticWorld/Blocks/BlockLightCube.java @@ -5,24 +5,20 @@ import java.util.Random; import mysticworld.MysticWorld; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.item.Item; import net.minecraft.world.World; public class BlockLightCube extends Block { - public BlockLightCube(int id) { - super(id, Material.circuits); - setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F); - setLightValue(1.0F); - this.setTickRandomly(true); + public BlockLightCube() { + super(Material.circuits); + setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F); + setLightLevel(1.0F); + setTickRandomly(true); } @Override - public int idDropped(int par1, Random par2Random, int par3) { - return 0; - } - - @Override - public boolean isOpaqueCube() { - return false; + public Item getItemDropped(int par1, Random par2Random, int par3) { + return null; } @Override @@ -31,13 +27,13 @@ public class BlockLightCube extends Block { MysticWorld.proxy.lightCubeFX(world, x + random.nextDouble(), y + 0.75D, z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F); } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean renderAsNormalBlock(){ + return false; + } - @Override - protected boolean canSilkHarvest() { - return true; - } + @Override + public boolean isOpaqueCube(){ + return false; + } } diff --git a/common/MysticWorld/Blocks/BlockPillar.java b/common/MysticWorld/Blocks/BlockPillar.java index 89a7c90..a4c9d24 100644 --- a/common/MysticWorld/Blocks/BlockPillar.java +++ b/common/MysticWorld/Blocks/BlockPillar.java @@ -3,23 +3,24 @@ package mysticworld.blocks; import mysticworld.MysticWorld; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.world.IBlockAccess; public class BlockPillar extends Block { - public BlockPillar(int id) { - super(id, Material.rock); - setBlockUnbreakable(); - setResistance(6000000.0F); + public BlockPillar() { + super(Material.rock); + setBlockUnbreakable(); + setResistance(6000000.0F); setCreativeTab(MysticWorld.MysticWorldTab); - setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F); + setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F); } - @Override - public boolean isOpaqueCube() { - return false; - } + @Override + public boolean isOpaqueCube(){ + return false; + } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean renderAsNormalBlock(){ + return false; + } } diff --git a/common/MysticWorld/Blocks/BlockPillarInsert.java b/common/MysticWorld/Blocks/BlockPillarInsert.java index 82f0ed2..eaf007d 100644 --- a/common/MysticWorld/Blocks/BlockPillarInsert.java +++ b/common/MysticWorld/Blocks/BlockPillarInsert.java @@ -4,28 +4,33 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import mysticworld.MysticWorld; import mysticworld.tiles.TileEntityPillarInsert; -import net.minecraft.block.BlockContainer; +import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; +import net.minecraft.init.Items; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -public class BlockPillarInsert extends BlockContainer { +public class BlockPillarInsert extends Block { public static int RENDER_PILLAR_INSERT; - public BlockPillarInsert(int id) { - super(id, Material.rock); + public BlockPillarInsert() { + super(Material.rock); this.setBlockUnbreakable(); this.setResistance(6000000.0F); this.setCreativeTab(MysticWorld.MysticWorldTab); - setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 1.0F, 0.875F); + setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 1.0F, 0.875F); } + @Override + public boolean hasTileEntity(int i){ + return true; + } + @Override - public TileEntity createNewTileEntity(World world) { + public TileEntity createTileEntity(World world, int i) { return new TileEntityPillarInsert(); } @@ -39,16 +44,11 @@ public class BlockPillarInsert extends BlockContainer { return RENDER_PILLAR_INSERT; } - @Override - public boolean isOpaqueCube() { - return false; - } - @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) { if (!world.isRemote) { - if (Item.enderPearl.itemID == entityPlayer.inventory.getCurrentItem().itemID) { - TileEntity te = world.getBlockTileEntity(x, y, z); + if (Items.ender_pearl == entityPlayer.inventory.getCurrentItem().getItem()) { + TileEntity te = world.getTileEntity(x, y, z); } } return false; @@ -56,15 +56,21 @@ public class BlockPillarInsert extends BlockContainer { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister par1IconRegister) { + public void registerBlockIcons(IIconRegister par1IconRegister) { } @Override - public boolean renderAsNormalBlock() { - return false; - } + public boolean renderAsNormalBlock(){ + return false; + } + + @Override + public boolean isOpaqueCube(){ + return false; + } @Override + @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int i) { return false; } diff --git a/common/MysticWorld/Blocks/BlockPillarPlatform.java b/common/MysticWorld/Blocks/BlockPillarPlatform.java index cac0fdb..7467aa6 100644 --- a/common/MysticWorld/Blocks/BlockPillarPlatform.java +++ b/common/MysticWorld/Blocks/BlockPillarPlatform.java @@ -9,18 +9,13 @@ import net.minecraft.entity.Entity; import net.minecraft.world.World; public class BlockPillarPlatform extends Block { - public BlockPillarPlatform(int id) { - super(id, Material.rock); + public BlockPillarPlatform() { + super(Material.rock); this.setBlockUnbreakable(); this.setResistance(6000000.0F); this.setTickRandomly(true); setCreativeTab(MysticWorld.MysticWorldTab); - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F); - } - - @Override - public boolean isOpaqueCube() { - return false; + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F); } @Override @@ -40,10 +35,15 @@ public class BlockPillarPlatform extends Block { } } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean renderAsNormalBlock(){ + return false; + } + + @Override + public boolean isOpaqueCube(){ + return false; + } @Override public int tickRate(World par1World) { @@ -57,11 +57,11 @@ public class BlockPillarPlatform extends Block { } private boolean isTowersNearby(World world, int x, int y, int z) { - int block = BlockHandler.pillar.blockID; - if (world.getBlockId(x - 2, y, z - 2) == block && world.getBlockId(x - 2, y, z + 2) == block && world.getBlockId(x + 2, y, z + 2) == block && world.getBlockId(x + 2, y, z - 2) == block - && world.getBlockId(x - 2, y + 1, z - 2) == block && world.getBlockId(x - 2, y + 1, z + 2) == block && world.getBlockId(x + 2, y + 1, z + 2) == block - && world.getBlockId(x + 2, y + 1, z - 2) == block && world.getBlockId(x - 2, y + 2, z - 2) == block && world.getBlockId(x - 2, y + 2, z + 2) == block - && world.getBlockId(x + 2, y + 2, z + 2) == block && world.getBlockId(x + 2, y + 2, z - 2) == block) { + Block block = BlockHandler.pillar; + if (world.getBlock(x - 2, y, z - 2) == block && world.getBlock(x - 2, y, z + 2) == block && world.getBlock(x + 2, y, z + 2) == block && world.getBlock(x + 2, y, z - 2) == block + && world.getBlock(x - 2, y + 1, z - 2) == block && world.getBlock(x - 2, y + 1, z + 2) == block && world.getBlock(x + 2, y + 1, z + 2) == block + && world.getBlock(x + 2, y + 1, z - 2) == block && world.getBlock(x - 2, y + 2, z - 2) == block && world.getBlock(x - 2, y + 2, z + 2) == block + && world.getBlock(x + 2, y + 2, z + 2) == block && world.getBlock(x + 2, y + 2, z - 2) == block) { return true; } return false; diff --git a/common/MysticWorld/Blocks/BlockPillarTower.java b/common/MysticWorld/Blocks/BlockPillarTower.java index 08103ba..fe67465 100644 --- a/common/MysticWorld/Blocks/BlockPillarTower.java +++ b/common/MysticWorld/Blocks/BlockPillarTower.java @@ -5,21 +5,21 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; public class BlockPillarTower extends Block { - public BlockPillarTower(int id) { - super(id, Material.rock); - setBlockUnbreakable(); - setResistance(6000000.0F); - setCreativeTab(MysticWorld.MysticWorldTab); - setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F); + public BlockPillarTower() { + super(Material.rock); + setBlockUnbreakable(); + setResistance(6000000.0F); + setCreativeTab(MysticWorld.MysticWorldTab); + setBlockBounds(0.15F, 0.0F, 0.15F, 0.85F, 1.0F, 0.85F); } - @Override - public boolean isOpaqueCube() { - return false; - } + @Override + public boolean isOpaqueCube(){ + return false; + } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean renderAsNormalBlock(){ + return false; + } } diff --git a/common/MysticWorld/Blocks/BlockPlatform.java b/common/MysticWorld/Blocks/BlockPlatform.java index 953e105..c97973c 100644 --- a/common/MysticWorld/Blocks/BlockPlatform.java +++ b/common/MysticWorld/Blocks/BlockPlatform.java @@ -8,23 +8,27 @@ import net.minecraft.block.material.Material; import net.minecraft.world.World; public class BlockPlatform extends Block { - public BlockPlatform(int id) { - super(id, Material.rock); - this.setBlockUnbreakable(); - this.setResistance(6000000.0F); - this.setTickRandomly(true); + public BlockPlatform() { + super(Material.rock); + setBlockUnbreakable(); + setResistance(6000000.0F); + setTickRandomly(true); setCreativeTab(MysticWorld.MysticWorldTab); - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F); + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15F, 1.0F); } - @Override - public boolean isOpaqueCube() { - return false; - } + @Override + public boolean isOpaqueCube(){ + return false; + } + + @Override + public boolean renderAsNormalBlock(){ + return false; + } @Override public void randomDisplayTick(World world, int x, int y, int z, Random rand) { - int block = BlockHandler.pillar.blockID; double posX = x; double posY = y; double posZ = z; @@ -39,11 +43,6 @@ public class BlockPlatform extends Block { } } - @Override - public boolean renderAsNormalBlock() { - return false; - } - @Override public int tickRate(World par1World) { return 30; @@ -54,12 +53,12 @@ public class BlockPlatform extends Block { } private boolean isTowersNearby(World world, int x, int y, int z) { - int pillar = BlockHandler.pillar.blockID; - int insert = BlockHandler.pillarInsert.blockID; - if (world.getBlockId(x - 2, y, z - 2) == pillar && world.getBlockId(x - 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z + 2) == pillar && world.getBlockId(x + 2, y, z - 2) == pillar - && world.getBlockId(x - 2, y + 1, z - 2) == insert && world.getBlockId(x - 2, y + 1, z + 2) == insert && world.getBlockId(x + 2, y + 1, z + 2) == insert - && world.getBlockId(x + 2, y + 1, z - 2) == insert && world.getBlockId(x - 2, y + 2, z - 2) == pillar && world.getBlockId(x - 2, y + 2, z + 2) == pillar - && world.getBlockId(x + 2, y + 2, z + 2) == pillar && world.getBlockId(x + 2, y + 2, z - 2) == pillar) { + Block pillar = BlockHandler.pillar; + Block insert = BlockHandler.pillarInsert; + if (world.getBlock(x - 2, y, z - 2) == pillar && world.getBlock(x - 2, y, z + 2) == pillar && world.getBlock(x + 2, y, z + 2) == pillar && world.getBlock(x + 2, y, z - 2) == pillar + && world.getBlock(x - 2, y + 1, z - 2) == insert && world.getBlock(x - 2, y + 1, z + 2) == insert && world.getBlock(x + 2, y + 1, z + 2) == insert + && world.getBlock(x + 2, y + 1, z - 2) == insert && world.getBlock(x - 2, y + 2, z - 2) == pillar && world.getBlock(x - 2, y + 2, z + 2) == pillar + && world.getBlock(x + 2, y + 2, z + 2) == pillar && world.getBlock(x + 2, y + 2, z - 2) == pillar) { return true; } return false; diff --git a/common/MysticWorld/Blocks/ItemBush.java b/common/MysticWorld/Blocks/ItemBush.java deleted file mode 100644 index c7118e2..0000000 --- a/common/MysticWorld/Blocks/ItemBush.java +++ /dev/null @@ -1,38 +0,0 @@ -package mysticworld.blocks; - -import mysticworld.lib.Strings; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.util.MathHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemBush extends ItemBlock { - public static String[] BUSH_TYPES = new String[] { Strings.BUSH_NAME, Strings.POISON_BUSH_NAME, Strings.WEAKNESS_BUSH_NAME, Strings.SLOWNESS_BUSH_NAME, Strings.HARMING_BUSH_NAME, - Strings.WITHER_BUSH_NAME, Strings.HEALTH_BUSH_NAME, Strings.SPEED_BUSH_NAME, Strings.FIRE_RESISTANCE_BUSH_NAME, Strings.REGEN_BUSH_NAME, Strings.NIGHT_VISION_BUSH_NAME, - Strings.INVISIBILITY_BUSH_NAME }; - - public ItemBush(int par1) { - super(par1); - setMaxDamage(0); - setHasSubtypes(true); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int par1) { - return BlockHandler.bush.getIcon(2, par1); - } - - @Override - public int getMetadata(int par1) { - return par1; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) { - int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, BUSH_TYPES.length); - return BUSH_TYPES[meta]; - } -} diff --git a/common/MysticWorld/Blocks/ItemImbuedStone.java b/common/MysticWorld/Blocks/ItemImbuedStone.java deleted file mode 100644 index 7453aa1..0000000 --- a/common/MysticWorld/Blocks/ItemImbuedStone.java +++ /dev/null @@ -1,43 +0,0 @@ -package mysticworld.blocks; - -import java.util.List; - - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.util.MathHelper; - -public class ItemImbuedStone extends ItemBlock { - - public static String[] IMBUED_STONE_TYPE = new String[] {"Fire", "Water", "Earth", "Air", "Energy"}; - - public ItemImbuedStone(int par1) { - super(par1); - setMaxDamage(0); - setHasSubtypes(true); - } - - - @Override - public String getUnlocalizedName(ItemStack itemStack) { - int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, IMBUED_STONE_TYPE.length); - return super.getUnlocalizedName() + IMBUED_STONE_TYPE[meta]; - } - - - public int getMetadata(int par1) - { - return par1; - } - - @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int par1) - { - return BlockHandler.oreImbuedStone.getIcon(2, par1); - } - -} diff --git a/common/MysticWorld/Client/ClientProxy.java b/common/MysticWorld/Client/ClientProxy.java index 4affb96..e330a01 100644 --- a/common/MysticWorld/Client/ClientProxy.java +++ b/common/MysticWorld/Client/ClientProxy.java @@ -15,6 +15,7 @@ import mysticworld.items.ItemHandler; import mysticworld.renderer.*; import mysticworld.tiles.TileEntityPillarInsert; import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; @@ -25,11 +26,6 @@ public class ClientProxy extends CommonProxy { public final Minecraft mc = Minecraft.getMinecraft(); public static final ResourceLocation particle = new ResourceLocation("textures/particle/particles.png"); - @Override - public int addArmor(String armor) { - return RenderingRegistry.addNewArmourRendererPrefix(armor); - } - //particles @Override public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age) { @@ -64,17 +60,17 @@ public class ClientProxy extends CommonProxy { @Override public void registerRenders() { BlockPillarInsert.RENDER_PILLAR_INSERT = RenderingRegistry.getNextAvailableRenderId(); - MinecraftForgeClient.registerItemRenderer(BlockHandler.pillarInsert.blockID, new BlockPillarInsertRenderer()); - MinecraftForgeClient.registerItemRenderer(ItemHandler.fireStaff.itemID, new StaffItemRenderer("Fire")); - MinecraftForgeClient.registerItemRenderer(ItemHandler.earthStaff.itemID, new StaffItemRenderer("Earth")); - MinecraftForgeClient.registerItemRenderer(ItemHandler.airStaff.itemID, new StaffItemRenderer("Air")); - MinecraftForgeClient.registerItemRenderer(ItemHandler.energyStaff.itemID, new StaffItemRenderer("Energy")); - MinecraftForgeClient.registerItemRenderer(ItemHandler.waterStaff.itemID, new StaffItemRenderer("Water")); - MinecraftForgeClient.registerItemRenderer(ItemHandler.fireOrb.itemID, new OrbItemRenderer("Fire")); - MinecraftForgeClient.registerItemRenderer(ItemHandler.earthOrb.itemID, new OrbItemRenderer("Earth")); - MinecraftForgeClient.registerItemRenderer(ItemHandler.airOrb.itemID, new OrbItemRenderer("Air")); - MinecraftForgeClient.registerItemRenderer(ItemHandler.energyOrb.itemID, new OrbItemRenderer("Energy")); - MinecraftForgeClient.registerItemRenderer(ItemHandler.waterOrb.itemID, new OrbItemRenderer("Water")); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockHandler.pillarInsert), new BlockPillarInsertRenderer()); + MinecraftForgeClient.registerItemRenderer(ItemHandler.fireStaff, new StaffItemRenderer("Fire")); + MinecraftForgeClient.registerItemRenderer(ItemHandler.earthStaff, new StaffItemRenderer("Earth")); + MinecraftForgeClient.registerItemRenderer(ItemHandler.airStaff, new StaffItemRenderer("Air")); + MinecraftForgeClient.registerItemRenderer(ItemHandler.energyStaff, new StaffItemRenderer("Energy")); + MinecraftForgeClient.registerItemRenderer(ItemHandler.waterStaff, new StaffItemRenderer("Water")); + MinecraftForgeClient.registerItemRenderer(ItemHandler.fireOrb, new OrbItemRenderer("Fire")); + MinecraftForgeClient.registerItemRenderer(ItemHandler.earthOrb, new OrbItemRenderer("Earth")); + MinecraftForgeClient.registerItemRenderer(ItemHandler.airOrb, new OrbItemRenderer("Air")); + MinecraftForgeClient.registerItemRenderer(ItemHandler.energyOrb, new OrbItemRenderer("Energy")); + MinecraftForgeClient.registerItemRenderer(ItemHandler.waterOrb, new OrbItemRenderer("Water")); RenderingRegistry.registerEntityRenderingHandler(EntityChargeFire.class, new RenderStaffPower(0)); RenderingRegistry.registerEntityRenderingHandler(EntityChargeWater.class, new RenderStaffPower(1)); RenderingRegistry.registerEntityRenderingHandler(EntityChargeEarth.class, new RenderStaffPower(2)); diff --git a/common/MysticWorld/Entity/EntityChargeAir.java b/common/MysticWorld/Entity/EntityChargeAir.java index f864baa..3a510be 100644 --- a/common/MysticWorld/Entity/EntityChargeAir.java +++ b/common/MysticWorld/Entity/EntityChargeAir.java @@ -72,7 +72,7 @@ public class EntityChargeAir extends Entity { super.onUpdate(); Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true); + MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec31, true, true, false); vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); if (movingobjectposition != null) { diff --git a/common/MysticWorld/Entity/EntityChargeEarth.java b/common/MysticWorld/Entity/EntityChargeEarth.java index dfa9823..c552b59 100644 --- a/common/MysticWorld/Entity/EntityChargeEarth.java +++ b/common/MysticWorld/Entity/EntityChargeEarth.java @@ -10,6 +10,8 @@ import net.minecraft.entity.boss.EntityDragon; import net.minecraft.entity.boss.EntityWither; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -79,7 +81,7 @@ public class EntityChargeEarth extends Entity { super.onUpdate(); Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true); + MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec31, true, true, false); vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); if (movingobjectposition != null) { @@ -143,15 +145,15 @@ public class EntityChargeEarth extends Entity { par1MovingObjectPosition.entityHit.addVelocity(this.motionX * 1 * 0.6000000238418579D / f3, 0.1D, this.motionZ * 1 * 0.6000000238418579D / f3); } par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 20); - this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.seeds, rand.nextInt(4)))); - this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.mushroomBrown, rand.nextInt(2)))); - this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.appleRed, rand.nextInt(2)))); - this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.sapling, rand.nextInt(2), 0))); - this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.pumpkinSeeds, rand.nextInt(2)))); - this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.sapling, rand.nextInt(2), 1))); - this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.sapling, rand.nextInt(2), 2))); - this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Block.sapling, rand.nextInt(2), 3))); - this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.melonSeeds, rand.nextInt(3)))); + this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.wheat_seeds, rand.nextInt(4)))); + this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.brown_mushroom, rand.nextInt(2)))); + this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.apple, rand.nextInt(2)))); + this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.sapling, rand.nextInt(2), 0))); + this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.pumpkin_seeds, rand.nextInt(2)))); + this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.sapling, rand.nextInt(2), 1))); + this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.sapling, rand.nextInt(2), 2))); + this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Blocks.sapling, rand.nextInt(2), 3))); + this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.melon_seeds, rand.nextInt(3)))); } else { int i = par1MovingObjectPosition.blockX; int j = par1MovingObjectPosition.blockY; diff --git a/common/MysticWorld/Entity/EntityChargeEnergy.java b/common/MysticWorld/Entity/EntityChargeEnergy.java index 3e80441..d05f54b 100644 --- a/common/MysticWorld/Entity/EntityChargeEnergy.java +++ b/common/MysticWorld/Entity/EntityChargeEnergy.java @@ -69,7 +69,7 @@ public class EntityChargeEnergy extends Entity { super.onUpdate(); Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true); + MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec31, true, true, false); vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); if (movingobjectposition != null) { diff --git a/common/MysticWorld/Entity/EntityChargeFire.java b/common/MysticWorld/Entity/EntityChargeFire.java index 8443cb0..859c144 100644 --- a/common/MysticWorld/Entity/EntityChargeFire.java +++ b/common/MysticWorld/Entity/EntityChargeFire.java @@ -6,6 +6,7 @@ import mysticworld.MysticWorld; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; @@ -70,7 +71,7 @@ public class EntityChargeFire extends Entity { super.onUpdate(); Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true); + MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec31, true, true, false); vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); if (movingobjectposition != null) { @@ -160,7 +161,7 @@ public class EntityChargeFire extends Entity { ++i; } if (this.worldObj.isAirBlock(i, j, k)) { - this.worldObj.setBlock(i, j, k, Block.fire.blockID); + this.worldObj.setBlock(i, j, k, Blocks.fire); } } this.setDead(); diff --git a/common/MysticWorld/Entity/EntityChargeWater.java b/common/MysticWorld/Entity/EntityChargeWater.java index 1168d74..8eb3aeb 100644 --- a/common/MysticWorld/Entity/EntityChargeWater.java +++ b/common/MysticWorld/Entity/EntityChargeWater.java @@ -69,7 +69,7 @@ public class EntityChargeWater extends Entity { super.onUpdate(); Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, true, true); + MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec31, true, true, false); vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); if (movingobjectposition != null) { diff --git a/common/MysticWorld/Entity/EntityHandler.java b/common/MysticWorld/Entity/EntityHandler.java index b3ea704..ea84b64 100644 --- a/common/MysticWorld/Entity/EntityHandler.java +++ b/common/MysticWorld/Entity/EntityHandler.java @@ -1,20 +1,21 @@ package mysticworld.entity; import mysticworld.MysticWorld; -import mysticworld.lib.EntityIds; import mysticworld.lib.Strings; import cpw.mods.fml.common.registry.EntityRegistry; public class EntityHandler { + //Entity IDs + public static int ENTITY_AIR_CHARGE = 1; + public static int ENTITY_FIREBALL = 2; + public static int ENTITY_EARTH_CHARGE = 3; + public static int ENTITY_ENERGY_CHARGE = 4; + public static int ENTITY_WATER_CHARGE = 5; public static void init() { - registerEntities(); - } - - public static void registerEntities() { - EntityRegistry.registerModEntity(EntityChargeAir.class, Strings.ENTITY_AIR_CHARGE_NAME, EntityIds.ENTITY_AIR_CHARGE, MysticWorld.instance, 80, 3, false); - EntityRegistry.registerModEntity(EntityChargeFire.class, Strings.ENTITY_FIREBALL_NAME, EntityIds.ENTITY_FIREBALL, MysticWorld.instance, 80, 3, false); - EntityRegistry.registerModEntity(EntityChargeEarth.class, Strings.ENTITY_EARTH_CHARGE_NAME, EntityIds.ENTITY_EARTH_CHARGE, MysticWorld.instance, 80, 3, false); - EntityRegistry.registerModEntity(EntityChargeEnergy.class, Strings.ENTITY_ENERGY_CHARGE_NAME, EntityIds.ENTITY_ENERGY_CHARGE, MysticWorld.instance, 80, 3, false); - EntityRegistry.registerModEntity(EntityChargeWater.class, Strings.ENTITY_WATER_CHARGE_NAME, EntityIds.ENTITY_WATER_CHARGE, MysticWorld.instance, 80, 3, false); + EntityRegistry.registerModEntity(EntityChargeAir.class, Strings.ENTITY_AIR_CHARGE_NAME, ENTITY_AIR_CHARGE, MysticWorld.instance, 80, 3, false); + EntityRegistry.registerModEntity(EntityChargeFire.class, Strings.ENTITY_FIREBALL_NAME, ENTITY_FIREBALL, MysticWorld.instance, 80, 3, false); + EntityRegistry.registerModEntity(EntityChargeEarth.class, Strings.ENTITY_EARTH_CHARGE_NAME, ENTITY_EARTH_CHARGE, MysticWorld.instance, 80, 3, false); + EntityRegistry.registerModEntity(EntityChargeEnergy.class, Strings.ENTITY_ENERGY_CHARGE_NAME, ENTITY_ENERGY_CHARGE, MysticWorld.instance, 80, 3, false); + EntityRegistry.registerModEntity(EntityChargeWater.class, Strings.ENTITY_WATER_CHARGE_NAME, ENTITY_WATER_CHARGE, MysticWorld.instance, 80, 3, false); } } diff --git a/common/MysticWorld/Items/EnumArmor.java b/common/MysticWorld/Items/EnumArmor.java index 89d822d..4e8192f 100644 --- a/common/MysticWorld/Items/EnumArmor.java +++ b/common/MysticWorld/Items/EnumArmor.java @@ -1,12 +1,12 @@ package mysticworld.items; -import net.minecraft.item.EnumArmorMaterial; -import net.minecraftforge.common.EnumHelper; +import net.minecraft.item.ItemArmor; +import net.minecraftforge.common.util.EnumHelper; public class EnumArmor { - static EnumArmorMaterial Verdite = EnumHelper.addArmorMaterial("Verdite", 262, new int[]{2, 5, 4, 1}, 5); - static EnumArmorMaterial Mithril = EnumHelper.addArmorMaterial("Mithril", 500, new int[]{2, 7, 6, 2}, 9); - static EnumArmorMaterial Adamantine = EnumHelper.addArmorMaterial("Adamantine", 3000, new int[]{4, 9, 6, 4}, 13); - static EnumArmorMaterial Iridium = EnumHelper.addArmorMaterial("Iridium", 4000, new int[]{4, 10, 7, 5}, 15); + static ItemArmor.ArmorMaterial Verdite = EnumHelper.addArmorMaterial("Verdite", 262, new int[]{2, 5, 4, 1}, 5); + static ItemArmor.ArmorMaterial Mithril = EnumHelper.addArmorMaterial("Mithril", 500, new int[]{2, 7, 6, 2}, 9); + static ItemArmor.ArmorMaterial Adamantine = EnumHelper.addArmorMaterial("Adamantine", 3000, new int[]{4, 9, 6, 4}, 13); + static ItemArmor.ArmorMaterial Iridium = EnumHelper.addArmorMaterial("Iridium", 4000, new int[]{4, 10, 7, 5}, 15); } diff --git a/common/MysticWorld/Items/ItemArmorAdamantine.java b/common/MysticWorld/Items/ItemArmorAdamantine.java index a7b4a00..8dcecef 100644 --- a/common/MysticWorld/Items/ItemArmorAdamantine.java +++ b/common/MysticWorld/Items/ItemArmorAdamantine.java @@ -1,30 +1,29 @@ package mysticworld.items; import mysticworld.MysticWorld; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; -import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; public class ItemArmorAdamantine extends ItemArmor { int ArmorType; - public ItemArmorAdamantine(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { - super(par1, par2EnumArmorMaterial, par3, par4); + public ItemArmorAdamantine(ArmorMaterial par2EnumArmorMaterial, int par4) { + super(par2EnumArmorMaterial, 0, par4); this.ArmorType = par4; this.setMaxDamage(3000); this.setCreativeTab(MysticWorld.MysticWorldTab); } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer) { int suffix = this.armorType == 2 ? 2 : 1; return "mysticworld:textures/models/armor/Adamantine_layer_" + suffix + ".png"; } @Override - public void registerIcons(IconRegister iconRegister) { + public void registerIcons(IIconRegister iconRegister) { itemIcon = iconRegister.registerIcon("mysticworld:AdamantineArmor_" + ArmorType); } } diff --git a/common/MysticWorld/Items/ItemArmorIridium.java b/common/MysticWorld/Items/ItemArmorIridium.java index cbd96b3..b2b4939 100644 --- a/common/MysticWorld/Items/ItemArmorIridium.java +++ b/common/MysticWorld/Items/ItemArmorIridium.java @@ -1,10 +1,9 @@ package mysticworld.items; import mysticworld.MysticWorld; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; @@ -14,44 +13,44 @@ import net.minecraft.world.World; public class ItemArmorIridium extends ItemArmor { int ArmorType; - public ItemArmorIridium(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { - super(par1, par2EnumArmorMaterial, par3, par4); + public ItemArmorIridium(ArmorMaterial par2EnumArmorMaterial, int par4) { + super(par2EnumArmorMaterial, 0, par4); this.ArmorType = par4; this.setMaxDamage(4000); this.setCreativeTab(MysticWorld.MysticWorldTab); } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer) { int suffix = this.armorType == 2 ? 2 : 1; return "mysticworld:textures/models/armor/Iridium_layer_" + suffix + ".png"; } @Override - public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) { - ItemStack helmet = player.getCurrentItemOrArmor(4); - ItemStack plate = player.getCurrentItemOrArmor(3); - ItemStack legs = player.getCurrentItemOrArmor(2); - ItemStack boots = player.getCurrentItemOrArmor(1); + public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { + ItemStack helmet = player.getEquipmentInSlot(4); + ItemStack plate = player.getEquipmentInSlot(3); + ItemStack legs = player.getEquipmentInSlot(2); + ItemStack boots = player.getEquipmentInSlot(1); if (helmet != null) { - if (helmet.itemID == ItemHandler.iridiumHelmet.itemID) { + if (helmet.getItem() == ItemHandler.iridiumHelmet) { player.addPotionEffect((new PotionEffect(Potion.nightVision.getId(), 200, 0))); } } if (plate != null) { - if (plate.itemID == ItemHandler.iridiumChestplate.itemID) { + if (plate.getItem() == ItemHandler.iridiumChestplate) { player.addPotionEffect((new PotionEffect(Potion.regeneration.getId(), 200, 0))); } } if (legs != null) { - if (legs.itemID == ItemHandler.iridiumLeggings.itemID) { + if (legs.getItem() == ItemHandler.iridiumLeggings) { player.addPotionEffect((new PotionEffect(Potion.moveSpeed.getId(), 200, 2))); player.addVelocity(0.0005, 0, 0.0005); player.stepHeight = 1.001F; } } if (boots != null) { - if (boots.itemID == ItemHandler.iridiumBoots.itemID) { + if (boots.getItem() == ItemHandler.iridiumBoots) { player.fallDistance = 0.0F; player.addPotionEffect((new PotionEffect(Potion.jump.getId(), 200, 2))); } @@ -59,7 +58,7 @@ public class ItemArmorIridium extends ItemArmor { } @Override - public void registerIcons(IconRegister iconRegister) { + public void registerIcons(IIconRegister iconRegister) { itemIcon = iconRegister.registerIcon("mysticworld:IridiumArmor_" + ArmorType); } } \ No newline at end of file diff --git a/common/MysticWorld/Items/ItemArmorMithril.java b/common/MysticWorld/Items/ItemArmorMithril.java index e649f9e..d6bd4e8 100644 --- a/common/MysticWorld/Items/ItemArmorMithril.java +++ b/common/MysticWorld/Items/ItemArmorMithril.java @@ -1,30 +1,29 @@ package mysticworld.items; import mysticworld.MysticWorld; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; -import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; public class ItemArmorMithril extends ItemArmor { int ArmorType; - public ItemArmorMithril(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { - super(par1, par2EnumArmorMaterial, par3, par4); + public ItemArmorMithril(ArmorMaterial par2EnumArmorMaterial, int par4) { + super(par2EnumArmorMaterial, 0, par4); this.ArmorType = par4; this.setMaxDamage(500); this.setCreativeTab(MysticWorld.MysticWorldTab); } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer) { int suffix = this.armorType == 2 ? 2 : 1; return "mysticworld:textures/models/armor/Mithril_layer_" + suffix + ".png"; } @Override - public void registerIcons(IconRegister iconRegister) { + public void registerIcons(IIconRegister iconRegister) { itemIcon = iconRegister.registerIcon("mysticworld:MithrilArmor_" + ArmorType); } } diff --git a/common/MysticWorld/Items/ItemArmorVerdite.java b/common/MysticWorld/Items/ItemArmorVerdite.java index 0e7553b..2d2b295 100644 --- a/common/MysticWorld/Items/ItemArmorVerdite.java +++ b/common/MysticWorld/Items/ItemArmorVerdite.java @@ -1,30 +1,29 @@ package mysticworld.items; import mysticworld.MysticWorld; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; -import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; public class ItemArmorVerdite extends ItemArmor { int ArmorType; - public ItemArmorVerdite(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { - super(par1, par2EnumArmorMaterial, par3, par4); + public ItemArmorVerdite(ArmorMaterial par2EnumArmorMaterial, int par4) { + super(par2EnumArmorMaterial, 0, par4); this.ArmorType = par4; this.setMaxDamage(262); this.setCreativeTab(MysticWorld.MysticWorldTab); } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer) { int suffix = this.armorType == 2 ? 2 : 1; return "mysticworld:textures/models/armor/Verdite_layer_" + suffix + ".png"; } @Override - public void registerIcons(IconRegister iconRegister) { + public void registerIcons(IIconRegister iconRegister) { itemIcon = iconRegister.registerIcon("mysticworld:VerditeArmor_" + ArmorType); } } diff --git a/common/MysticWorld/Items/ItemBushFruit.java b/common/MysticWorld/Items/ItemBushFruit.java index 755fab1..ce12fad 100644 --- a/common/MysticWorld/Items/ItemBushFruit.java +++ b/common/MysticWorld/Items/ItemBushFruit.java @@ -3,26 +3,27 @@ package mysticworld.items; import java.util.List; import mysticworld.MysticWorld; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemBushFruit extends ItemFood { - private Icon[] icons; + private IIcon[] icons; private static final String[] FRUIT_TYPES = new String[] { "Mundane", "Poison", "Weakness", "Slowness", "Harming", "Wither", "Health", "Speed", "FireResistance", "Regen", "NightVision", "Invisibility" }; - public ItemBushFruit(int id, int health) { - super(id, health, 0.6F, false); + public ItemBushFruit(int health) { + super(health, 0.6F, false); this.setHasSubtypes(true); this.setCreativeTab(MysticWorld.MysticWorldTab); maxStackSize = 64; @@ -32,7 +33,7 @@ public class ItemBushFruit extends ItemFood { @Override @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int meta) { + public IIcon getIconFromDamage(int meta) { int j = MathHelper.clamp_int(meta, 0, FRUIT_TYPES.length); return icons[j]; } @@ -44,7 +45,7 @@ public class ItemBushFruit extends ItemFood { @Override @SideOnly(Side.CLIENT) - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { + public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { for (int var4 = 0; var4 < FRUIT_TYPES.length; var4++) { par3List.add(new ItemStack(par1, 1, var4)); } @@ -60,8 +61,8 @@ public class ItemBushFruit extends ItemFood { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - icons = new Icon[FRUIT_TYPES.length]; + public void registerIcons(IIconRegister iconRegister) { + icons = new IIcon[FRUIT_TYPES.length]; for (int i = 0; i < FRUIT_TYPES.length; ++i) { icons[i] = iconRegister.registerIcon("mysticworld:Fruit" + FRUIT_TYPES[i]); } @@ -76,77 +77,77 @@ public class ItemBushFruit extends ItemFood { case 1: potion = player.getActivePotionEffect(Potion.poison); if (potion != null) { - duration = potion.duration; + duration = potion.getDuration(); } player.addPotionEffect(new PotionEffect(Potion.poison.id, duration + 160, 0)); break; case 2: potion = player.getActivePotionEffect(Potion.weakness); if (potion != null) { - duration = potion.duration; + duration = potion.getDuration(); } player.addPotionEffect(new PotionEffect(Potion.weakness.id, duration + 160, 0)); break; case 3: potion = player.getActivePotionEffect(Potion.moveSlowdown); if (potion != null) { - duration = potion.duration; + duration = potion.getDuration(); } player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration + 160, 0)); break; case 4: potion = player.getActivePotionEffect(Potion.harm); if (potion != null) { - duration = potion.duration; + duration = potion.getDuration(); } player.addPotionEffect(new PotionEffect(Potion.harm.id, duration + 1, 0)); break; case 5: potion = player.getActivePotionEffect(Potion.wither); if (potion != null) { - duration = potion.duration; + duration = potion.getDuration(); } player.addPotionEffect(new PotionEffect(Potion.wither.id, duration + 160, 0)); break; case 6: potion = player.getActivePotionEffect(Potion.heal); if (potion != null) { - duration = potion.duration; + duration = potion.getDuration(); } player.addPotionEffect(new PotionEffect(Potion.heal.id, duration + 1, 0)); break; case 7: potion = player.getActivePotionEffect(Potion.moveSpeed); if (potion != null) { - duration = potion.duration; + duration = potion.getDuration(); } player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, duration + 160, 0)); break; case 8: potion = player.getActivePotionEffect(Potion.fireResistance); if (potion != null) { - duration = potion.duration; + duration = potion.getDuration(); } player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, duration + 160, 0)); break; case 9: potion = player.getActivePotionEffect(Potion.regeneration); if (potion != null) { - duration = potion.duration; + duration = potion.getDuration(); } player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 160, 0)); break; case 10: potion = player.getActivePotionEffect(Potion.nightVision); if (potion != null) { - duration = potion.duration; + duration = potion.getDuration(); } player.addPotionEffect(new PotionEffect(Potion.nightVision.id, duration + 160, 0)); break; case 11: potion = player.getActivePotionEffect(Potion.invisibility); if (potion != null) { - duration = potion.duration; + duration = potion.getDuration(); } player.addPotionEffect(new PotionEffect(Potion.invisibility.id, duration + 160, 0)); break; diff --git a/common/MysticWorld/Items/ItemImbuedShard.java b/common/MysticWorld/Items/ItemImbuedShard.java index 1e234b9..a31ab59 100644 --- a/common/MysticWorld/Items/ItemImbuedShard.java +++ b/common/MysticWorld/Items/ItemImbuedShard.java @@ -4,21 +4,21 @@ import java.util.List; import mysticworld.MysticWorld; import mysticworld.lib.Strings; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemImbuedShard extends Item { - private Icon[] icons; + private IIcon[] icons; private static final String[] SHARD_TYPES = new String[] { "Fire", "Water", "Earth", "Air", "Energy" }; - public ItemImbuedShard(int id) { - super(id); + public ItemImbuedShard() { + super(); this.setHasSubtypes(true); this.setUnlocalizedName(Strings.IMBUED_SHARD_NAME); this.setCreativeTab(MysticWorld.MysticWorldTab); @@ -26,14 +26,14 @@ public class ItemImbuedShard extends Item { @Override @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int meta) { + public IIcon getIconFromDamage(int meta) { int j = MathHelper.clamp_int(meta, 0, 5); return icons[j]; } @Override @SideOnly(Side.CLIENT) - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { + public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { for (int var4 = 0; var4 < SHARD_TYPES.length; var4++) { par3List.add(new ItemStack(par1, 1, var4)); } @@ -47,8 +47,8 @@ public class ItemImbuedShard extends Item { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - icons = new Icon[SHARD_TYPES.length]; + public void registerIcons(IIconRegister iconRegister) { + icons = new IIcon[SHARD_TYPES.length]; for (int i = 0; i < SHARD_TYPES.length; ++i) { icons[i] = iconRegister.registerIcon("mysticworld:Shard" + SHARD_TYPES[i]); } diff --git a/common/MysticWorld/Items/ItemOrb.java b/common/MysticWorld/Items/ItemOrb.java index 7cb7af7..38012b1 100644 --- a/common/MysticWorld/Items/ItemOrb.java +++ b/common/MysticWorld/Items/ItemOrb.java @@ -6,14 +6,14 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import mysticworld.MysticWorld; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; public class ItemOrb extends Item { Random rand = new Random(); - public ItemOrb(int id) { - super(id); + public ItemOrb() { + super(); this.setMaxStackSize(1); this.setMaxDamage(200); this.setCreativeTab(MysticWorld.MysticWorldTab); @@ -21,6 +21,6 @@ public class ItemOrb extends Item { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister par1IconRegister) { + public void registerIcons(IIconRegister par1IconRegister) { } } diff --git a/common/MysticWorld/Items/ItemOrbAir.java b/common/MysticWorld/Items/ItemOrbAir.java index 9a6868b..99ac3e1 100644 --- a/common/MysticWorld/Items/ItemOrbAir.java +++ b/common/MysticWorld/Items/ItemOrbAir.java @@ -11,8 +11,8 @@ import net.minecraft.world.World; import org.lwjgl.input.Mouse; public class ItemOrbAir extends ItemOrb { - public ItemOrbAir(int id) { - super(id); + public ItemOrbAir() { + super(); } @Override diff --git a/common/MysticWorld/Items/ItemOrbEarth.java b/common/MysticWorld/Items/ItemOrbEarth.java index c796ce0..e1ad6de 100644 --- a/common/MysticWorld/Items/ItemOrbEarth.java +++ b/common/MysticWorld/Items/ItemOrbEarth.java @@ -1,26 +1,15 @@ package mysticworld.items; import mysticworld.MysticWorld; -import net.minecraft.block.Block; -import net.minecraft.block.BlockCocoa; -import net.minecraft.block.BlockCrops; -import net.minecraft.block.BlockDirectional; -import net.minecraft.block.BlockMushroom; -import net.minecraft.block.BlockSapling; -import net.minecraft.block.BlockStem; import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemDye; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import net.minecraftforge.common.ForgeHooks; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.Event.Result; -import net.minecraftforge.event.entity.player.BonemealEvent; public class ItemOrbEarth extends ItemOrb { - public ItemOrbEarth(int id) { - super(id); + public ItemOrbEarth() { + super(); } @Override @@ -47,113 +36,6 @@ public class ItemOrbEarth extends ItemOrb { } public static boolean applyBonemeal(ItemStack itemStack, World par1World, int par2, int par3, int par4, EntityPlayer player) { - int l = par1World.getBlockId(par2, par3, par4); - BonemealEvent event = new BonemealEvent(player, par1World, l, par2, par3, par4); - if (MinecraftForge.EVENT_BUS.post(event)) { - return false; - } - if (event.getResult() == Result.ALLOW) { - itemStack.damageItem(1, player); - return true; - } - if (l == Block.sapling.blockID) { - if (!par1World.isRemote) { - if (par1World.rand.nextFloat() < 0.45D) { - ((BlockSapling) Block.sapling).markOrGrowMarked(par1World, par2, par3, par4, par1World.rand); - } - itemStack.damageItem(1, player); - } - return true; - } else if (l == Block.cobblestone.blockID) { - if (!par1World.isRemote) { - par1World.setBlock(par2, par3, par4, Block.cobblestoneMossy.blockID); - } - itemStack.damageItem(1, player); - } else if (l == Block.deadBush.blockID) { - if (!par1World.isRemote) { - par1World.setBlock(par2, par3, par4, 0); - par1World.spawnEntityInWorld(new EntityItem(par1World, par2, par3, par4, new ItemStack(Block.sapling, 1))); - } - itemStack.damageItem(1, player); - } else if (l != Block.mushroomBrown.blockID && l != Block.mushroomRed.blockID) { - if (l != Block.melonStem.blockID && l != Block.pumpkinStem.blockID) { - if (l > 0 && Block.blocksList[l] instanceof BlockCrops) { - if (par1World.getBlockMetadata(par2, par3, par4) == 7) { - return false; - } else { - if (!par1World.isRemote) { - ((BlockCrops) Block.blocksList[l]).fertilize(par1World, par2, par3, par4); - itemStack.damageItem(1, player); - } - return true; - } - } else { - int i1; - int j1; - int k1; - if (l == Block.cocoaPlant.blockID) { - i1 = par1World.getBlockMetadata(par2, par3, par4); - j1 = BlockDirectional.getDirection(i1); - k1 = BlockCocoa.func_72219_c(i1); - if (k1 >= 2) { - return false; - } else { - if (!par1World.isRemote) { - ++k1; - par1World.setBlockMetadataWithNotify(par2, par3, par4, k1 << 2 | j1, 2); - itemStack.damageItem(1, player); - } - return true; - } - } else if (l != Block.grass.blockID) { - return false; - } else { - if (!par1World.isRemote) { - itemStack.damageItem(1, player); - label102: for (i1 = 0; i1 < 128; ++i1) { - j1 = par2; - k1 = par3 + 1; - int l1 = par4; - for (int i2 = 0; i2 < i1 / 16; ++i2) { - j1 += itemRand.nextInt(3) - 1; - k1 += (itemRand.nextInt(3) - 1) * itemRand.nextInt(3) / 2; - l1 += itemRand.nextInt(3) - 1; - if (par1World.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || par1World.isBlockNormalCube(j1, k1, l1)) { - continue label102; - } - } - if (par1World.getBlockId(j1, k1, l1) == 0) { - if (itemRand.nextInt(10) != 0) { - if (Block.tallGrass.canBlockStay(par1World, j1, k1, l1)) { - par1World.setBlock(j1, k1, l1, Block.tallGrass.blockID, 1, 3); - } - } else { - ForgeHooks.plantGrass(par1World, j1, k1, l1); - } - } - } - } - return true; - } - } - } else if (par1World.getBlockMetadata(par2, par3, par4) == 7) { - return false; - } else { - if (!par1World.isRemote) { - ((BlockStem) Block.blocksList[l]).fertilizeStem(par1World, par2, par3, par4); - itemStack.damageItem(1, player); - } - return true; - } - } else { - if (!par1World.isRemote) { - if (par1World.rand.nextFloat() < 0.4D) { - ((BlockMushroom) Block.blocksList[l]).fertilizeMushroom(par1World, par2, par3, par4, par1World.rand); - } - itemStack.damageItem(1, player); - } - return true; - } - return true; + return ItemDye.applyBonemeal(itemStack, par1World, par2, par3, par4, player); } } diff --git a/common/MysticWorld/Items/ItemOrbEnergy.java b/common/MysticWorld/Items/ItemOrbEnergy.java index 1a9bae3..81ef707 100644 --- a/common/MysticWorld/Items/ItemOrbEnergy.java +++ b/common/MysticWorld/Items/ItemOrbEnergy.java @@ -2,16 +2,18 @@ package mysticworld.items; import mysticworld.MysticWorld; import mysticworld.blocks.BlockHandler; +import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class ItemOrbEnergy extends ItemOrb { - public ItemOrbEnergy(int id) { - super(id); + public ItemOrbEnergy() { + super(); } @Override @@ -37,10 +39,10 @@ public class ItemOrbEnergy extends ItemOrb { if (!entityPlayer.canPlayerEdit(par4, par5, par6, par7, itemStack)) { return false; } else { - int i1 = world.getBlockId(par4, par5, par6); - if (i1 == 0) { + Block i1 = world.getBlock(par4, par5, par6); + if (i1 == Blocks.air) { world.playSoundEffect(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); - world.setBlock(par4, par5, par6, BlockHandler.lightCube.blockID); + world.setBlock(par4, par5, par6, BlockHandler.lightCube); } itemStack.damageItem(1, entityPlayer); return true; diff --git a/common/MysticWorld/Items/ItemOrbFire.java b/common/MysticWorld/Items/ItemOrbFire.java index ea63028..8b1d909 100644 --- a/common/MysticWorld/Items/ItemOrbFire.java +++ b/common/MysticWorld/Items/ItemOrbFire.java @@ -5,6 +5,7 @@ import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; @@ -12,8 +13,8 @@ import net.minecraft.util.DamageSource; import net.minecraft.world.World; public class ItemOrbFire extends ItemOrb { - public ItemOrbFire(int id) { - super(id); + public ItemOrbFire() { + super(); } @Override @@ -49,7 +50,7 @@ public class ItemOrbFire extends ItemOrb { } else { if (par3World.isAirBlock(par4, par5, par6)) { par3World.playSoundEffect(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); - par3World.setBlock(par4, par5, par6, Block.fire.blockID); + par3World.setBlock(par4, par5, par6, Blocks.fire); } par1ItemStack.damageItem(1, par2EntityPlayer); return true; diff --git a/common/MysticWorld/Items/ItemOrbWater.java b/common/MysticWorld/Items/ItemOrbWater.java index dad06f5..cb18d8f 100644 --- a/common/MysticWorld/Items/ItemOrbWater.java +++ b/common/MysticWorld/Items/ItemOrbWater.java @@ -5,14 +5,14 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class ItemOrbWater extends ItemOrb { - public ItemOrbWater(int id) { - super(id); + public ItemOrbWater() { + super(); } @Override @@ -21,7 +21,7 @@ public class ItemOrbWater extends ItemOrb { if (movingobjectposition == null) { return itemStack; } else { - if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { int i = movingobjectposition.blockX; int j = movingobjectposition.blockY; int k = movingobjectposition.blockZ; @@ -31,7 +31,7 @@ public class ItemOrbWater extends ItemOrb { if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) { return itemStack; } - if (world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0) { + if (world.getBlock(i, j, k).getMaterial() == Material.water && world.getBlockMetadata(i, j, k) == 0) { world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); world.setBlockToAir(i, j, k); itemStack.damageItem(1, entityPlayer); @@ -58,10 +58,10 @@ public class ItemOrbWater extends ItemOrb { if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) { return itemStack; } else { - int i1 = world.getBlockId(i, j, k); - if (i1 == 0) { + Block i1 = world.getBlock(i, j, k); + if (i1 == Blocks.air) { world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); - world.setBlock(i, j, k, Block.waterMoving.blockID); + world.setBlock(i, j, k, Blocks.flowing_water); itemStack.damageItem(1, entityPlayer); } return itemStack; diff --git a/common/MysticWorld/Items/ItemStaff.java b/common/MysticWorld/Items/ItemStaff.java index 692cffb..588e6f8 100644 --- a/common/MysticWorld/Items/ItemStaff.java +++ b/common/MysticWorld/Items/ItemStaff.java @@ -3,7 +3,7 @@ package mysticworld.items; import java.util.Random; import mysticworld.MysticWorld; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -11,8 +11,8 @@ import cpw.mods.fml.relauncher.SideOnly; public class ItemStaff extends Item { Random rand = new Random(); - public ItemStaff(int id) { - super(id); + public ItemStaff() { + super(); this.setMaxStackSize(1); this.setMaxDamage(200); this.setCreativeTab(MysticWorld.MysticWorldTab); @@ -26,6 +26,6 @@ public class ItemStaff extends Item { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister par1IconRegister) { + public void registerIcons(IIconRegister par1IconRegister) { } } diff --git a/common/MysticWorld/Items/ItemStaffAir.java b/common/MysticWorld/Items/ItemStaffAir.java index 85b3da2..e8376fa 100644 --- a/common/MysticWorld/Items/ItemStaffAir.java +++ b/common/MysticWorld/Items/ItemStaffAir.java @@ -11,8 +11,8 @@ import net.minecraft.world.World; import org.lwjgl.input.Mouse; public class ItemStaffAir extends ItemStaff { - public ItemStaffAir(int id) { - super(id); + public ItemStaffAir() { + super(); } @Override @@ -33,13 +33,13 @@ public class ItemStaffAir extends ItemStaff { ItemStack currentItem = player.inventory.getCurrentItem(); itemStack.stackTagCompound.setInteger("maxChargeTime", 3 * 20); if (currentItem != null) { - if (currentItem.itemID == itemStack.itemID) { + if (currentItem.getItem() == itemStack.getItem()) { player.fallDistance = 0.0F; chargeEffect(itemStack, world, player); if (!Mouse.isButtonDown(1)) { if (itemStack.stackTagCompound.getInteger("chargeTime") > 0) { if (!world.isRemote) { - world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) player.posX, (int) player.posY, (int) player.posZ, 0); + world.playAuxSFXAtEntity(null, 1009, (int) player.posX, (int) player.posY, (int) player.posZ, 0); world.spawnEntityInWorld(new EntityChargeAir(world, player, 1.0f + ((itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float) itemStack.stackTagCompound .getInteger("maxChargeTime")))), (itemStack.stackTagCompound.getInteger("chargeTime")) * (2.5D * (1.0D / itemStack.stackTagCompound.getInteger("maxChargeTime"))))); itemStack.damageItem(1, player); diff --git a/common/MysticWorld/Items/ItemStaffEarth.java b/common/MysticWorld/Items/ItemStaffEarth.java index 4798e1e..729a810 100644 --- a/common/MysticWorld/Items/ItemStaffEarth.java +++ b/common/MysticWorld/Items/ItemStaffEarth.java @@ -2,40 +2,26 @@ package mysticworld.items; import mysticworld.MysticWorld; import mysticworld.entity.EntityChargeEarth; -import net.minecraft.block.Block; -import net.minecraft.block.BlockCocoa; -import net.minecraft.block.BlockCrops; -import net.minecraft.block.BlockDirectional; -import net.minecraft.block.BlockMushroom; -import net.minecraft.block.BlockSapling; -import net.minecraft.block.BlockStem; import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemDye; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import net.minecraftforge.common.ForgeHooks; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.Event.Result; -import net.minecraftforge.event.entity.player.BonemealEvent; - -import org.lwjgl.input.Keyboard; public class ItemStaffEarth extends ItemStaff { - public ItemStaffEarth(int id) { - super(id); + public ItemStaffEarth() { + super(); } @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { - if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + if (entityPlayer.isSneaking()) { MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true); if (movingobjectposition == null) { return itemStack; } else { - if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { int i = movingobjectposition.blockX; int j = movingobjectposition.blockY; int k = movingobjectposition.blockZ; @@ -55,7 +41,7 @@ public class ItemStaffEarth extends ItemStaff { } } } else { - world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0); + world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0); if (!world.isRemote) { world.spawnEntityInWorld(new EntityChargeEarth(world, entityPlayer)); itemStack.damageItem(1, entityPlayer); @@ -74,113 +60,6 @@ public class ItemStaffEarth extends ItemStaff { } public static boolean applyBonemeal(ItemStack itemStack, World par1World, int par2, int par3, int par4, EntityPlayer player) { - int l = par1World.getBlockId(par2, par3, par4); - BonemealEvent event = new BonemealEvent(player, par1World, l, par2, par3, par4); - if (MinecraftForge.EVENT_BUS.post(event)) { - return false; - } - if (event.getResult() == Result.ALLOW) { - itemStack.damageItem(1, player); - return true; - } - if (l == Block.sapling.blockID) { - if (!par1World.isRemote) { - if (par1World.rand.nextFloat() < 0.45D) { - ((BlockSapling) Block.sapling).markOrGrowMarked(par1World, par2, par3, par4, par1World.rand); - } - itemStack.damageItem(1, player); - } - return true; - } else if (l == Block.cobblestone.blockID) { - if (!par1World.isRemote) { - par1World.setBlock(par2, par3, par4, Block.cobblestoneMossy.blockID); - } - itemStack.damageItem(1, player); - } else if (l == Block.deadBush.blockID) { - if (!par1World.isRemote) { - par1World.setBlock(par2, par3, par4, 0); - par1World.spawnEntityInWorld(new EntityItem(par1World, par2, par3, par4, new ItemStack(Block.sapling, 1))); - } - itemStack.damageItem(1, player); - } else if (l != Block.mushroomBrown.blockID && l != Block.mushroomRed.blockID) { - if (l != Block.melonStem.blockID && l != Block.pumpkinStem.blockID) { - if (l > 0 && Block.blocksList[l] instanceof BlockCrops) { - if (par1World.getBlockMetadata(par2, par3, par4) == 7) { - return false; - } else { - if (!par1World.isRemote) { - ((BlockCrops) Block.blocksList[l]).fertilize(par1World, par2, par3, par4); - itemStack.damageItem(1, player); - } - return true; - } - } else { - int i1; - int j1; - int k1; - if (l == Block.cocoaPlant.blockID) { - i1 = par1World.getBlockMetadata(par2, par3, par4); - j1 = BlockDirectional.getDirection(i1); - k1 = BlockCocoa.func_72219_c(i1); - if (k1 >= 2) { - return false; - } else { - if (!par1World.isRemote) { - ++k1; - par1World.setBlockMetadataWithNotify(par2, par3, par4, k1 << 2 | j1, 2); - itemStack.damageItem(1, player); - } - return true; - } - } else if (l != Block.grass.blockID) { - return false; - } else { - if (!par1World.isRemote) { - itemStack.damageItem(1, player); - label102: for (i1 = 0; i1 < 128; ++i1) { - j1 = par2; - k1 = par3 + 1; - int l1 = par4; - for (int i2 = 0; i2 < i1 / 16; ++i2) { - j1 += itemRand.nextInt(3) - 1; - k1 += (itemRand.nextInt(3) - 1) * itemRand.nextInt(3) / 2; - l1 += itemRand.nextInt(3) - 1; - if (par1World.getBlockId(j1, k1 - 1, l1) != Block.grass.blockID || par1World.isBlockNormalCube(j1, k1, l1)) { - continue label102; - } - } - if (par1World.getBlockId(j1, k1, l1) == 0) { - if (itemRand.nextInt(10) != 0) { - if (Block.tallGrass.canBlockStay(par1World, j1, k1, l1)) { - par1World.setBlock(j1, k1, l1, Block.tallGrass.blockID, 1, 3); - } - } else { - ForgeHooks.plantGrass(par1World, j1, k1, l1); - } - } - } - } - return true; - } - } - } else if (par1World.getBlockMetadata(par2, par3, par4) == 7) { - return false; - } else { - if (!par1World.isRemote) { - ((BlockStem) Block.blocksList[l]).fertilizeStem(par1World, par2, par3, par4); - itemStack.damageItem(1, player); - } - return true; - } - } else { - if (!par1World.isRemote) { - if (par1World.rand.nextFloat() < 0.4D) { - ((BlockMushroom) Block.blocksList[l]).fertilizeMushroom(par1World, par2, par3, par4, par1World.rand); - } - itemStack.damageItem(1, player); - } - return true; - } - return true; + return ItemDye.applyBonemeal(itemStack, par1World, par2, par3, par4, player); } } diff --git a/common/MysticWorld/Items/ItemStaffEnegy.java b/common/MysticWorld/Items/ItemStaffEnegy.java index 54f3edc..706be06 100644 --- a/common/MysticWorld/Items/ItemStaffEnegy.java +++ b/common/MysticWorld/Items/ItemStaffEnegy.java @@ -8,25 +8,22 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import org.lwjgl.input.Keyboard; - public class ItemStaffEnegy extends ItemStaff { - public ItemStaffEnegy(int id) { - super(id); + public ItemStaffEnegy() { + super(); } @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { - if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + if (entityPlayer.isSneaking()) { MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true); if (movingobjectposition == null) { return itemStack; } else { - if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { int i = movingobjectposition.blockX; int j = movingobjectposition.blockY; int k = movingobjectposition.blockZ; @@ -59,7 +56,7 @@ public class ItemStaffEnegy extends ItemStaff { } else { if (world.isAirBlock(i, j, k)) { world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); - world.setBlock(i, j, k, BlockHandler.lightCube.blockID); + world.setBlock(i, j, k, BlockHandler.lightCube); } itemStack.damageItem(1, entityPlayer); return itemStack; @@ -68,7 +65,7 @@ public class ItemStaffEnegy extends ItemStaff { } } } else { - world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0); + world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0); if (!world.isRemote) { world.spawnEntityInWorld(new EntityChargeEnergy(world, entityPlayer)); itemStack.damageItem(1, entityPlayer); diff --git a/common/MysticWorld/Items/ItemStaffFire.java b/common/MysticWorld/Items/ItemStaffFire.java index fa6b100..4c89a2b 100644 --- a/common/MysticWorld/Items/ItemStaffFire.java +++ b/common/MysticWorld/Items/ItemStaffFire.java @@ -6,25 +6,23 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import org.lwjgl.input.Keyboard; - public class ItemStaffFire extends ItemStaff { - public ItemStaffFire(int id) { - super(id); + public ItemStaffFire() { + super(); } @Override public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer entityPlayer, EntityLivingBase entityLiving) { - if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + if (entityPlayer.isSneaking()) { entityLiving.setFire(5); entityLiving.attackEntityFrom(DamageSource.magic, 7); itemStack.damageItem(1, entityLiving); @@ -35,12 +33,12 @@ public class ItemStaffFire extends ItemStaff { @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { - if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + if (entityPlayer.isSneaking()) { MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true); if (movingobjectposition == null) { return itemStack; } else { - if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { int i = movingobjectposition.blockX; int j = movingobjectposition.blockY; int k = movingobjectposition.blockZ; @@ -50,12 +48,12 @@ public class ItemStaffFire extends ItemStaff { if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) { return itemStack; } else { - ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(world.getBlockId(i, j, k), 1, world.getBlockMetadata(i, j, k))); - if (!world.isRemote && !(result == null)) { - int id = result.itemID; + ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(world.getBlock(i, j, k), 1, world.getBlockMetadata(i, j, k))); + if (!world.isRemote && result != null) { + Item id = result.getItem(); int meta = result.getItemDamage(); world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); - world.setBlock(i, j, k, 0); + world.setBlockToAir(i, j, k); world.spawnEntityInWorld(new EntityItem(world, i, j, k, new ItemStack(id, 1, meta))); itemStack.damageItem(1, entityPlayer); } @@ -63,7 +61,7 @@ public class ItemStaffFire extends ItemStaff { } } } else { - world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0); + world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0); if (!world.isRemote) { world.spawnEntityInWorld(new EntityChargeFire(world, entityPlayer)); itemStack.damageItem(1, entityPlayer); diff --git a/common/MysticWorld/Items/ItemStaffParts.java b/common/MysticWorld/Items/ItemStaffParts.java index b1206ec..9ebe03c 100644 --- a/common/MysticWorld/Items/ItemStaffParts.java +++ b/common/MysticWorld/Items/ItemStaffParts.java @@ -3,35 +3,35 @@ package mysticworld.items; import java.util.List; import mysticworld.MysticWorld; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemStaffParts extends Item { - private Icon[] icons; + private IIcon[] icons; private static final String[] STAFF_PARTS = new String[] { "Staff", "Hilt", "Handle", "Head" }; - public ItemStaffParts(int id) { - super(id); + public ItemStaffParts() { + super(); this.setHasSubtypes(true); this.setCreativeTab(MysticWorld.MysticWorldTab); } @Override @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int meta) { + public IIcon getIconFromDamage(int meta) { int j = MathHelper.clamp_int(meta, 0, STAFF_PARTS.length); return icons[j]; } @Override @SideOnly(Side.CLIENT) - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { + public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { for (int var4 = 0; var4 < STAFF_PARTS.length; var4++) { par3List.add(new ItemStack(par1, 1, var4)); } @@ -51,8 +51,8 @@ public class ItemStaffParts extends Item { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - icons = new Icon[STAFF_PARTS.length]; + public void registerIcons(IIconRegister iconRegister) { + icons = new IIcon[STAFF_PARTS.length]; for (int i = 0; i < STAFF_PARTS.length; ++i) { icons[i] = iconRegister.registerIcon("mysticworld:StaffPart_" + STAFF_PARTS[i]); } diff --git a/common/MysticWorld/Items/ItemStaffPower.java b/common/MysticWorld/Items/ItemStaffPower.java index a9ad7e9..025e775 100644 --- a/common/MysticWorld/Items/ItemStaffPower.java +++ b/common/MysticWorld/Items/ItemStaffPower.java @@ -1,19 +1,19 @@ package mysticworld.items; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemStaffPower extends Item { - private Icon[] icons; + private IIcon[] icons; private static final String[] CHARGE_NAMES = new String[] { "Fire", "Water", "Earth", "Air", "Energy" }; - public ItemStaffPower(int id) { - super(id); + public ItemStaffPower() { + super(); this.setHasSubtypes(true); this.setCreativeTab(null); maxStackSize = 64; @@ -21,7 +21,7 @@ public class ItemStaffPower extends Item { @Override @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int meta) { + public IIcon getIconFromDamage(int meta) { int j = MathHelper.clamp_int(meta, 0, 5); return icons[j]; } @@ -34,8 +34,8 @@ public class ItemStaffPower extends Item { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - icons = new Icon[CHARGE_NAMES.length]; + public void registerIcons(IIconRegister iconRegister) { + icons = new IIcon[CHARGE_NAMES.length]; for (int i = 0; i < CHARGE_NAMES.length; ++i) { icons[i] = iconRegister.registerIcon("mysticworld:Charge" + CHARGE_NAMES[i]); } diff --git a/common/MysticWorld/Items/ItemStaffWater.java b/common/MysticWorld/Items/ItemStaffWater.java index 84b3b21..2c68cd5 100644 --- a/common/MysticWorld/Items/ItemStaffWater.java +++ b/common/MysticWorld/Items/ItemStaffWater.java @@ -6,16 +6,14 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import org.lwjgl.input.Keyboard; - public class ItemStaffWater extends ItemStaff { - public ItemStaffWater(int id) { - super(id); + public ItemStaffWater() { + super(); this.setMaxStackSize(1); this.setMaxDamage(200); this.setCreativeTab(MysticWorld.MysticWorldTab); @@ -23,12 +21,12 @@ public class ItemStaffWater extends ItemStaff { @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { - if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + if (entityPlayer.isSneaking()) { MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, entityPlayer, true); if (movingobjectposition == null) { return itemStack; } else { - if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { int i = movingobjectposition.blockX; int j = movingobjectposition.blockY; int k = movingobjectposition.blockZ; @@ -38,7 +36,7 @@ public class ItemStaffWater extends ItemStaff { if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) { return itemStack; } - if (world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0) { + if (world.getBlock(i, j, k).getMaterial() == Material.water && world.getBlockMetadata(i, j, k) == 0) { world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); world.setBlockToAir(i, j, k); itemStack.damageItem(1, entityPlayer); @@ -65,10 +63,10 @@ public class ItemStaffWater extends ItemStaff { if (!entityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStack)) { return itemStack; } else { - int i1 = world.getBlockId(i, j, k); - if (i1 == 0) { + Block i1 = world.getBlock(i, j, k); + if (i1 == Blocks.air) { world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); - world.setBlock(i, j, k, Block.waterMoving.blockID); + world.setBlock(i, j, k, Blocks.flowing_water); itemStack.damageItem(1, entityPlayer); } return itemStack; @@ -78,7 +76,7 @@ public class ItemStaffWater extends ItemStaff { return itemStack; } } else { - world.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0); + world.playAuxSFXAtEntity(null, 1009, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ, 0); if (!world.isRemote) { world.spawnEntityInWorld(new EntityChargeWater(world, entityPlayer)); itemStack.damageItem(1, entityPlayer); diff --git a/common/MysticWorld/Items/ItemVoidShard.java b/common/MysticWorld/Items/ItemVoidShard.java index 9e9f250..51b0ac5 100644 --- a/common/MysticWorld/Items/ItemVoidShard.java +++ b/common/MysticWorld/Items/ItemVoidShard.java @@ -12,8 +12,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemVoidShard extends Item { - public ItemVoidShard(int id) { - super(id); + public ItemVoidShard() { + super(); this.setMaxStackSize(1); this.setCreativeTab(MysticWorld.MysticWorldTab); this.setMaxDamage(1); @@ -28,7 +28,7 @@ public class ItemVoidShard extends Item { } @Override - public boolean hasEffect(ItemStack itemStack) { + public boolean hasEffect(ItemStack itemStack, int i) { if (itemStack.stackTagCompound == null) itemStack.setTagCompound(new NBTTagCompound()); if (itemStack.stackTagCompound.hasKey("filled")) { @@ -44,7 +44,7 @@ public class ItemVoidShard extends Item { itemStack.setTagCompound(new NBTTagCompound()); int experience = entityPlayer.experienceLevel; int experienceSubtract = entityPlayer.experienceLevel - 30; - if (itemStack.stackTagCompound.getBoolean("filled") == false) { + if (!itemStack.stackTagCompound.getBoolean("filled")) { if (experience > 0 && experience <= 30) { entityPlayer.experienceLevel = 0; itemStack.stackTagCompound.setInteger("xpStored", experience); diff --git a/common/MysticWorld/Lib/BlockIds.java b/common/MysticWorld/Lib/BlockIds.java deleted file mode 100644 index 76b3432..0000000 --- a/common/MysticWorld/Lib/BlockIds.java +++ /dev/null @@ -1,21 +0,0 @@ -package mysticworld.lib; - -public class BlockIds { - public static int ORE_STONE_1 = 600; - public static int BUSH = 601; - public static int POISON_BUSH = 602; - public static int WEAKNESS_BUSH = 603; - public static int SLOWNESS_BUSH = 604; - public static int HARMING_BUSH = 605; - public static int WITHER_BUSH = 606; - public static int HEALTH_BUSH = 607; - public static int SPEED_BUSH = 608; - public static int FIRE_RESISTANCE_BUSH = 609; - public static int REGEN_BUSH = 610; - public static int NIGHT_VISION_BUSH = 611; - public static int INVISIBILITY_BUSH = 612; - public static int LIGHT_CUBE = 613; - public static int PLATFORM = 614; - public static int PILLAR = 615; - public static int PILLAR_INSERT = 616; -} diff --git a/common/MysticWorld/Lib/EntityIds.java b/common/MysticWorld/Lib/EntityIds.java deleted file mode 100644 index dac5313..0000000 --- a/common/MysticWorld/Lib/EntityIds.java +++ /dev/null @@ -1,14 +0,0 @@ -package mysticworld.lib; - -public class EntityIds { - - //Entity IDs - public static int ENTITY_AIR_CHARGE = 1; - public static int ENTITY_FIREBALL = 2; - public static int ENTITY_EARTH_CHARGE = 3; - public static int ENTITY_ENERGY_CHARGE = 4; - public static int ENTITY_WATER_CHARGE = 5; - - public static int ENTITY_PIGMAN = 6; - -} diff --git a/common/MysticWorld/Lib/ItemIds.java b/common/MysticWorld/Lib/ItemIds.java deleted file mode 100644 index 1a99d9b..0000000 --- a/common/MysticWorld/Lib/ItemIds.java +++ /dev/null @@ -1,35 +0,0 @@ -package mysticworld.lib; - -public class ItemIds { - public static int STAFF_PARTS = 5503; - public static int IMBUED_SHARD = 5504; - public static int FIRE_STAFF = 5505; - public static int WATER_STAFF = 5506; - public static int EARTH_STAFF = 5507; - public static int AIR_STAFF = 5508; - public static int ENERGY_STAFF = 5509; - public static int STAFF_POWER = 5510; - public static int BUSH_FRUIT = 5511; - public static int VERDITE_HELMET = 5512; - public static int VERDITE_CHESTPLATE = 5513; - public static int VERDITE_LEGGINGS = 5514; - public static int VERDITE_BOOTS = 5515; - public static int MITHRIL_HELMET = 5516; - public static int MITHRIL_CHESTPLATE = 5517; - public static int MITHRIL_LEGGINGS = 5518; - public static int MITHRIL_BOOTS = 5519; - public static int ADAMANTINE_HELMET = 5520; - public static int ADAMANTINE_CHESTPLATE = 5521; - public static int ADAMANTINE_LEGGINGS = 5522; - public static int ADAMANTINE_BOOTS = 5523; - public static int IRIDIUM_HELMET = 5524; - public static int IRIDIUM_CHESTPLATE = 5525; - public static int IRIDIUM_LEGGINGS = 5526; - public static int IRIDIUM_BOOTS = 5527; - public static int FIRE_ORB = 5528; - public static int WATER_ORB = 5529; - public static int EARTH_ORB = 5530; - public static int AIR_ORB = 5531; - public static int ENERGY_ORB = 5532; - public static int VOID_SHARD = 5533; -} diff --git a/common/MysticWorld/Lib/Strings.java b/common/MysticWorld/Lib/Strings.java index e5b811a..efa79f0 100644 --- a/common/MysticWorld/Lib/Strings.java +++ b/common/MysticWorld/Lib/Strings.java @@ -80,7 +80,4 @@ public class Strings { //Tile Entity Names public static final String PILLAR_INSERT_TE_NAME = "pillarInsert"; - //Config Category Names - public static final String ENTITY_CATEGORY = "entity"; - } diff --git a/common/MysticWorld/Model/ModelOrb.java b/common/MysticWorld/Model/ModelOrb.java index 6a985ec..cc4b2aa 100644 --- a/common/MysticWorld/Model/ModelOrb.java +++ b/common/MysticWorld/Model/ModelOrb.java @@ -1,14 +1,16 @@ package mysticworld.model; import net.minecraft.client.model.ModelBase; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.IModelCustom; public class ModelOrb extends ModelBase { + private static final ResourceLocation orb = new ResourceLocation("mysticworld", "models/orb.obj"); private IModelCustom modelOrb; public ModelOrb() { - modelOrb = AdvancedModelLoader.loadModel("/assets/mysticworld/models/orb.obj"); + modelOrb = AdvancedModelLoader.loadModel(orb); } public void render() { diff --git a/common/MysticWorld/Model/ModelPillarInsert.java b/common/MysticWorld/Model/ModelPillarInsert.java index 7a785d0..83d8634 100644 --- a/common/MysticWorld/Model/ModelPillarInsert.java +++ b/common/MysticWorld/Model/ModelPillarInsert.java @@ -70,10 +70,5 @@ public class ModelPillarInsert extends ModelBase model.rotateAngleY = y; model.rotateAngleZ = z; } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } } diff --git a/common/MysticWorld/Model/ModelStaff.java b/common/MysticWorld/Model/ModelStaff.java index 15bcb18..40d253a 100644 --- a/common/MysticWorld/Model/ModelStaff.java +++ b/common/MysticWorld/Model/ModelStaff.java @@ -142,9 +142,4 @@ public class ModelStaff extends ModelBase model.rotateAngleY = y; model.rotateAngleZ = z; } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } } diff --git a/common/MysticWorld/MysticWorld.java b/common/MysticWorld/MysticWorld.java index 9b68fb0..0628152 100644 --- a/common/MysticWorld/MysticWorld.java +++ b/common/MysticWorld/MysticWorld.java @@ -1,61 +1,60 @@ package mysticworld; +import cpw.mods.fml.common.FMLCommonHandler; import mysticworld.biome.BiomeHandler; import mysticworld.blocks.BlockHandler; import mysticworld.entity.EntityHandler; import mysticworld.items.ItemHandler; -import mysticworld.lib.Booleans; import mysticworld.tiles.TileEntityHandler; import mysticworld.util.Config; import mysticworld.util.RecipeHandler; import mysticworld.util.Reference; import mysticworld.util.TickHandler; -import mysticworld.worldgen.WorldGenBushes; -import mysticworld.worldgen.WorldGenStones; +import mysticworld.worldgen.WorldGenerators; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.TickRegistry; -import cpw.mods.fml.relauncher.Side; @Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION_NUMBER) -@NetworkMod(clientSideRequired = true, serverSideRequired = false) public class MysticWorld { @Instance(Reference.MOD_ID) public static MysticWorld instance; @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS) public static CommonProxy proxy; public static final CreativeTabs MysticWorldTab = new CreativeTabs("MysticWorldTab") { - @Override - public ItemStack getIconItemStack() { - return new ItemStack(ItemHandler.earthStaff, 1); - } - }; + + @Override + public Item getTabIconItem() { + return ItemHandler.earthStaff; + } + }; + public boolean ENABLE = true; @EventHandler public void load(FMLInitializationEvent event) { - TickRegistry.registerTickHandler(new TickHandler(), Side.SERVER); - BlockHandler.init(); - ItemHandler.init(); - TileEntityHandler.init(); - if (Booleans.ENABLE_BUSH_GEN) - GameRegistry.registerWorldGenerator(new WorldGenBushes()); - GameRegistry.registerWorldGenerator(new WorldGenStones()); - EntityHandler.init(); - RecipeHandler.init(); - proxy.registerRenders(); + if(ENABLE){ + FMLCommonHandler.instance().bus().register(new TickHandler()); + GameRegistry.registerWorldGenerator(new WorldGenerators(), 100); + EntityHandler.init(); + proxy.registerRenders(); + } } @EventHandler public void preInit(FMLPreInitializationEvent event) { Config.initialize(event.getSuggestedConfigurationFile()); - BiomeHandler.init(); + if(ENABLE){ + BiomeHandler.init(); + BlockHandler.init(); + ItemHandler.init(); + TileEntityHandler.init(); + RecipeHandler.init(); + } } } diff --git a/common/MysticWorld/Renderer/RenderStaffPower.java b/common/MysticWorld/Renderer/RenderStaffPower.java index 4e7c33b..7f9380f 100644 --- a/common/MysticWorld/Renderer/RenderStaffPower.java +++ b/common/MysticWorld/Renderer/RenderStaffPower.java @@ -5,7 +5,7 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; @@ -28,7 +28,7 @@ public class RenderStaffPower extends Render { this.bindEntityTexture(entity); GL11.glTranslatef((float) par2, (float) par4, (float) par6); GL11.glEnable(GL12.GL_RESCALE_NORMAL); - Icon icon = ItemHandler.staffPower.getIconFromDamage(this.meta); + IIcon icon = ItemHandler.staffPower.getIconFromDamage(this.meta); Tessellator tessellator = Tessellator.instance; float f3 = icon.getMinU(); float f4 = icon.getMaxU(); diff --git a/common/MysticWorld/Util/Config.java b/common/MysticWorld/Util/Config.java index e3c782b..8756ab0 100644 --- a/common/MysticWorld/Util/Config.java +++ b/common/MysticWorld/Util/Config.java @@ -2,17 +2,16 @@ package mysticworld.util; import java.io.File; -import mysticworld.lib.BlockIds; +import mysticworld.MysticWorld; import mysticworld.lib.Booleans; -import mysticworld.lib.ItemIds; -import mysticworld.lib.Strings; -import net.minecraftforge.common.Configuration; +import net.minecraftforge.common.config.Configuration; public class Config { public static Configuration config; public static void initialize(File file) { config = new Configuration(file); + MysticWorld.instance.ENABLE = config.get("General", "Enable", true).getBoolean(true); //Boolean Configurations Booleans.ENABLE_BUSH_GEN = config.get("World Generation", "Enable Bush Generation", true).getBoolean(true); Booleans.ENABLE_GLACIER_GEN = config.get("World Generation", "Enable Glacier Biome", true).getBoolean(true); @@ -20,45 +19,6 @@ public class Config { Booleans.ENABLE_MOUNTAIN_GEN = config.get("World Generation", "Enable Mountain Biome", true).getBoolean(true); Booleans.ENABLE_STEPPE_GEN = config.get("World Generation", "Enable Steppe Biome", true).getBoolean(true); Booleans.ENABLE_TUNDRA_GEN = config.get("World Generation", "Enable Tundra Biome", true).getBoolean(true); - //Block Configuration - BlockIds.ORE_STONE_1 = config.getBlock(Strings.IMBUED_STONE_NAME, BlockIds.ORE_STONE_1).getInt(BlockIds.ORE_STONE_1); - BlockIds.BUSH = config.getBlock(Strings.BUSH_NAME, BlockIds.BUSH).getInt(BlockIds.BUSH); - BlockIds.LIGHT_CUBE = config.getBlock(Strings.LIGHT_CUBE_NAME, BlockIds.LIGHT_CUBE).getInt(BlockIds.LIGHT_CUBE); - BlockIds.PLATFORM = config.getBlock(Strings.PLATFORM_NAME, BlockIds.PLATFORM).getInt(BlockIds.PLATFORM); - BlockIds.PILLAR = config.getBlock(Strings.PILLAR_NAME, BlockIds.PILLAR).getInt(BlockIds.PILLAR); - BlockIds.PILLAR_INSERT = config.getBlock(Strings.PILLAR_INSERT_NAME, BlockIds.PILLAR_INSERT).getInt(BlockIds.PILLAR_INSERT); - //Item Configuration - ItemIds.IMBUED_SHARD = config.getItem(Strings.IMBUED_SHARD_NAME, ItemIds.IMBUED_SHARD).getInt(ItemIds.IMBUED_SHARD); - ItemIds.STAFF_PARTS = config.getItem(Strings.STAFF_NAME, ItemIds.STAFF_PARTS).getInt(ItemIds.STAFF_PARTS); - ItemIds.FIRE_STAFF = config.getItem(Strings.FIRE_STAFF_NAME, ItemIds.FIRE_STAFF).getInt(ItemIds.FIRE_STAFF); - ItemIds.WATER_STAFF = config.getItem(Strings.WATER_STAFF_NAME, ItemIds.WATER_STAFF).getInt(ItemIds.WATER_STAFF); - ItemIds.EARTH_STAFF = config.getItem(Strings.EARTH_STAFF_NAME, ItemIds.EARTH_STAFF).getInt(ItemIds.EARTH_STAFF); - ItemIds.AIR_STAFF = config.getItem(Strings.AIR_STAFF_NAME, ItemIds.AIR_STAFF).getInt(ItemIds.AIR_STAFF); - ItemIds.ENERGY_STAFF = config.getItem(Strings.ENERGY_STAFF_NAME, ItemIds.ENERGY_STAFF).getInt(ItemIds.ENERGY_STAFF); - ItemIds.STAFF_POWER = config.getItem(Strings.POWER_STAFF_NAME, ItemIds.STAFF_POWER).getInt(ItemIds.STAFF_POWER); - ItemIds.BUSH_FRUIT = config.getItem(Strings.BUSH_FRUIT_NAME, ItemIds.BUSH_FRUIT).getInt(ItemIds.BUSH_FRUIT); - ItemIds.VERDITE_HELMET = config.getItem(Strings.VERDITE_HELMET_NAME, ItemIds.VERDITE_HELMET).getInt(ItemIds.VERDITE_HELMET); - ItemIds.VERDITE_CHESTPLATE = config.getItem(Strings.VERDITE_CHESTPLATE_NAME, ItemIds.VERDITE_CHESTPLATE).getInt(ItemIds.VERDITE_CHESTPLATE); - ItemIds.VERDITE_LEGGINGS = config.getItem(Strings.VERDITE_LEGGINGS_NAME, ItemIds.VERDITE_LEGGINGS).getInt(ItemIds.VERDITE_LEGGINGS); - ItemIds.VERDITE_BOOTS = config.getItem(Strings.VERDITE_BOOTS_NAME, ItemIds.VERDITE_BOOTS).getInt(ItemIds.VERDITE_BOOTS); - ItemIds.MITHRIL_HELMET = config.getItem(Strings.MITHRIL_HELMET_NAME, ItemIds.MITHRIL_HELMET).getInt(ItemIds.MITHRIL_HELMET); - ItemIds.MITHRIL_CHESTPLATE = config.getItem(Strings.MITHRIL_CHESTPLATE_NAME, ItemIds.MITHRIL_CHESTPLATE).getInt(ItemIds.MITHRIL_CHESTPLATE); - ItemIds.MITHRIL_LEGGINGS = config.getItem(Strings.MITHRIL_LEGGINGS_NAME, ItemIds.MITHRIL_LEGGINGS).getInt(ItemIds.MITHRIL_LEGGINGS); - ItemIds.MITHRIL_BOOTS = config.getItem(Strings.MITHRIL_BOOTS_NAME, ItemIds.MITHRIL_BOOTS).getInt(ItemIds.MITHRIL_BOOTS); - ItemIds.ADAMANTINE_HELMET = config.getItem(Strings.ADAMANTINE_HELMET_NAME, ItemIds.ADAMANTINE_HELMET).getInt(ItemIds.ADAMANTINE_HELMET); - ItemIds.ADAMANTINE_CHESTPLATE = config.getItem(Strings.ADAMANTINE_CHESTPLATE_NAME, ItemIds.ADAMANTINE_CHESTPLATE).getInt(ItemIds.ADAMANTINE_CHESTPLATE); - ItemIds.ADAMANTINE_LEGGINGS = config.getItem(Strings.ADAMANTINE_LEGGINGS_NAME, ItemIds.ADAMANTINE_LEGGINGS).getInt(ItemIds.ADAMANTINE_LEGGINGS); - ItemIds.ADAMANTINE_BOOTS = config.getItem(Strings.ADAMANTINE_BOOTS_NAME, ItemIds.ADAMANTINE_BOOTS).getInt(ItemIds.ADAMANTINE_BOOTS); - ItemIds.IRIDIUM_HELMET = config.getItem(Strings.IRIDIUM_HELMET_NAME, ItemIds.IRIDIUM_HELMET).getInt(ItemIds.IRIDIUM_HELMET); - ItemIds.IRIDIUM_CHESTPLATE = config.getItem(Strings.IRIDIUM_CHESTPLATE_NAME, ItemIds.IRIDIUM_CHESTPLATE).getInt(ItemIds.IRIDIUM_CHESTPLATE); - ItemIds.IRIDIUM_LEGGINGS = config.getItem(Strings.IRIDIUM_LEGGINGS_NAME, ItemIds.IRIDIUM_LEGGINGS).getInt(ItemIds.IRIDIUM_LEGGINGS); - ItemIds.IRIDIUM_BOOTS = config.getItem(Strings.IRIDIUM_BOOTS_NAME, ItemIds.IRIDIUM_BOOTS).getInt(ItemIds.IRIDIUM_BOOTS); - ItemIds.FIRE_ORB = config.getItem(Strings.FIRE_ORB_NAME, ItemIds.FIRE_ORB).getInt(ItemIds.FIRE_ORB); - ItemIds.WATER_ORB = config.getItem(Strings.WATER_ORB_NAME, ItemIds.WATER_ORB).getInt(ItemIds.WATER_ORB); - ItemIds.EARTH_ORB = config.getItem(Strings.EARTH_ORB_NAME, ItemIds.EARTH_ORB).getInt(ItemIds.EARTH_ORB); - ItemIds.AIR_ORB = config.getItem(Strings.AIR_ORB_NAME, ItemIds.AIR_ORB).getInt(ItemIds.AIR_ORB); - ItemIds.ENERGY_ORB = config.getItem(Strings.ENERGY_ORB_NAME, ItemIds.ENERGY_ORB).getInt(ItemIds.ENERGY_ORB); - ItemIds.VOID_SHARD = config.getItem(Strings.VOID_SHARD_NAME, ItemIds.VOID_SHARD).getInt(ItemIds.VOID_SHARD); config.save(); } } \ No newline at end of file diff --git a/common/MysticWorld/Util/RecipeHandler.java b/common/MysticWorld/Util/RecipeHandler.java index c1d64ba..dacdeaf 100644 --- a/common/MysticWorld/Util/RecipeHandler.java +++ b/common/MysticWorld/Util/RecipeHandler.java @@ -13,27 +13,27 @@ public class RecipeHandler { } private static void bootsRecipe(Item output, ItemStack input) { - GameRegistry.addRecipe(new ItemStack(output), new Object[] { "# #", "# #", '#', input }); + GameRegistry.addRecipe(new ItemStack(output), "# #", "# #", '#', input); } private static void chestplateRecipe(Item output, ItemStack input) { - GameRegistry.addRecipe(new ItemStack(output), new Object[] { "# #", "###", "###", '#', input }); + GameRegistry.addRecipe(new ItemStack(output), "# #", "###", "###", '#', input); } private static void helmetRecipe(Item output, ItemStack input) { - GameRegistry.addRecipe(new ItemStack(output), new Object[] { "###", "# #", '#', input }); + GameRegistry.addRecipe(new ItemStack(output), "###", "# #", '#', input); } private static void itemRecipes() { //Staff Hilt Recipe - GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 1), new Object[] { " # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.diamond }); + GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 1), " # ", "#$#", " # ", '#', net.minecraft.init.Items.gold_ingot, '$', net.minecraft.init.Items.diamond); //Staff Handle Recipe - GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 2), new Object[] { "#", "$", "S", '#', Item.goldNugget, '$', Item.stick, 'S', Item.dyePowder }); + GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 2), "#", "$", "S", '#', net.minecraft.init.Items.gold_nugget, '$', net.minecraft.init.Items.stick, 'S', net.minecraft.init.Items.dye); //Staff Topper Recipe - GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 3), new Object[] { " # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.netherStar }); + GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 3), " # ", "#$#", " # ", '#', net.minecraft.init.Items.gold_ingot, '$', net.minecraft.init.Items.nether_star); //Staff Recipe - GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 0), new Object[] { " #", " X ", "Y ", '#', new ItemStack(ItemHandler.staffParts, 1, 3), 'X', - new ItemStack(ItemHandler.staffParts, 1, 2), 'Y', new ItemStack(ItemHandler.staffParts, 1, 1) }); + GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 0), " #", " X ", "Y ", '#', new ItemStack(ItemHandler.staffParts, 1, 3), 'X', + new ItemStack(ItemHandler.staffParts, 1, 2), 'Y', new ItemStack(ItemHandler.staffParts, 1, 1)); //Orb Recipes orbRecipe(ItemHandler.fireOrb, new ItemStack(ItemHandler.imbuedShard, 1, 0)); orbRecipe(ItemHandler.waterOrb, new ItemStack(ItemHandler.imbuedShard, 1, 1)); @@ -69,15 +69,15 @@ public class RecipeHandler { } private static void itemSmelting() { - GameRegistry.addSmelting(ItemHandler.imbuedShard.itemID, new ItemStack(ItemHandler.voidShard), 0.5f); + GameRegistry.addSmelting(ItemHandler.imbuedShard, new ItemStack(ItemHandler.voidShard), 0.5f); } private static void leggingsRecipe(Item output, ItemStack input) { - GameRegistry.addRecipe(new ItemStack(output), new Object[] { "###", "# #", "# #", '#', input }); + GameRegistry.addRecipe(new ItemStack(output), "###", "# #", "# #", '#', input); } private static void orbRecipe(Item output, ItemStack input) { - GameRegistry.addRecipe(new ItemStack(output), new Object[] { "##", "##", '#', input }); + GameRegistry.addRecipe(new ItemStack(output), "##", "##", '#', input); } private static void staffRecipe(Item output, ItemStack input) { diff --git a/common/MysticWorld/Util/TickHandler.java b/common/MysticWorld/Util/TickHandler.java index 6eb38b8..73e52ad 100644 --- a/common/MysticWorld/Util/TickHandler.java +++ b/common/MysticWorld/Util/TickHandler.java @@ -1,56 +1,36 @@ package mysticworld.util; -import java.util.EnumSet; import java.util.Random; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; import mysticworld.blocks.BlockHandler; +import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.Item; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; -import cpw.mods.fml.common.IScheduledTickHandler; -import cpw.mods.fml.common.TickType; -public class TickHandler implements IScheduledTickHandler { +public class TickHandler { public static final Enchantment[] enchantmentsPick = { Enchantment.efficiency, Enchantment.fortune, Enchantment.silkTouch, Enchantment.unbreaking }; - @Override - public String getLabel() { - return "mystic world tick"; + @SubscribeEvent + public void tickStart(TickEvent.PlayerTickEvent event) { + if(event.phase== TickEvent.Phase.START && event.side.isServer() && event.player.worldObj.getWorldTime()%20==0) + pillarTick(event.player, event.player.worldObj, new Random()); } - @Override - public int nextTickSpacing() { - return 20; - } - - @Override - public void tickEnd(EnumSet type, Object... tickData) { - } - - @Override - public EnumSet ticks() { - return EnumSet.of(TickType.PLAYER); - } - - @Override - public void tickStart(EnumSet type, Object... tickData) { - EntityPlayer player = (EntityPlayer) tickData[0]; - pillarTick(player, player.worldObj, player.inventory, new Random()); - } - - private static void pillarTick(EntityPlayer player, World world, InventoryPlayer inventory, Random rand) { - ItemStack itemStack = inventory.getCurrentItem(); + private static void pillarTick(EntityPlayer player, World world, Random rand) { + ItemStack itemStack = player.inventory.getCurrentItem(); int blockX = (int) player.posX - 1; int blockY = (int) (player.posY - 0.15D); int blockZ = (int) player.posZ - 1; - int blockId = world.getBlockId(blockX, blockY, blockZ); + Block blockId = world.getBlock(blockX, blockY, blockZ); int blockMeta = world.getBlockMetadata(blockX, blockY, blockZ); - if (blockId == BlockHandler.pillarPlatform.blockID) { + if (blockId == BlockHandler.pillarPlatform) { switch (blockMeta) { //food case 0: @@ -85,8 +65,8 @@ public class TickHandler implements IScheduledTickHandler { //enchanter case 7: if (itemStack != null - && (itemStack.itemID == Item.pickaxeWood.itemID || itemStack.itemID == Item.pickaxeStone.itemID || itemStack.itemID == Item.pickaxeIron.itemID - || itemStack.itemID == Item.pickaxeGold.itemID || itemStack.itemID == Item.pickaxeDiamond.itemID)) { + && (itemStack.getItem() == Items.wooden_pickaxe || itemStack.getItem() == Items.stone_pickaxe || itemStack.getItem() == Items.iron_pickaxe + || itemStack.getItem() == Items.golden_pickaxe || itemStack.getItem() == Items.diamond_pickaxe)) { if (itemStack.isItemEnchanted() != true && player.experienceLevel >= 10) { player.experienceLevel -= 10; itemStack.addEnchantment(enchantmentsPick[rand.nextInt(3)], rand.nextInt(4) + 1); diff --git a/common/MysticWorld/WorldGen/BushesGen.java b/common/MysticWorld/WorldGen/BushesGen.java index baecf4a..fb73023 100644 --- a/common/MysticWorld/WorldGen/BushesGen.java +++ b/common/MysticWorld/WorldGen/BushesGen.java @@ -3,7 +3,7 @@ package mysticworld.worldgen; import java.util.Random; import mysticworld.blocks.BlockHandler; -import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; @@ -15,8 +15,8 @@ public class BushesGen extends WorldGenerator { int i1 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); int j1 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); - if (par1World.isAirBlock(i1, j1, k1) && par1World.getBlockId(i1, j1 - 1, k1) == Block.grass.blockID && BlockHandler.bush.canPlaceBlockAt(par1World, i1, j1, k1)) { - par1World.setBlock(i1, j1, k1, BlockHandler.bush.blockID, bushType, 2); + if (par1World.isAirBlock(i1, j1, k1) && par1World.getBlock(i1, j1 - 1, k1) == Blocks.grass && BlockHandler.bush.canPlaceBlockAt(par1World, i1, j1, k1)) { + par1World.setBlock(i1, j1, k1, BlockHandler.bush, bushType, 2); } } return true; diff --git a/common/MysticWorld/WorldGen/StonesGen.java b/common/MysticWorld/WorldGen/StonesGen.java index 5a31bff..43fd9cc 100644 --- a/common/MysticWorld/WorldGen/StonesGen.java +++ b/common/MysticWorld/WorldGen/StonesGen.java @@ -3,7 +3,7 @@ package mysticworld.worldgen; import java.util.Random; import mysticworld.blocks.BlockHandler; -import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; @@ -14,8 +14,8 @@ public class StonesGen extends WorldGenerator { int i1 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); int j1 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); - if (par1World.isAirBlock(i1, j1, k1) && par1World.getBlockId(i1, j1 - 1, k1) == Block.grass.blockID && BlockHandler.oreImbuedStone.canPlaceBlockAt(par1World, i1, j1, k1)) { - par1World.setBlock(i1, j1, k1, BlockHandler.oreImbuedStone.blockID, par2Random.nextInt(5), 2); + if (par1World.isAirBlock(i1, j1, k1) && par1World.getBlock(i1, j1 - 1, k1) == Blocks.grass && BlockHandler.oreImbuedStone.canPlaceBlockAt(par1World, i1, j1, k1)) { + par1World.setBlock(i1, j1, k1, BlockHandler.oreImbuedStone, par2Random.nextInt(5), 2); } } return true; diff --git a/common/MysticWorld/WorldGen/WorldGenStones.java b/common/MysticWorld/WorldGen/WorldGenStones.java deleted file mode 100644 index 6bc68cc..0000000 --- a/common/MysticWorld/WorldGen/WorldGenStones.java +++ /dev/null @@ -1,30 +0,0 @@ -package mysticworld.worldgen; - -import java.util.Random; - -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import net.minecraft.world.gen.feature.WorldGenerator; - -import cpw.mods.fml.common.IWorldGenerator; - -public class WorldGenStones implements IWorldGenerator { - public static final WorldGenerator stones = new StonesGen(); - - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { - switch (world.provider.dimensionId) { - case 0: - generateSurface(world, random, chunkX * 16, chunkZ * 16); - } - } - - private void generateSurface(World world, Random random, int blockX, int blockZ) { - for (int i = 0; i < 1; i++) { - int Xcoord1 = blockX + random.nextInt(16) + 8; - int Ycoord1 = random.nextInt(11) + 60; - int Zcoord1 = blockZ + random.nextInt(16) + 8; - stones.generate(world, random, Xcoord1, Ycoord1, Zcoord1); - } - } -} \ No newline at end of file diff --git a/common/assets/mysticworld/lang/de_DE.lang b/common/assets/mysticworld/lang/de_DE.lang index c9fa7a1..8e6ce7d 100644 --- a/common/assets/mysticworld/lang/de_DE.lang +++ b/common/assets/mysticworld/lang/de_DE.lang @@ -1,9 +1,9 @@  -tile.imbuedStoneFire.name=Magmatischer Felsbrocken -tile.imbuedStoneWater.name=Aquatischer Felsbrocken -tile.imbuedStoneEarth.name=Fruchtbarer Felsbrocken -tile.imbuedStoneAir.name=Durchlüfteter Felsbrocken -tile.imbuedStoneEnergy.name=Kinetischer Felsbrocken +imbuedStoneFire.name=Magmatischer Felsbrocken +imbuedStoneWater.name=Aquatischer Felsbrocken +imbuedStoneEarth.name=Fruchtbarer Felsbrocken +imbuedStoneAir.name=Durchlüfteter Felsbrocken +imbuedStoneEnergy.name=Kinetischer Felsbrocken Bush.name=Gewöhnlicher Busch Poisonous Bush.name=Giftiger Busch diff --git a/common/assets/mysticworld/lang/en_US.lang b/common/assets/mysticworld/lang/en_US.lang index 3b8e63d..c015889 100644 --- a/common/assets/mysticworld/lang/en_US.lang +++ b/common/assets/mysticworld/lang/en_US.lang @@ -1,9 +1,9 @@  -tile.imbuedStoneFire.name=Magmatic Stone Chunk -tile.imbuedStoneWater.name=Aquatic Stone Chunk -tile.imbuedStoneEarth.name=Fertile Stone Chunk -tile.imbuedStoneAir.name=Aerated Stone Chunk -tile.imbuedStoneEnergy.name=Kinetic Stone Chunk +imbuedStoneFire.name=Magmatic Stone Chunk +imbuedStoneWater.name=Aquatic Stone Chunk +imbuedStoneEarth.name=Fertile Stone Chunk +imbuedStoneAir.name=Aerated Stone Chunk +imbuedStoneEnergy.name=Kinetic Stone Chunk Bush.name=Mundane Bush Poisonous Bush.name=Poisonous Bush diff --git a/common/mysticores/Items/ItemHatchet.java b/common/mysticores/Items/ItemHatchet.java new file mode 100644 index 0000000..59a074c --- /dev/null +++ b/common/mysticores/Items/ItemHatchet.java @@ -0,0 +1,9 @@ +package mysticores.items; + +import net.minecraft.item.ItemAxe; + +public class ItemHatchet extends ItemAxe{ + public ItemHatchet(ToolMaterial mat) { + super(mat); + } +} diff --git a/common/mysticores/Items/ItemPick.java b/common/mysticores/Items/ItemPick.java new file mode 100644 index 0000000..0c2d6f4 --- /dev/null +++ b/common/mysticores/Items/ItemPick.java @@ -0,0 +1,9 @@ +package mysticores.items; + +import net.minecraft.item.ItemPickaxe; + +public class ItemPick extends ItemPickaxe{ + public ItemPick(ToolMaterial mat) { + super(mat); + } +} diff --git a/common/mysticores/worldgen/WorldGenOres.java b/common/mysticores/worldgen/WorldGenOres.java index b2a2695..cb31c75 100644 --- a/common/mysticores/worldgen/WorldGenOres.java +++ b/common/mysticores/worldgen/WorldGenOres.java @@ -4,21 +4,21 @@ import java.util.Random; import mysticores.blocks.BlockHandler; import mysticores.lib.Rarity; -import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import cpw.mods.fml.common.IWorldGenerator; public class WorldGenOres implements IWorldGenerator { - public static final WorldGenMinable adamantine = new WorldGenMinable(BlockHandler.BlockBase.blockID, 0, 3); - public static final WorldGenMinable amethyst = new WorldGenMinable(BlockHandler.BlockBase.blockID, 1, 4, Block.stone.blockID); - public static final WorldGenMinable iridium = new WorldGenMinable(BlockHandler.BlockBase.blockID, 2, 6, Block.stone.blockID); - public static final WorldGenMinable mithril = new WorldGenMinable(BlockHandler.BlockBase.blockID, 3, 6, Block.stone.blockID); - public static final WorldGenMinable tourmaline = new WorldGenMinable(BlockHandler.BlockBase.blockID, 4, 4, Block.stone.blockID); - public static final WorldGenMinable topaz = new WorldGenMinable(BlockHandler.BlockBase.blockID, 5, 4, Block.stone.blockID); - public static final WorldGenMinable verdite = new WorldGenMinable(BlockHandler.BlockBase.blockID, 6, 9, Block.stone.blockID); - public static final WorldGenMinable agate = new WorldGenMinable(BlockHandler.BlockBase.blockID, 11, 4, Block.stone.blockID); + public static final WorldGenMinable adamantine = new WorldGenMinable(BlockHandler.BlockBase, 0, 3, Blocks.stone); + public static final WorldGenMinable amethyst = new WorldGenMinable(BlockHandler.BlockBase, 1, 4, Blocks.stone); + public static final WorldGenMinable iridium = new WorldGenMinable(BlockHandler.BlockBase, 2, 6, Blocks.stone); + public static final WorldGenMinable mithril = new WorldGenMinable(BlockHandler.BlockBase, 3, 6, Blocks.stone); + public static final WorldGenMinable tourmaline = new WorldGenMinable(BlockHandler.BlockBase, 4, 4, Blocks.stone); + public static final WorldGenMinable topaz = new WorldGenMinable(BlockHandler.BlockBase, 5, 4, Blocks.stone); + public static final WorldGenMinable verdite = new WorldGenMinable(BlockHandler.BlockBase, 6, 9, Blocks.stone); + public static final WorldGenMinable agate = new WorldGenMinable(BlockHandler.BlockBase, 11, 4, Blocks.stone); @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { diff --git a/common/mysticstones/blocks/BlockMulti.java b/common/mysticstones/blocks/BlockMulti.java index b62d9a3..6005670 100644 --- a/common/mysticstones/blocks/BlockMulti.java +++ b/common/mysticstones/blocks/BlockMulti.java @@ -10,15 +10,15 @@ import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class BlockMulti extends Block { - Icon[] textures; + IIcon[] textures; - public BlockMulti(int par1, Material par2Material) { - super(par1, par2Material); + public BlockMulti(Material par2Material) { + super(par2Material); setCreativeTab(MysticStones.MysticStonesTab); } @@ -29,26 +29,22 @@ public class BlockMulti extends Block { @Override @SideOnly(Side.CLIENT) - public Icon getIcon(int side, int meta) { + public IIcon getIcon(int side, int meta) { return textures[meta]; } @Override public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - int id = idPicked(world, x, y, z); - if (id == 0) { - return null; - } - Item item = Item.itemsList[id]; + Item item = getItem(world, x, y, z); if (item == null) { return null; } - return new ItemStack(id, 1, getDamageValue(world, x, y, z)); + return new ItemStack(item, 1, getDamageValue(world, x, y, z)); } @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(int i, CreativeTabs tab, List list) { + public void getSubBlocks(Item i, CreativeTabs tab, List list) { for (int j = 0; j < textures.length; j++) { list.add(new ItemStack(i, 1, j)); } diff --git a/common/mysticstones/blocks/ItemBlockMulti.java b/common/mysticstones/blocks/ItemBlockMulti.java index 952a23a..2a50eca 100644 --- a/common/mysticstones/blocks/ItemBlockMulti.java +++ b/common/mysticstones/blocks/ItemBlockMulti.java @@ -1,39 +1,22 @@ package mysticstones.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemBlockWithMetadata; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; -public class ItemBlockMulti extends ItemBlock { - private String[] types; - private Block block; +import java.util.ArrayList; - public ItemBlockMulti(int par1, Block block, String[] names) { - super(par1); +public class ItemBlockMulti extends ItemBlockWithMetadata { + private ArrayList types; + public ItemBlockMulti(Block block, ArrayList names) { + super(block, block); this.types = names; - this.block = block; - setMaxDamage(0); - setHasSubtypes(true); - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int par1) { - return block.getIcon(2, par1); - } - - @Override - public int getMetadata(int par1) { - return par1; } @Override public String getUnlocalizedName(ItemStack itemStack) { - int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, types.length); - return types[meta]; + int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, types.size()); + return types.get(meta); } } diff --git a/common/mysticstones/worldgen/WorldGeneratorStones.java b/common/mysticstones/worldgen/WorldGeneratorStones.java index e7ddd51..c6a5aef 100644 --- a/common/mysticstones/worldgen/WorldGeneratorStones.java +++ b/common/mysticstones/worldgen/WorldGeneratorStones.java @@ -4,20 +4,20 @@ import java.util.Random; import mysticstones.MysticStones; import mysticstones.util.Config; -import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import cpw.mods.fml.common.IWorldGenerator; public class WorldGeneratorStones implements IWorldGenerator { - public static final WorldGenMinable anorthosite = new WorldGenMinable(MysticStones.stones.blockID, 0, 24, Block.stone.blockID); - public static final WorldGenMinable limestone = new WorldGenMinable(MysticStones.stones.blockID, 2, 48, Block.stone.blockID); - public static final WorldGenMinable marble = new WorldGenMinable(MysticStones.stones.blockID, 4, 24, Block.stone.blockID); - public static final WorldGenMinable migmatite = new WorldGenMinable(MysticStones.stones.blockID, 6, 48, Block.stone.blockID); - public static final WorldGenMinable orthogneiss = new WorldGenMinable(MysticStones.stones.blockID, 8, 48, Block.stone.blockID); - public static final WorldGenMinable slate = new WorldGenMinable(MysticStones.stones.blockID, 10, 24, Block.stone.blockID); - public static final WorldGenMinable travertine = new WorldGenMinable(MysticStones.stones.blockID, 12, 24, Block.stone.blockID); + public static final WorldGenMinable anorthosite = new WorldGenMinable(MysticStones.stones, 0, 24, Blocks.stone); + public static final WorldGenMinable limestone = new WorldGenMinable(MysticStones.stones, 2, 48, Blocks.stone); + public static final WorldGenMinable marble = new WorldGenMinable(MysticStones.stones, 4, 24, Blocks.stone); + public static final WorldGenMinable migmatite = new WorldGenMinable(MysticStones.stones, 6, 48, Blocks.stone); + public static final WorldGenMinable orthogneiss = new WorldGenMinable(MysticStones.stones, 8, 48, Blocks.stone); + public static final WorldGenMinable slate = new WorldGenMinable(MysticStones.stones, 10, 24, Blocks.stone); + public static final WorldGenMinable travertine = new WorldGenMinable(MysticStones.stones, 12, 24, Blocks.stone); @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { diff --git a/common/MysticWorld/Blocks/BlockBush.java b/common/mysticworld/Blocks/BlockBushes.java similarity index 59% rename from common/MysticWorld/Blocks/BlockBush.java rename to common/mysticworld/Blocks/BlockBushes.java index 19f10bf..bae85a8 100644 --- a/common/MysticWorld/Blocks/BlockBush.java +++ b/common/mysticworld/Blocks/BlockBushes.java @@ -6,13 +6,15 @@ import java.util.Random; import mysticworld.MysticWorld; import mysticworld.items.ItemHandler; import net.minecraft.block.Block; -import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockBush; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.world.ColorizerFoliage; import net.minecraft.world.ColorizerGrass; import net.minecraft.world.IBlockAccess; @@ -21,23 +23,23 @@ import net.minecraftforge.common.EnumPlantType; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockBush extends BlockFlower { - Icon[] textures; +public class BlockBushes extends BlockBush { + IIcon[] textures; - public BlockBush(int id) { - super(id, Material.leaves); + public BlockBushes() { + super(Material.leaves); setCreativeTab(MysticWorld.MysticWorldTab); - setHardness(0.3F); - setResistance(0.1F); - setStepSound(Block.soundGrassFootstep); - setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); + setHardness(0.3F); + setResistance(0.1F); + setStepSound(Block.soundTypeGrass); + setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); } @Override @SideOnly(Side.CLIENT) public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - return l == -1 ? 16777215 : par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeGrassColor(); + return l == -1 ? 16777215 : par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeGrassColor(par2, par3, par4); } @Override @@ -55,17 +57,17 @@ public class BlockBush extends BlockFlower { @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return AxisAlignedBB.getAABBPool().getAABB(par2 + this.minX, par3 + this.minY, par4 + this.minZ, par2 + this.maxX, par3 + this.maxY, par4 + this.maxZ); + return AxisAlignedBB.getAABBPool().getAABB(par2 + this.getBlockBoundsMinX(), par3 + this.getBlockBoundsMinY(), par4 + this.getBlockBoundsMinZ(), par2 + this.getBlockBoundsMaxX(), par3 + this.getBlockBoundsMaxY(), par4 + this.getBlockBoundsMaxZ()); } @Override @SideOnly(Side.CLIENT) - public Icon getIcon(int side, int meta) { + public IIcon getIcon(int side, int meta) { return textures[meta]; } @Override - public EnumPlantType getPlantType(World world, int x, int y, int z) { + public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) { return EnumPlantType.Plains; } @@ -82,15 +84,15 @@ public class BlockBush extends BlockFlower { @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(int i, CreativeTabs tab, List list) { + public void getSubBlocks(Item i, CreativeTabs tab, List list) { for (int j = 0; j < 12; j++) { list.add(new ItemStack(i, 1, j)); } } @Override - public int idDropped(int par1, Random par2Random, int par3) { - return ItemHandler.bushFruit.itemID; + public Item getItemDropped(int par1, Random par2Random, int par3) { + return ItemHandler.bushFruit; } @Override @@ -100,15 +102,15 @@ public class BlockBush extends BlockFlower { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - textures = new Icon[16]; + public void registerBlockIcons(IIconRegister iconRegister) { + textures = new IIcon[16]; for (int i = 0; i < 12; i++) { - textures[i] = iconRegister.registerIcon("mysticworld:" + ItemBush.BUSH_TYPES[i]); + textures[i] = iconRegister.registerIcon("mysticworld:" + BlockHandler.BUSH_TYPES.get(i)); } } @Override - protected boolean canThisPlantGrowOnThisBlockID(int par1) { - return par1 == Block.grass.blockID || par1 == Block.dirt.blockID; + protected boolean canPlaceBlockOn(Block par1) { + return par1 == Blocks.grass || par1 == Blocks.dirt; } } diff --git a/common/mysticworld/Blocks/ItemBlockMulti.java b/common/mysticworld/Blocks/ItemBlockMulti.java new file mode 100644 index 0000000..2ab15ec --- /dev/null +++ b/common/mysticworld/Blocks/ItemBlockMulti.java @@ -0,0 +1,22 @@ +package mysticworld.blocks; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlockWithMetadata; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; + +import java.util.ArrayList; + +public class ItemBlockMulti extends ItemBlockWithMetadata { + public final ArrayList names; + public ItemBlockMulti(Block block, ArrayList names) { + super(block, block); + this.names = names; + } + + @Override + public String getUnlocalizedName(ItemStack itemStack) { + int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, names.size()); + return names.get(meta); + } +} diff --git a/common/MysticWorld/WorldGen/WorldGenBushes.java b/common/mysticworld/WorldGen/WorldGenerators.java similarity index 50% rename from common/MysticWorld/WorldGen/WorldGenBushes.java rename to common/mysticworld/WorldGen/WorldGenerators.java index ef9d6a6..f0f4796 100644 --- a/common/MysticWorld/WorldGen/WorldGenBushes.java +++ b/common/mysticworld/WorldGen/WorldGenerators.java @@ -2,14 +2,16 @@ package mysticworld.worldgen; import java.util.Random; +import mysticworld.lib.Booleans; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenerator; import cpw.mods.fml.common.IWorldGenerator; -public class WorldGenBushes implements IWorldGenerator { +public class WorldGenerators implements IWorldGenerator { public static final WorldGenerator bushes = new BushesGen(); + public static final WorldGenerator stones = new StonesGen(); @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { @@ -20,11 +22,15 @@ public class WorldGenBushes implements IWorldGenerator { } private void generateSurface(World world, Random random, int blockX, int blockZ) { - for (int i = 0; i < 1; i++) { - int Xcoord1 = blockX + random.nextInt(16) + 8; - int Ycoord1 = random.nextInt(11) + 60; - int Zcoord1 = blockZ + random.nextInt(16) + 8; - bushes.generate(world, random, Xcoord1, Ycoord1, Zcoord1); - } + int Xcoord1 = blockX + random.nextInt(16) + 8; + int Ycoord1 = random.nextInt(11) + 60; + int Zcoord1 = blockZ + random.nextInt(16) + 8; + stones.generate(world, random, Xcoord1, Ycoord1, Zcoord1); + if (Booleans.ENABLE_BUSH_GEN){ + Xcoord1 = blockX + random.nextInt(16) + 8; + Ycoord1 = random.nextInt(11) + 60; + Zcoord1 = blockZ + random.nextInt(16) + 8; + bushes.generate(world, random, Xcoord1, Ycoord1, Zcoord1); + } } } \ No newline at end of file diff --git a/common/mysticworld/items/ItemHandler.java b/common/mysticworld/items/ItemHandler.java index 511cf71..cc15932 100644 --- a/common/mysticworld/items/ItemHandler.java +++ b/common/mysticworld/items/ItemHandler.java @@ -1,7 +1,5 @@ package mysticworld.items; -import mysticworld.MysticWorld; -import mysticworld.lib.ItemIds; import mysticworld.lib.Strings; import net.minecraft.item.Item; @@ -44,43 +42,43 @@ public class ItemHandler { public static Item voidShard; public static void init() { - staffParts = new ItemStaffParts(ItemIds.STAFF_PARTS); - imbuedShard = new ItemImbuedShard(ItemIds.IMBUED_SHARD); - bushFruit = new ItemBushFruit(ItemIds.BUSH_FRUIT, 2); - fireStaff = new ItemStaffFire(ItemIds.FIRE_STAFF).setUnlocalizedName(Strings.FIRE_STAFF_NAME); - waterStaff = new ItemStaffWater(ItemIds.WATER_STAFF).setUnlocalizedName(Strings.WATER_STAFF_NAME); - earthStaff = new ItemStaffEarth(ItemIds.EARTH_STAFF).setUnlocalizedName(Strings.EARTH_STAFF_NAME); - airStaff = new ItemStaffAir(ItemIds.AIR_STAFF).setUnlocalizedName(Strings.AIR_STAFF_NAME); - energyStaff = new ItemStaffEnegy(ItemIds.ENERGY_STAFF).setUnlocalizedName(Strings.ENERGY_STAFF_NAME); - staffPower = new ItemStaffPower(ItemIds.STAFF_POWER); - fireOrb = new ItemOrbFire(ItemIds.FIRE_ORB).setUnlocalizedName(Strings.FIRE_ORB_NAME); - waterOrb = new ItemOrbWater(ItemIds.WATER_ORB).setUnlocalizedName(Strings.WATER_ORB_NAME); - earthOrb = new ItemOrbEarth(ItemIds.EARTH_ORB).setUnlocalizedName(Strings.EARTH_ORB_NAME); - airOrb = new ItemOrbAir(ItemIds.AIR_ORB).setUnlocalizedName(Strings.AIR_ORB_NAME); - energyOrb = new ItemOrbEnergy(ItemIds.ENERGY_ORB).setUnlocalizedName(Strings.ENERGY_ORB_NAME); - verditeHelmet = new ItemArmorVerdite(ItemIds.VERDITE_HELMET, EnumArmor.Verdite, MysticWorld.proxy.addArmor(EnumArmor.Verdite.name()), 0).setUnlocalizedName(Strings.VERDITE_HELMET_NAME); - verditeChestplate = new ItemArmorVerdite(ItemIds.VERDITE_CHESTPLATE, EnumArmor.Verdite, MysticWorld.proxy.addArmor(EnumArmor.Verdite.name()), 1) + staffParts = new ItemStaffParts(); + imbuedShard = new ItemImbuedShard(); + bushFruit = new ItemBushFruit(2); + fireStaff = new ItemStaffFire().setUnlocalizedName(Strings.FIRE_STAFF_NAME); + waterStaff = new ItemStaffWater().setUnlocalizedName(Strings.WATER_STAFF_NAME); + earthStaff = new ItemStaffEarth().setUnlocalizedName(Strings.EARTH_STAFF_NAME); + airStaff = new ItemStaffAir().setUnlocalizedName(Strings.AIR_STAFF_NAME); + energyStaff = new ItemStaffEnegy().setUnlocalizedName(Strings.ENERGY_STAFF_NAME); + staffPower = new ItemStaffPower(); + fireOrb = new ItemOrbFire().setUnlocalizedName(Strings.FIRE_ORB_NAME); + waterOrb = new ItemOrbWater().setUnlocalizedName(Strings.WATER_ORB_NAME); + earthOrb = new ItemOrbEarth().setUnlocalizedName(Strings.EARTH_ORB_NAME); + airOrb = new ItemOrbAir().setUnlocalizedName(Strings.AIR_ORB_NAME); + energyOrb = new ItemOrbEnergy().setUnlocalizedName(Strings.ENERGY_ORB_NAME); + verditeHelmet = new ItemArmorVerdite(EnumArmor.Verdite, 0).setUnlocalizedName(Strings.VERDITE_HELMET_NAME); + verditeChestplate = new ItemArmorVerdite(EnumArmor.Verdite, 1) .setUnlocalizedName(Strings.VERDITE_CHESTPLATE_NAME); - verditeLeggings = new ItemArmorVerdite(ItemIds.VERDITE_LEGGINGS, EnumArmor.Verdite, MysticWorld.proxy.addArmor(EnumArmor.Verdite.name()), 2).setUnlocalizedName(Strings.VERDITE_LEGGINGS_NAME); - verditeBoots = new ItemArmorVerdite(ItemIds.VERDITE_BOOTS, EnumArmor.Verdite, MysticWorld.proxy.addArmor(EnumArmor.Verdite.name()), 3).setUnlocalizedName(Strings.VERDITE_BOOTS_NAME); - mithrilHelmet = new ItemArmorMithril(ItemIds.MITHRIL_HELMET, EnumArmor.Mithril, MysticWorld.proxy.addArmor(EnumArmor.Mithril.name()), 0).setUnlocalizedName(Strings.MITHRIL_HELMET_NAME); - mithrilChestplate = new ItemArmorMithril(ItemIds.MITHRIL_CHESTPLATE, EnumArmor.Mithril, MysticWorld.proxy.addArmor(EnumArmor.Mithril.name()), 1) + verditeLeggings = new ItemArmorVerdite(EnumArmor.Verdite, 2).setUnlocalizedName(Strings.VERDITE_LEGGINGS_NAME); + verditeBoots = new ItemArmorVerdite(EnumArmor.Verdite, 3).setUnlocalizedName(Strings.VERDITE_BOOTS_NAME); + mithrilHelmet = new ItemArmorMithril(EnumArmor.Mithril, 0).setUnlocalizedName(Strings.MITHRIL_HELMET_NAME); + mithrilChestplate = new ItemArmorMithril(EnumArmor.Mithril, 1) .setUnlocalizedName(Strings.MITHRIL_CHESTPLATE_NAME); - mithrilLeggings = new ItemArmorMithril(ItemIds.MITHRIL_LEGGINGS, EnumArmor.Mithril, MysticWorld.proxy.addArmor(EnumArmor.Mithril.name()), 2).setUnlocalizedName(Strings.MITHRIL_LEGGINGS_NAME); - mithrilBoots = new ItemArmorMithril(ItemIds.MITHRIL_BOOTS, EnumArmor.Mithril, MysticWorld.proxy.addArmor(EnumArmor.Mithril.name()), 3).setUnlocalizedName(Strings.MITHRIL_BOOTS_NAME); - adamantineHelmet = new ItemArmorAdamantine(ItemIds.ADAMANTINE_HELMET, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 0) + mithrilLeggings = new ItemArmorMithril(EnumArmor.Mithril, 2).setUnlocalizedName(Strings.MITHRIL_LEGGINGS_NAME); + mithrilBoots = new ItemArmorMithril(EnumArmor.Mithril, 3).setUnlocalizedName(Strings.MITHRIL_BOOTS_NAME); + adamantineHelmet = new ItemArmorAdamantine(EnumArmor.Adamantine, 0) .setUnlocalizedName(Strings.ADAMANTINE_HELMET_NAME); - adamantineChestplate = new ItemArmorAdamantine(ItemIds.ADAMANTINE_CHESTPLATE, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 1) + adamantineChestplate = new ItemArmorAdamantine(EnumArmor.Adamantine, 1) .setUnlocalizedName(Strings.ADAMANTINE_CHESTPLATE_NAME); - adamantineLeggings = new ItemArmorAdamantine(ItemIds.ADAMANTINE_LEGGINGS, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 2) + adamantineLeggings = new ItemArmorAdamantine(EnumArmor.Adamantine, 2) .setUnlocalizedName(Strings.ADAMANTINE_LEGGINGS_NAME); - adamantineBoots = new ItemArmorAdamantine(ItemIds.ADAMANTINE_BOOTS, EnumArmor.Adamantine, MysticWorld.proxy.addArmor(EnumArmor.Adamantine.name()), 3) + adamantineBoots = new ItemArmorAdamantine(EnumArmor.Adamantine, 3) .setUnlocalizedName(Strings.ADAMANTINE_BOOTS_NAME); - iridiumHelmet = new ItemArmorIridium(ItemIds.IRIDIUM_HELMET, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 0).setUnlocalizedName(Strings.IRIDIUM_HELMET_NAME); - iridiumChestplate = new ItemArmorIridium(ItemIds.IRIDIUM_CHESTPLATE, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 1) + iridiumHelmet = new ItemArmorIridium(EnumArmor.Iridium, 0).setUnlocalizedName(Strings.IRIDIUM_HELMET_NAME); + iridiumChestplate = new ItemArmorIridium(EnumArmor.Iridium, 1) .setUnlocalizedName(Strings.IRIDIUM_CHESTPLATE_NAME); - iridiumLeggings = new ItemArmorIridium(ItemIds.IRIDIUM_LEGGINGS, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 2).setUnlocalizedName(Strings.IRIDIUM_LEGGINGS_NAME); - iridiumBoots = new ItemArmorIridium(ItemIds.IRIDIUM_BOOTS, EnumArmor.Iridium, MysticWorld.proxy.addArmor(EnumArmor.Iridium.name()), 3).setUnlocalizedName(Strings.IRIDIUM_BOOTS_NAME); - voidShard = new ItemVoidShard(ItemIds.VOID_SHARD).setUnlocalizedName(Strings.VOID_SHARD_NAME).setTextureName("mysticworld:ShardVoid"); + iridiumLeggings = new ItemArmorIridium(EnumArmor.Iridium, 2).setUnlocalizedName(Strings.IRIDIUM_LEGGINGS_NAME); + iridiumBoots = new ItemArmorIridium(EnumArmor.Iridium, 3).setUnlocalizedName(Strings.IRIDIUM_BOOTS_NAME); + voidShard = new ItemVoidShard().setUnlocalizedName(Strings.VOID_SHARD_NAME).setTextureName("mysticworld:ShardVoid"); } } diff --git a/common/mysticworld/tiles/TileEntityPillarInsert.java b/common/mysticworld/tiles/TileEntityPillarInsert.java index c74307f..dea1dfa 100644 --- a/common/mysticworld/tiles/TileEntityPillarInsert.java +++ b/common/mysticworld/tiles/TileEntityPillarInsert.java @@ -1,9 +1,9 @@ package mysticworld.tiles; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet; -import net.minecraft.network.packet.Packet132TileEntityData; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; public class TileEntityPillarInsert extends TileEntity { @@ -11,21 +11,11 @@ public class TileEntityPillarInsert extends TileEntity { public Packet getDescriptionPacket() { NBTTagCompound nbtTag = new NBTTagCompound(); this.writeToNBT(nbtTag); - return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag); } @Override - public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) { - readFromNBT(packet.data); - } - - @Override - public void readFromNBT(NBTTagCompound par1) { - super.readFromNBT(par1); - } - - @Override - public void writeToNBT(NBTTagCompound par1) { - super.writeToNBT(par1); + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { + readFromNBT(packet.func_148857_g()); } }