summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2014-02-08 03:03:22 +0200
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2014-02-08 03:03:22 +0200
commit4d0e0e8de72bda8543a888082a93b1e56f13856b (patch)
treeb17c62ab7119ce485d49f163e4c10dfd05ae0d57 /common
parent9075a22c3e303699db18062ebfc0159cace27c29 (diff)
Added a new block and implemented an on/off "switch" for the rings that give buffs, also working on balancing the rings
Diffstat (limited to 'common')
-rw-r--r--common/darkknight/jewelrycraft/JewelrycraftMod.java6
-rw-r--r--common/darkknight/jewelrycraft/block/BlockGlow.java39
-rw-r--r--common/darkknight/jewelrycraft/block/BlockList.java11
-rw-r--r--common/darkknight/jewelrycraft/block/BlockShadow.java87
-rw-r--r--common/darkknight/jewelrycraft/client/ClientProxy.java10
-rw-r--r--common/darkknight/jewelrycraft/config/ConfigHandler.java4
-rw-r--r--common/darkknight/jewelrycraft/item/ItemRing.java48
-rw-r--r--common/darkknight/jewelrycraft/recipes/CraftingRecipes.java1
-rw-r--r--common/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java77
-rw-r--r--common/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java1
-rw-r--r--common/darkknight/jewelrycraft/util/JewelryNBT.java23
-rw-r--r--common/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java7
-rw-r--r--common/darkknight/jewelrycraft/worldGen/village/JCTrades.java3
13 files changed, 278 insertions, 39 deletions
diff --git a/common/darkknight/jewelrycraft/JewelrycraftMod.java b/common/darkknight/jewelrycraft/JewelrycraftMod.java
index f432797..29fe6a2 100644
--- a/common/darkknight/jewelrycraft/JewelrycraftMod.java
+++ b/common/darkknight/jewelrycraft/JewelrycraftMod.java
@@ -1,3 +1,9 @@
+/*
+ * Mod made by DarkKnight during the Modjam 3
+ * It's an awesome mod
+ * I love me! :D
+ */
+
package darkknight.jewelrycraft;
import java.util.logging.Logger;
diff --git a/common/darkknight/jewelrycraft/block/BlockGlow.java b/common/darkknight/jewelrycraft/block/BlockGlow.java
new file mode 100644
index 0000000..9a34552
--- /dev/null
+++ b/common/darkknight/jewelrycraft/block/BlockGlow.java
@@ -0,0 +1,39 @@
+package darkknight.jewelrycraft.block;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.world.World;
+
+public class BlockGlow extends Block
+{
+ protected BlockGlow(int par1)
+ {
+ super(par1, Material.air);
+ }
+
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int i)
+ {
+ return null;
+ }
+
+ public boolean isCollidable()
+ {
+ return false;
+ }
+
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
+ public boolean renderAsNormalBlock()
+ {
+ return false;
+ }
+
+ public int getRenderType()
+ {
+ return -1;
+ }
+}
diff --git a/common/darkknight/jewelrycraft/block/BlockList.java b/common/darkknight/jewelrycraft/block/BlockList.java
index 66631aa..09a8dbc 100644
--- a/common/darkknight/jewelrycraft/block/BlockList.java
+++ b/common/darkknight/jewelrycraft/block/BlockList.java
@@ -6,10 +6,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import darkknight.jewelrycraft.JewelrycraftMod;
import darkknight.jewelrycraft.config.ConfigHandler;
-import darkknight.jewelrycraft.tileentity.TileEntityDisplayer;
-import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable;
-import darkknight.jewelrycraft.tileentity.TileEntityMolder;
-import darkknight.jewelrycraft.tileentity.TileEntitySmelter;
+import darkknight.jewelrycraft.tileentity.*;
public class BlockList
{
@@ -19,6 +16,7 @@ public class BlockList
public static Block molder;
public static Block displayer;
public static Block jewelCraftingTable;
+ public static Block shadowBlock;
private static boolean isInitialized = false;
@@ -27,13 +25,15 @@ public class BlockList
if (!isInitialized)
{
shadowOre = new Block(ConfigHandler.idShadowOre, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setTextureName("jewelrycraft:oreShadow").setUnlocalizedName("Jewelrycraft.oreShadow").setCreativeTab(JewelrycraftMod.jewelrycraft);
- glow = new BlockShadow(ConfigHandler.idGlow).setUnlocalizedName("Jewelrycraft.glow").setLightValue(1F);
+ glow = new BlockGlow(ConfigHandler.idGlow).setUnlocalizedName("Jewelrycraft.glow").setLightValue(1F);
smelter = new BlockSmelter(ConfigHandler.idSmelter, Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Jewelrycraft.smelter").setCreativeTab(JewelrycraftMod.jewelrycraft);
molder = new BlockMolder(ConfigHandler.idMolder, Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Jewelrycraft.molder").setCreativeTab(JewelrycraftMod.jewelrycraft);
displayer = new BlockDisplayer(ConfigHandler.idDisplayer, Material.iron).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Jewelrycraft.displayer").setCreativeTab(JewelrycraftMod.jewelrycraft);
jewelCraftingTable = new BlockJewelrsCraftingTable(ConfigHandler.idJewelCraftingTable, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Jewelrycraft.jewelCraftingTable").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ shadowBlock = new BlockShadow(ConfigHandler.idShadowBlock).setHardness(5.0F).setResistance(7.0F).setStepSound(Block.soundMetalFootstep).setTextureName("jewelrycraft:blockShadow").setUnlocalizedName("Jewelrycraft.blockShadow").setCreativeTab(JewelrycraftMod.jewelrycraft);
GameRegistry.registerBlock(shadowOre, "shadowOre");
+ GameRegistry.registerBlock(shadowBlock, "shadowBlock");
GameRegistry.registerBlock(smelter, "Smelter");
GameRegistry.registerBlock(molder, "Molder");
GameRegistry.registerBlock(jewelCraftingTable, "jewelCraftingTable");
@@ -43,6 +43,7 @@ public class BlockList
GameRegistry.registerTileEntity(TileEntityMolder.class, "31");
GameRegistry.registerTileEntity(TileEntityJewelrsCraftingTable.class, "32");
GameRegistry.registerTileEntity(TileEntityDisplayer.class, "33");
+ GameRegistry.registerTileEntity(TileEntityBlockShadow.class, "34");
isInitialized = true;
}
diff --git a/common/darkknight/jewelrycraft/block/BlockShadow.java b/common/darkknight/jewelrycraft/block/BlockShadow.java
index ea811ee..9aeb82a 100644
--- a/common/darkknight/jewelrycraft/block/BlockShadow.java
+++ b/common/darkknight/jewelrycraft/block/BlockShadow.java
@@ -1,39 +1,100 @@
package darkknight.jewelrycraft.block;
-import net.minecraft.block.Block;
+import darkknight.jewelrycraft.tileentity.TileEntityBlockShadow;
+import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.Icon;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.ForgeDirection;
-public class BlockShadow extends Block
+public class BlockShadow extends BlockContainer
{
- protected BlockShadow(int par1)
+ private Icon[] iconArray;
+
+ public BlockShadow(int par1)
{
- super(par1, Material.air);
+ super(par1, Material.iron);
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int i)
+ public int getRenderBlockPass()
{
- return null;
+ return 1;
}
-
- public boolean isCollidable()
+
+ public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
{
- return false;
+ return true;
}
-
+
public boolean isOpaqueCube()
{
return false;
}
-
+
public boolean renderAsNormalBlock()
{
return false;
}
+
+ public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side)
+ {
+ return true;
+ }
+
+ public static boolean isNormalCube(int par0)
+ {
+ return true;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world)
+ {
+ return new TileEntityBlockShadow();
+ }
+
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ this.iconArray = new Icon[16];
+
+ for (int i = 0; i < this.iconArray.length; ++i)
+ {
+ this.iconArray[i] = par1IconRegister.registerIcon(this.getTextureName() + (15 - i));
+ }
+ }
- public int getRenderType()
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
+ {
+ if(world.getBlockMetadata(x, y, z) == 15) return null;
+ return super.getCollisionBoundingBoxFromPool(world, x, y, z);
+ }
+
+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
+ {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
+ {
+ return true;
+ }
+
+ public boolean hasComparatorInputOverride()
+ {
+ return true;
+ }
+
+ public int getComparatorInputOverride(World world, int x, int y, int z, int meta)
+ {
+ return world.getBlockMetadata(x, y, z);
+ }
+
+ public Icon getIcon(int par1, int par2)
{
- return -1;
+ return this.iconArray[par2];
}
}
diff --git a/common/darkknight/jewelrycraft/client/ClientProxy.java b/common/darkknight/jewelrycraft/client/ClientProxy.java
index 2becba5..e086e94 100644
--- a/common/darkknight/jewelrycraft/client/ClientProxy.java
+++ b/common/darkknight/jewelrycraft/client/ClientProxy.java
@@ -4,14 +4,8 @@ import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.registry.VillagerRegistry;
import darkknight.jewelrycraft.CommonProxy;
-import darkknight.jewelrycraft.renders.TileEntityDisplayerRender;
-import darkknight.jewelrycraft.renders.TileEntityJewelrsCraftingTableRender;
-import darkknight.jewelrycraft.renders.TileEntityMolderRender;
-import darkknight.jewelrycraft.renders.TileEntitySmelterRender;
-import darkknight.jewelrycraft.tileentity.TileEntityDisplayer;
-import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable;
-import darkknight.jewelrycraft.tileentity.TileEntityMolder;
-import darkknight.jewelrycraft.tileentity.TileEntitySmelter;
+import darkknight.jewelrycraft.renders.*;
+import darkknight.jewelrycraft.tileentity.*;
public class ClientProxy extends CommonProxy
{
diff --git a/common/darkknight/jewelrycraft/config/ConfigHandler.java b/common/darkknight/jewelrycraft/config/ConfigHandler.java
index cba8759..648d0bd 100644
--- a/common/darkknight/jewelrycraft/config/ConfigHandler.java
+++ b/common/darkknight/jewelrycraft/config/ConfigHandler.java
@@ -17,7 +17,8 @@ public class ConfigHandler
public static int idDisplayer = 1752;
public static int idJewelCraftingTable = 1753;
public static int idMolder = 1754;
- public static int idGlow = 1755;
+ public static int idGlow = 1755;
+ public static int idShadowBlock = 1756;
public static int ingotCoolingTime = 200;
public static int ingotMeltingTime = 1500;
@@ -40,6 +41,7 @@ public class ConfigHandler
idRing = config.getItem("Ring", idRing).getInt();
idShadowOre = config.getBlock("Shadow Ore", idShadowOre).getInt();
+ idShadowBlock = config.getBlock("Shadow Block", idShadowBlock).getInt();
idSmelter = config.getBlock("Smelter", idSmelter).getInt();
idMolder = config.getBlock("Molder", idMolder).getInt();
idDisplayer = config.getBlock("Displayer", idDisplayer).getInt();
diff --git a/common/darkknight/jewelrycraft/item/ItemRing.java b/common/darkknight/jewelrycraft/item/ItemRing.java
index 730af20..318d679 100644
--- a/common/darkknight/jewelrycraft/item/ItemRing.java
+++ b/common/darkknight/jewelrycraft/item/ItemRing.java
@@ -176,14 +176,26 @@ public class ItemRing extends Item
JewelryNBT.addCoordonatesAndDimension(stack, player.posX, player.posY, player.posZ, world.provider.dimensionId, world.provider.getDimensionName());
JewelryNBT.addFakeEnchantment(stack);
}
- else if(player.inventory.getCurrentItem() != null && JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(stack, new ItemStack(Item.book)))
+
+ if(JewelryNBT.hasTag(stack, "mode"))
{
String mode = "";
if(JewelryNBT.isModeX(stack, "Disenchant")) mode = "Transfer";
else if(JewelryNBT.isModeX(stack, "Transfer")) mode = "Enchant";
else if(JewelryNBT.isModeX(stack, "Enchant")) mode = "Disenchant";
- player.addChatMessage("Switched to " + mode + " mode");
- JewelryNBT.addMode(stack, mode);
+ if(mode != "")
+ {
+ player.addChatMessage("Switched to " + mode + " mode");
+ JewelryNBT.addMode(stack, mode);
+ }
+ if(JewelryNBT.isModeX(stack, "Activated")) mode = "Deactivated";
+ else if(JewelryNBT.isModeX(stack, "Deactivated")) mode = "Activated";
+ if(mode != "")
+ {
+ player.addChatMessage("The Ring has been " + mode);
+ JewelryNBT.addMode(stack, mode);
+ }
+
}
}
return stack;
@@ -279,16 +291,30 @@ public class ItemRing extends Item
else if (JewelryNBT.isJewelX(stack, new ItemStack(Item.emerald))) amplifier = 2;
else if (JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar))) amplifier = 7;
- if (JewelryNBT.isModifierX(stack, new ItemStack(Item.blazePowder)) && entityplayer != null) entityplayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 4, amplifier, true));
- else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.sugar)) && entityplayer != null) entityplayer.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 4, amplifier, true));
- else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.pickaxeIron)) && entityplayer != null) entityplayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 4, amplifier, true));
- else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.feather)) && entityplayer != null)
+ if(JewelryNBT.isModeX(stack, "Activated"))
{
- entityplayer.addPotionEffect(new PotionEffect(Potion.jump.id, 4, amplifier, true));
- entityplayer.fallDistance=0;
+ if (JewelryNBT.isModifierX(stack, new ItemStack(Item.blazePowder)) && entityplayer != null)
+ {
+ entityplayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 4, amplifier, true));
+ entityplayer.addPotionEffect(new PotionEffect(Potion.weakness.id, 4, amplifier, true));
+ }
+ else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.sugar)) && entityplayer != null)
+ {
+ entityplayer.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 4, amplifier, true));
+ entityplayer.addExhaustion(0.05f*amplifier);
+ }
+ else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.pickaxeIron)) && entityplayer != null)
+ {
+ entityplayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 4, amplifier, true));
+ entityplayer.addPotionEffect(new PotionEffect(Potion.resistance.id, 4, -2*amplifier, true));
+ }
+ else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.feather)) && entityplayer != null)
+ {
+ entityplayer.addPotionEffect(new PotionEffect(Potion.jump.id, 4, amplifier, true));
+ entityplayer.fallDistance=0;
+ }
+ else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.potion, 1, 8270)) && entityplayer != null) entityplayer.addPotionEffect(new PotionEffect(Potion.invisibility.id, 4, amplifier, true));
}
- else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.potion, 1, 8270)) && entityplayer != null) entityplayer.addPotionEffect(new PotionEffect(Potion.invisibility.id, 4, amplifier, true));
-
if(entityplayer.inventory.getCurrentItem() != null && JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(stack, new ItemStack(Item.book)) && entityplayer.inventory.getCurrentItem().equals(stack))
{
ItemStack item = null;
diff --git a/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java b/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java
index 3f4587f..25027db 100644
--- a/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java
+++ b/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java
@@ -24,6 +24,7 @@ public class CraftingRecipes
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);
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/tileentity/TileEntityBlockShadow.java b/common/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java
new file mode 100644
index 0000000..138d0ab
--- /dev/null
+++ b/common/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java
@@ -0,0 +1,77 @@
+package darkknight.jewelrycraft.tileentity;
+
+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;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.EnumSkyBlock;
+
+public class TileEntityBlockShadow extends TileEntity
+{
+ public int metadata;
+
+ public TileEntityBlockShadow()
+ {
+ this.metadata = -1;
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ nbt.setInteger("metadata", metadata);
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ this.metadata = nbt.getInteger("metadata");
+ }
+
+ @Override
+ public void updateEntity()
+ {
+ super.updateEntity();
+ int blockLight, realLight;
+ int lightValue = worldObj.getSavedLightValue(EnumSkyBlock.Sky, xCoord, yCoord, zCoord) - worldObj.skylightSubtracted;
+ float sunPosAngle = worldObj.getCelestialAngleRadians(1.0F);
+
+ if (sunPosAngle < (float)Math.PI) sunPosAngle += (0.0F - sunPosAngle) * 0.2F;
+ else sunPosAngle += (((float)Math.PI * 2F) - sunPosAngle) * 0.2F;
+
+ lightValue = Math.round((float)lightValue * MathHelper.cos(sunPosAngle));
+
+ if (lightValue < 0) lightValue = 0;
+ if (lightValue > 15) lightValue = 15;
+
+ blockLight = worldObj.getChunkFromBlockCoords(xCoord, zCoord).getSavedLightValue(EnumSkyBlock.Block, xCoord & 15, yCoord, zCoord & 15);
+ realLight = worldObj.getChunkFromBlockCoords(xCoord, zCoord).getBlockLightValue(xCoord & 15, yCoord, zCoord & 15, 0);
+
+ if((blockLight == 0 && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord)) || (lightValue >= blockLight)) metadata = 15 - lightValue;
+ else if(!worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord)) metadata = 15 - realLight;
+ else if(lightValue < blockLight) metadata = 15 - blockLight;
+
+ worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, metadata, 2);
+ worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlockId(xCoord, yCoord, zCoord));
+ }
+
+ @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/tileentity/TileEntityJewelrsCraftingTable.java b/common/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java
index 935d87b..69fd69a 100644
--- a/common/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java
+++ b/common/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java
@@ -112,6 +112,7 @@ public class TileEntityJewelrsCraftingTable extends TileEntity
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;
diff --git a/common/darkknight/jewelrycraft/util/JewelryNBT.java b/common/darkknight/jewelrycraft/util/JewelryNBT.java
index aa11e8d..606ea4a 100644
--- a/common/darkknight/jewelrycraft/util/JewelryNBT.java
+++ b/common/darkknight/jewelrycraft/util/JewelryNBT.java
@@ -3,6 +3,7 @@ package darkknight.jewelrycraft.util;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@@ -175,6 +176,20 @@ public class JewelryNBT
itemStackData.removeTag(tag);
}
+ public static boolean hasTag(ItemStack item, String tag)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound())
+ itemStackData = item.getTagCompound();
+ else
+ {
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ if(itemStackData.hasKey(tag)) return true;
+ return false;
+ }
+
public static void removeEntity(ItemStack item)
{
JewelryNBT.removeNBT(item, "entityID");
@@ -231,6 +246,14 @@ public class JewelryNBT
return false;
}
+ public static boolean isModifierEffectType(ItemStack stack)
+ {
+ if(modifier(stack) != null && (isModifierX(stack, new ItemStack(Item.blazePowder)) || isModifierX(stack, new ItemStack(Item.sugar))
+ || isModifierX(stack, new ItemStack(Item.pickaxeIron)) || isModifierX(stack, new ItemStack(Item.feather))
+ || isModifierX(stack, new ItemStack(Item.potion, 1, 8270)))) return true;
+ return false;
+ }
+
public static ItemStack ingot(ItemStack stack)
{
if(stack != null && stack != new ItemStack(0, 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("ingot"))
diff --git a/common/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java b/common/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java
index 2d9b99e..3983274 100644
--- a/common/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java
+++ b/common/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java
@@ -13,6 +13,7 @@ import darkknight.jewelrycraft.util.JewelryNBT;
import darkknight.jewelrycraft.util.JewelrycraftUtil;
import net.minecraft.block.Block;
+import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.tileentity.TileEntityFurnace;
@@ -67,7 +68,8 @@ public class ComponentJewelry extends ComponentVillage
* arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int
* maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace)
*/
- this.fillWithBlocks(world, sbb, 0, 0, 0, 11, 5, 12, 0, 0, false);
+ this.fillWithBlocks(world, sbb, 0, 0, 6, 10, 5, 11, 0, 0, false);
+ this.fillWithBlocks(world, sbb, 2, 0, 0, 8, 5, 5, 0, 0, false);
//Pillars
this.fillWithBlocks(world, sbb, 2, 0, 0, 2, 3, 0, Block.wood.blockID, Block.wood.blockID, false);
this.fillWithBlocks(world, sbb, 2, 0, 3, 2, 3, 3, Block.wood.blockID, Block.wood.blockID, false);
@@ -262,6 +264,9 @@ public class ComponentJewelry extends ComponentVillage
JewelryNBT.addMetal(ring, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())));
JewelryNBT.addModifier(ring, JewelrycraftUtil.modifiers.get(random.nextInt(JewelrycraftUtil.modifiers.size())));
JewelryNBT.addJewel(ring, JewelrycraftUtil.jewel.get(random.nextInt(JewelrycraftUtil.jewel.size())));
+ if(JewelryNBT.isModifierEffectType(ring)) JewelryNBT.addMode(ring, "Activated");
+ if(JewelryNBT.isJewelX(ring, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(ring, new ItemStack(Item.book)))
+ JewelryNBT.addMode(ring, "Disenchant");
displayer.object = ring;
displayer.quantity = 1;
displayer.hasObject = true;
diff --git a/common/darkknight/jewelrycraft/worldGen/village/JCTrades.java b/common/darkknight/jewelrycraft/worldGen/village/JCTrades.java
index 4e1022d..a60696b 100644
--- a/common/darkknight/jewelrycraft/worldGen/village/JCTrades.java
+++ b/common/darkknight/jewelrycraft/worldGen/village/JCTrades.java
@@ -131,6 +131,9 @@ public class JCTrades implements IVillageTradeHandler
JewelryNBT.addMetal(result, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())));
JewelryNBT.addModifier(result, JewelrycraftUtil.modifiers.get(random.nextInt(JewelrycraftUtil.modifiers.size())));
JewelryNBT.addJewel(result, JewelrycraftUtil.jewel.get(random.nextInt(JewelrycraftUtil.jewel.size())));
+ if(JewelryNBT.isModifierEffectType(result)) JewelryNBT.addMode(result, "Activated");
+ if(JewelryNBT.isJewelX(result, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(result, new ItemStack(Item.book)))
+ JewelryNBT.addMode(result, "Disenchant");
ingredient = new ItemStack(Item.emerald, 16 + random.nextInt(20));
ingredient2 = new ItemStack(Block.blockEmerald, 5 + random.nextInt(5));
}