mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-13 00:47:32 +00:00
Colored frying pans
- Added colored frying pans - Switched frying pans to using the itemstack sensitive container item since the non-sensitive version was deprecated.
This commit is contained in:
1 parent
80efde613a
commit
2f44669d52
5 files changed
+72
-28
No files matched your search
@@ -16,6 +16,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.*;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.items.tools.FryingPan;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.tools.ToolProxyCommon;
|
||||
import tconstruct.tools.logic.*;
|
||||
import tconstruct.tools.model.FrypanRender;
|
||||
@@ -194,6 +196,34 @@ public class EquipBlock extends InventoryBlock
|
||||
return TConstruct.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier (IBlockAccess blockAccess, int x, int y, int z)
|
||||
{
|
||||
TileEntity te = blockAccess.getTileEntity(x, y, z);
|
||||
|
||||
if (te instanceof FrypanLogic)
|
||||
{
|
||||
FrypanLogic logic = (FrypanLogic) te;
|
||||
ItemStack stack = logic.getEquipmentItem();
|
||||
if (stack != null && stack.getItem() instanceof FryingPan)
|
||||
{
|
||||
FryingPan pan = (FryingPan) stack.getItem();
|
||||
|
||||
NBTTagCompound tag = stack.getTagCompound().getCompoundTag("InfiTool");
|
||||
|
||||
if (tag != null)
|
||||
{
|
||||
int head = tag.getInteger("Head");
|
||||
|
||||
return TConstructRegistry.getMaterial(head).primaryColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity (World world, int metadata)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user