Renaming ItemHandler, moving variables

Improving generation code
This commit is contained in:
GotoLink 2013-10-23 22:48:40 +02:00
commit 5a3a9ccf0a
16 changed files with 123 additions and 154 deletions

View file

@ -4,7 +4,7 @@ import java.util.List;
import java.util.Random;
import mysticworld.MysticWorld;
import mysticworld.items.ItemHandler$1;
import mysticworld.items.ItemHandler;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
@ -113,7 +113,7 @@ public class BlockBush extends Block implements IPlantable {
@Override
public int idDropped(int par1, Random par2Random, int par3) {
return ItemHandler$1.bushFruit.itemID;
return ItemHandler.bushFruit.itemID;
}
@Override

View file

@ -4,7 +4,7 @@ import java.util.List;
import java.util.Random;
import mysticworld.MysticWorld;
import mysticworld.items.ItemHandler$1;
import mysticworld.items.ItemHandler;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFence;
import net.minecraft.block.material.Material;
@ -57,7 +57,7 @@ public class BlockImbuedStone extends Block {
@Override
public int idDropped(int par1, Random par2Random, int par3) {
return ItemHandler$1.imbuedShard.itemID;
return ItemHandler.imbuedShard.itemID;
}
@Override

View file

@ -1,7 +1,6 @@
package mysticworld.blocks;
import mysticworld.MysticWorld;
import mysticworld.lib.RenderIds;
import mysticworld.tiles.TileEntityPillarInsert;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@ -12,6 +11,8 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockPillarInsert extends BlockContainer {
public static int RENDER_PILLAR_INSERT;
public BlockPillarInsert(int id) {
super(id, Material.rock);
this.setBlockUnbreakable();
@ -32,7 +33,7 @@ public class BlockPillarInsert extends BlockContainer {
@Override
public int getRenderType() {
return RenderIds.RENDER_PILLAR_INSERT;
return RENDER_PILLAR_INSERT;
}
@Override
@ -42,7 +43,7 @@ public class BlockPillarInsert extends BlockContainer {
@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 (!world.isRemote) {
if (Item.enderPearl.itemID == entityPlayer.inventory.getCurrentItem().itemID) {
TileEntity te = world.getBlockTileEntity(x, y, z);
}

View file

@ -1,6 +1,7 @@
package mysticworld.client;
import mysticworld.blocks.BlockHandler;
import mysticworld.blocks.BlockPillarInsert;
import mysticworld.client.fx.LightCubeFX;
import mysticworld.client.fx.PowerAirFX;
import mysticworld.client.fx.PowerEarthFX;
@ -12,8 +13,7 @@ import mysticworld.entity.EntityChargeEarth;
import mysticworld.entity.EntityChargeEnergy;
import mysticworld.entity.EntityChargeFire;
import mysticworld.entity.EntityChargeWater;
import mysticworld.items.ItemHandler$1;
import mysticworld.lib.RenderIds;
import mysticworld.items.ItemHandler;
import mysticworld.renderer.BlockPillarInsertRenderer;
import mysticworld.renderer.ItemOrbAirRenderer;
import mysticworld.renderer.ItemOrbEarthRenderer;
@ -29,13 +29,15 @@ import mysticworld.renderer.RenderStaffPower;
import mysticworld.renderer.TileEntityPillarInsertRenderer;
import mysticworld.tiles.TileEntityPillarInsert;
import mysticworld.util.CommonProxy;
import net.minecraft.src.ModLoader;
import net.minecraft.client.Minecraft;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class ClientProxy extends CommonProxy {
public final Minecraft mc = Minecraft.getMinecraft();
@Override
public int addArmor(String armor) {
return RenderingRegistry.addNewArmourRendererPrefix(armor);
@ -45,51 +47,47 @@ public class ClientProxy extends CommonProxy {
@Override
public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age) {
PowerAirFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(airFX);
mc.effectRenderer.addEffect(airFX);
}
@Override
public void earthFX(World worldObj, double x, double y, double z, float scale) {
PowerEarthFX earthFX = new PowerEarthFX(worldObj, x, y, z, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(earthFX);
mc.effectRenderer.addEffect(earthFX);
}
@Override
public void energyFX(World worldObj, double x, double y, double z, float scale) {
PowerEnergyFX energyFX = new PowerEnergyFX(worldObj, x, y, z, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(energyFX);
mc.effectRenderer.addEffect(energyFX);
}
@Override
public void fireFX(World worldObj, double x, double y, double z, float scale) {
PowerFireFX fireFX = new PowerFireFX(worldObj, x, y, z, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(fireFX);
mc.effectRenderer.addEffect(fireFX);
}
@Override
public void lightCubeFX(World worldObj, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
LightCubeFX lightCubeFX = new LightCubeFX(worldObj, x, y, z, motionX, motionY, motionZ, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(lightCubeFX);
}
@Override
public void registerRenderIDs() {
RenderIds.RENDER_PILLAR_INSERT = RenderingRegistry.getNextAvailableRenderId();
mc.effectRenderer.addEffect(lightCubeFX);
}
@Override
public void registerRenders() {
BlockPillarInsert.RENDER_PILLAR_INSERT = RenderingRegistry.getNextAvailableRenderId();
MinecraftForgeClient.registerItemRenderer(BlockHandler.pillarInsert.blockID, new BlockPillarInsertRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.fireStaff.itemID, new ItemStaffFireRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.earthStaff.itemID, new ItemStaffEarthRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.airStaff.itemID, new ItemStaffAirRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.energyStaff.itemID, new ItemStaffEnergyRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.waterStaff.itemID, new ItemStaffWaterRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.fireOrb.itemID, new ItemOrbFireRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.earthOrb.itemID, new ItemOrbEarthRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.airOrb.itemID, new ItemOrbAirRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.energyOrb.itemID, new ItemOrbEnergyRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler$1.waterOrb.itemID, new ItemOrbWaterRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireStaff.itemID, new ItemStaffFireRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthStaff.itemID, new ItemStaffEarthRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.airStaff.itemID, new ItemStaffAirRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyStaff.itemID, new ItemStaffEnergyRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterStaff.itemID, new ItemStaffWaterRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireOrb.itemID, new ItemOrbFireRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthOrb.itemID, new ItemOrbEarthRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.airOrb.itemID, new ItemOrbAirRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyOrb.itemID, new ItemOrbEnergyRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterOrb.itemID, new ItemOrbWaterRenderer());
RenderingRegistry.registerEntityRenderingHandler(EntityChargeFire.class, new RenderStaffPower(0));
RenderingRegistry.registerEntityRenderingHandler(EntityChargeWater.class, new RenderStaffPower(1));
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEarth.class, new RenderStaffPower(2));
@ -101,6 +99,6 @@ public class ClientProxy extends CommonProxy {
@Override
public void waterFX(World worldObj, double x, double y, double z, float scale) {
PowerWaterFX waterFX = new PowerWaterFX(worldObj, x, y, z, scale);
ModLoader.getMinecraftInstance().effectRenderer.addEffect(waterFX);
mc.effectRenderer.addEffect(waterFX);
}
}

View file

@ -38,24 +38,24 @@ public class ItemArmorIridium extends ItemArmor {
ItemStack legs = player.getCurrentItemOrArmor(2);
ItemStack boots = player.getCurrentItemOrArmor(1);
if (helmet != null) {
if (helmet.itemID == ItemHandler$1.iridiumHelmet.itemID) {
if (helmet.itemID == ItemHandler.iridiumHelmet.itemID) {
player.addPotionEffect((new PotionEffect(Potion.nightVision.getId(), 200, 0)));
}
}
if (plate != null) {
if (plate.itemID == ItemHandler$1.iridiumChestplate.itemID) {
if (plate.itemID == ItemHandler.iridiumChestplate.itemID) {
player.addPotionEffect((new PotionEffect(Potion.regeneration.getId(), 200, 0)));
}
}
if (legs != null) {
if (legs.itemID == ItemHandler$1.iridiumLeggings.itemID) {
if (legs.itemID == ItemHandler.iridiumLeggings.itemID) {
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$1.iridiumBoots.itemID) {
if (boots.itemID == ItemHandler.iridiumBoots.itemID) {
player.fallDistance = 0.0F;
player.addPotionEffect((new PotionEffect(Potion.jump.getId(), 200, 2)));
}

View file

@ -1,7 +0,0 @@
package mysticworld.lib;
public class RenderIds {
public static int RENDER_PILLAR_INSERT;
}

View file

@ -1,11 +1,10 @@
package mysticworld;
import java.io.File;
import mysticworld.biome.BiomeHandler;
import mysticworld.blocks.BlockHandler;
import mysticworld.entity.EntityHandler;
import mysticworld.items.ItemHandler$1;
import mysticworld.items.ItemHandler;
import mysticworld.lib.Booleans;
import mysticworld.tiles.TileEntityHandler;
import mysticworld.util.CommonProxy;
import mysticworld.util.Config;
@ -14,7 +13,8 @@ import mysticworld.util.RecipeHandler;
import mysticworld.util.Reference;
import mysticworld.util.TabMysticWorld;
import mysticworld.util.TickHandler;
import mysticworld.worldgen.WorldGenHandler$1;
import mysticworld.worldgen.WorldGenBushes;
import mysticworld.worldgen.WorldGenStones;
import net.minecraft.creativetab.CreativeTabs;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
@ -23,6 +23,7 @@ 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;
@ -33,29 +34,26 @@ public class MysticWorld {
public static MysticWorld instance;
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
private TickHandler tickHandler;
public static CreativeTabs MysticWorldTab = new TabMysticWorld(CreativeTabs.getNextID(), "MysticWorldTab");
public static final CreativeTabs MysticWorldTab = new TabMysticWorld("MysticWorldTab");
@EventHandler
public void load(FMLInitializationEvent event) {
this.tickHandler = new TickHandler();
TickRegistry.registerTickHandler(this.tickHandler, Side.SERVER);
TickRegistry.registerTickHandler(new TickHandler(), Side.SERVER);
BlockHandler.init();
ItemHandler$1.init();
ItemHandler.init();
TileEntityHandler.init();
WorldGenHandler$1.init();
if (Booleans.ENABLE_BUSH_GEN)
GameRegistry.registerWorldGenerator(new WorldGenBushes());
GameRegistry.registerWorldGenerator(new WorldGenStones());
EntityHandler.init();
RecipeHandler.init();
Localizations.Initialize();
proxy.registerRenderIDs();
proxy.registerRenders();
}
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
Config.initialize(new File(event.getModConfigurationDirectory(), "Mystic Mods/Mystic World.cfg"));
Config.save();
Config.initialize(event.getSuggestedConfigurationFile());
BiomeHandler.init();
instance = this;
}
}

View file

@ -1,6 +1,6 @@
package mysticworld.renderer;
import mysticworld.items.ItemHandler$1;
import mysticworld.items.ItemHandler;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.TextureMap;
@ -30,7 +30,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$1.staffPower.getIconFromDamage(this.meta);
Icon icon = ItemHandler.staffPower.getIconFromDamage(this.meta);
Tessellator tessellator = Tessellator.instance;
float f3 = icon.getMinU();
float f4 = icon.getMaxU();

View file

@ -22,9 +22,6 @@ public class CommonProxy {
public void lightCubeFX(World worldObj, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
}
public void registerRenderIDs() {
}
public void registerRenders() {
}

View file

@ -61,8 +61,4 @@ public class Config {
ItemIds.VOID_SHARD = config.getItem(Strings.VOID_SHARD_NAME, ItemIds.VOID_SHARD_DEFAULT).getInt(ItemIds.VOID_SHARD_DEFAULT);
config.save();
}
public static void save() {
config.save();
}
}

View file

@ -1,7 +1,7 @@
package mysticworld.util;
import mysticores.items.Items;
import mysticworld.items.ItemHandler$1;
import mysticworld.items.ItemHandler;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;
@ -13,74 +13,74 @@ public class RecipeHandler {
}
private static void bootsRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "# #", "# #", '#', input });
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "# #", "# #", '#', input });
}
private static void chestplateRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "# #", "###", "###", '#', input });
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "# #", "###", "###", '#', input });
}
private static void helmetRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "###", "# #", '#', input });
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "###", "# #", '#', input });
}
private static void itemRecipes() {
//Staff Hilt Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.staffParts, 1, 1), new Object[] { " # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.diamond });
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 1), new Object[] { " # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.diamond });
//Staff Handle Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.staffParts, 1, 2), new Object[] { "#", "$", "S", '#', Item.goldNugget, '$', Item.stick, 'S', Item.dyePowder });
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 2), new Object[] { "#", "$", "S", '#', Item.goldNugget, '$', Item.stick, 'S', Item.dyePowder });
//Staff Topper Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.staffParts, 1, 3), new Object[] { " # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.netherStar });
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 3), new Object[] { " # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.netherStar });
//Staff Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler$1.staffParts, 1, 0), new Object[] { " #", " X ", "Y ", '#', new ItemStack(ItemHandler$1.staffParts, 1, 3), 'X',
new ItemStack(ItemHandler$1.staffParts, 1, 2), 'Y', new ItemStack(ItemHandler$1.staffParts, 1, 1) });
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) });
//Orb Recipes
orbRecipe(ItemHandler$1.fireOrb, new ItemStack(ItemHandler$1.imbuedShard, 1, 0));
orbRecipe(ItemHandler$1.waterOrb, new ItemStack(ItemHandler$1.imbuedShard, 1, 1));
orbRecipe(ItemHandler$1.earthOrb, new ItemStack(ItemHandler$1.imbuedShard, 1, 2));
orbRecipe(ItemHandler$1.airOrb, new ItemStack(ItemHandler$1.imbuedShard, 1, 3));
orbRecipe(ItemHandler$1.energyOrb, new ItemStack(ItemHandler$1.imbuedShard, 1, 4));
orbRecipe(ItemHandler.fireOrb, new ItemStack(ItemHandler.imbuedShard, 1, 0));
orbRecipe(ItemHandler.waterOrb, new ItemStack(ItemHandler.imbuedShard, 1, 1));
orbRecipe(ItemHandler.earthOrb, new ItemStack(ItemHandler.imbuedShard, 1, 2));
orbRecipe(ItemHandler.airOrb, new ItemStack(ItemHandler.imbuedShard, 1, 3));
orbRecipe(ItemHandler.energyOrb, new ItemStack(ItemHandler.imbuedShard, 1, 4));
//Staff Recipes
staffRecipe(ItemHandler$1.fireStaff, new ItemStack(ItemHandler$1.fireOrb));
staffRecipe(ItemHandler$1.waterStaff, new ItemStack(ItemHandler$1.waterOrb));
staffRecipe(ItemHandler$1.earthStaff, new ItemStack(ItemHandler$1.earthOrb));
staffRecipe(ItemHandler$1.airStaff, new ItemStack(ItemHandler$1.airOrb));
staffRecipe(ItemHandler$1.energyStaff, new ItemStack(ItemHandler$1.energyOrb));
staffRecipe(ItemHandler.fireStaff, new ItemStack(ItemHandler.fireOrb));
staffRecipe(ItemHandler.waterStaff, new ItemStack(ItemHandler.waterOrb));
staffRecipe(ItemHandler.earthStaff, new ItemStack(ItemHandler.earthOrb));
staffRecipe(ItemHandler.airStaff, new ItemStack(ItemHandler.airOrb));
staffRecipe(ItemHandler.energyStaff, new ItemStack(ItemHandler.energyOrb));
//Verdite Armor
helmetRecipe(ItemHandler$1.verditeHelmet, new ItemStack(Items.Resource, 1, 0));
chestplateRecipe(ItemHandler$1.verditeChestplate, new ItemStack(Items.Resource, 1, 0));
leggingsRecipe(ItemHandler$1.verditeLeggings, new ItemStack(Items.Resource, 1, 0));
bootsRecipe(ItemHandler$1.verditeBoots, new ItemStack(Items.Resource, 1, 0));
helmetRecipe(ItemHandler.verditeHelmet, new ItemStack(Items.Resource, 1, 0));
chestplateRecipe(ItemHandler.verditeChestplate, new ItemStack(Items.Resource, 1, 0));
leggingsRecipe(ItemHandler.verditeLeggings, new ItemStack(Items.Resource, 1, 0));
bootsRecipe(ItemHandler.verditeBoots, new ItemStack(Items.Resource, 1, 0));
//Mithril Armor
helmetRecipe(ItemHandler$1.mithrilHelmet, new ItemStack(Items.Resource, 1, 1));
chestplateRecipe(ItemHandler$1.mithrilChestplate, new ItemStack(Items.Resource, 1, 1));
leggingsRecipe(ItemHandler$1.mithrilLeggings, new ItemStack(Items.Resource, 1, 1));
bootsRecipe(ItemHandler$1.mithrilBoots, new ItemStack(Items.Resource, 1, 1));
helmetRecipe(ItemHandler.mithrilHelmet, new ItemStack(Items.Resource, 1, 1));
chestplateRecipe(ItemHandler.mithrilChestplate, new ItemStack(Items.Resource, 1, 1));
leggingsRecipe(ItemHandler.mithrilLeggings, new ItemStack(Items.Resource, 1, 1));
bootsRecipe(ItemHandler.mithrilBoots, new ItemStack(Items.Resource, 1, 1));
//Adamantine Armor
helmetRecipe(ItemHandler$1.adamantineHelmet, new ItemStack(Items.Resource, 1, 2));
chestplateRecipe(ItemHandler$1.adamantineChestplate, new ItemStack(Items.Resource, 1, 2));
leggingsRecipe(ItemHandler$1.adamantineLeggings, new ItemStack(Items.Resource, 1, 2));
bootsRecipe(ItemHandler$1.adamantineBoots, new ItemStack(Items.Resource, 1, 2));
helmetRecipe(ItemHandler.adamantineHelmet, new ItemStack(Items.Resource, 1, 2));
chestplateRecipe(ItemHandler.adamantineChestplate, new ItemStack(Items.Resource, 1, 2));
leggingsRecipe(ItemHandler.adamantineLeggings, new ItemStack(Items.Resource, 1, 2));
bootsRecipe(ItemHandler.adamantineBoots, new ItemStack(Items.Resource, 1, 2));
//Iridium Armor
helmetRecipe(ItemHandler$1.iridiumHelmet, new ItemStack(Items.Resource, 1, 3));
chestplateRecipe(ItemHandler$1.iridiumChestplate, new ItemStack(Items.Resource, 1, 3));
leggingsRecipe(ItemHandler$1.iridiumLeggings, new ItemStack(Items.Resource, 1, 3));
bootsRecipe(ItemHandler$1.iridiumBoots, new ItemStack(Items.Resource, 1, 3));
helmetRecipe(ItemHandler.iridiumHelmet, new ItemStack(Items.Resource, 1, 3));
chestplateRecipe(ItemHandler.iridiumChestplate, new ItemStack(Items.Resource, 1, 3));
leggingsRecipe(ItemHandler.iridiumLeggings, new ItemStack(Items.Resource, 1, 3));
bootsRecipe(ItemHandler.iridiumBoots, new ItemStack(Items.Resource, 1, 3));
}
private static void itemSmelting() {
GameRegistry.addSmelting(ItemHandler$1.imbuedShard.itemID, new ItemStack(ItemHandler$1.voidShard, 1), 0.5f);
GameRegistry.addSmelting(ItemHandler.imbuedShard.itemID, new ItemStack(ItemHandler.voidShard), 0.5f);
}
private static void leggingsRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "###", "# #", "# #", '#', input });
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "###", "# #", "# #", '#', input });
}
private static void orbRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output, 1), new Object[] { "##", "##", '#', input });
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "##", "##", '#', input });
}
private static void staffRecipe(Item output, ItemStack input) {
GameRegistry.addShapelessRecipe(new ItemStack(output, 1), input, new ItemStack(ItemHandler$1.staffParts, 1, 0));
GameRegistry.addShapelessRecipe(new ItemStack(output), input, new ItemStack(ItemHandler.staffParts, 1, 0));
}
}

View file

@ -1,16 +1,16 @@
package mysticworld.util;
import mysticworld.items.ItemHandler$1;
import mysticworld.items.ItemHandler;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
public class TabMysticWorld extends CreativeTabs {
public TabMysticWorld(int par1, String par2Str) {
super(par1, par2Str);
public TabMysticWorld(String par2Str) {
super(par2Str);
}
@Override
public ItemStack getIconItemStack() {
return new ItemStack(ItemHandler$1.earthStaff, 1);
return new ItemStack(ItemHandler.earthStaff, 1);
}
}

View file

@ -4,28 +4,27 @@ 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 WorldGenBushes implements IWorldGenerator
{
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);
public class WorldGenBushes implements IWorldGenerator {
public static final WorldGenerator bushes = new BushesGen();
@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++)
{
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;
(new BushesGen()).generate(world, random, Xcoord1, Ycoord1, Zcoord1);
bushes.generate(world, random, Xcoord1, Ycoord1, Zcoord1);
}
}
}

View file

@ -1,12 +0,0 @@
package mysticworld.worldgen;
import mysticworld.lib.Booleans;
import cpw.mods.fml.common.registry.GameRegistry;
public class WorldGenHandler$1 {
public static void init() {
if (Booleans.ENABLE_BUSH_GEN)
GameRegistry.registerWorldGenerator(new WorldGenBushes());
GameRegistry.registerWorldGenerator(new WorldGenStones());
}
}

View file

@ -4,28 +4,27 @@ 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 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);
}
}
public class WorldGenStones implements IWorldGenerator {
public static final WorldGenerator stones = new StonesGen();
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;
(new StonesGen()).generate(world, random, Xcoord1, Ycoord1, Zcoord1);
}
}
@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);
}
}
}

View file

@ -5,7 +5,7 @@ import mysticworld.lib.ItemIds;
import mysticworld.lib.Strings;
import net.minecraft.item.Item;
public class ItemHandler$1 {
public class ItemHandler {
public static Item staffParts;
public static Item imbuedShard;
public static Item fireStaff;