mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-19 12:09:12 +00:00
Change package name for realsies now :P
This commit is contained in:
1 parent
4d8df815cc
commit
dae454dc17
138 files changed
+491
-438
No files matched your search
@@ -0,0 +1,58 @@
|
||||
package com.cricketcraft.chisel.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cricketcraft.chisel.Configurations;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.carving.CarvableVariation;
|
||||
import com.cricketcraft.chisel.utils.General;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class ItemCarvable extends ItemBlock
|
||||
{
|
||||
|
||||
public ItemCarvable(Block block)
|
||||
{
|
||||
super(block);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage)
|
||||
{
|
||||
return Block.getBlockFromItem(this).getIcon(2, damage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips)
|
||||
{
|
||||
if(!Configurations.blockDescriptions) return;
|
||||
|
||||
Item item = General.getItem(stack);
|
||||
if(item == null) return;
|
||||
|
||||
Block block = Block.getBlockFromItem(this);
|
||||
if(!(block instanceof ICarvable)) return;
|
||||
|
||||
ICarvable carvable = (ICarvable) block;
|
||||
CarvableVariation var = carvable.getVariation(stack.getItemDamage());
|
||||
if(var == null)
|
||||
return;
|
||||
|
||||
lines.add(var.description);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user