summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2014-03-08 22:16:06 +0200
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2014-03-08 22:16:06 +0200
commit3e0556ee7aadfbb7695f87063662a9ca0d28175f (patch)
tree3a5ab57ce1e64e002fc22e16e91ae62a573d5f45
parent05b5b13256c420568d1f07ed634dfd47509d53f2 (diff)
Lots of new things
-rw-r--r--common/darkknight/jewelrycraft/CreativeTabRings.java57
-rw-r--r--common/darkknight/jewelrycraft/JewelrycraftMod.java9
-rw-r--r--common/darkknight/jewelrycraft/block/BlockCrystalizer.java99
-rw-r--r--common/darkknight/jewelrycraft/config/ConfigHandler.java2
-rw-r--r--common/darkknight/jewelrycraft/item/ItemCrystal.java59
-rw-r--r--common/darkknight/jewelrycraft/item/ItemList.java7
-rw-r--r--common/darkknight/jewelrycraft/item/ItemRing.java94
-rw-r--r--common/darkknight/jewelrycraft/recipes/CraftingRecipes.java13
-rw-r--r--common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java81
-rw-r--r--common/darkknight/jewelrycraft/tileentity/TileEntityCrystalizer.java143
-rw-r--r--common/darkknight/jewelrycraft/util/JewelryNBT.java62
-rw-r--r--common/darkknight/jewelrycraft/util/JewelrycraftUtil.java12
-rw-r--r--common/darkknight/jewelrycraft/worldGen/Generation.java3
-rw-r--r--common/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java47
-rw-r--r--common/darkknight/jewelrycraft/worldGen/village/JCTrades.java58
-rw-r--r--resources/assets/jewelrycraft/Changelog.txt80
-rw-r--r--resources/assets/jewelrycraft/lang/en_US.lang2
-rw-r--r--resources/assets/jewelrycraft/textures/blocks/oreShadow.pngbin1882 -> 462 bytes
-rw-r--r--resources/assets/jewelrycraft/textures/items/crystal.pngbin305 -> 285 bytes
-rw-r--r--resources/assets/jewelrycraft/textures/items/crystalOverlay.pngbin312 -> 274 bytes
20 files changed, 462 insertions, 366 deletions
diff --git a/common/darkknight/jewelrycraft/CreativeTabRings.java b/common/darkknight/jewelrycraft/CreativeTabRings.java
new file mode 100644
index 0000000..2236943
--- /dev/null
+++ b/common/darkknight/jewelrycraft/CreativeTabRings.java
@@ -0,0 +1,57 @@
+package darkknight.jewelrycraft;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.oredict.OreDictionary;
+
+public class CreativeTabRings extends CreativeTabs
+{
+ public static ArrayList<ItemStack> metal = new ArrayList<ItemStack>();
+
+ public CreativeTabRings(String par2Str)
+ {
+ super(par2Str);
+ }
+
+ @Override
+ public ItemStack getIconItemStack()
+ {
+ ItemStack ring = new ItemStack(ItemList.ring);
+ JewelryNBT.addMetal(ring, JewelrycraftUtil.metal.get(0));
+ JewelryNBT.addModifier(ring, JewelrycraftUtil.modifiers.get(3));
+ JewelryNBT.addJewel(ring, JewelrycraftUtil.jewel.get(2));
+ return ring;
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public void displayAllReleventItems(List par1List)
+ {
+ int index = 0, index2 = 0;
+ while(index < OreDictionary.getOreNames().length)
+ {
+ while(index2 < OreDictionary.getOres(OreDictionary.getOreNames()[index]).size())
+ {
+ if(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2).getUnlocalizedName().toLowerCase().contains("ingot") && !metal.contains(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2)))
+ metal.add(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2));
+ index2++;
+ }
+ index2 = 0;
+ index++;
+ }
+ if(!metal.contains(new ItemStack(Item.ingotGold)))metal.add(new ItemStack(Item.ingotGold));
+ if(!metal.contains(new ItemStack(Item.ingotIron)))metal.add(new ItemStack(Item.ingotIron));
+ for(int i = 0; i < metal.size(); i++)
+ for(int j = 0; j < JewelrycraftUtil.modifiers.size(); j++)
+ for(int k = 0; k < JewelrycraftUtil.jewel.size(); k++)
+ par1List.add(ItemList.ring.getModifiedItemStack(metal.get(i), JewelrycraftUtil.modifiers.get(j),JewelrycraftUtil.jewel.get(k)));
+ }
+
+}
diff --git a/common/darkknight/jewelrycraft/JewelrycraftMod.java b/common/darkknight/jewelrycraft/JewelrycraftMod.java
index 29fe6a2..5191047 100644
--- a/common/darkknight/jewelrycraft/JewelrycraftMod.java
+++ b/common/darkknight/jewelrycraft/JewelrycraftMod.java
@@ -69,9 +69,10 @@ public class JewelrycraftMod implements IConnectionHandler
@Override
public ItemStack getIconItemStack()
{
- return new ItemStack(ItemList.ring, 1, 0);
+ return new ItemStack(BlockList.jewelCraftingTable);
}
};
+ public static CreativeTabs rings = new CreativeTabRings("Rings");
@EventHandler
public void preInit(FMLPreInitializationEvent e)
@@ -80,7 +81,8 @@ public class JewelrycraftMod implements IConnectionHandler
ItemList.preInit(e);
BlockList.preInit(e);
CraftingRecipes.preInit(e);
- JewelrycraftUtil.addMetals();
+ OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot));
+ OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre));
VillagerRegistry.instance().registerVillagerId(3000);
VillagerRegistry.instance().registerVillageTradeHandler(3000, new JCTrades());
@@ -100,8 +102,6 @@ public class JewelrycraftMod implements IConnectionHandler
@EventHandler
public void init(FMLInitializationEvent e)
{
- OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot));
- OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre));
GameRegistry.registerWorldGenerator(new Generation());
new GuiHandler();
}
@@ -109,6 +109,7 @@ public class JewelrycraftMod implements IConnectionHandler
@EventHandler
public void postInit(FMLPostInitializationEvent e)
{
+ JewelrycraftUtil.addMetals();
JewelrycraftUtil.addStuff();
JewelrycraftUtil.jamcrafters();
}
diff --git a/common/darkknight/jewelrycraft/block/BlockCrystalizer.java b/common/darkknight/jewelrycraft/block/BlockCrystalizer.java
deleted file mode 100644
index c6ea205..0000000
--- a/common/darkknight/jewelrycraft/block/BlockCrystalizer.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package darkknight.jewelrycraft.block;
-
-import java.util.Random;
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IconRegister;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import darkknight.jewelrycraft.tileentity.*;
-
-public class BlockCrystalizer extends BlockContainer
-{
- Random rand = new Random();
-
- protected BlockCrystalizer(int par1, Material par2Material)
- {
- super(par1, par2Material);
- this.setBlockBounds(0.0F, 0F, 0.0F, 1.0F, 0.8F, 1.0F);
- }
-
- @Override
- public TileEntity createNewTileEntity(World world)
- {
- return new TileEntityCrystalizer();
- }
-
- @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)
- {
- TileEntityCrystalizer te = (TileEntityCrystalizer) world.getBlockTileEntity(i, j, k);
- ItemStack item = entityPlayer.inventory.getCurrentItem();
- if (te != null && !world.isRemote)
- {
- }
- return true;
- }
-
- public void dropItem(World world, double x, double y, double z, ItemStack stack)
- {
- EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 1D, z + 0.5D, stack);
- entityitem.motionX = 0;
- entityitem.motionZ = 0;
- entityitem.motionY = 0.21000000298023224D;
- world.spawnEntityInWorld(entityitem);
- }
-
- public void breakBlock(World world, int i, int j, int k, int par5, int par6)
- {
- TileEntityCrystalizer te = (TileEntityCrystalizer) world.getBlockTileEntity(i, j, k);
- if (te != null)
- {
- world.markTileEntityForDespawn(te);
- }
- super.breakBlock(world, i, j, k, par5, par6);
- }
-
- @Override
- public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player)
- {
- TileEntityCrystalizer te = (TileEntityCrystalizer) world.getBlockTileEntity(i, j, k);
- if (te != null && !world.isRemote)
- {
- }
- }
-
- @Override
- public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
- {
- return false;
- }
-
- @Override
- public boolean isOpaqueCube()
- {
- return false;
- }
-
- @Override
- public int getRenderType()
- {
- return -1;
- }
-
- @Override
- public void registerIcons(IconRegister icon)
- {
- this.blockIcon = icon.registerIcon("jewelrycraft:crystalizer");
- }
-}
diff --git a/common/darkknight/jewelrycraft/config/ConfigHandler.java b/common/darkknight/jewelrycraft/config/ConfigHandler.java
index 648d0bd..24450f9 100644
--- a/common/darkknight/jewelrycraft/config/ConfigHandler.java
+++ b/common/darkknight/jewelrycraft/config/ConfigHandler.java
@@ -11,6 +11,7 @@ public class ConfigHandler
public static int idMolds = 17495;
public static int idRing = 17496;
public static int idClayMolds = 17497;
+ public static int idCrystal = 17498;
public static int idShadowOre = 1750;
public static int idSmelter = 1751;
@@ -39,6 +40,7 @@ public class ConfigHandler
idMolds = config.getItem("Molds", idMolds).getInt();
idClayMolds = config.getItem("Clay Molds", idClayMolds).getInt();
idRing = config.getItem("Ring", idRing).getInt();
+ idCrystal = config.getItem("Crystal", idCrystal).getInt();
idShadowOre = config.getBlock("Shadow Ore", idShadowOre).getInt();
idShadowBlock = config.getBlock("Shadow Block", idShadowBlock).getInt();
diff --git a/common/darkknight/jewelrycraft/item/ItemCrystal.java b/common/darkknight/jewelrycraft/item/ItemCrystal.java
new file mode 100644
index 0000000..325c2ce
--- /dev/null
+++ b/common/darkknight/jewelrycraft/item/ItemCrystal.java
@@ -0,0 +1,59 @@
+package darkknight.jewelrycraft.item;
+
+import java.util.List;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.Icon;
+
+public class ItemCrystal extends Item
+{
+ public Icon overlay;
+ public static final int[] dyeColors = new int[] {1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320};
+
+ public ItemCrystal(int par1)
+ {
+ super(par1);
+ this.setHasSubtypes(true);
+ this.setMaxDamage(0);
+ }
+
+ public void registerIcons(IconRegister iconRegister)
+ {
+ itemIcon = iconRegister.registerIcon("jewelrycraft:crystal");
+ overlay = iconRegister.registerIcon("jewelrycraft:crystalOverlay");
+ }
+
+ @Override
+ public boolean requiresMultipleRenderPasses()
+ {
+ return true;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public int getColorFromItemStack(ItemStack stack, int pass)
+ {
+ if(pass == 1 && this.getDamage(stack) != 16) return dyeColors[this.getDamage(stack)];
+ return 16777215;
+ }
+
+ public Icon getIcon(ItemStack stack, int pass)
+ {
+ return pass == 0 ? itemIcon : overlay;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
+ {
+ for (int j = 0; j < 16; ++j)
+ {
+ par3List.add(new ItemStack(par1, 1, j));
+ }
+ }
+
+}
diff --git a/common/darkknight/jewelrycraft/item/ItemList.java b/common/darkknight/jewelrycraft/item/ItemList.java
index 83bf91b..027f0a6 100644
--- a/common/darkknight/jewelrycraft/item/ItemList.java
+++ b/common/darkknight/jewelrycraft/item/ItemList.java
@@ -12,7 +12,8 @@ public class ItemList
public static Item shadowIngot;
public static Item molds;
public static Item clayMolds;
- public static Item ring;
+ public static Item crystal;
+ public static ItemRing ring;
private static boolean isInitialized = false;
@@ -24,13 +25,15 @@ public class ItemList
shadowIngot = new Item(ConfigHandler.idShadowIngot - 256).setUnlocalizedName("Jewelrycraft.ingotShadow").setTextureName("jewelrycraft:ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft);
molds = new ItemMolds(ConfigHandler.idMolds - 256).setUnlocalizedName("Jewelrycraft.mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft);
clayMolds = new ItemClayMolds(ConfigHandler.idClayMolds - 256).setUnlocalizedName("Jewelrycraft.mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft);
- ring = new ItemRing(ConfigHandler.idRing - 256).setUnlocalizedName("Jewelrycraft.ring").setTextureName("jewelrycraft:ring").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ ring = (ItemRing) new ItemRing(ConfigHandler.idRing - 256).setUnlocalizedName("Jewelrycraft.ring").setTextureName("jewelrycraft:ring");
+ crystal = new ItemCrystal(ConfigHandler.idCrystal - 256).setUnlocalizedName("Jewelrycraft.crystal").setTextureName("jewelrycraft:crystal").setCreativeTab(JewelrycraftMod.jewelrycraft);
GameRegistry.registerItem(thiefGloves, "thiefGloves");
GameRegistry.registerItem(shadowIngot, "shadowIngot");
GameRegistry.registerItem(molds, "molds");
GameRegistry.registerItem(clayMolds, "clayMolds");
GameRegistry.registerItem(ring, "ring");
+ GameRegistry.registerItem(crystal, "crystal");
isInitialized = true;
}
diff --git a/common/darkknight/jewelrycraft/item/ItemRing.java b/common/darkknight/jewelrycraft/item/ItemRing.java
index 184d3f3..bb09d69 100644
--- a/common/darkknight/jewelrycraft/item/ItemRing.java
+++ b/common/darkknight/jewelrycraft/item/ItemRing.java
@@ -64,11 +64,11 @@ public class ItemRing extends Item
}
@SideOnly(Side.CLIENT)
- public int getColorFromItemStack(ItemStack par1ItemStack, int pass)
+ public int getColorFromItemStack(ItemStack stack, int pass)
{
try
{
- return color(par1ItemStack, pass);
+ return color(stack, pass);
}
catch (IOException e)
{
@@ -79,7 +79,8 @@ public class ItemRing extends Item
public Icon getIcon(ItemStack stack, int pass)
{
- if (JewelryNBT.jewel(stack) != null) return pass == 0 ? itemIcon : jewel;
+ if(pass == 0) return itemIcon;
+ if(pass == 1 && JewelryNBT.jewel(stack) != null) return jewel;
return itemIcon;
}
@@ -87,7 +88,8 @@ public class ItemRing extends Item
{
String domain = "", texture;
ResourceManager rm = Minecraft.getMinecraft().getResourceManager();
- if (pass == 1 && JewelryNBT.ingot(stack) != null && JewelryNBT.jewel(stack) == null)
+ int x=0, y=0, ok = 0;
+ if (pass == 0 && JewelryNBT.ingot(stack) != null)
{
if (JewelryNBT.ingot(stack).getIconIndex().getIconName().substring(0, JewelryNBT.ingot(stack).getIconIndex().getIconName().indexOf(":") + 1) != "") domain = JewelryNBT.ingot(stack).getIconIndex().getIconName().substring(0, JewelryNBT.ingot(stack).getIconIndex().getIconName().indexOf(":") + 1).replace(":", " ").trim();
else domain = "minecraft";
@@ -96,30 +98,52 @@ public class ItemRing extends Item
if (JewelryNBT.ingot(stack).getUnlocalizedName().contains("item")) ingot = new ResourceLocation(domain, "textures/items/" + texture);
else ingot = new ResourceLocation(domain, "textures/blocks/" + texture);
BufferedImage bufferedimage = ImageIO.read(rm.getResource(ingot).getInputStream());
- return bufferedimage.getRGB(9, 9);
+ while(ok == 0){
+ int red = (bufferedimage.getRGB(x, y) >> 16) & 0xFF;
+ int green = (bufferedimage.getRGB(x, y) >> 8) & 0xFF;
+ int blue = bufferedimage.getRGB(x, y) & 0xFF;
+ if((red <= 80 && green <=80 && blue <= 80) || (red >= 180 && green >= 180 && blue >= 180)){
+ if(x<bufferedimage.getTileWidth()-1) x++;
+ if(x>=bufferedimage.getTileWidth()-1 && y<bufferedimage.getTileWidth()-1){
+ x=0;
+ y++;
+ }
+ if(x == bufferedimage.getTileWidth()-1 && y==bufferedimage.getTileWidth()-1)ok=1;
+ }
+ else ok=1;
+ }
+ JewelryNBT.addIngotColor(stack, bufferedimage.getRGB(x, y));
}
- else if (JewelryNBT.ingot(stack) != null && JewelryNBT.jewel(stack) != null)
+ else if (pass == 1 && JewelryNBT.jewel(stack) != null)
{
- if (pass == 1)
- {
- if (JewelryNBT.jewel(stack).getIconIndex().getIconName().substring(0, JewelryNBT.jewel(stack).getIconIndex().getIconName().indexOf(":") + 1) != "") domain = JewelryNBT.jewel(stack).getIconIndex().getIconName().substring(0, JewelryNBT.jewel(stack).getIconIndex().getIconName().indexOf(":") + 1).replace(":", " ").trim();
- else domain = "minecraft";
- texture = JewelryNBT.jewel(stack).getIconIndex().getIconName().substring(JewelryNBT.jewel(stack).getIconIndex().getIconName().lastIndexOf(":") + 1) + ".png";
- ResourceLocation jewelLoc = null;
- if (JewelryNBT.jewel(stack).getUnlocalizedName().contains("item")) jewelLoc = new ResourceLocation(domain, "textures/items/" + texture);
- else jewelLoc = new ResourceLocation(domain, "textures/blocks/" + texture);
- BufferedImage bufferedimage = ImageIO.read(rm.getResource(jewelLoc).getInputStream());
- return bufferedimage.getRGB(9, 4);
- }
- if (JewelryNBT.ingot(stack).getIconIndex().getIconName().substring(0, JewelryNBT.ingot(stack).getIconIndex().getIconName().indexOf(":") + 1) != "") domain = JewelryNBT.ingot(stack).getIconIndex().getIconName().substring(0, JewelryNBT.ingot(stack).getIconIndex().getIconName().indexOf(":") + 1).replace(":", " ").trim();
+ x = 0; y = 0; ok=0;
+ if (JewelryNBT.jewel(stack).getIconIndex().getIconName().substring(0, JewelryNBT.jewel(stack).getIconIndex().getIconName().indexOf(":") + 1) != "") domain = JewelryNBT.jewel(stack).getIconIndex().getIconName().substring(0, JewelryNBT.jewel(stack).getIconIndex().getIconName().indexOf(":") + 1).replace(":", " ").trim();
else domain = "minecraft";
- texture = JewelryNBT.ingot(stack).getIconIndex().getIconName().substring(JewelryNBT.ingot(stack).getIconIndex().getIconName().lastIndexOf(":") + 1) + ".png";
- ResourceLocation ingot = null;
- if (JewelryNBT.ingot(stack).getUnlocalizedName().contains("item")) ingot = new ResourceLocation(domain, "textures/items/" + texture);
- else ingot = new ResourceLocation(domain, "textures/blocks/" + texture);
- BufferedImage bufferedimage = ImageIO.read(rm.getResource(ingot).getInputStream());
- return bufferedimage.getRGB(9, 9);
+ texture = JewelryNBT.jewel(stack).getIconIndex().getIconName().substring(JewelryNBT.jewel(stack).getIconIndex().getIconName().lastIndexOf(":") + 1) + ".png";
+ ResourceLocation jewelLoc = null;
+ if (JewelryNBT.jewel(stack).getUnlocalizedName().contains("item")) jewelLoc = new ResourceLocation(domain, "textures/items/" + texture);
+ else jewelLoc = new ResourceLocation(domain, "textures/blocks/" + texture);
+ BufferedImage bufferedimage = ImageIO.read(rm.getResource(jewelLoc).getInputStream());
+ while(ok == 0){
+ int red = (bufferedimage.getRGB(x, y) >> 16) & 0xFF;
+ int green = (bufferedimage.getRGB(x, y) >> 8) & 0xFF;
+ int blue = bufferedimage.getRGB(x, y) & 0xFF;
+ if((red <= 80 && green <=80 && blue <= 80) || (red >= 180 && green >= 180 && blue >= 180)){
+ if(x<bufferedimage.getTileWidth()-1) x++;
+ if(x>=bufferedimage.getTileWidth()-1 && y<bufferedimage.getTileWidth()-1){
+ x=0;
+ y++;
+ }
+ if(x == bufferedimage.getTileWidth()-1 && y==bufferedimage.getTileWidth()-1)ok=1;
+ }
+ else ok=1;
+ }
+ if(JewelryNBT.jewel(stack).getItem().getColorFromItemStack(JewelryNBT.jewel(stack), 1) == 16777215) JewelryNBT.addJewelColor(stack, bufferedimage.getRGB(x, y));
+ else JewelryNBT.addJewelColor(stack, JewelryNBT.jewel(stack).getItem().getColorFromItemStack(JewelryNBT.jewel(stack), 1));
}
+ if(pass == 0 && JewelryNBT.ingot(stack) != null) return JewelryNBT.ingotColor(stack);
+ if(pass == 1 && JewelryNBT.jewel(stack) != null) return JewelryNBT.jewelColor(stack);
+ else if(JewelryNBT.ingot(stack) != null) return JewelryNBT.ingotColor(stack);
return 16777215;
}
@@ -204,7 +228,7 @@ public class ItemRing extends Item
@Override
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity)
{
- if (!player.worldObj.isRemote && JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(stack, new ItemStack(Block.chest)) && JewelryNBT.entity(stack, player) == null){
+ if (!player.worldObj.isRemote && entity instanceof EntityLivingBase && JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(stack, new ItemStack(Block.chest)) && JewelryNBT.entity(stack, player) == null){
JewelryNBT.addEntity(stack, entity);
JewelryNBT.addEntityID(stack, entity);
entity.setDead();
@@ -247,6 +271,12 @@ public class ItemRing extends Item
String modeN = JewelryNBT.modeName(stack);
if(modeN != null) list.add("Mode: " + modeN);
+
+// int colorI = JewelryNBT.ingotColor(stack);
+// if(colorI != -1) list.add("Ingot Color: " + colorI);
+//
+// int colorJ = JewelryNBT.jewelColor(stack);
+// if(colorJ != -1) list.add("Jewel Color: " + colorJ);
}
}
@@ -255,7 +285,7 @@ public class ItemRing extends Item
if (!world.isRemote)
{
EntityLivingBase entity = JewelryNBT.entity(stack, player);
- if(entity != null){
+ if(entity != null && entity instanceof EntityLivingBase){
entity.setLocationAndAngles(i + 0.5D, j + 1D, k + 0.5D, MathHelper.wrapAngleTo180_float(world.rand.nextFloat() * 360.0F), 0.0F);
world.spawnEntityInWorld(entity);
JewelryNBT.removeEntity(stack);
@@ -403,4 +433,16 @@ public class ItemRing extends Item
}
}
}
+
+ public ItemStack getModifiedItemStack(ItemStack ingot, ItemStack modifier, ItemStack jewel)
+ {
+ ItemStack itemstack = new ItemStack(this);
+ JewelryNBT.addMetal(itemstack, ingot);
+ JewelryNBT.addModifier(itemstack, modifier);
+ JewelryNBT.addJewel(itemstack, jewel);
+ if(JewelryNBT.isModifierEffectType(itemstack)) JewelryNBT.addMode(itemstack, "Activated");
+ if(JewelryNBT.isJewelX(itemstack, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(itemstack, new ItemStack(Item.book)))
+ JewelryNBT.addMode(itemstack, "Disenchant");
+ return itemstack;
+ }
}
diff --git a/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java b/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java
index 25027db..6e396eb 100644
--- a/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java
+++ b/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java
@@ -17,15 +17,26 @@ public class CraftingRecipes
{
if (!isInitialized)
{
+ //Items
GameRegistry.addRecipe(new ItemStack(ItemList.thiefGloves), "x x", "yxy", "yxy", 'x', ItemList.shadowIngot, 'y', new ItemStack(Block.cloth, 1, 15));
GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 0), "xx", 'x', Item.clay);
GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 1), " x ", "x x", " x ", 'x', Item.clay);
+ GameRegistry.addRecipe(new ItemStack(ItemList.crystal, 1, 15), " x ", "x x", " x ", 'x', Block.glass);
+ for(int i=0; i < 15; i++)
+ {
+ GameRegistry.addShapelessRecipe(new ItemStack(ItemList.crystal, 1, i), new Object[]{new ItemStack(ItemList.crystal, 1, 15), new ItemStack(Item.dyePowder, 1, i)});
+ GameRegistry.addShapelessRecipe(new ItemStack(ItemList.crystal, 1, 15), new Object[]{new ItemStack(ItemList.crystal, 1, i), new ItemStack(Item.dyePowder, 1, 15)});
+ }
+
+ //Blocks
GameRegistry.addRecipe(new ItemStack(BlockList.molder), "x x", "xxx", 'x', Block.cobblestone);
GameRegistry.addRecipe(new ItemStack(BlockList.smelter), "xyx", "x x", "xzx", 'x', Block.cobblestone, 'y', Item.bucketEmpty, 'z', Item.bucketLava);
GameRegistry.addRecipe(new ItemStack(BlockList.jewelCraftingTable), "xxx", "y y", "y y", 'x', Block.planks, 'y', Block.cobblestone);
GameRegistry.addRecipe(new ItemStack(BlockList.displayer, 2), " x ", "xxx", "yyy", 'x', Item.ingotIron, 'y', Block.blockEmerald);
GameRegistry.addRecipe(new ItemStack(BlockList.shadowBlock, 1), "xxx", "xxx", "xxx", 'x', ItemList.shadowIngot);
- GameRegistry.addSmelting(BlockList.shadowOre.blockID, new ItemStack(ItemList.shadowIngot), 1.5f);
+
+ //Smelting
+ GameRegistry.addSmelting(BlockList.shadowOre.blockID, new ItemStack(ItemList.shadowIngot), 1.5f);
FurnaceRecipes.smelting().addSmelting(ItemList.clayMolds.itemID, 0, new ItemStack(ItemList.molds, 1, 0), 0.85F);
FurnaceRecipes.smelting().addSmelting(ItemList.clayMolds.itemID, 1, new ItemStack(ItemList.molds, 1, 1), 0.85F);
diff --git a/common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java b/common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java
index 483c5be..48f24b4 100644
--- a/common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java
+++ b/common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java
@@ -17,7 +17,6 @@ import net.minecraft.item.ItemStack;
import darkknight.jewelrycraft.model.ModelDisplayer;
import darkknight.jewelrycraft.tileentity.TileEntityDisplayer;
import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.common.FakePlayer;
@@ -45,11 +44,11 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer
{
int ind = -3;
GL11.glPushMatrix();
- renderLabel(EnumChatFormatting.YELLOW + disp.object.getDisplayName(), 0F, (-0.171F)*ind, 0, block, disp);
+ renderLabel(disp.object.getDisplayName(), 0F, (-0.171F)*ind, 0F, block, disp, Color.YELLOW.getRGB());
GL11.glPopMatrix();
ind++;
GL11.glPushMatrix();
- renderLabel(Integer.toString(disp.quantity), 0F, (-0.171F)*ind, 0, block, disp);
+ renderLabel(Integer.toString(disp.quantity), 0F, (-0.171F)*ind, 0F, block, disp, Color.GRAY.getRGB());
GL11.glPopMatrix();
ind++;
if(disp.object.itemID != Item.map.itemID && disp.object != null && disp.object != new ItemStack(0, 0, 0) && disp.object.getTooltip(null, true) != null)
@@ -59,7 +58,7 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer
if(disp.object.getTooltip(new FakePlayer(te.worldObj, "Player"), true).get(i).toString() != "")
{
GL11.glPushMatrix();
- renderLabel(disp.object.getTooltip(new FakePlayer(te.worldObj, "Player"), true).get(i).toString(), 0F, (-0.171F)*ind, 0, block, disp);
+ renderLabel(disp.object.getTooltip(new FakePlayer(te.worldObj, "Player"), true).get(i).toString(), 0F, (-0.171F)*ind, 0F, block, disp, Color.GRAY.getRGB());
GL11.glPopMatrix();
ind++;
}
@@ -100,45 +99,43 @@ public class TileEntityDisplayerRender extends TileEntitySpecialRenderer
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) modulousModifier, divModifier);
}
- protected void renderLabel(String par2Str, double x, double y, double z, int metadata, TileEntity te)
+ protected void renderLabel(String par2Str, double x, double y, double z, int metadata, TileEntity te, int color)
{
FontRenderer fontrenderer = RenderManager.instance.getFontRenderer();
- if(te.worldObj.getClosestPlayer((double)te.xCoord, (double)te.yCoord, (double)te.zCoord, 3.5D) != null)
- {
- float var14 = 0.01266667F * 1.5F;
- float var17 = 0.015F;
- 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.glTranslatef((float)x, (float)y, (float)z + 0.45F);
- GL11.glScalef(-0.015F, -var14, 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);
- GL11.glDisable(GL11.GL_DEPTH_TEST);
- GL11.glDepthMask(true);
- Tessellator tessellator = Tessellator.instance;
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- int j = fontrenderer.getStringWidth(par2Str) / 2;
- tessellator.startDrawingQuads();
- tessellator.setColorRGBA_F(0.2F, 0.2F, 0.2F, 0.8F);
- tessellator.addVertex((double)(-33.333 - 0), -1D, 0.1D);
- tessellator.addVertex((double)(-33.333 - 0), 8D, 0.1D);
- tessellator.addVertex((double)(33.333 + 0), 8D, 0.1D);
- tessellator.addVertex((double)(33.333 + 0), -1D, 0.1D);
- tessellator.draw();
- if ((fontrenderer.getStringWidth(par2Str)/2) > 30) var17 = 0.9F / fontrenderer.getStringWidth(par2Str);
- else var17 = var14;
- GL11.glScalef(var17*70F, 1F, 0F);
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- fontrenderer.drawStringWithShadow(par2Str, -j, 0, Color.GRAY.getRGB());
- GL11.glEnable(GL11.GL_DEPTH_TEST);
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glPopMatrix();
- }
+ float var14 = 0.01266667F * 1.5F;
+// float var17 = 0.015F;
+ 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.glTranslatef((float)x, (float)y, (float)z + 0.45F);
+ GL11.glScalef(-0.015F, -var14, 0.015F);
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDepthMask(true);
+ Tessellator tessellator = Tessellator.instance;
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ int j = fontrenderer.getStringWidth(par2Str) / 2;
+ tessellator.startDrawingQuads();
+ tessellator.setColorRGBA_F(0.2F, 0.2F, 0.2F, 0.8F);
+ tessellator.addVertex((double)(-33.333 - 0), -1D, 0.1D);
+ tessellator.addVertex((double)(-33.333 - 0), 8D, 0.1D);
+ tessellator.addVertex((double)(33.333 + 0), 8D, 0.1D);
+ tessellator.addVertex((double)(33.333 + 0), -1D, 0.1D);
+ tessellator.draw();
+// if ((fontrenderer.getStringWidth(par2Str)/2) > 20) var17 = 0.9F / fontrenderer.getStringWidth(par2Str);
+// else var17 = var14;
+// GL11.glScalef(var17*70F, 1F, 0F);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ int red = (color >> 16) & 0xFF;
+ int green = (color >> 8) & 0xFF;
+ int blue = color & 0xFF;
+ GL11.glTranslatef((float)x + 1f, (float)y + 1f, (float)z);
+ fontrenderer.drawString(par2Str, -j, 0, 65536 * (red/2) + 256 * (green/2) + blue/2);
+ GL11.glTranslatef((float)x - 1f, (float)y - 1f, (float)z - 1F);
+ fontrenderer.drawString(par2Str, -j, 0, color);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
}
}
diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntityCrystalizer.java b/common/darkknight/jewelrycraft/tileentity/TileEntityCrystalizer.java
deleted file mode 100644
index 5a4caeb..0000000
--- a/common/darkknight/jewelrycraft/tileentity/TileEntityCrystalizer.java
+++ /dev/null
@@ -1,143 +0,0 @@
-package darkknight.jewelrycraft.tileentity;
-
-import darkknight.jewelrycraft.config.ConfigHandler;
-import darkknight.jewelrycraft.util.JewelryNBT;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.network.INetworkManager;
-import net.minecraft.network.packet.Packet;
-import net.minecraft.network.packet.Packet132TileEntityData;
-import net.minecraft.tileentity.TileEntity;
-
-public class TileEntityCrystalizer extends TileEntity
-{
- public boolean hasJewelry, hasModifier, hasEndItem, isDirty, hasJewel;
- public ItemStack jewelry, modifier, endItem, jewel;
- public int timer, effect;
- public float angle;
-
- public TileEntityCrystalizer()
- {
- this.jewelry = new ItemStack(0, 0, 0);
- this.modifier = new ItemStack(0, 0, 0);
- this.endItem = new ItemStack(0, 0, 0);
- this.jewel = new ItemStack(0, 0, 0);
- this.hasJewelry = false;
- this.hasModifier = false;
- this.hasEndItem = false;
- this.hasJewel = false;
- this.timer = 0;
- this.effect = 0;
- this.angle = 0;
- this.isDirty = false;
- }
-
- @Override
- public void writeToNBT(NBTTagCompound nbt)
- {
- super.writeToNBT(nbt);
- nbt.setBoolean("hasJewelry", hasJewelry);
- nbt.setBoolean("hasModifier", hasModifier);
- nbt.setBoolean("hasEndItem", hasEndItem);
- nbt.setBoolean("hasJewel", hasJewel);
- nbt.setInteger("timer", timer);
- nbt.setInteger("effect", effect);
- nbt.setFloat("angle", angle);
-
- NBTTagCompound tag = new NBTTagCompound();
- NBTTagCompound tag1 = new NBTTagCompound();
- NBTTagCompound tag2 = new NBTTagCompound();
- NBTTagCompound tag3 = new NBTTagCompound();
-
- this.jewelry.writeToNBT(tag);
- nbt.setCompoundTag("jewelry", tag);
- this.modifier.writeToNBT(tag1);
- nbt.setCompoundTag("modifier", tag1);
- this.endItem.writeToNBT(tag2);
- nbt.setCompoundTag("endItem", tag2);
- this.jewel.writeToNBT(tag3);
- nbt.setCompoundTag("jewel", tag3);
- }
-
- @Override
- public void readFromNBT(NBTTagCompound nbt)
- {
- super.readFromNBT(nbt);
- this.hasJewelry = nbt.getBoolean("hasJewelry");
- this.hasModifier = nbt.getBoolean("hasModifier");
- this.hasEndItem = nbt.getBoolean("hasEndItem");
- this.hasJewel = nbt.getBoolean("hasJewel");
-
- this.timer = nbt.getInteger("timer");
- this.effect = nbt.getInteger("effect");
- this.angle = nbt.getFloat("angle");
- this.jewelry = new ItemStack(0, 0, 0);
- this.jewelry.readFromNBT(nbt.getCompoundTag("jewelry"));
- this.modifier = new ItemStack(0, 0, 0);
- this.modifier.readFromNBT(nbt.getCompoundTag("modifier"));
- this.endItem = new ItemStack(0, 0, 0);
- this.endItem.readFromNBT(nbt.getCompoundTag("endItem"));
- this.jewel = new ItemStack(0, 0, 0);
- this.jewel.readFromNBT(nbt.getCompoundTag("jewel"));
- }
-
- @Override
- public void updateEntity()
- {
- super.updateEntity();
- if(isDirty){
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
- isDirty = true;
- }
- if(angle<360F)angle+=3F;
- else angle=0F;
- if (this.hasJewelry && (this.hasModifier || this.hasJewel) && !this.hasEndItem)
- {
- if (timer > 0)
- {
- timer--;
- for (int l = 0; l < ConfigHandler.jewelryCraftingTime/(timer + 2); ++l)
- {
- if(this.getBlockMetadata() == 0) this.worldObj.spawnParticle("witchMagic", xCoord + 0.5F, (double) yCoord + 0.8F, zCoord + 0.2F, 0.0D, 0.0D, 0.0D);
- if(this.getBlockMetadata() == 1) this.worldObj.spawnParticle("witchMagic", xCoord + 0.8F, (double) yCoord + 0.8F, zCoord + 0.5F, 0.0D, 0.0D, 0.0D);
- if(this.getBlockMetadata() == 2) this.worldObj.spawnParticle("witchMagic", xCoord + 0.5F, (double) yCoord + 0.8F, zCoord + 0.8F, 0.0D, 0.0D, 0.0D);
- if(this.getBlockMetadata() == 3) this.worldObj.spawnParticle("witchMagic", xCoord + 0.2F, (double) yCoord + 0.8F, zCoord + 0.5F, 0.0D, 0.0D, 0.0D);
- }
- }
- if (timer == 0)
- {
- this.hasEndItem = true;
- this.endItem = jewelry.copy();
- if (hasModifier && modifier != new ItemStack(0, 0, 0)) JewelryNBT.addModifier(endItem, modifier);
- if (hasJewel && jewel != new ItemStack(0, 0, 0)) JewelryNBT.addJewel(endItem, jewel);
- if (hasJewel && hasModifier && JewelryNBT.isJewelX(endItem, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(endItem, new ItemStack(Item.book))) JewelryNBT.addMode(endItem, "Disenchant");
- if (hasModifier && JewelryNBT.isModifierEffectType(endItem)) JewelryNBT.addMode(endItem, "Activated");
- this.hasJewelry = false;
- this.jewelry = new ItemStack(0, 0, 0);
- this.hasModifier = false;
- this.modifier = new ItemStack(0, 0, 0);
- this.hasJewel = false;
- this.jewel = new ItemStack(0, 0, 0);
- timer = -1;
- }
- }
- }
-
- @Override
- public Packet getDescriptionPacket()
- {
- Packet132TileEntityData packet = (Packet132TileEntityData) super.getDescriptionPacket();
- NBTTagCompound dataTag = packet != null ? packet.data : new NBTTagCompound();
- writeToNBT(dataTag);
- return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, dataTag);
- }
-
- @Override
- public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt)
- {
- super.onDataPacket(net, pkt);
- NBTTagCompound tag = pkt != null ? pkt.data : new NBTTagCompound();
- readFromNBT(tag);
- }
-}
diff --git a/common/darkknight/jewelrycraft/util/JewelryNBT.java b/common/darkknight/jewelrycraft/util/JewelryNBT.java
index 606ea4a..263b6b6 100644
--- a/common/darkknight/jewelrycraft/util/JewelryNBT.java
+++ b/common/darkknight/jewelrycraft/util/JewelryNBT.java
@@ -287,15 +287,19 @@ public class JewelryNBT
int entityID = 0;
entityID = enID.getInteger("entityID");
EntityLivingBase entity = (EntityLivingBase) EntityList.createEntityByID(entityID, player.worldObj);
- entity.readFromNBT(en);
- return entity;
+ if(entity != null && entity instanceof EntityLivingBase)
+ {
+ entity.readFromNBT(en);
+ return entity;
+ }
+ else return null;
}
return null;
}
public static boolean isEntityX(ItemStack stack, EntityPlayer player, EntityLivingBase entity)
{
- if(entity(stack, player) != null && entity(stack, player).equals(entity)) return true;
+ if(entity != null && entity instanceof EntityLivingBase && entity(stack, player) != null && entity(stack, player).equals(entity)) return true;
return false;
}
@@ -409,4 +413,56 @@ public class JewelryNBT
}
return -1;
}
+
+ public static void addIngotColor(ItemStack item, int color)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound())
+ itemStackData = item.getTagCompound();
+ else
+ {
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound colors = new NBTTagCompound();
+ colors.setInteger("ingotColor", color);
+ itemStackData.setTag("ingotColor", colors);
+ }
+
+ public static int ingotColor(ItemStack stack)
+ {
+ if(stack != null && stack != new ItemStack(0, 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("ingotColor"))
+ {
+ NBTTagCompound colors = (NBTTagCompound) stack.getTagCompound().getTag("ingotColor");
+ int color = colors.getInteger("ingotColor");
+ return color;
+ }
+ return 16777215;
+ }
+
+ public static void addJewelColor(ItemStack item, int color)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound())
+ itemStackData = item.getTagCompound();
+ else
+ {
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound colors = new NBTTagCompound();
+ colors.setInteger("jewelColor", color);
+ itemStackData.setTag("jewelColor", colors);
+ }
+
+ public static int jewelColor(ItemStack stack)
+ {
+ if(stack != null && stack != new ItemStack(0, 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewelColor"))
+ {
+ NBTTagCompound colors = (NBTTagCompound) stack.getTagCompound().getTag("jewelColor");
+ int color = colors.getInteger("jewelColor");
+ return color;
+ }
+ return 16777215;
+ }
}
diff --git a/common/darkknight/jewelrycraft/util/JewelrycraftUtil.java b/common/darkknight/jewelrycraft/util/JewelrycraftUtil.java
index b344724..4247175 100644
--- a/common/darkknight/jewelrycraft/util/JewelrycraftUtil.java
+++ b/common/darkknight/jewelrycraft/util/JewelrycraftUtil.java
@@ -34,6 +34,12 @@ public class JewelrycraftUtil
modifiers.add(new ItemStack(Item.potion, 1, 8270));
//Jewels
+ for(int i=0; i <= 16; i++)
+ jewel.add(new ItemStack(ItemList.crystal, 1, i));
+ jewel.add(new ItemStack(Item.redstone));
+ jewel.add(new ItemStack(Block.blockRedstone));
+ jewel.add(new ItemStack(Item.dyePowder, 1, 4));
+ jewel.add(new ItemStack(Block.blockLapis));
jewel.add(new ItemStack(Block.obsidian));
jewel.add(new ItemStack(Item.diamond));
jewel.add(new ItemStack(Item.emerald));
@@ -83,15 +89,15 @@ public class JewelrycraftUtil
{
while(index2 < OreDictionary.getOres(OreDictionary.getOreNames()[index]).size())
{
- if(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2).getUnlocalizedName().contains("ingot"))
+ if(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2).getUnlocalizedName().toLowerCase().contains("ingot") && !JewelrycraftUtil.metal.contains(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2)))
metal.add(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2));
index2++;
}
index2 = 0;
index++;
}
- metal.add(new ItemStack(Item.ingotGold));
- metal.add(new ItemStack(Item.ingotIron));
+ if(!metal.contains(new ItemStack(Item.ingotGold)))metal.add(new ItemStack(Item.ingotGold));
+ if(!metal.contains(new ItemStack(Item.ingotIron)))metal.add(new ItemStack(Item.ingotIron));
}
public static boolean isModifier(ItemStack item)
diff --git a/common/darkknight/jewelrycraft/worldGen/Generation.java b/common/darkknight/jewelrycraft/worldGen/Generation.java
index 9444e6a..32da73d 100644
--- a/common/darkknight/jewelrycraft/worldGen/Generation.java
+++ b/common/darkknight/jewelrycraft/worldGen/Generation.java
@@ -36,7 +36,8 @@ public class Generation implements IWorldGenerator
int x = i + random.nextInt(16);
int y = 5 + random.nextInt(4);
int z = j + random.nextInt(16);
- if(world.rand.nextInt(10) == 0) world.setBlock(x, y, z, BlockList.shadowOre.blockID);
+ world.setBlock(x, y, z, BlockList.shadowOre.blockID);
+ if(random.nextInt(3) == 0) world.setBlock(x + random.nextInt(2), y + random.nextInt(1), z + random.nextInt(2), BlockList.shadowOre.blockID);
}
}
diff --git a/common/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java b/common/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java
index 3983274..2c740f5 100644
--- a/common/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java
+++ b/common/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java
@@ -175,12 +175,12 @@ public class ComponentJewelry extends ComponentVillage
generateDisplayer(world, 3, 1, 4, (coordBaseMode == 0 || coordBaseMode == 2)?1:2, random, sbb);
generateChest(world, 3, 1, 5, 0, random, sbb, 2, 6);
- this.placeBlockAtCurrentPosition(world, Block.furnaceIdle.blockID, 0, 1, 1, 7, sbb);
- this.placeBlockAtCurrentPosition(world, Block.furnaceIdle.blockID, 0, 1, 2, 7, sbb);
- this.placeBlockAtCurrentPosition(world, Block.furnaceIdle.blockID, 0, 1, 3, 7, sbb);
- this.placeBlockAtCurrentPosition(world, Block.furnaceIdle.blockID, 0, 1, 1, 10, sbb);
- this.placeBlockAtCurrentPosition(world, Block.furnaceIdle.blockID, 0, 1, 2, 10, sbb);
- this.placeBlockAtCurrentPosition(world, Block.furnaceIdle.blockID, 0, 1, 3, 10, sbb);
+ generateFurnace(world, 1, 1, 7, 0, random, sbb, 1, 2, true);
+ generateFurnace(world, 1, 2, 7, 0, random, sbb, 2, 3, true);
+ generateFurnace(world, 1, 3, 7, 0, random, sbb, 1, 3, true);
+ generateFurnace(world, 1, 1, 10, 0, random, sbb, 1, 2, true);
+ generateFurnace(world, 1, 2, 10, 0, random, sbb, 2, 3, true);
+ generateFurnace(world, 1, 3, 10, 0, random, sbb, 1, 3, true);
generateSmelter(world, 1, 1, 8, (coordBaseMode == 0 || coordBaseMode == 2)?1:2, random, sbb, random.nextBoolean());
generateSmelter(world, 1, 1, 9, (coordBaseMode == 0 || coordBaseMode == 2)?1:2, random, sbb, random.nextBoolean());
@@ -188,10 +188,10 @@ public class ComponentJewelry extends ComponentVillage
generateMolder(world, 2, 1, 8, (coordBaseMode == 0 || coordBaseMode == 2)?1:2, random, sbb, random.nextBoolean(), random.nextBoolean());
generateMolder(world, 2, 1, 9, (coordBaseMode == 0 || coordBaseMode == 2)?1:2, random, sbb, random.nextBoolean(), random.nextBoolean());
- this.placeBlockAtCurrentPosition(world, Block.chest.blockID, 0, 9, 1, 7, sbb);
- this.placeBlockAtCurrentPosition(world, Block.chest.blockID, 0, 9, 1, 8, sbb);
- this.placeBlockAtCurrentPosition(world, Block.chestTrapped.blockID, 0, 9, 1, 9, sbb);
- this.placeBlockAtCurrentPosition(world, Block.chestTrapped.blockID, 0, 9, 1, 10, sbb);
+ generateIngotChest(world, 9, 1, 7, 0, random, sbb, 3, 12, Block.chest, 5);
+ generateIngotChest(world, 9, 1, 8, 0, random, sbb, 5, 16, Block.chest, 3);
+ generateIngotChest(world, 9, 1, 9, 0, random, sbb, 3, 10, Block.chestTrapped, 2);
+ generateIngotChest(world, 9, 1, 10, 0, random, sbb, 3, 9, Block.chestTrapped, 6);
for (int l = 0; l < 6; ++l)
@@ -234,6 +234,22 @@ public class ComponentJewelry extends ComponentVillage
}
}
+ public void generateIngotChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount)
+ {
+ int i1 = this.getXWithOffset(i, k);
+ int j1 = this.getYWithOffset(j);
+ int k1 = this.getZWithOffset(i, k);
+ int t = random.nextInt(max - min + 1) + min;
+ this.placeBlockAtCurrentPosition(world, chestB.blockID, metadata, i, j, k, sbb);
+ TileEntityChest chest = (TileEntityChest)world.getBlockTileEntity(i1, j1, k1);
+ while(chest != null && t > 0)
+ {
+ chest.setChestGuiName("Ingot Chest");
+ if(random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), new ItemStack(JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).getItem(), 2 + random.nextInt(randomAmount)));
+ t--;
+ }
+ }
+
public void generateTrappedChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max)
{
int i1 = this.getXWithOffset(i, k);
@@ -320,12 +336,11 @@ public class ComponentJewelry extends ComponentVillage
TileEntityFurnace furnace = (TileEntityFurnace)world.getBlockTileEntity(i1, j1, k1);
if(furnace != null)
{
-// if(random.nextBoolean()) furnace.setInventorySlotContents(1, new ItemStack(Item.coal, random.nextInt(16)));
-// if(hasMetal){
-// ItemStack metal = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()));
-// metal.stackSize = random.nextInt(max - min + 1) + min;
-// furnace.setInventorySlotContents(2, metal);
-// }
+ if(random.nextBoolean()) furnace.setInventorySlotContents(1, new ItemStack(Item.coal, 1 + random.nextInt(16)));
+ if(hasMetal){
+ ItemStack metal = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()));
+ furnace.setInventorySlotContents(2, new ItemStack(metal.getItem(), random.nextInt(max - min + 1) + min));
+ }
}
}
diff --git a/common/darkknight/jewelrycraft/worldGen/village/JCTrades.java b/common/darkknight/jewelrycraft/worldGen/village/JCTrades.java
index a60696b..2a5ba6f 100644
--- a/common/darkknight/jewelrycraft/worldGen/village/JCTrades.java
+++ b/common/darkknight/jewelrycraft/worldGen/village/JCTrades.java
@@ -37,15 +37,15 @@ public class JCTrades implements IVillageTradeHandler
case 0:
{
result = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()));
- result.stackSize = 1 + random.nextInt(16);
- ingredient = new ItemStack(Item.emerald, 8 + random.nextInt(8));
- if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 8 + random.nextInt(8));
+ result.stackSize = 5 + random.nextInt(8);
+ ingredient = new ItemStack(Item.emerald, 2 + random.nextInt(2));
+ if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 2 + random.nextInt(2));
break;
}
case 1:
{
- result = new ItemStack(ItemList.molds, 1, random.nextInt(2));
- ingredient = new ItemStack(Item.emerald, 1 + random.nextInt(2));
+ result = new ItemStack(ItemList.molds, 5 + random.nextInt(7), random.nextInt(2));
+ ingredient = new ItemStack(Item.emerald, 1 + random.nextInt(1));
if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 1 + random.nextInt(2));
break;
}
@@ -53,70 +53,76 @@ public class JCTrades implements IVillageTradeHandler
{
result = new ItemStack(ItemList.thiefGloves);
ingredient = new ItemStack(Item.emerald, 16 + random.nextInt(8));
- if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 16 + random.nextInt(8));
+ if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 8 + random.nextInt(4));
break;
}
case 3:
{
result = new ItemStack(BlockList.displayer, 1 + random.nextInt(6));
- ingredient = new ItemStack(Item.emerald, 8 + random.nextInt(32));
- if(random.nextBoolean()) ingredient2 = new ItemStack(Block.blockEmerald, 2 + random.nextInt(6));
+ ingredient = new ItemStack(Item.emerald, 3 + random.nextInt(8));
+ if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 3 + random.nextInt(8));
break;
}
case 4:
{
result = new ItemStack(BlockList.jewelCraftingTable);
- ingredient = new ItemStack(Item.emerald, 8 + random.nextInt(17));
- if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 8 + random.nextInt(17));
+ ingredient = new ItemStack(Item.emerald, 1 + random.nextInt(2));
+ if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 1 + random.nextInt(2));
break;
}
case 5:
{
result = new ItemStack(BlockList.shadowOre, 1 + random.nextInt(16));
- ingredient = new ItemStack(Item.emerald, 8 + random.nextInt(17));
- if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 8 + random.nextInt(17));
+ ingredient = new ItemStack(Item.emerald, 3 + random.nextInt(4));
+ if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 3 + random.nextInt(4));
break;
}
case 6:
{
- result = new ItemStack(BlockList.molder);
- ingredient = new ItemStack(Item.emerald, 1 + random.nextInt(2));
- if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 1 + random.nextInt(3));
+ result = new ItemStack(BlockList.molder, 5 + random.nextInt(5));
+ ingredient = new ItemStack(Item.emerald, 1 + random.nextInt(1));
+ if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 1 + random.nextInt(1));
break;
}
case 7:
{
result = new ItemStack(BlockList.smelter);
- ingredient = new ItemStack(Item.emerald, 3 + random.nextInt(9));
- if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 4 + random.nextInt(2));
+ ingredient = new ItemStack(Item.emerald, 1 + random.nextInt(2));
+ if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 1 + random.nextInt(2));
break;
}
case 8:
{
int end = random.nextInt(JewelrycraftUtil.modifiers.size());
result = JewelrycraftUtil.modifiers.get(end);
- if(result.getMaxStackSize() > 1) result.stackSize = 1 + random.nextInt(16);
if(JewelrycraftUtil.modifiers.size() - 1 - end >= 3)
{
- ingredient = new ItemStack(Item.emerald, 3 + random.nextInt(9));
- if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 4 + random.nextInt(2));
+ result.stackSize = 1 + random.nextInt(JewelrycraftUtil.modifiers.size() - end);
+ int value = end;
+ if(value > 64) value = 64;
+ ingredient = new ItemStack(Item.emerald, 3 + random.nextInt(value));
+ if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 4 + random.nextInt(value));
}
else
{
- ingredient = new ItemStack(Item.emerald, 32 + random.nextInt(33));
- ingredient2 = new ItemStack(Block.blockEmerald, 8 + random.nextInt(16));
+ result.stackSize = 1 + random.nextInt(7);
+ ingredient = new ItemStack(Item.emerald, result.stackSize/2 + 1 + random.nextInt(7));
+ ingredient2 = new ItemStack(Item.emerald, result.stackSize/2 + 1 + random.nextInt(4));
}
+ if(result.getMaxStackSize()<=1) result.stackSize = 1;
break;
}
case 9:
{
int end = random.nextInt(JewelrycraftUtil.jewel.size());
result = JewelrycraftUtil.jewel.get(end);
- result.stackSize = 1 + random.nextInt(3);
- if(JewelrycraftUtil.modifiers.size() - 1 - end >= 1)
+ result.stackSize = 1 + random.nextInt(JewelrycraftUtil.jewel.size() - end);
+ if(JewelrycraftUtil.jewel.size() - 1 - end >= 1)
{
- ingredient = new ItemStack(Item.emerald, 6 + random.nextInt(32));
- if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 2 + random.nextInt(16));
+ int value = end;
+ if(value > 64) value = 64;
+ ingredient = new ItemStack(Item.emerald, 2 + random.nextInt(value));
+ if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 2 + random.nextInt(value));
}
else
{
diff --git a/resources/assets/jewelrycraft/Changelog.txt b/resources/assets/jewelrycraft/Changelog.txt
index e69de29..c295992 100644
--- a/resources/assets/jewelrycraft/Changelog.txt
+++ b/resources/assets/jewelrycraft/Changelog.txt
@@ -0,0 +1,80 @@
+- Added the Shadow Block
+- Added a enchanting/disenchanting/enchantments transfering ring made out of a Netherstar as jewel and book as modifier
+- Added a creative tab that generates all the possible ingot+jewel+modifier combinations
+- Fixed(?) bug with knightmetal ingots from Twilight Forest not being detected as ingots
+- Fixed weird empty spaces generated by Jewelries in villages
+- Added crystals
+- Reworked the coloring system, thus fixed some rings not having proper colors
+- Fixed(?) the entity holding ring storing entities that don't extend EntityLivingBase
+- Added generation of ingots in the Jewelry village house
+- Added 4 new possible jewels: Redstone, Redstone Block, Lapis and Lapis Block
+- Removed animation from the Shadow Ore
+- Made Shadow Ore more common
+- Balanced Villager trades
+
+TODO
+- Make it so you can smelt ores in the smelter
+- Make a way so that the ingot affects the jewels somehow
+- Add a ring of Resistance
+- Think of a way to balance the rings
+- (MAYBE) Shadow Ring -> Shadow ingot ring, nether star, obsidian - makes you appear as hostile so mobs actually leave you alone
+- Elemental jewellery -> punch a creature with it in your hand to do different things, lightning, fling into the air, set on fire,
+ encase in ice/fences/iron bars, turn into a sheep (like that spell from Warcraft 2, if anyone remembers that), blindness, extreme
+ knockback, charm (turns on your enemies), tame - tames any tamable mob
+- Add Necklaces, bracelets and earrings; Necklaces could have an AOE effect;
+- Shadow armor and tools
+- Add an item that can store rings (maybe a keychain?)
+- Monks Ring -> ups your unarmed damage / block breaking speed / ability to break harder blocks with bare hands, made with a block of iron and a jewel.
+- Ring of Strength -> self explanatory
+- (MAYBE) Add a Shadow Merchant (a villager that trades only shadow related stuff and appears randomly at night)
+- Add a blast protection jewelry
+- Add a jewelery of the Arrow Catcher - each tier of protection gives you a certain % chance of catching arrows instead of being hit by them.
+- (MAYBE) Render the rings on the character
+- In the case of passive benefits, might it be possible to make it so, with fire resistance for example, it refreshes the buff as long as you're not in fire,
+ but as soon as you are it gains a limited duration (better jewels for longer durations) that, when it expires there goes the buff and you can burn to death.
+ Then you'd need to avoid being on fire for a cooldown period of a few seconds before it could refresh back to the passive state (this part reduced by better jewels)?
+ Invisibility could turn off for a period when you punch a mob, that kind of thing.
+- Glowstone Block (Modifier): Places a torch-like blob of light in exchange for 1/2 a heart, higher-tier jewels increase the light emitted.
+- Ghast Tear (Modifier): Allows for a limited-duration flight buff, say starting at 3 seconds all the way to 60 when combined with a nether star. When the timer expires
+ you have to land again to reset the usage.
+- Any Color Dye (Modifier): Right-click a sheep to dye it the chosen color. Posted Image
+- Beacon (Modifier): Portable beacon, with the tier based on the jewel added. Shift + Right-click to open the beacon GUI, which would work just like the vanilla one.
+- Water Bucket (Modifier): Right-click the air to start a storm.
+- Lava Bucket (Modifier): Passively adds fire aspect to your weapons and tools.
+- Sand (Modifier): Shift + right-click to advance the day 1 hour. Only usable once per day by default, better jewels increase this.
+- Glass (Jewel): Right-click while holding the ring to zoom in!
+- Lapis Piece (Modifier): Passively adds a slowing effect to your weapons. Better jewels improve this.
+- Lapis Block (Jewel): A jewel that looks pretty but doesn't do much else.
+- Bone (Jewel): Right-click to trade 1/2 a hunger for a bonemeal effect. Otherwise a white jewel with no benefit.
+- Carrot (Modifier): Right-click to trade 1/2 a heart for 1/2 a hunger. Better jewels increase these values. 4 hearts for a steaks-worth of food? XD
+- Diamond Block (Jewel): When on a gold ring it turns it into "Ostentatious Wedding Ring". Otherwise the same (or a little better than) diamond.
+- Golden Apple (Jewel): Ring becomes named "Discord". Right-clicking gives an entirely random buff, a debuff, launches you high into the air, teleports you to a
+ random location, sets you on fire, spawns a pig or makes lightning strike. Pretty much anything can happen, and the more biased to negative results the better. :P
+- Enchanted Golden Apple (Jewel): As above, but more biased towards positive effects. Hail Discordia!
+- Name Tag (Jewel): Right-clicking a mob gives it a random name (bonus points if it's from a user-editable list!)
+- Add randomly generated "named" loot to dungeon chests! Ring of Displacement (lets you tele randomly like an enderman), Necklace of Second Chances
+ (heals you for 50 when you drop to 3 or fewer hearts with a cooldown of ~1 minute), Trinket of the Gale (arrow/fireball immunity!), Goggles of the Merfolk
+ (water breathing!). Endless possibilities! :D
+- Also! Trinkets and Belts!
+
+Trinkets would probably require a new mold, and should bring out the more passive side of items (like, say, instead of opening an enderchest, it automatically
+sucks items into your ender chest, or instead of teleporting you it prevents endermen from teleporting away from you [which could be done pretty easily with a
+fake screen overlay that's treated like the pumpkin one]).
+
+Belts... I'd personally see belts as a ring crafted with a piece of Leather as the "jewel" and could provide conditional buffs proportionate to some factor, like
+say increasing strength buff the lower your HP is. The idea being that the belt should assist you in a useful way, but only when its needed. I'd probably limit it
+to HP and Hunger as determining factors. Things like resistance, regeneration and strength could be applied at low HP, while things like jump boost, haste and speed
+could be applied at high hunger meter values. I wouldn't tie anything to having high/max HP or no hunger since those would be things that players normally try to
+avoid or always have.
+
+And as for goggles... A new mold for the base goggle template, and have it only accept "jewel"-typed items (as "lenses"). If you can't think of where to put a neat
+effect it should probably end up on goggles. Off the top of my head I can think of a few neat uses: Ore Radar (2x diamonds), Clear Vision (2x glass), Mob Spawnable
+Area Highlighting (2x ender pearl), Compass and Clock overlays (doy), Coordinate HUD (map and glass), Speedometer (glass and enderpearl), Altimiter (glass and emerald),
+Thermometer (diamond and glass)... Required Pickaxe Level HUD (no idea). XD
+
+Oooh! And last but not least: Cursed items! I'd probably start with an upgraded jewelry table requiring a regular one, a brewing stand, a piece of glass and a stick.
+You could initially use this upgraded stand to add additional effects, or merge two items into one. Should operate kind of like a furnace, but only accepts blaze powder
+and rods as fuel (about 1 rod or 2 powder = 1 process, the idea being using the blaze stuff like welding materials). But the other use would be cursing jewelry! Why?
+Because nothing says "I hate you so much." like a non-dequipable piece of jewelry that gives you blindness and slowness! Slimeballs could add a cursed sticky effect
+that prevents you dropping it without dying. Fermented spider eye, like with brewing potions, could corrupt the effects on the item. Flint and steel could randomly set
+you on fire. Eye of Ender could randomly tell the world your coordinates. \ No newline at end of file
diff --git a/resources/assets/jewelrycraft/lang/en_US.lang b/resources/assets/jewelrycraft/lang/en_US.lang
index d656fa1..4209988 100644
--- a/resources/assets/jewelrycraft/lang/en_US.lang
+++ b/resources/assets/jewelrycraft/lang/en_US.lang
@@ -7,6 +7,7 @@ item.Jewelrycraft.mold.clayIngot.name=Clay Ingot Mold
item.Jewelrycraft.mold.clayRing.name=Clay Ring Mold
item.Jewelrycraft.mold.clayNecklace.name=Clay Necklace Mold
item.Jewelrycraft.ring.name=Ring
+item.Jewelrycraft.crystal.name=Crystal
tile.Jewelrycraft.oreShadow.name=Shadow Ore
tile.Jewelrycraft.blockShadow.name=Shadow Block
tile.Jewelrycraft.glow.name=Glow
@@ -15,6 +16,7 @@ tile.Jewelrycraft.molder.name=Molder
tile.Jewelrycraft.displayer.name=Storage Displayer
tile.Jewelrycraft.jewelCraftingTable.name=Jeweler's Crafting Table
itemGroup.JewelryCraft=Jewelrycraft
+itemGroup.Rings=Jewelrycraft Rings
chatmessage.Jewelrycraft.molder.addedmold=Added %s to molder.
chatmessage.Jewelrycraft.molder.metaliscooling=Molten metal is cooling...
chatmessage.Jewelrycraft.molder.moldisempty=Mold is currently empty.
diff --git a/resources/assets/jewelrycraft/textures/blocks/oreShadow.png b/resources/assets/jewelrycraft/textures/blocks/oreShadow.png
index 31ee2a6..ffc48dc 100644
--- a/resources/assets/jewelrycraft/textures/blocks/oreShadow.png
+++ b/resources/assets/jewelrycraft/textures/blocks/oreShadow.png
Binary files differ
diff --git a/resources/assets/jewelrycraft/textures/items/crystal.png b/resources/assets/jewelrycraft/textures/items/crystal.png
index 662a12d..563a41f 100644
--- a/resources/assets/jewelrycraft/textures/items/crystal.png
+++ b/resources/assets/jewelrycraft/textures/items/crystal.png
Binary files differ
diff --git a/resources/assets/jewelrycraft/textures/items/crystalOverlay.png b/resources/assets/jewelrycraft/textures/items/crystalOverlay.png
index 4d3a2da..d17e909 100644
--- a/resources/assets/jewelrycraft/textures/items/crystalOverlay.png
+++ b/resources/assets/jewelrycraft/textures/items/crystalOverlay.png
Binary files differ