summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/darkknight/jewelrycraft/block/BlockMolder.java24
-rw-r--r--common/darkknight/jewelrycraft/block/BlockSmelter.java20
-rw-r--r--common/darkknight/jewelrycraft/item/ItemRing.java6
-rw-r--r--common/darkknight/jewelrycraft/item/ItemThiefGloves.java3
-rw-r--r--common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java2
-rw-r--r--common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java2
6 files changed, 21 insertions, 36 deletions
diff --git a/common/darkknight/jewelrycraft/block/BlockMolder.java b/common/darkknight/jewelrycraft/block/BlockMolder.java
index b5b8368..6ccaee5 100644
--- a/common/darkknight/jewelrycraft/block/BlockMolder.java
+++ b/common/darkknight/jewelrycraft/block/BlockMolder.java
@@ -42,10 +42,7 @@ public class BlockMolder extends BlockContainer
@Override
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
- {
- if (world.isRemote)
- return true;
-
+ {
TileEntityMolder te = (TileEntityMolder) world.getBlockTileEntity(i, j, k);
ItemStack item = entityPlayer.inventory.getCurrentItem();
if (te != null && item != null && !te.hasMold && item.itemID == ItemList.molds.itemID)
@@ -66,8 +63,6 @@ public class BlockMolder extends BlockContainer
@Override
public void onBlockDestroyedByPlayer(World world, int i, int j, int k, int par5)
{
- if (world.isRemote)
- return;
TileEntityMolder te = (TileEntityMolder) world.getBlockTileEntity(i, j, k);
if (te != null)
@@ -110,10 +105,7 @@ public class BlockMolder extends BlockContainer
@Override
public void onBlockDestroyedByExplosion(World world, int i, int j, int k, Explosion par5Explosion)
- {
- if (world.isRemote)
- return;
-
+ {
onBlockDestroyedByPlayer(world, i, j, k, 0);
}
@@ -121,21 +113,19 @@ public class BlockMolder extends BlockContainer
{
if (item != null)
{
+ ItemStack copy = null;
if (item.itemID == ItemList.ring.itemID && metal != null)
{
- Item r = new ItemRing(ItemList.ring.itemID, metal);
- item = new ItemStack(r);
+ Item r = new ItemRing(ItemList.ring.itemID, metal).setUnlocalizedName("jewelrycraft.ring");
+ copy = new ItemStack(r);
}
- player.inventory.addItemStackToInventory(item);
+ player.inventory.addItemStackToInventory(copy);
}
}
@Override
public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player)
- {
- if (world.isRemote)
- return;
-
+ {
TileEntityMolder me = (TileEntityMolder) world.getBlockTileEntity(i, j, k);
if (me != null && me.hasJewelBase)
{
diff --git a/common/darkknight/jewelrycraft/block/BlockSmelter.java b/common/darkknight/jewelrycraft/block/BlockSmelter.java
index b066284..c9cf575 100644
--- a/common/darkknight/jewelrycraft/block/BlockSmelter.java
+++ b/common/darkknight/jewelrycraft/block/BlockSmelter.java
@@ -41,10 +41,7 @@ public class BlockSmelter extends BlockContainer
@Override
public void onBlockDestroyedByPlayer(World world, int i, int j, int k, int par5)
- {
- if (world.isRemote)
- return;
-
+ {
TileEntitySmelter te = (TileEntitySmelter) world.getBlockTileEntity(i, j, k);
if (te != null)
{
@@ -77,10 +74,7 @@ public class BlockSmelter extends BlockContainer
@Override
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
- {
- if (world.isRemote)
- return true;
-
+ {
TileEntitySmelter te = (TileEntitySmelter) world.getBlockTileEntity(i, j, k);
ItemStack item = entityPlayer.inventory.getCurrentItem();
if (te != null && !world.isRemote)
@@ -111,10 +105,7 @@ public class BlockSmelter extends BlockContainer
@Override
public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player)
- {
- if (world.isRemote)
- return;
-
+ {
TileEntitySmelter te = (TileEntitySmelter) world.getBlockTileEntity(i, j, k);
TileEntityMolder me = null;
if (world.getBlockMetadata(i, j, k) == 0)
@@ -164,10 +155,7 @@ public class BlockSmelter extends BlockContainer
@Override
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack)
- {
- if (world.isRemote)
- return;
-
+ {
int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
}
diff --git a/common/darkknight/jewelrycraft/item/ItemRing.java b/common/darkknight/jewelrycraft/item/ItemRing.java
index 155261c..c96dd2f 100644
--- a/common/darkknight/jewelrycraft/item/ItemRing.java
+++ b/common/darkknight/jewelrycraft/item/ItemRing.java
@@ -5,6 +5,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
public class ItemRing extends ItemBase
{
@@ -33,6 +34,11 @@ public class ItemRing extends ItemBase
{
return 65535;
}
+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
+ {
+ par2EntityPlayer.addChatMessage("Hello");
+ return true;
+ }
/**
* allows items to add custom lines of information to the mouseover description
diff --git a/common/darkknight/jewelrycraft/item/ItemThiefGloves.java b/common/darkknight/jewelrycraft/item/ItemThiefGloves.java
index 97d83cd..3621dae 100644
--- a/common/darkknight/jewelrycraft/item/ItemThiefGloves.java
+++ b/common/darkknight/jewelrycraft/item/ItemThiefGloves.java
@@ -37,8 +37,9 @@ public class ItemThiefGloves extends ItemBase
while(iterator.hasNext())
{
MerchantRecipe recipe = (MerchantRecipe)iterator.next();
+ int toolUses = (Integer) ReflectionHelper.getPrivateValue(MerchantRecipe.class, recipe, "toolUses", "field_77400_d");
int quantity;
- if(recipe.getItemToSell().isStackable()) quantity = recipe.getItemToSell().stackSize * 7;
+ if(recipe.getItemToSell().isStackable()) quantity = recipe.getItemToSell().stackSize * (7 - toolUses);
else quantity = 1;
ItemStack s = new ItemStack(recipe.getItemToSell().itemID, quantity, recipe.getItemToSell().getItemDamage());
s.setTagCompound(recipe.getItemToSell().getTagCompound());
diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java b/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java
index 27cd27e..e52aaf4 100644
--- a/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java
+++ b/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java
@@ -87,7 +87,7 @@ public class TileEntityMolder extends TileEntity
for (int l = 0; l < 4; ++l)
{
//EntityFX entityfx = new EntityReddustFX(this.worldObj, (double)xCoord + Math.random(), (double)yCoord + 0.2D, (double)zCoord + Math.random(), 0.0F, 0.0F, 0.0F);
- this.worldObj.spawnParticle("reddust", (double)xCoord + Math.random(), (double)yCoord + 0.2F, (double)zCoord + Math.random(), 0.0D, 1.0D, 0.0D);
+ this.worldObj.spawnParticle("reddust", (double)xCoord, (double)yCoord + 0.2F, (double)zCoord, 0.0D, 1.0D, 0.0D);
}
}
}
diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java b/common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java
index cefd21e..d25534f 100644
--- a/common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java
+++ b/common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java
@@ -74,7 +74,7 @@ public class TileEntitySmelter extends TileEntity
this.worldObj.spawnParticle("flame", (double)xCoord + Math.random(), (double)yCoord + 0.5F, (double)zCoord + Math.random(), 0.0D, 0.0D, 0.0D);
}
}
- if(rand.nextInt(15) == 0){
+ if(rand.nextInt(65) == 0){
double d5 = (double)((float)this.xCoord + rand.nextFloat());
double d7 = (double)this.yCoord;
double d6 = (double)((float)this.zCoord + rand.nextFloat());