summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/darkknight/jewelrycraft/JewelrycraftMod.java57
-rw-r--r--common/darkknight/jewelrycraft/block/BlockList.java3
-rw-r--r--common/darkknight/jewelrycraft/block/BlockSmelter.java44
-rw-r--r--common/darkknight/jewelrycraft/config/ConfigHandler.java14
-rw-r--r--common/darkknight/jewelrycraft/model/ModelMolder.java83
-rw-r--r--common/darkknight/jewelrycraft/model/ModelSmelter.java276
-rw-r--r--common/darkknight/jewelrycraft/renders/TileEntitySmelterRender.java88
-rw-r--r--common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java46
-rw-r--r--resources/assets/jewelrycraft/Smelter.tcnbin0 -> 2089 bytes
-rw-r--r--resources/assets/jewelrycraft/lang/en_US.lang2
-rw-r--r--resources/assets/jewelrycraft/textures/blocks/smelter.pngbin0 -> 537 bytes
-rw-r--r--resources/assets/jewelrycraft/textures/tileentities/Molder.pngbin0 -> 1020 bytes
-rw-r--r--resources/assets/jewelrycraft/textures/tileentities/Smelter.pngbin0 -> 886 bytes
13 files changed, 555 insertions, 58 deletions
diff --git a/common/darkknight/jewelrycraft/JewelrycraftMod.java b/common/darkknight/jewelrycraft/JewelrycraftMod.java
index d7a2939..2a63509 100644
--- a/common/darkknight/jewelrycraft/JewelrycraftMod.java
+++ b/common/darkknight/jewelrycraft/JewelrycraftMod.java
@@ -33,29 +33,29 @@ 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)
+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);
- }
- };
-
+ {
+ @Override
+ public ItemStack getIconItemStack()
+ {
+ return new ItemStack(ItemList.shadowIngot, 1, 0);
+ }
+ };
+
@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
@@ -64,59 +64,60 @@ public class JewelrycraftMod implements IConnectionHandler
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/BlockList.java b/common/darkknight/jewelrycraft/block/BlockList.java
index 18bdb5b..e29287d 100644
--- a/common/darkknight/jewelrycraft/block/BlockList.java
+++ b/common/darkknight/jewelrycraft/block/BlockList.java
@@ -2,10 +2,12 @@ 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
@@ -32,6 +34,7 @@ public class BlockList
GameRegistry.registerBlock(jewelCraftingTable, "jewelCraftingTable");
GameRegistry.registerTileEntity(TileEntitySmelter.class, "30");
+ ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender());
}
}
}
diff --git a/common/darkknight/jewelrycraft/block/BlockSmelter.java b/common/darkknight/jewelrycraft/block/BlockSmelter.java
index 2be6743..eb22b63 100644
--- a/common/darkknight/jewelrycraft/block/BlockSmelter.java
+++ b/common/darkknight/jewelrycraft/block/BlockSmelter.java
@@ -3,9 +3,13 @@ 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
@@ -14,19 +18,19 @@ public class BlockSmelter extends BlockContainer
{
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)
{
@@ -37,17 +41,18 @@ public class BlockSmelter extends BlockContainer
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 && item != null && item.getDisplayName().contains("Ingot"))
+ 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));
@@ -57,4 +62,33 @@ public class BlockSmelter extends BlockContainer
}
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/config/ConfigHandler.java b/common/darkknight/jewelrycraft/config/ConfigHandler.java
index e90a69b..be671a3 100644
--- a/common/darkknight/jewelrycraft/config/ConfigHandler.java
+++ b/common/darkknight/jewelrycraft/config/ConfigHandler.java
@@ -8,31 +8,31 @@ 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/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/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/tileentity/TileEntitySmelter.java b/common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java
index 1a9ce66..f0c7918 100644
--- a/common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java
+++ b/common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java
@@ -1,13 +1,17 @@
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;
@@ -16,35 +20,36 @@ public class TileEntitySmelter extends TileEntity
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);
+ 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");
+ 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)
+ if(this.hasMetal && !this.hasMoltenMetal)
{
- while(melting > 0){
+ while(melting > 0)
+ {
this.melting--;
System.out.println(melting);
}
@@ -57,4 +62,11 @@ public class TileEntitySmelter extends TileEntity
}
}
}
+
+ public Packet getDescriptionPacket()
+ {
+ NBTTagCompound nbtTag = new NBTTagCompound();
+ this.writeToNBT(nbtTag);
+ return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag);
+ }
}
diff --git a/resources/assets/jewelrycraft/Smelter.tcn b/resources/assets/jewelrycraft/Smelter.tcn
new file mode 100644
index 0000000..2f6597f
--- /dev/null
+++ b/resources/assets/jewelrycraft/Smelter.tcn
Binary files differ
diff --git a/resources/assets/jewelrycraft/lang/en_US.lang b/resources/assets/jewelrycraft/lang/en_US.lang
index d0489d7..ed9778b 100644
--- a/resources/assets/jewelrycraft/lang/en_US.lang
+++ b/resources/assets/jewelrycraft/lang/en_US.lang
@@ -4,4 +4,4 @@ tile.jewelrycraft.oreShadow.name=Shadow Ore
tile.jewelrycraft.smelter.name=Smelter
tile.jewelrycraft.molder.name=Molder
tile.jewelrycraft.jewelCraftingTable.name=Jewelers Crafting Table
-itemGroup.jewelrycraft.name=Jewelrycraft
+itemGroup.JewelryCraft.name=Jewelrycraft
diff --git a/resources/assets/jewelrycraft/textures/blocks/smelter.png b/resources/assets/jewelrycraft/textures/blocks/smelter.png
new file mode 100644
index 0000000..4da0c0a
--- /dev/null
+++ b/resources/assets/jewelrycraft/textures/blocks/smelter.png
Binary files differ
diff --git a/resources/assets/jewelrycraft/textures/tileentities/Molder.png b/resources/assets/jewelrycraft/textures/tileentities/Molder.png
new file mode 100644
index 0000000..c5acc88
--- /dev/null
+++ b/resources/assets/jewelrycraft/textures/tileentities/Molder.png
Binary files differ
diff --git a/resources/assets/jewelrycraft/textures/tileentities/Smelter.png b/resources/assets/jewelrycraft/textures/tileentities/Smelter.png
new file mode 100644
index 0000000..6ec3595
--- /dev/null
+++ b/resources/assets/jewelrycraft/textures/tileentities/Smelter.png
Binary files differ