diff options
| author | Onyx <sor1n.iliutza16@gmail.com> | 2015-12-01 20:55:30 +0000 |
|---|---|---|
| committer | Onyx <sor1n.iliutza16@gmail.com> | 2015-12-01 20:55:30 +0000 |
| commit | 01c8701b68986ccfa83e902515716838d6829311 (patch) | |
| tree | b21aa78f4df6ca9bac90e2726221114a41f2294a /src/main/java/darkknight/jewelrycraft/tileentity | |
| parent | 35da479288f75d6686c64a00e1dc77e7e7fd50e1 (diff) | |
- Fixed all of the bugs mentioned on github
- Added new config options
- Rabbits paw now increases the chance of spawning hearts, rather than
itself spawning some
- Hearts now have a much lower chance to spawn by default
- You can no longer increase your health past 20 hearts (aka double the
default health)
- The guide now also shows the total number of pages on each tab
- A new luck stat has been added to the Curse API
- Cleaned up the code a bit (removed unused methods, imports etc)
- The displayer's info now has a purple solid color background; the text
also has a much closer shadow and now shrinks in height as well as in
width when too big
- I have modified the potion list to use Mithion's code, credits have
been given
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/tileentity')
15 files changed, 565 insertions, 676 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityCrystal.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityCrystal.java index 9f97969..c7ca018 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityCrystal.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityCrystal.java @@ -3,7 +3,6 @@ */
package darkknight.jewelrycraft.tileentity;
-import org.lwjgl.opengl.GL11;
import darkknight.jewelrycraft.config.ConfigHandler;
import net.minecraft.tileentity.TileEntity;
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java index e8bdb9d..c23ee15 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java @@ -1,133 +1,133 @@ -package darkknight.jewelrycraft.tileentity; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; - -public class TileEntityDisplayer extends TileEntity -{ - public float ringTranslation1, ringTranslation2, ringTranslation3, rotAngle; - public boolean isDescending1, isDescending2, isDescending3, isDirty, hasObject; - public ItemStack object; - public int quantity, infoIndex, timer = 0; - - /** - * - */ - public TileEntityDisplayer() - { - ringTranslation1 = 0.6f; - ringTranslation2 = 0.3f; - ringTranslation3 = 0.0f; - rotAngle = 0; - quantity = 0; - infoIndex = 1; - isDescending1 = false; - isDescending2 = false; - isDescending3 = false; - isDirty = false; - hasObject = false; - object = new ItemStack(Item.getItemById(0), 0, 0); - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setFloat("translation1", ringTranslation1); - nbt.setFloat("translation2", ringTranslation2); - nbt.setFloat("translation3", ringTranslation3); - nbt.setFloat("angle", rotAngle); - nbt.setInteger("quantity", quantity); - nbt.setInteger("infoIndex", infoIndex); - nbt.setBoolean("descending1", isDescending1); - nbt.setBoolean("descending2", isDescending2); - nbt.setBoolean("descending3", isDescending3); - nbt.setBoolean("hasObject", hasObject); - NBTTagCompound tag = new NBTTagCompound(); - object.writeToNBT(tag); - nbt.setTag("object", tag); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - ringTranslation1 = nbt.getFloat("translation1"); - ringTranslation2 = nbt.getFloat("translation2"); - ringTranslation3 = nbt.getFloat("translation3"); - rotAngle = nbt.getFloat("angle"); - quantity = nbt.getInteger("quantity"); - infoIndex = nbt.getInteger("infoIndex"); - isDescending1 = nbt.getBoolean("descending1"); - isDescending2 = nbt.getBoolean("descending2"); - isDescending3 = nbt.getBoolean("descending3"); - hasObject = nbt.getBoolean("hasObject"); - object = new ItemStack(Item.getItemById(0), 0, 0); - object.readFromNBT(nbt.getCompoundTag("object")); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - if (isDirty){ - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - isDirty = false; - } - if (ringTranslation1 >= 0.6) isDescending1 = true; - if (ringTranslation1 <= 0) isDescending1 = false; - if (!isDescending1) ringTranslation1 += 0.03; - if (isDescending1) ringTranslation1 -= 0.03; - if (ringTranslation2 >= 0.6) isDescending2 = true; - if (ringTranslation2 <= 0) isDescending2 = false; - if (!isDescending2) ringTranslation2 += 0.02; - if (isDescending2) ringTranslation2 -= 0.02; - if (ringTranslation3 >= 0.6) isDescending3 = true; - if (ringTranslation3 <= 0) isDescending3 = false; - if (!isDescending3) ringTranslation3 += 0.01; - if (isDescending3) ringTranslation3 -= 0.01; - if (rotAngle < 360F) rotAngle += 3F; - if (rotAngle >= 360F) rotAngle = 0F; - timer++; - if (timer >= 20){ - infoIndex++; - timer = 0; - } - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} +package darkknight.jewelrycraft.tileentity;
+
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.Packet;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.TileEntity;
+
+public class TileEntityDisplayer extends TileEntity
+{
+ public float ringTranslation1, ringTranslation2, ringTranslation3, rotAngle;
+ public boolean isDescending1, isDescending2, isDescending3, isDirty, hasObject;
+ public ItemStack object;
+ public int quantity, infoIndex, timer = 0;
+
+ /**
+ *
+ */
+ public TileEntityDisplayer()
+ {
+ ringTranslation1 = 0.6f;
+ ringTranslation2 = 0.3f;
+ ringTranslation3 = 0.0f;
+ rotAngle = 0;
+ quantity = 0;
+ infoIndex = 1;
+ isDescending1 = false;
+ isDescending2 = false;
+ isDescending3 = false;
+ isDirty = false;
+ hasObject = false;
+ object = new ItemStack(Item.getItemById(0), 0, 0);
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ nbt.setFloat("translation1", ringTranslation1);
+ nbt.setFloat("translation2", ringTranslation2);
+ nbt.setFloat("translation3", ringTranslation3);
+ nbt.setFloat("angle", rotAngle);
+ nbt.setInteger("quantity", quantity);
+ nbt.setInteger("infoIndex", infoIndex);
+ nbt.setBoolean("descending1", isDescending1);
+ nbt.setBoolean("descending2", isDescending2);
+ nbt.setBoolean("descending3", isDescending3);
+ nbt.setBoolean("hasObject", hasObject);
+ NBTTagCompound tag = new NBTTagCompound();
+ object.writeToNBT(tag);
+ nbt.setTag("object", tag);
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ ringTranslation1 = nbt.getFloat("translation1");
+ ringTranslation2 = nbt.getFloat("translation2");
+ ringTranslation3 = nbt.getFloat("translation3");
+ rotAngle = nbt.getFloat("angle");
+ quantity = nbt.getInteger("quantity");
+ infoIndex = nbt.getInteger("infoIndex");
+ isDescending1 = nbt.getBoolean("descending1");
+ isDescending2 = nbt.getBoolean("descending2");
+ isDescending3 = nbt.getBoolean("descending3");
+ hasObject = nbt.getBoolean("hasObject");
+ object = new ItemStack(Item.getItemById(0), 0, 0);
+ object.readFromNBT(nbt.getCompoundTag("object"));
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void updateEntity()
+ {
+ super.updateEntity();
+ if (isDirty){
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ isDirty = false;
+ }
+ if (ringTranslation1 >= 0.6) isDescending1 = true;
+ if (ringTranslation1 <= 0) isDescending1 = false;
+ if (!isDescending1) ringTranslation1 += 0.03;
+ if (isDescending1) ringTranslation1 -= 0.03;
+ if (ringTranslation2 >= 0.6) isDescending2 = true;
+ if (ringTranslation2 <= 0) isDescending2 = false;
+ if (!isDescending2) ringTranslation2 += 0.02;
+ if (isDescending2) ringTranslation2 -= 0.02;
+ if (ringTranslation3 >= 0.6) isDescending3 = true;
+ if (ringTranslation3 <= 0) isDescending3 = false;
+ if (!isDescending3) ringTranslation3 += 0.01;
+ if (isDescending3) ringTranslation3 -= 0.01;
+ if (rotAngle < 360F) rotAngle += 3F;
+ if (rotAngle >= 360F) rotAngle = 0F;
+ timer++;
+ if (timer >= 40){
+ infoIndex++;
+ timer = 0;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public Packet getDescriptionPacket()
+ {
+ NBTTagCompound nbttagcompound = new NBTTagCompound();
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
+ }
+
+ /**
+ * @param net
+ * @param packet
+ */
+ @Override
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
+ {
+ readFromNBT(packet.func_148857_g());
+ worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java index 4ecaf7d..830da74 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java @@ -1,8 +1,10 @@ package darkknight.jewelrycraft.tileentity;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
-import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
@@ -10,9 +12,6 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-import darkknight.jewelrycraft.config.ConfigHandler;
-import darkknight.jewelrycraft.util.JewelryNBT;
-import darkknight.jewelrycraft.util.JewelrycraftUtil;
public class TileEntityJewelrsCraftingTable extends TileEntity
{
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java index da8cc19..b2fe655 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java @@ -1,144 +1,144 @@ -package darkknight.jewelrycraft.tileentity; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.util.JewelryNBT; - -public class TileEntityMolder extends TileEntity -{ - public int cooling; - public boolean hasMoltenMetal, hasJewelBase, hasMold, isDirty; - public ItemStack mold, jewelBase, moltenMetal, ringMetal; - public float quantity; - - /** - * - */ - public TileEntityMolder() - { - moltenMetal = new ItemStack(Item.getItemById(0), 0, 0); - jewelBase = new ItemStack(Item.getItemById(0), 0, 0); - mold = new ItemStack(Item.getItemById(0), 0, 0); - ringMetal = new ItemStack(Item.getItemById(0), 0, 0); - cooling = -1; - quantity = 0f; - hasJewelBase = false; - hasMoltenMetal = false; - hasMold = false; - isDirty = false; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("cooling", cooling); - nbt.setFloat("quantity", quantity); - nbt.setBoolean("hasJewelBase", hasJewelBase); - nbt.setBoolean("hasMoltenMetal", hasMoltenMetal); - nbt.setBoolean("hasMold", hasMold); - NBTTagCompound tag = new NBTTagCompound(); - NBTTagCompound tag1 = new NBTTagCompound(); - NBTTagCompound tag2 = new NBTTagCompound(); - NBTTagCompound tag3 = new NBTTagCompound(); - mold.writeToNBT(tag); - nbt.setTag("mold", tag); - jewelBase.writeToNBT(tag1); - nbt.setTag("jewelBase", tag1); - moltenMetal.writeToNBT(tag2); - nbt.setTag("moltenMetal", tag2); - ringMetal.writeToNBT(tag3); - nbt.setTag("ringMetal", tag3); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - cooling = nbt.getInteger("cooling"); - quantity = nbt.getFloat("quantity"); - hasJewelBase = nbt.getBoolean("hasJewelBase"); - hasMoltenMetal = nbt.getBoolean("hasMoltenMetal"); - hasMold = nbt.getBoolean("hasMold"); - mold = new ItemStack(Item.getItemById(0), 0, 0); - mold.readFromNBT(nbt.getCompoundTag("mold")); - jewelBase = new ItemStack(Item.getItemById(0), 0, 0); - jewelBase.readFromNBT(nbt.getCompoundTag("jewelBase")); - moltenMetal = new ItemStack(Item.getItemById(0), 0, 0); - moltenMetal.readFromNBT(nbt.getCompoundTag("moltenMetal")); - ringMetal = new ItemStack(Item.getItemById(0), 0, 0); - ringMetal.readFromNBT(nbt.getCompoundTag("ringMetal")); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - if (isDirty){ - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - isDirty = false; - } - if (hasMoltenMetal && moltenMetal.getItem() != Item.getItemById(0) && quantity > 0f){ - if (worldObj.rand.nextInt(20) == 0) worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord, "random.fizz", 0.5F, 1F); - for(int l = 0; l < 2; ++l) - worldObj.spawnParticle("reddust", xCoord + Math.random(), (double)yCoord + 0.2F, zCoord + Math.random(), 0.0D, 1.0D, 1.0D); - } - if (hasMoltenMetal && !hasJewelBase && quantity >= 0.1f){ - ringMetal = moltenMetal.copy(); - if (cooling > 0) cooling--; - if (cooling <= 0f){ - if (mold.getItemDamage() == 0) jewelBase = moltenMetal; - else if (mold.getItemDamage() == 1) jewelBase = new ItemStack(ItemList.ring); - else if (mold.getItemDamage() == 2) jewelBase = new ItemStack(ItemList.necklace); - else if (mold.getItemDamage() == 3) jewelBase = new ItemStack(ItemList.bracelet); - else if (mold.getItemDamage() == 4) jewelBase = new ItemStack(ItemList.earrings); - ringMetal.stackSize = 1; - jewelBase.stackSize = 1; - if (mold.getItemDamage() != 0 && jewelBase != new ItemStack(Item.getItemById(0), 0, 0)) JewelryNBT.addMetal(jewelBase, ringMetal); - hasMoltenMetal = false; - moltenMetal = new ItemStack(Item.getItemById(0), 0, 0); - hasJewelBase = true; - cooling = -1; - quantity = 0f; - isDirty = true; - } - } - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} +package darkknight.jewelrycraft.tileentity;
+
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.Packet;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.TileEntity;
+
+public class TileEntityMolder extends TileEntity
+{
+ public int cooling;
+ public boolean hasMoltenMetal, hasJewelBase, hasMold, isDirty;
+ public ItemStack mold, jewelBase, moltenMetal, ringMetal;
+ public float quantity;
+
+ /**
+ *
+ */
+ public TileEntityMolder()
+ {
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ jewelBase = new ItemStack(Item.getItemById(0), 0, 0);
+ mold = new ItemStack(Item.getItemById(0), 0, 0);
+ ringMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ cooling = -1;
+ quantity = 0f;
+ hasJewelBase = false;
+ hasMoltenMetal = false;
+ hasMold = false;
+ isDirty = false;
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ nbt.setInteger("cooling", cooling);
+ nbt.setFloat("quantity", quantity);
+ nbt.setBoolean("hasJewelBase", hasJewelBase);
+ nbt.setBoolean("hasMoltenMetal", hasMoltenMetal);
+ nbt.setBoolean("hasMold", hasMold);
+ NBTTagCompound tag = new NBTTagCompound();
+ NBTTagCompound tag1 = new NBTTagCompound();
+ NBTTagCompound tag2 = new NBTTagCompound();
+ NBTTagCompound tag3 = new NBTTagCompound();
+ mold.writeToNBT(tag);
+ nbt.setTag("mold", tag);
+ jewelBase.writeToNBT(tag1);
+ nbt.setTag("jewelBase", tag1);
+ moltenMetal.writeToNBT(tag2);
+ nbt.setTag("moltenMetal", tag2);
+ ringMetal.writeToNBT(tag3);
+ nbt.setTag("ringMetal", tag3);
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ cooling = nbt.getInteger("cooling");
+ quantity = nbt.getFloat("quantity");
+ hasJewelBase = nbt.getBoolean("hasJewelBase");
+ hasMoltenMetal = nbt.getBoolean("hasMoltenMetal");
+ hasMold = nbt.getBoolean("hasMold");
+ mold = new ItemStack(Item.getItemById(0), 0, 0);
+ mold.readFromNBT(nbt.getCompoundTag("mold"));
+ jewelBase = new ItemStack(Item.getItemById(0), 0, 0);
+ jewelBase.readFromNBT(nbt.getCompoundTag("jewelBase"));
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ moltenMetal.readFromNBT(nbt.getCompoundTag("moltenMetal"));
+ ringMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ ringMetal.readFromNBT(nbt.getCompoundTag("ringMetal"));
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void updateEntity()
+ {
+ super.updateEntity();
+ if (isDirty){
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ isDirty = false;
+ }
+ if (hasMoltenMetal && moltenMetal.getItem() != Item.getItemById(0) && quantity > 0f){
+ if (worldObj.rand.nextInt(20) == 0) worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord, "random.fizz", 0.5F, 1F);
+ for(int l = 0; l < 2; ++l)
+ worldObj.spawnParticle("reddust", xCoord + Math.random(), (double)yCoord + 0.2F, zCoord + Math.random(), 0.0D, 1.0D, 1.0D);
+ }
+ if (hasMoltenMetal && !hasJewelBase && quantity >= 0.1f){
+ ringMetal = moltenMetal.copy();
+ if (cooling > 0) cooling--;
+ if (cooling <= 0f){
+ if (mold.getItemDamage() == 0) jewelBase = moltenMetal;
+ else if (mold.getItemDamage() == 1) jewelBase = new ItemStack(ItemList.ring);
+ else if (mold.getItemDamage() == 2) jewelBase = new ItemStack(ItemList.necklace);
+ else if (mold.getItemDamage() == 3) jewelBase = new ItemStack(ItemList.bracelet);
+ else if (mold.getItemDamage() == 4) jewelBase = new ItemStack(ItemList.earrings);
+ ringMetal.stackSize = 1;
+ jewelBase.stackSize = 1;
+ if (mold.getItemDamage() != 0 && jewelBase != new ItemStack(Item.getItemById(0), 0, 0)) JewelryNBT.addMetal(jewelBase, ringMetal);
+ hasMoltenMetal = false;
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ hasJewelBase = true;
+ cooling = -1;
+ quantity = 0f;
+ isDirty = true;
+ }
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public Packet getDescriptionPacket()
+ {
+ NBTTagCompound nbttagcompound = new NBTTagCompound();
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
+ }
+
+ /**
+ * @param net
+ * @param packet
+ */
+ @Override
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
+ {
+ readFromNBT(packet.func_148857_g());
+ worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMoltenMetal.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMoltenMetal.java index 5da722a..f8efb14 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMoltenMetal.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMoltenMetal.java @@ -3,7 +3,6 @@ */
package darkknight.jewelrycraft.tileentity;
-import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java index f006984..cdc3ac5 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java @@ -1,9 +1,16 @@ package darkknight.jewelrycraft.tileentity;
import java.util.ArrayList;
-
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.block.BlockHandPedestal;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.model.ModelShadowEye;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+import darkknight.jewelrycraft.util.Variables;
import net.minecraft.block.Block;
-import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@@ -17,16 +24,6 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import darkknight.jewelrycraft.block.BlockHandPedestal;
-import darkknight.jewelrycraft.block.BlockList;
-import darkknight.jewelrycraft.config.ConfigHandler;
-import darkknight.jewelrycraft.model.ModelShadowEye;
-import darkknight.jewelrycraft.util.JewelryNBT;
-import darkknight.jewelrycraft.util.JewelrycraftUtil;
-import darkknight.jewelrycraft.util.PlayerUtils;
-import darkknight.jewelrycraft.util.Variables;
public class TileEntityShadowEye extends TileEntity
{
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java index cb3da14..c75d8f0 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java @@ -1,6 +1,9 @@ package darkknight.jewelrycraft.tileentity;
import java.util.Random;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -8,9 +11,6 @@ import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
-import darkknight.jewelrycraft.config.ConfigHandler;
-import darkknight.jewelrycraft.util.JewelryNBT;
-import darkknight.jewelrycraft.util.JewelrycraftUtil;
public class TileEntitySmelter extends TileEntity
{
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java index f36fa84..18f83b9 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java @@ -3,6 +3,10 @@ package darkknight.jewelrycraft.tileentity.renders; import java.awt.Color;
import java.util.HashMap;
import java.util.List;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.model.ModelDisplayer;
+import darkknight.jewelrycraft.tileentity.TileEntityDisplayer;
+import darkknight.jewelrycraft.util.Variables;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
@@ -18,10 +22,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
-import org.lwjgl.opengl.GL11;
-import darkknight.jewelrycraft.model.ModelDisplayer;
-import darkknight.jewelrycraft.tileentity.TileEntityDisplayer;
-import darkknight.jewelrycraft.util.Variables;
public class TileEntityDisplayerRender extends TileEntitySpecialRenderer
{
@@ -48,13 +48,6 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer }
};
- /**
- * @param te
- * @param x
- * @param y
- * @param z
- * @param scale
- */
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale)
{
@@ -132,133 +125,40 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer GL11.glPopMatrix();
}
- /**
- * @param par2Str
- * @param x
- * @param y
- * @param z
- * @param metadata
- * @param te
- * @param color
- */
- protected void renderLabel(String par2Str, double x, double y, double z, int metadata, TileEntity te, int color)
+ protected void renderLabel(String text, double x, double y, double z, int metadata, TileEntity te, int color)
{
FontRenderer fontrenderer = RenderManager.instance.getFontRenderer();
- float var14 = 0.01266667F * 1.5F;
- float var17 = 0.015F;
+ float width = 0.015F, height = 1F;
GL11.glRotatef(180F, 0F, 0F, 1F);
- if (metadata == 0) GL11.glRotatef(0F, 0F, 1F, 0F);
- else if (metadata == 1) GL11.glRotatef(270F, 0F, 1F, 0F);
- else if (metadata == 2) GL11.glRotatef(180F, 0F, 1F, 0F);
- else if (metadata == 3) GL11.glRotatef(90F, 0F, 1F, 0F);
+ GL11.glRotatef(360 - metadata * 90F, 0F, 1F, 0F);
GL11.glTranslatef((float)x, (float)y, (float)z + 0.45F);
- GL11.glScalef(-0.015F, -var14, 0.015F);
+ GL11.glScalef(-0.015F, -0.019F, 0.015F);
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Tessellator tessellator = Tessellator.instance;
GL11.glDisable(GL11.GL_TEXTURE_2D);
- int j = fontrenderer.getStringWidth(par2Str) / 2;
+ int j = fontrenderer.getStringWidth(text) / 2;
tessellator.startDrawingQuads();
- tessellator.setColorRGBA_F(0.0F, 0.2F, 0.2F, 0.9F);
+ tessellator.setColorRGBA_F(0.275F, 0.145F, 0.431F, 0.5F);
tessellator.addVertex(-33.333 - 0, 0D, 0.1D);
tessellator.addVertex(-33.333 - 0, 9D, 0.1D);
tessellator.addVertex(33.333 + 0, 9D, 0.1D);
tessellator.addVertex(33.333 + 0, 0D, 0.1D);
tessellator.draw();
- if (fontrenderer.getStringWidth(par2Str) / 2 > 20) var17 = 0.9F / fontrenderer.getStringWidth(par2Str);
- else var17 = var14;
- int red = color >> 16 & 0xFF;
- int green = color >> 8 & 0xFF;
- int blue = color & 0xFF;
+ if (fontrenderer.getStringWidth(text) / 2 > 20){
+ width = 0.9F / fontrenderer.getStringWidth(text);
+ height = 1F - fontrenderer.getStringWidth(text)/20*0.06F;
+ }
GL11.glTranslatef((float)x + 1f, (float)y + 1f, (float)z);
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glScalef(var17 * 70F, 1F, 0F);
- int i = 15728880;
- int t = i % 65536;
- int k = i / 65536;
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, t / 1.0F, k / 1.0F);
- fontrenderer.drawString(par2Str.replaceFirst("§0", "§r").replaceFirst("§1", "§r").replaceFirst("§2", "§r").replaceFirst("§3", "§r").replaceFirst("§4", "§r").replaceFirst("§5", "§r").replaceFirst("§6", "§r").replaceFirst("§7", "§r").replaceFirst("§8", "§r").replaceFirst("§9", "§r").replaceFirst("§a", "§r").replaceFirst("§b", "§r").replaceFirst("§c", "§r").replaceFirst("§d", "§r").replaceFirst("§e", "§r").replaceFirst("§f", "§r"), -j, 0, 1973790);
+ GL11.glScalef(width * 70F, height, 0F);
+ fontrenderer.drawString(text.replaceFirst("§0", "§r").replaceFirst("§1", "§r").replaceFirst("§2", "§r").replaceFirst("§3", "§r").replaceFirst("§4", "§r").replaceFirst("§5", "§r").replaceFirst("§6", "§r").replaceFirst("§7", "§r").replaceFirst("§8", "§r").replaceFirst("§9", "§r").replaceFirst("§a", "§r").replaceFirst("§b", "§r").replaceFirst("§c", "§r").replaceFirst("§d", "§r").replaceFirst("§e", "§r").replaceFirst("§f", "§r"), -j, 0, 1973790);
GL11.glPopMatrix();
- GL11.glTranslatef((float)x - 1f, (float)y - 1f, (float)z - 1F);
- GL11.glScalef(var17 * 70F, 1F, 0F);
- fontrenderer.drawString(par2Str, -j, 0, color);
- GL11.glDisable(GL11.GL_BLEND);
+ GL11.glTranslatef((float)x - 0.5f, (float)y - 0.5f, (float)z - 0.5F);
+ GL11.glScalef(width * 70F, height, 0F);
+ fontrenderer.drawString(text, -j, 0, color);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
-
- /**
- * @param str
- * @param color
- */
- public void replaceEnumEnchValues(String str, int color)
- {
- if (str.contains("§0")){
- color = Color.BLACK.getRGB();
- str.replace("§0", "");
- }
- if (str.contains("§1")){
- color = 85;
- str.replace("§1", "");
- }
- if (str.contains("§2")){
- color = 17920;
- str.replace("§2", "");
- }
- if (str.contains("§3")){
- color = 1336183;
- str.replace("§3", "");
- }
- if (str.contains("§4")){
- color = 4587520;
- str.replace("§4", "");
- }
- if (str.contains("§5")){
- color = 5701759;
- str.replace("§5", "");
- }
- if (str.contains("§6")){
- color = 16762880;
- str.replace("§6", "");
- }
- if (str.contains("§7")){
- color = Color.GRAY.getRGB();
- str.replace("§7", "");
- }
- if (str.contains("§8")){
- color = Color.DARK_GRAY.getRGB();
- str.replace("§8", "");
- }
- if (str.contains("§9")){
- color = Color.BLUE.getRGB();
- str.replace("§9", "");
- }
- if (str.contains("§a")){
- color = Color.GREEN.getRGB();
- str.replace("§a", "");
- }
- if (str.contains("§b")){
- color = Color.CYAN.getRGB();
- str.replace("§b", "");
- }
- if (str.contains("§c")){
- color = Color.RED.getRGB();
- str.replace("§c", "");
- }
- if (str.contains("§d")){
- color = 11665663;
- str.replace("§d", "");
- }
- if (str.contains("§e")){
- color = Color.YELLOW.getRGB();
- str.replace("§e", "");
- }
- if (str.contains("§f")){
- color = Color.WHITE.getRGB();
- str.replace("§f", "");
- }
- }
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java index ac98ca6..d639d93 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java @@ -1,47 +1,47 @@ -package darkknight.jewelrycraft.tileentity.renders; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; -import darkknight.jewelrycraft.model.ModelHandPedestal; -import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal; - -/** - * @author Paul Fulham (pau101) - */ -public class TileEntityHandPedestalRender extends TileEntitySpecialRenderer -{ - private ModelHandPedestal model; - private ResourceLocation texture; - - /** - * @param model - * @param texture - */ - public TileEntityHandPedestalRender(ModelHandPedestal model, ResourceLocation texture) - { - this.model = model; - this.texture = texture; - } - - /** - * @param te - * @param x - * @param y - * @param z - * @param partialRenderTicks - */ - @Override - public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialRenderTicks) - { - GL11.glPushMatrix(); - GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); - TileEntityHandPedestal pedestal = (TileEntityHandPedestal)te; - bindTexture(texture); - GL11.glRotatef(180, 0, 0, 1); - GL11.glRotatef(pedestal.getWorldObj() == null ? 180 : pedestal.getBlockMetadata() % 8 / 8F * 360, 0, 1, 0); - model.render(pedestal, partialRenderTicks, 0.0625F); - GL11.glPopMatrix(); - } +package darkknight.jewelrycraft.tileentity.renders;
+
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.model.ModelHandPedestal;
+import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+
+/**
+ * @author Paul Fulham (pau101)
+ */
+public class TileEntityHandPedestalRender extends TileEntitySpecialRenderer
+{
+ private ModelHandPedestal model;
+ private ResourceLocation texture;
+
+ /**
+ * @param model
+ * @param texture
+ */
+ public TileEntityHandPedestalRender(ModelHandPedestal model, ResourceLocation texture)
+ {
+ this.model = model;
+ this.texture = texture;
+ }
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param partialRenderTicks
+ */
+ @Override
+ public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialRenderTicks)
+ {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
+ TileEntityHandPedestal pedestal = (TileEntityHandPedestal)te;
+ bindTexture(texture);
+ GL11.glRotatef(180, 0, 0, 1);
+ GL11.glRotatef(pedestal.getWorldObj() == null ? 180 : pedestal.getBlockMetadata() % 8 / 8F * 360, 0, 1, 0);
+ model.render(pedestal, partialRenderTicks, 0.0625F);
+ GL11.glPopMatrix();
+ }
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java index 248ac2e..02b12aa 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java @@ -1,137 +1,137 @@ -package darkknight.jewelrycraft.tileentity.renders; - -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.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import org.lwjgl.opengl.GL11; -import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; -import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; -import darkknight.jewelrycraft.util.Variables; - -public class TileEntityJewelrsCraftingTableRender extends TileEntitySpecialRenderer -{ - ModelJewlersCraftingBench modelTable = new ModelJewlersCraftingBench(); - String texture = "textures/tileentities/JewelrsCraftingBench.png"; - - /** - * @param te - * @param x - * @param y - * @param z - * @param scale - */ - @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(Variables.MODID, texture); - Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture); - TileEntityJewelrsCraftingTable jt = (TileEntityJewelrsCraftingTable)te; - GL11.glPushMatrix(); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - try{ - int block = te.getBlockMetadata(); - if (block == 1) GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F); - else if (block == 2){ - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); - }else if (block == 3){ - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F); - } - } - catch(Exception e){} - modelTable.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - if (jt != null){ - if (jt.hasJewelry && jt.jewelry.getIconIndex() != null && jt.jewelry.getIconIndex().getIconName() != ""){ - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, jt.jewelry); - entityitem.getEntityItem().stackSize = 1; - entityitem.hoverStart = 0.0F; - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glTranslatef(0.55F, -1.5F, -0.45F); - GL11.glRotatef(jt.angle, 0F, 1F, 0F); - if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - else{ - GL11.glRotatef(180F, 0F, 1F, 0F); - RenderManager.instance.options.fancyGraphics = true; - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - RenderManager.instance.options.fancyGraphics = false; - } - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - } - if (jt.hasEndItem && jt.endItem.getIconIndex().getIconName() != ""){ - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, jt.endItem); - entityitem.getEntityItem().stackSize = 1; - entityitem.hoverStart = 0.0F; - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glTranslatef(0.0F, -1.6F, 0.6F); - GL11.glRotatef(jt.angle, 0F, 1F, 0F); - if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - else{ - GL11.glRotatef(180F, 0F, 1F, 0F); - RenderManager.instance.options.fancyGraphics = true; - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - RenderManager.instance.options.fancyGraphics = false; - } - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - } - if (jt.hasGem && jt.gem.getIconIndex().getIconName() != ""){ - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, jt.gem); - entityitem.getEntityItem().stackSize = 1; - entityitem.hoverStart = 0.0F; - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glTranslatef(-0.55F, -1.5F, -0.45F); - GL11.glRotatef(jt.angle, 0F, 1F, 0F); - if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - else{ - GL11.glRotatef(180F, 0F, 1F, 0F); - RenderManager.instance.options.fancyGraphics = true; - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - RenderManager.instance.options.fancyGraphics = false; - } - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - } - } - GL11.glPopMatrix(); - GL11.glPopMatrix(); - } - - /** - * @param world - * @param i - * @param j - * @param k - * @param block - */ - public void adjustLightFixture(World world, int i, int j, int k, Block block) - { - Tessellator tess = Tessellator.instance; - float brightness = block.getLightOpacity(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, modulousModifier, divModifier); - } -} +package darkknight.jewelrycraft.tileentity.renders;
+
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.model.ModelJewlersCraftingBench;
+import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable;
+import darkknight.jewelrycraft.util.Variables;
+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.entity.RenderManager;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+
+public class TileEntityJewelrsCraftingTableRender extends TileEntitySpecialRenderer
+{
+ ModelJewlersCraftingBench modelTable = new ModelJewlersCraftingBench();
+ String texture = "textures/tileentities/JewelrsCraftingBench.png";
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param scale
+ */
+ @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(Variables.MODID, texture);
+ Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ TileEntityJewelrsCraftingTable jt = (TileEntityJewelrsCraftingTable)te;
+ GL11.glPushMatrix();
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ try{
+ int block = te.getBlockMetadata();
+ if (block == 1) GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
+ else if (block == 2){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
+ }else if (block == 3){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F);
+ }
+ }
+ catch(Exception e){}
+ modelTable.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
+ if (jt != null){
+ if (jt.hasJewelry && jt.jewelry.getIconIndex() != null && jt.jewelry.getIconIndex().getIconName() != ""){
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, jt.jewelry);
+ entityitem.getEntityItem().stackSize = 1;
+ entityitem.hoverStart = 0.0F;
+ GL11.glRotatef(180F, 1F, 0F, 0F);
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ GL11.glTranslatef(0.55F, -1.5F, -0.45F);
+ GL11.glRotatef(jt.angle, 0F, 1F, 0F);
+ if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ else{
+ GL11.glRotatef(180F, 0F, 1F, 0F);
+ RenderManager.instance.options.fancyGraphics = true;
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.options.fancyGraphics = false;
+ }
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ if (jt.hasEndItem && jt.endItem.getIconIndex().getIconName() != ""){
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, jt.endItem);
+ entityitem.getEntityItem().stackSize = 1;
+ entityitem.hoverStart = 0.0F;
+ GL11.glRotatef(180F, 1F, 0F, 0F);
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ GL11.glTranslatef(0.0F, -1.6F, 0.6F);
+ GL11.glRotatef(jt.angle, 0F, 1F, 0F);
+ if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ else{
+ GL11.glRotatef(180F, 0F, 1F, 0F);
+ RenderManager.instance.options.fancyGraphics = true;
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.options.fancyGraphics = false;
+ }
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ if (jt.hasGem && jt.gem.getIconIndex().getIconName() != ""){
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, jt.gem);
+ entityitem.getEntityItem().stackSize = 1;
+ entityitem.hoverStart = 0.0F;
+ GL11.glRotatef(180F, 1F, 0F, 0F);
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ GL11.glTranslatef(-0.55F, -1.5F, -0.45F);
+ GL11.glRotatef(jt.angle, 0F, 1F, 0F);
+ if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ else{
+ GL11.glRotatef(180F, 0F, 1F, 0F);
+ RenderManager.instance.options.fancyGraphics = true;
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.options.fancyGraphics = false;
+ }
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ }
+ GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param block
+ */
+ public void adjustLightFixture(World world, int i, int j, int k, Block block)
+ {
+ Tessellator tess = Tessellator.instance;
+ float brightness = block.getLightOpacity(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, modulousModifier, divModifier);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMidasTouchRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMidasTouchRender.java index 286780f..786568a 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMidasTouchRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMidasTouchRender.java @@ -1,32 +1,32 @@ -package darkknight.jewelrycraft.tileentity.renders; - -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.passive.EntityPig; -import net.minecraft.tileentity.TileEntity; -import org.lwjgl.opengl.GL11; -import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; - -public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer -{ - @Override - public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) - { - GL11.glPushMatrix(); - TileEntityMidasTouch midas = (TileEntityMidasTouch)te; - if (midas.target != null){ - EntityLiving target = ((EntityLiving)midas.target); - target.hurtTime = 0; - GL11.glTranslatef(0.5F, 0.0F, 0.5F); - GL11.glColor3f(1.0F, 1.0F, 0.0F); - RenderManager.instance.renderEntityWithPosYaw(target, midas.xCoord - RenderManager.instance.renderPosX, midas.yCoord - RenderManager.instance.renderPosY, midas.zCoord - RenderManager.instance.renderPosZ, 0F, 1F); - } - else{ - GL11.glTranslatef(0.5F, 0.0F, 0.5F); - GL11.glColor3f(1.0F, 1.0F, 0.0F); - RenderManager.instance.renderEntityWithPosYaw(new EntityPig(te.getWorldObj()), midas.xCoord - RenderManager.instance.renderPosX, midas.yCoord - RenderManager.instance.renderPosY, midas.zCoord - RenderManager.instance.renderPosZ, 0F, 1F); - } - GL11.glPopMatrix(); - } -} +package darkknight.jewelrycraft.tileentity.renders;
+
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.passive.EntityPig;
+import net.minecraft.tileentity.TileEntity;
+
+public class TileEntityMidasTouchRender extends TileEntitySpecialRenderer
+{
+ @Override
+ public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale)
+ {
+ GL11.glPushMatrix();
+ TileEntityMidasTouch midas = (TileEntityMidasTouch)te;
+ if (midas.target != null){
+ EntityLiving target = ((EntityLiving)midas.target);
+ target.hurtTime = 0;
+ GL11.glTranslatef(0.5F, 0.0F, 0.5F);
+ GL11.glColor3f(1.0F, 1.0F, 0.0F);
+ RenderManager.instance.renderEntityWithPosYaw(target, midas.xCoord - RenderManager.instance.renderPosX, midas.yCoord - RenderManager.instance.renderPosY, midas.zCoord - RenderManager.instance.renderPosZ, 0F, 1F);
+ }
+ else{
+ GL11.glTranslatef(0.5F, 0.0F, 0.5F);
+ GL11.glColor3f(1.0F, 1.0F, 0.0F);
+ RenderManager.instance.renderEntityWithPosYaw(new EntityPig(te.getWorldObj()), midas.xCoord - RenderManager.instance.renderPosX, midas.yCoord - RenderManager.instance.renderPosY, midas.zCoord - RenderManager.instance.renderPosZ, 0F, 1F);
+ }
+ GL11.glPopMatrix();
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java index 6067e2a..51e0677 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java @@ -1,5 +1,12 @@ package darkknight.jewelrycraft.tileentity.renders;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.model.ModelMolder;
+import darkknight.jewelrycraft.tileentity.TileEntityMolder;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.Variables;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
@@ -15,13 +22,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
-import org.lwjgl.opengl.GL11;
-import darkknight.jewelrycraft.JewelrycraftMod;
-import darkknight.jewelrycraft.item.ItemList;
-import darkknight.jewelrycraft.model.ModelMolder;
-import darkknight.jewelrycraft.tileentity.TileEntityMolder;
-import darkknight.jewelrycraft.util.JewelryNBT;
-import darkknight.jewelrycraft.util.Variables;
public class TileEntityMolderRender extends TileEntitySpecialRenderer
{
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java index 82cffbb..e347901 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java @@ -1,5 +1,11 @@ package darkknight.jewelrycraft.tileentity.renders;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.util.glu.GLU;
+import org.lwjgl.util.glu.Sphere;
+import darkknight.jewelrycraft.model.ModelShadowEye;
+import darkknight.jewelrycraft.tileentity.TileEntityShadowEye;
+import darkknight.jewelrycraft.util.Variables;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
@@ -9,17 +15,8 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
-import net.minecraft.util.Vec3;
import net.minecraft.world.World;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.glu.GLU;
-import org.lwjgl.util.glu.Sphere;
-
-import darkknight.jewelrycraft.model.ModelShadowEye;
-import darkknight.jewelrycraft.tileentity.TileEntityShadowEye;
-import darkknight.jewelrycraft.util.Variables;
-
public class TileEntityShadowEyeRender extends TileEntitySpecialRenderer
{
ModelShadowEye eye = new ModelShadowEye();
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java index d0e2799..85a90d2 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java @@ -1,20 +1,20 @@ -package darkknight.jewelrycraft.tileentity.renders; - -import net.minecraft.util.ResourceLocation; -import darkknight.jewelrycraft.model.ModelHandPedestal; - -/** - * @author Paul Fulham (pau101) - */ -public class TileEntityShadowHandRender extends TileEntityHandPedestalRender -{ - - /** - * @param model - * @param texture - */ - public TileEntityShadowHandRender(ModelHandPedestal model, ResourceLocation texture) - { - super(model, texture); - } +package darkknight.jewelrycraft.tileentity.renders;
+
+import darkknight.jewelrycraft.model.ModelHandPedestal;
+import net.minecraft.util.ResourceLocation;
+
+/**
+ * @author Paul Fulham (pau101)
+ */
+public class TileEntityShadowHandRender extends TileEntityHandPedestalRender
+{
+
+ /**
+ * @param model
+ * @param texture
+ */
+ public TileEntityShadowHandRender(ModelHandPedestal model, ResourceLocation texture)
+ {
+ super(model, texture);
+ }
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java index 3db99c8..fa98f2c 100644 --- a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java @@ -1,6 +1,12 @@ package darkknight.jewelrycraft.tileentity.renders;
-import net.minecraft.block.Block;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.model.ModelSmelter;
+import darkknight.jewelrycraft.tileentity.TileEntitySmelter;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.Variables;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.entity.RenderItem;
@@ -9,17 +15,9 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
-import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
-import org.lwjgl.opengl.GL11;
-import darkknight.jewelrycraft.JewelrycraftMod;
-import darkknight.jewelrycraft.item.ItemList;
-import darkknight.jewelrycraft.model.ModelSmelter;
-import darkknight.jewelrycraft.tileentity.TileEntitySmelter;
-import darkknight.jewelrycraft.util.JewelryNBT;
-import darkknight.jewelrycraft.util.Variables;
public class TileEntitySmelterRender extends TileEntitySpecialRenderer
{
|
