diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2013-12-15 16:52:41 +0200 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2013-12-15 16:52:41 +0200 |
| commit | 06415dc21d71e8ac363dae5c56c5317971f7aede (patch) | |
| tree | 7ddbe2cc709a5a39c3fe8b8a80d7ac77f336a220 /common/darkknight | |
| parent | 9342967bd8a6a9451591325c7c5deb5416819adc (diff) | |
| parent | 943f1a493b27c630e95730b385e6524643d98564 (diff) | |
Merge branch 'master' of https://github.com/sor1n/Modjam-Mod
As well as added the smelter and working on the molder
Diffstat (limited to 'common/darkknight')
21 files changed, 1115 insertions, 0 deletions
diff --git a/common/darkknight/jewelrycraft/CommonProxy.java b/common/darkknight/jewelrycraft/CommonProxy.java new file mode 100644 index 0000000..28ca770 --- /dev/null +++ b/common/darkknight/jewelrycraft/CommonProxy.java @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import cpw.mods.fml.common.network.IGuiHandler; + +public class CommonProxy implements IGuiHandler +{ + + @Override + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) + { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/common/darkknight/jewelrycraft/JewelrycraftMod.java b/common/darkknight/jewelrycraft/JewelrycraftMod.java new file mode 100644 index 0000000..2a63509 --- /dev/null +++ b/common/darkknight/jewelrycraft/JewelrycraftMod.java @@ -0,0 +1,123 @@ +package darkknight.jewelrycraft; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetworkManager; +import net.minecraft.network.NetLoginHandler; +import net.minecraft.network.packet.NetHandler; +import net.minecraft.network.packet.Packet1Login; +import net.minecraft.server.MinecraftServer; +import net.minecraftforge.oredict.OreDictionary; +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.Mod.Metadata; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.network.IConnectionHandler; +import cpw.mods.fml.common.network.NetworkMod; +import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler; +import cpw.mods.fml.common.network.Player; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.client.JewelryCraftClient; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.lib.Reference; +import darkknight.jewelrycraft.recipes.CraftingRecipes; +import darkknight.jewelrycraft.server.JewelryCraftServer; +import darkknight.jewelrycraft.worldGen.Generation; + +@Mod(modid = Reference.MODID, name = Reference.MODNAME, version = Reference.VERSION) +@NetworkMod(clientSideRequired = false, serverSideRequired = false, +clientPacketHandlerSpec = @SidedPacketHandler(channels = { Reference.PACKET_CHANNEL }, packetHandler = JewelryCraftClient.class), +serverPacketHandlerSpec = @SidedPacketHandler(channels = { Reference.PACKET_CHANNEL }, packetHandler = JewelryCraftServer.class), +connectionHandler = JewelrycraftMod.class) +public class JewelrycraftMod implements IConnectionHandler +{ + @Instance(Reference.MODID) + public static JewelrycraftMod instance; + + @Metadata(Reference.MODID) + public static ModMetadata metadata; + + @SidedProxy(clientSide = "darkknight.jewelrycraft.client.ClientProxy", serverSide = "darkknight.jewelrycraft.CommonProxy") + public static CommonProxy proxy; + + public static CreativeTabs jewelrycraft = new CreativeTabs("JewelryCraft") + { + @Override + public ItemStack getIconItemStack() + { + return new ItemStack(ItemList.shadowIngot, 1, 0); + } + }; + + @EventHandler + public void preInit(FMLPreInitializationEvent e) + { + ConfigHandler.preInit(e); + ItemList.preInit(e); + BlockList.preInit(e); + CraftingRecipes.preInit(e); + } + + @EventHandler + public void init(FMLInitializationEvent e) + { + OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot)); + OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre)); + GameRegistry.registerWorldGenerator(new Generation()); + } + + @EventHandler + public void postInit(FMLPostInitializationEvent e) + { + + } + + @Override + // 2) Called when a player logs into the server SERVER SIDE + public void playerLoggedIn(Player player, NetHandler netHandler, INetworkManager manager) + { + + } + + @Override + // If you don't want the connection to continue, return a non-empty string here SERVER SIDE + public String connectionReceived(NetLoginHandler netHandler, INetworkManager manager) + { + return null; + } + + @Override + // 1) Fired when a remote connection is opened CLIENT SIDE + public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager) + { + + } + + @Override + // 1) Fired when a local connection is opened CLIENT SIDE + public void connectionOpened(NetHandler netClientHandler, MinecraftServer server, INetworkManager manager) + { + + } + + @Override + // Fired when a connection closes ALL SIDES + public void connectionClosed(INetworkManager manager) + { + + } + + @Override + // 3) Fired when the client established the connection to the server CLIENT SIDE + public void clientLoggedIn(NetHandler clientHandler, INetworkManager manager, Packet1Login login) + { + + } +} diff --git a/common/darkknight/jewelrycraft/block/BlockBase.java b/common/darkknight/jewelrycraft/block/BlockBase.java new file mode 100644 index 0000000..0378fb5 --- /dev/null +++ b/common/darkknight/jewelrycraft/block/BlockBase.java @@ -0,0 +1,19 @@ +package darkknight.jewelrycraft.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; + +public class BlockBase extends Block +{ + public BlockBase(int par1, Material mat) + { + super(par1, mat); + } + + @Override + public Block setUnlocalizedName(String name) + { + Block r = super.setUnlocalizedName(name); + return r.setTextureName(name.replaceAll("\\.", ":")); + } +} diff --git a/common/darkknight/jewelrycraft/block/BlockList.java b/common/darkknight/jewelrycraft/block/BlockList.java new file mode 100644 index 0000000..e29287d --- /dev/null +++ b/common/darkknight/jewelrycraft/block/BlockList.java @@ -0,0 +1,40 @@ +package darkknight.jewelrycraft.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.renders.TileEntitySmelterRender; +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; + +public class BlockList +{ + public static Block shadowOre; + public static Block smelter; + public static Block molder; + public static Block jewelCraftingTable; + + private static boolean isInitialized = false; + + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized) + { + shadowOre = new BlockBase(ConfigHandler.idShadowOre, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("jewelrycraft.oreShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + smelter = new BlockSmelter(ConfigHandler.idSmelter, Material.iron).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("jewelrycraft.smelter").setCreativeTab(JewelrycraftMod.jewelrycraft); + molder = new BlockMolder(ConfigHandler.idMolder, Material.iron).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("jewelrycraft.molder").setCreativeTab(JewelrycraftMod.jewelrycraft); + jewelCraftingTable = new BlockBase(ConfigHandler.idJewelCraftingTable, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("jewelrycraft.jewelCraftingTable").setCreativeTab(JewelrycraftMod.jewelrycraft); + + GameRegistry.registerBlock(shadowOre, "shadowOre"); + GameRegistry.registerBlock(smelter, "Smelter"); + GameRegistry.registerBlock(molder, "Molder"); + GameRegistry.registerBlock(jewelCraftingTable, "jewelCraftingTable"); + + GameRegistry.registerTileEntity(TileEntitySmelter.class, "30"); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); + } + } +} diff --git a/common/darkknight/jewelrycraft/block/BlockMolder.java b/common/darkknight/jewelrycraft/block/BlockMolder.java new file mode 100644 index 0000000..05b7b0a --- /dev/null +++ b/common/darkknight/jewelrycraft/block/BlockMolder.java @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.block; + +import darkknight.jewelrycraft.tileentity.TileEntityMolder; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class BlockMolder extends BlockContainer +{ + protected BlockMolder(int par1, Material par2Material) + { + super(par1, par2Material); + } + + @Override + public TileEntity createNewTileEntity(World world) + { + return new TileEntityMolder(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } +} diff --git a/common/darkknight/jewelrycraft/block/BlockSmelter.java b/common/darkknight/jewelrycraft/block/BlockSmelter.java new file mode 100644 index 0000000..eb22b63 --- /dev/null +++ b/common/darkknight/jewelrycraft/block/BlockSmelter.java @@ -0,0 +1,94 @@ +package darkknight.jewelrycraft.block; + +import darkknight.jewelrycraft.tileentity.TileEntitySmelter; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockSmelter extends BlockContainer +{ + protected BlockSmelter(int par1, Material par2Material) + { + super(par1, par2Material); + } + + @Override + public TileEntity createNewTileEntity(World world) + { + return new TileEntitySmelter(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) + { + TileEntitySmelter te = (TileEntitySmelter) world.getBlockTileEntity(i, j, k); + ItemStack item = entityPlayer.inventory.getCurrentItem(); + if (te != null && !world.isRemote) + { + if (!te.hasMetal && !te.hasMoltenMetal && item != null && item.getDisplayName().contains("Ingot")) + { + te.metalID = item.getItem().itemID; + te.metal = item; + te.hasMetal = true; + te.melting = 200000; + --item.stackSize; + } + else if (te.hasMetal && !te.hasMoltenMetal && item != null && item.getDisplayName().contains("Ingot")) + entityPlayer.addChatMessage("The Smelter already contains a " + new ItemStack(te.metalID, 1, 0).getDisplayName()); + else if (te.hasMoltenMetal) + entityPlayer.addChatMessage("The Smelter contains molten " + new ItemStack(te.moltenMetalID, 1, 0).getDisplayName().toLowerCase().replace("ingot", "")); + else if (item != null && !item.getDisplayName().contains("Ingot")) + entityPlayer.addChatMessage("The item needs to be an ingot!"); + + if (te.hasMetal && entityPlayer.isSneaking()) + { + entityPlayer.dropPlayerItem(new ItemStack(te.metalID, 1, 0)); + te.hasMetal = false; + } + world.setBlockTileEntity(i, j, k, te); + } + return true; + } + + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack) + { + int rotation = MathHelper.floor_double((double)(entityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + world.setBlockMetadataWithNotify(i, j, k, rotation, 2); + System.out.println(world.getBlockMetadata(i, j, k)); + } + + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + public void registerIcons(IconRegister icon) + { + this.blockIcon = icon.registerIcon("jewelrycraft:smelter"); + } + +} diff --git a/common/darkknight/jewelrycraft/client/ClientProxy.java b/common/darkknight/jewelrycraft/client/ClientProxy.java new file mode 100644 index 0000000..e280402 --- /dev/null +++ b/common/darkknight/jewelrycraft/client/ClientProxy.java @@ -0,0 +1,8 @@ +package darkknight.jewelrycraft.client; + +import darkknight.jewelrycraft.CommonProxy; + +public class ClientProxy extends CommonProxy +{ + +} diff --git a/common/darkknight/jewelrycraft/client/JewelryCraftClient.java b/common/darkknight/jewelrycraft/client/JewelryCraftClient.java new file mode 100644 index 0000000..734e9d5 --- /dev/null +++ b/common/darkknight/jewelrycraft/client/JewelryCraftClient.java @@ -0,0 +1,16 @@ +package darkknight.jewelrycraft.client; + +import net.minecraft.network.INetworkManager; +import net.minecraft.network.packet.Packet250CustomPayload; +import cpw.mods.fml.common.network.IPacketHandler; +import cpw.mods.fml.common.network.Player; + +public class JewelryCraftClient implements IPacketHandler +{ + @Override + public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) + { + // TODO Auto-generated method stub + + } +} diff --git a/common/darkknight/jewelrycraft/config/ConfigHandler.java b/common/darkknight/jewelrycraft/config/ConfigHandler.java new file mode 100644 index 0000000..be671a3 --- /dev/null +++ b/common/darkknight/jewelrycraft/config/ConfigHandler.java @@ -0,0 +1,39 @@ +package darkknight.jewelrycraft.config; + +import net.minecraftforge.common.Configuration; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ConfigHandler +{ + private static Configuration config; + public static int idThiefGloves = 17493; + public static int idShadowIngot = 17497; + + public static int idShadowOre = 1750; + public static int idSmelter = 1751; + public static int idMolder = 1752; + public static int idJewelCraftingTable = 1753; + + private static boolean isInitialized = false; + + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized) + { + config = new Configuration(e.getSuggestedConfigurationFile()); + + config.load(); + + idThiefGloves = config.getItem("id.ThiefGloves", idThiefGloves).getInt(); + idShadowIngot = config.getItem("id.ShadowIngot", idShadowIngot).getInt(); + idShadowOre = config.getBlock("id.ShadowOre", idShadowOre).getInt(); + idSmelter = config.getBlock("id.Smelter", idSmelter).getInt(); + idMolder = config.getBlock("id.Molder", idMolder).getInt(); + idJewelCraftingTable = config.getBlock("id.JewelCraftingTable", idJewelCraftingTable).getInt(); + + config.save(); + + isInitialized = true; + } + } +} diff --git a/common/darkknight/jewelrycraft/item/ItemBase.java b/common/darkknight/jewelrycraft/item/ItemBase.java new file mode 100644 index 0000000..7f806bf --- /dev/null +++ b/common/darkknight/jewelrycraft/item/ItemBase.java @@ -0,0 +1,18 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; + +public class ItemBase extends Item +{ + public ItemBase(int par1) + { + super(par1); + } + + @Override + public Item setUnlocalizedName(String name) + { + Item r = super.setUnlocalizedName(name); + return r.setTextureName(name.replaceAll("\\.", ":")); + } +} diff --git a/common/darkknight/jewelrycraft/item/ItemList.java b/common/darkknight/jewelrycraft/item/ItemList.java new file mode 100644 index 0000000..7bf3705 --- /dev/null +++ b/common/darkknight/jewelrycraft/item/ItemList.java @@ -0,0 +1,24 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.config.ConfigHandler; + +public class ItemList +{ + public static Item thiefGloves; + public static Item shadowIngot; + + private static boolean isInitialized = false; + + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized) + { + thiefGloves = new ItemThiefGloves(ConfigHandler.idThiefGloves).setUnlocalizedName("jewelrycraft.thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); + shadowIngot = new ItemBase(ConfigHandler.idShadowIngot).setUnlocalizedName("jewelrycraft.ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); + + } + } +} diff --git a/common/darkknight/jewelrycraft/item/ItemThiefGloves.java b/common/darkknight/jewelrycraft/item/ItemThiefGloves.java new file mode 100644 index 0000000..97d83cd --- /dev/null +++ b/common/darkknight/jewelrycraft/item/ItemThiefGloves.java @@ -0,0 +1,64 @@ +package darkknight.jewelrycraft.item; + +import java.util.Iterator; +import java.util.Random; + +import cpw.mods.fml.relauncher.ReflectionHelper; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; + +public class ItemThiefGloves extends ItemBase +{ + public Random rand; + public ItemThiefGloves(int par1) + { + super(par1); + this.setCreativeTab(CreativeTabs.tabTools); + } + + @Override + public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) + { + if (par3EntityLivingBase instanceof EntityVillager) + { + EntityVillager villager = (EntityVillager) par3EntityLivingBase; + int wealth = (Integer) ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "wealth", "field_70956_bz"); + MerchantRecipeList buyingList = (MerchantRecipeList) ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "buyingList", "field_70963_i"); + if(buyingList!=null) + { + Iterator<?> iterator = buyingList.iterator(); + while(iterator.hasNext()) + { + MerchantRecipe recipe = (MerchantRecipe)iterator.next(); + int quantity; + if(recipe.getItemToSell().isStackable()) quantity = recipe.getItemToSell().stackSize * 7; + else quantity = 1; + ItemStack s = new ItemStack(recipe.getItemToSell().itemID, quantity, recipe.getItemToSell().getItemDamage()); + s.setTagCompound(recipe.getItemToSell().getTagCompound()); + if(par2EntityPlayer.inventory.addItemStackToInventory(s)); + else villager.entityDropItem(s, 0); + par2EntityPlayer.addChatMessage("Villager #" + villager.getProfession() + ": Hmmm... I seem to have lost my " + s.getDisplayName() + "!"); + } + buyingList.clear(); + ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 300, "timeUntilReset", "field_70961_j"); + ReflectionHelper.setPrivateValue(EntityVillager.class, villager, true, "needsInitilization", "field_70959_by"); + } + + villager.dropItem(Item.emerald.itemID, wealth); + ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 0, "wealth", "field_70956_bz"); + return true; + } + else + { + return super.itemInteractionForEntity(par1ItemStack, par2EntityPlayer, par3EntityLivingBase); + } + } + +} diff --git a/common/darkknight/jewelrycraft/lib/Reference.java b/common/darkknight/jewelrycraft/lib/Reference.java new file mode 100644 index 0000000..4514e5c --- /dev/null +++ b/common/darkknight/jewelrycraft/lib/Reference.java @@ -0,0 +1,9 @@ +package darkknight.jewelrycraft.lib; + +public class Reference +{ + public static final String MODID = "Jewelrycraft"; + public static final String MODNAME = "Jewelrycraft"; + public static final String VERSION = "1.0.0"; + public static final String PACKET_CHANNEL = "Jewelrycraft"; +} diff --git a/common/darkknight/jewelrycraft/model/ModelMolder.java b/common/darkknight/jewelrycraft/model/ModelMolder.java new file mode 100644 index 0000000..3c89e7d --- /dev/null +++ b/common/darkknight/jewelrycraft/model/ModelMolder.java @@ -0,0 +1,83 @@ +// Date: 12/15/2013 4:51:25 PM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + + + + + + +package net.minecraft.src; + +public class ModelMolder extends ModelBase +{ + //fields + ModelRenderer Base; + ModelRenderer Side; + ModelRenderer Side1; + ModelRenderer Side2; + ModelRenderer Side3; + + public ModelMolder() + { + textureWidth = 64; + textureHeight = 32; + + Base = new ModelRenderer(this, 0, 0); + Base.addBox(0F, 0F, 0F, 10, 1, 10); + Base.setRotationPoint(-5F, 23F, -5F); + Base.setTextureSize(64, 32); + Base.mirror = true; + setRotation(Base, 0F, 0F, 0F); + Side = new ModelRenderer(this, 0, 13); + Side.addBox(0F, 0F, 0F, 10, 2, 1); + Side.setRotationPoint(-5F, 21F, 5F); + Side.setTextureSize(64, 32); + Side.mirror = true; + setRotation(Side, 0F, 0F, 0F); + Side1 = new ModelRenderer(this, 0, 13); + Side1.addBox(0F, 0F, 0F, 10, 2, 1); + Side1.setRotationPoint(-5F, 21F, -6F); + Side1.setTextureSize(64, 32); + Side1.mirror = true; + setRotation(Side1, 0F, 0F, 0F); + Side2 = new ModelRenderer(this, 41, 0); + Side2.addBox(0F, 0F, 0F, 1, 2, 10); + Side2.setRotationPoint(-6F, 21F, -5F); + Side2.setTextureSize(64, 32); + Side2.mirror = true; + setRotation(Side2, 0F, 0F, 0F); + Side3 = new ModelRenderer(this, 41, 0); + Side3.addBox(0F, 0F, 0F, 1, 2, 10); + Side3.setRotationPoint(5F, 21F, -5F); + Side3.setTextureSize(64, 32); + Side3.mirror = true; + setRotation(Side3, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5); + Base.render(f5); + Side.render(f5); + Side1.render(f5); + Side2.render(f5); + Side3.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5); + } + +} diff --git a/common/darkknight/jewelrycraft/model/ModelSmelter.java b/common/darkknight/jewelrycraft/model/ModelSmelter.java new file mode 100644 index 0000000..2e71dac --- /dev/null +++ b/common/darkknight/jewelrycraft/model/ModelSmelter.java @@ -0,0 +1,276 @@ +package darkknight.jewelrycraft.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelSmelter extends ModelBase +{ + //fields + ModelRenderer Support1; + ModelRenderer Support2; + ModelRenderer Hold1; + ModelRenderer Hold2; + ModelRenderer SmelterBase; + ModelRenderer SmelterSide1; + ModelRenderer SmelterSide2; + ModelRenderer SmelterSide3; + ModelRenderer SmelterSide4; + ModelRenderer SmelterSide5; + ModelRenderer SmelterSide6; + ModelRenderer SmelterSide7; + ModelRenderer SmelterSide8; + ModelRenderer SmelterSide9; + ModelRenderer SmelterSide10; + ModelRenderer SmelterSide11; + ModelRenderer SmelterSide12; + ModelRenderer HeatSourceSide1; + ModelRenderer HeatSourceSide2; + ModelRenderer HeatSourceSide3; + ModelRenderer HeatSourceSide4; + ModelRenderer HeatSourceSide5; + ModelRenderer HeatSourceBase; + ModelRenderer HeatSourceSide6; + ModelRenderer HeatSourceSide7; + ModelRenderer HeatSourceSide8; + ModelRenderer HeatSourceSide9; + ModelRenderer HeatSourceSide10; + ModelRenderer HeatSourceSide11; + ModelRenderer HeatSourceSide12; + + public ModelSmelter() + { + textureWidth = 64; + textureHeight = 32; + + Support1 = new ModelRenderer(this, 0, 0); + Support1.addBox(0F, 0F, 0F, 2, 15, 3); + Support1.setRotationPoint(6F, 9F, -1F); + Support1.setTextureSize(64, 32); + Support1.mirror = true; + setRotation(Support1, 0F, 0F, 0F); + Support2 = new ModelRenderer(this, 0, 0); + Support2.addBox(0F, 0F, 0F, 2, 15, 3); + Support2.setRotationPoint(-8F, 9F, -1F); + Support2.setTextureSize(64, 32); + Support2.mirror = true; + setRotation(Support2, 0F, 0F, 0F); + Hold1 = new ModelRenderer(this, 0, 0); + Hold1.addBox(0F, 0F, 0F, 2, 1, 1); + Hold1.setRotationPoint(4F, 11F, 0F); + Hold1.setTextureSize(64, 32); + Hold1.mirror = true; + setRotation(Hold1, 0F, 0F, 0F); + Hold2 = new ModelRenderer(this, 0, 0); + Hold2.addBox(0F, 0F, 0F, 2, 1, 1); + Hold2.setRotationPoint(-6F, 11F, 0F); + Hold2.setTextureSize(64, 32); + Hold2.mirror = true; + setRotation(Hold2, 0F, 0F, 0F); + SmelterBase = new ModelRenderer(this, 0, 0); + SmelterBase.addBox(0F, 0F, 0F, 4, 1, 5); + SmelterBase.setRotationPoint(-2F, 18F, -2F); + SmelterBase.setTextureSize(64, 32); + SmelterBase.mirror = true; + setRotation(SmelterBase, 0F, 0F, 0F); + SmelterSide1 = new ModelRenderer(this, 0, 0); + SmelterSide1.addBox(0F, 0F, 0F, 4, 2, 1); + SmelterSide1.setRotationPoint(-2F, 16F, -3F); + SmelterSide1.setTextureSize(64, 32); + SmelterSide1.mirror = true; + setRotation(SmelterSide1, 0F, 0F, 0F); + SmelterSide2 = new ModelRenderer(this, 0, 0); + SmelterSide2.addBox(0F, 0F, 0F, 4, 2, 1); + SmelterSide2.setRotationPoint(-2F, 16F, 3F); + SmelterSide2.setTextureSize(64, 32); + SmelterSide2.mirror = true; + setRotation(SmelterSide2, 0F, 0F, 0F); + SmelterSide3 = new ModelRenderer(this, 0, 0); + SmelterSide3.addBox(0F, 0F, 0F, 1, 2, 5); + SmelterSide3.setRotationPoint(2F, 16F, -2F); + SmelterSide3.setTextureSize(64, 32); + SmelterSide3.mirror = true; + setRotation(SmelterSide3, 0F, 0F, 0F); + SmelterSide4 = new ModelRenderer(this, 0, 0); + SmelterSide4.addBox(0F, 0F, 0F, 1, 2, 5); + SmelterSide4.setRotationPoint(-3F, 16F, -2F); + SmelterSide4.setTextureSize(64, 32); + SmelterSide4.mirror = true; + setRotation(SmelterSide4, 0F, 0F, 0F); + SmelterSide5 = new ModelRenderer(this, 0, 0); + SmelterSide5.addBox(0F, 0F, 0F, 1, 7, 5); + SmelterSide5.setRotationPoint(3F, 9F, -2F); + SmelterSide5.setTextureSize(64, 32); + SmelterSide5.mirror = true; + setRotation(SmelterSide5, 0F, 0F, 0F); + SmelterSide6 = new ModelRenderer(this, 0, 0); + SmelterSide6.addBox(0F, 0F, 0F, 1, 7, 5); + SmelterSide6.setRotationPoint(-4F, 9F, -2F); + SmelterSide6.setTextureSize(64, 32); + SmelterSide6.mirror = true; + setRotation(SmelterSide6, 0F, 0F, 0F); + SmelterSide7 = new ModelRenderer(this, 0, 0); + SmelterSide7.addBox(0F, 0F, 0F, 1, 7, 1); + SmelterSide7.setRotationPoint(2F, 9F, 3F); + SmelterSide7.setTextureSize(64, 32); + SmelterSide7.mirror = true; + setRotation(SmelterSide7, 0F, 0F, 0F); + SmelterSide8 = new ModelRenderer(this, 0, 0); + SmelterSide8.addBox(0F, 0F, 0F, 1, 7, 1); + SmelterSide8.setRotationPoint(-3F, 9F, 3F); + SmelterSide8.setTextureSize(64, 32); + SmelterSide8.mirror = true; + setRotation(SmelterSide8, 0F, 0F, 0F); + SmelterSide9 = new ModelRenderer(this, 0, 0); + SmelterSide9.addBox(0F, 0F, 0F, 4, 7, 1); + SmelterSide9.setRotationPoint(-2F, 9F, 4F); + SmelterSide9.setTextureSize(64, 32); + SmelterSide9.mirror = true; + setRotation(SmelterSide9, 0F, 0F, 0F); + SmelterSide10 = new ModelRenderer(this, 0, 0); + SmelterSide10.addBox(0F, 0F, 0F, 4, 7, 1); + SmelterSide10.setRotationPoint(-2F, 9F, -4F); + SmelterSide10.setTextureSize(64, 32); + SmelterSide10.mirror = true; + setRotation(SmelterSide10, 0F, 0F, 0F); + SmelterSide11 = new ModelRenderer(this, 0, 0); + SmelterSide11.addBox(0F, 0F, 0F, 1, 7, 1); + SmelterSide11.setRotationPoint(2F, 9F, -3F); + SmelterSide11.setTextureSize(64, 32); + SmelterSide11.mirror = true; + setRotation(SmelterSide11, 0F, 0F, 0F); + SmelterSide12 = new ModelRenderer(this, 0, 0); + SmelterSide12.addBox(0F, 0F, 0F, 1, 7, 1); + SmelterSide12.setRotationPoint(-3F, 9F, -3F); + SmelterSide12.setTextureSize(64, 32); + SmelterSide12.mirror = true; + setRotation(SmelterSide12, 0F, 0F, 0F); + HeatSourceSide1 = new ModelRenderer(this, 0, 0); + HeatSourceSide1.addBox(0F, 0F, 0F, 8, 2, 1); + HeatSourceSide1.setRotationPoint(-4F, 19F, 7F); + HeatSourceSide1.setTextureSize(64, 32); + HeatSourceSide1.mirror = true; + setRotation(HeatSourceSide1, 0F, 0F, 0F); + HeatSourceSide2 = new ModelRenderer(this, 0, 0); + HeatSourceSide2.addBox(0F, 0F, 0F, 1, 2, 12); + HeatSourceSide2.setRotationPoint(-6F, 19F, -6F); + HeatSourceSide2.setTextureSize(64, 32); + HeatSourceSide2.mirror = true; + setRotation(HeatSourceSide2, 0F, 0F, 0F); + HeatSourceSide3 = new ModelRenderer(this, 0, 0); + HeatSourceSide3.addBox(0F, 0F, 0F, 1, 2, 12); + HeatSourceSide3.setRotationPoint(5F, 19F, -6F); + HeatSourceSide3.setTextureSize(64, 32); + HeatSourceSide3.mirror = true; + setRotation(HeatSourceSide3, 0F, 0F, 0F); + HeatSourceSide4 = new ModelRenderer(this, 0, 0); + HeatSourceSide4.addBox(0F, 0F, 0F, 1, 2, 12); + HeatSourceSide4.setRotationPoint(4F, 21F, -6F); + HeatSourceSide4.setTextureSize(64, 32); + HeatSourceSide4.mirror = true; + setRotation(HeatSourceSide4, 0F, 0F, 0F); + HeatSourceSide5 = new ModelRenderer(this, 0, 0); + HeatSourceSide5.addBox(0F, 0F, 0F, 1, 2, 12); + HeatSourceSide5.setRotationPoint(-5F, 21F, -6F); + HeatSourceSide5.setTextureSize(64, 32); + HeatSourceSide5.mirror = true; + setRotation(HeatSourceSide5, 0F, 0F, 0F); + HeatSourceBase = new ModelRenderer(this, 0, 0); + HeatSourceBase.addBox(0F, 0F, 0F, 8, 1, 12); + HeatSourceBase.setRotationPoint(-4F, 23F, -6F); + HeatSourceBase.setTextureSize(64, 32); + HeatSourceBase.mirror = true; + setRotation(HeatSourceBase, 0F, 0F, 0F); + HeatSourceSide6 = new ModelRenderer(this, 0, 0); + HeatSourceSide6.addBox(0F, 0F, 0F, 8, 2, 1); + HeatSourceSide6.setRotationPoint(-4F, 21F, -7F); + HeatSourceSide6.setTextureSize(64, 32); + HeatSourceSide6.mirror = true; + setRotation(HeatSourceSide6, 0F, 0F, 0F); + HeatSourceSide7 = new ModelRenderer(this, 0, 0); + HeatSourceSide7.addBox(0F, 0F, 0F, 8, 2, 1); + HeatSourceSide7.setRotationPoint(-4F, 21F, 6F); + HeatSourceSide7.setTextureSize(64, 32); + HeatSourceSide7.mirror = true; + setRotation(HeatSourceSide7, 0F, 0F, 0F); + HeatSourceSide8 = new ModelRenderer(this, 0, 0); + HeatSourceSide8.addBox(0F, 0F, 0F, 1, 2, 1); + HeatSourceSide8.setRotationPoint(-5F, 19F, 6F); + HeatSourceSide8.setTextureSize(64, 32); + HeatSourceSide8.mirror = true; + setRotation(HeatSourceSide8, 0F, 0F, 0F); + HeatSourceSide9 = new ModelRenderer(this, 0, 0); + HeatSourceSide9.addBox(0F, 0F, 0F, 1, 2, 1); + HeatSourceSide9.setRotationPoint(4F, 19F, 6F); + HeatSourceSide9.setTextureSize(64, 32); + HeatSourceSide9.mirror = true; + setRotation(HeatSourceSide9, 0F, 0F, 0F); + HeatSourceSide10 = new ModelRenderer(this, 0, 0); + HeatSourceSide10.addBox(0F, 0F, 0F, 1, 2, 1); + HeatSourceSide10.setRotationPoint(4F, 19F, -7F); + HeatSourceSide10.setTextureSize(64, 32); + HeatSourceSide10.mirror = true; + setRotation(HeatSourceSide10, 0F, 0F, 0F); + HeatSourceSide11 = new ModelRenderer(this, 0, 0); + HeatSourceSide11.addBox(0F, 0F, 0F, 1, 2, 1); + HeatSourceSide11.setRotationPoint(-5F, 19F, -7F); + HeatSourceSide11.setTextureSize(64, 32); + HeatSourceSide11.mirror = true; + setRotation(HeatSourceSide11, 0F, 0F, 0F); + HeatSourceSide12 = new ModelRenderer(this, 0, 0); + HeatSourceSide12.addBox(0F, 0F, 0F, 8, 2, 1); + HeatSourceSide12.setRotationPoint(-4F, 19F, -8F); + HeatSourceSide12.setTextureSize(64, 32); + HeatSourceSide12.mirror = true; + setRotation(HeatSourceSide12, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5); + Support1.render(f5); + Support2.render(f5); + Hold1.render(f5); + Hold2.render(f5); + SmelterBase.render(f5); + SmelterSide1.render(f5); + SmelterSide2.render(f5); + SmelterSide3.render(f5); + SmelterSide4.render(f5); + SmelterSide5.render(f5); + SmelterSide6.render(f5); + SmelterSide7.render(f5); + SmelterSide8.render(f5); + SmelterSide9.render(f5); + SmelterSide10.render(f5); + SmelterSide11.render(f5); + SmelterSide12.render(f5); + HeatSourceSide1.render(f5); + HeatSourceSide2.render(f5); + HeatSourceSide3.render(f5); + HeatSourceSide4.render(f5); + HeatSourceSide5.render(f5); + HeatSourceBase.render(f5); + HeatSourceSide6.render(f5); + HeatSourceSide7.render(f5); + HeatSourceSide8.render(f5); + HeatSourceSide9.render(f5); + HeatSourceSide10.render(f5); + HeatSourceSide11.render(f5); + HeatSourceSide12.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, null); + } + +} diff --git a/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java b/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java new file mode 100644 index 0000000..57d28fa --- /dev/null +++ b/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java @@ -0,0 +1,22 @@ +package darkknight.jewelrycraft.recipes; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.item.ItemList; + +public class CraftingRecipes +{ + private static boolean isInitialized = false; + + public static void preInit(FMLPreInitializationEvent e) + { + if (!isInitialized) + { + GameRegistry.addRecipe(new ItemStack(ItemList.thiefGloves), "x x", "yxy", "yxy", 'x', ItemList.shadowIngot, 'y', new ItemStack(Block.cloth, 1, 15)); + GameRegistry.addSmelting(BlockList.shadowOre.blockID, new ItemStack(ItemList.shadowIngot), 1.5f); + } + } +} diff --git a/common/darkknight/jewelrycraft/renders/TileEntitySmelterRender.java b/common/darkknight/jewelrycraft/renders/TileEntitySmelterRender.java new file mode 100644 index 0000000..d3cd2ad --- /dev/null +++ b/common/darkknight/jewelrycraft/renders/TileEntitySmelterRender.java @@ -0,0 +1,88 @@ +package darkknight.jewelrycraft.renders; + +import org.lwjgl.opengl.GL11; + +import darkknight.jewelrycraft.model.ModelSmelter; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class TileEntitySmelterRender extends TileEntitySpecialRenderer +{ + ModelSmelter modelSmelter = new ModelSmelter(); + String texture = "textures/tileentities/Smelter.png", lava = "texture/blocks/lava_still.png"; + + @Override + public void renderTileEntityAt (TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); + + ResourceLocation blockTexture = new ResourceLocation("jewelrycraft", texture); + Tessellator tessellator = Tessellator.instance; + ResourceLocation lava = new ResourceLocation(null, "textures/blocks/lava_still.png"); + Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture); + int block = te.getBlockMetadata(); + + GL11.glPushMatrix(); + if(block == 0) GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + else if(block == 1) GL11.glRotatef(180F, 1F, 0.0F, 1F); + else if(block == 2) GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); + else if(block == 3) GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F); + + modelSmelter.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + + //Mrkol's liquid render code base - thank you man for the help :) I used only the top + Minecraft.getMinecraft().renderEngine.bindTexture(lava); + Block.lavaStill.getIcon(3, 0).getInterpolatedU(0); + double minu = Block.lavaStill.getIcon(0, 0).getInterpolatedU(0); + double minv = Block.lavaStill.getIcon(0, 0).getInterpolatedV(0); + double maxu = Block.lavaStill.getIcon(0, 0).getInterpolatedU(16); + double maxv = Block.lavaStill.getIcon(0, 0).getInterpolatedV(16); + GL11.glPushMatrix(); + GL11.glScalef(1f/16f, 1f/16f, 1f/16f); + GL11.glDisable(GL11.GL_LIGHTING); + // without F it scales it down to 0, 0, 0. That's because it is trying to make 0.0625 an integer, and 0.0625 without .0625 is 0. + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(5, 20, 6, maxu, maxv); + tessellator.addVertexWithUV(-5, 20, 6, maxu, minv); + tessellator.addVertexWithUV(-5, 20, -6, minu, minv); + tessellator.addVertexWithUV(5, 20, -6, minu, maxv); + + tessellator.addVertexWithUV(4, 20, -6, maxu, maxv); + tessellator.addVertexWithUV(-4, 20, -6, maxu, minv); + tessellator.addVertexWithUV(-4, 20, -7, minu, minv); + tessellator.addVertexWithUV(4, 20, -7, minu, maxv); + + tessellator.addVertexWithUV(4, 20, 7, maxu, maxv); + tessellator.addVertexWithUV(-4, 20, 7, maxu, minv); + tessellator.addVertexWithUV(-4, 20, 6, minu, minv); + tessellator.addVertexWithUV(4, 20, 6, minu, maxv); + tessellator.draw(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + + GL11.glPopMatrix(); + GL11.glPopMatrix(); + } + + public void adjustLightFixture (World world, int i, int j, int k, Block block) + { + Tessellator tess = Tessellator.instance; + float brightness = block.getBlockBrightness(world, i, j, k); + int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0); + int modulousModifier = skyLight % 65536; + int divModifier = skyLight / 65536; + tess.setColorOpaque_F(brightness, brightness, brightness); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) modulousModifier, divModifier); + } + + +} diff --git a/common/darkknight/jewelrycraft/server/JewelryCraftServer.java b/common/darkknight/jewelrycraft/server/JewelryCraftServer.java new file mode 100644 index 0000000..061175c --- /dev/null +++ b/common/darkknight/jewelrycraft/server/JewelryCraftServer.java @@ -0,0 +1,16 @@ +package darkknight.jewelrycraft.server; + +import net.minecraft.network.INetworkManager; +import net.minecraft.network.packet.Packet250CustomPayload; +import cpw.mods.fml.common.network.IPacketHandler; +import cpw.mods.fml.common.network.Player; + +public class JewelryCraftServer implements IPacketHandler +{ + @Override + public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) + { + // TODO Auto-generated method stub + + } +} diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java b/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java new file mode 100644 index 0000000..fbf7203 --- /dev/null +++ b/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java @@ -0,0 +1,8 @@ +package darkknight.jewelrycraft.tileentity; + +import net.minecraft.tileentity.TileEntity; + +public class TileEntityMolder extends TileEntity +{ + +} diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java b/common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java new file mode 100644 index 0000000..f0c7918 --- /dev/null +++ b/common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java @@ -0,0 +1,72 @@ +package darkknight.jewelrycraft.tileentity; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.packet.Packet; +import net.minecraft.network.packet.Packet132TileEntityData; +import net.minecraft.tileentity.TileEntity; + +public class TileEntitySmelter extends TileEntity +{ + public int moltenMetalID, metalID, melting; + public boolean hasMetal, hasMoltenMetal; + public ItemStack metal; + + public TileEntitySmelter() + { + this.moltenMetalID = 0; + this.metalID = 0; + this.melting = 0; + this.hasMetal = false; + this.hasMoltenMetal= false; + } + + @Override + public void writeToNBT(NBTTagCompound par1) + { + super.writeToNBT(par1); + par1.setInteger("moltenMetalID", moltenMetalID); + par1.setInteger("metalID", metalID); + par1.setInteger("melting", melting); + par1.setBoolean("hasMetal", hasMetal); + par1.setBoolean("hasMoltenMetal", hasMoltenMetal); + } + + @Override + public void readFromNBT(NBTTagCompound par1) + { + super.readFromNBT(par1); + this.moltenMetalID = par1.getInteger("moltenMetalID"); + this.metalID = par1.getInteger("metalID"); + this.melting = par1.getInteger("melting"); + this.hasMetal = par1.getBoolean("hasMetal"); + this.hasMoltenMetal = par1.getBoolean("hasMoltenMetal"); + } + + public void updateEntity() + { + super.updateEntity(); + if(this.hasMetal && !this.hasMoltenMetal) + { + while(melting > 0) + { + this.melting--; + System.out.println(melting); + } + if(melting == 0) + { + this.hasMetal = false; + this.moltenMetalID = metalID; + this.metalID = 0; + this.hasMoltenMetal = true; + } + } + } + + public Packet getDescriptionPacket() + { + NBTTagCompound nbtTag = new NBTTagCompound(); + this.writeToNBT(nbtTag); + return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag); + } +} diff --git a/common/darkknight/jewelrycraft/worldGen/Generation.java b/common/darkknight/jewelrycraft/worldGen/Generation.java new file mode 100644 index 0000000..341b91e --- /dev/null +++ b/common/darkknight/jewelrycraft/worldGen/Generation.java @@ -0,0 +1,45 @@ +package darkknight.jewelrycraft.worldGen; + +import java.util.Random; + + +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.feature.WorldGenMinable; +import cpw.mods.fml.common.IWorldGenerator; +import darkknight.jewelrycraft.block.BlockList; + +public class Generation implements IWorldGenerator +{ + + @Override + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) + { + switch(world.provider.dimensionId){ + case -1: + generateNether(world, random, chunkX * 16, chunkZ * 16); + break; + case 0: + generateSurface(world, random, chunkX * 16, chunkZ * 16); + break; + case 1: + generateEnd(world, random, chunkX * 16, chunkZ * 16); + break; + } + } + + private void generateEnd(World world, Random random, int i, int j) {} + + private void generateSurface(World world, Random random, int i, int j) + { + for(int k = 0; k < 1; k++) { + int x = i + random.nextInt(16); + int y = random.nextInt(5); + int z = j + random.nextInt(16); + (new WorldGenMinable(BlockList.shadowOre.blockID, 1)).generate(world, random, x, y, z); + } + } + + private void generateNether(World world, Random random, int i, int j) {} + +} |
