Fixed #181 - Rubble not stacking properly
This commit is contained in:
parent
2671882e04
commit
5725a99501
1 changed files with 9 additions and 9 deletions
|
@ -41,6 +41,13 @@ public class ItemOreResource extends ItemRI
|
|||
setMaxDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
// par3List.add("TEST" +
|
||||
// itemStack.getTagCompound().equals(getStackFromMaterial(getMaterialFromStack(itemStack)).getTagCompound()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemDisplayName(ItemStack is)
|
||||
{
|
||||
|
@ -203,21 +210,14 @@ public class ItemOreResource extends ItemRI
|
|||
public ItemStack getStackFromMaterial(String name)
|
||||
{
|
||||
ItemStack itemStack = new ItemStack(this);
|
||||
NBTTagCompound nbt = NBTUtility.getNBTTagCompound(itemStack);
|
||||
nbt.setString("name", name);
|
||||
itemStack.setItemDamage(ResourceGenerator.materialNames.indexOf(name));
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public static String getMaterialFromStack(ItemStack itemStack)
|
||||
{
|
||||
NBTTagCompound nbt = NBTUtility.getNBTTagCompound(itemStack);
|
||||
|
||||
if (nbt.hasKey("name"))
|
||||
{
|
||||
return nbt.getString("name");
|
||||
}
|
||||
|
||||
if (ResourceGenerator.materialNames.size() > itemStack.getItemDamage())
|
||||
return ResourceGenerator.materialNames.get(itemStack.getItemDamage());
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue