Skip to content

Commit

Permalink
"Tsuki no me" almost complete
Browse files Browse the repository at this point in the history
Becomes super apparent what project "Tsuki no me" is about
  • Loading branch information
fuj1n committed Sep 26, 2013
1 parent 21a611e commit abdd27c
Show file tree
Hide file tree
Showing 11 changed files with 922 additions and 665 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 36 additions & 4 deletions src/tconstruct/blocks/RedstoneMachine.java
Expand Up @@ -35,10 +35,10 @@ public RedstoneMachine(int id)
@Override
public int getLightValue (IBlockAccess world, int x, int y, int z)
{
if (world.getBlockMetadata(x, y, z) == 0)
if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2)
{
TileEntity logic = world.getBlockTileEntity(x, y, z);

if (logic != null && logic instanceof DrawbridgeLogic)
{
if (((DrawbridgeLogic) logic).getStackInSlot(1) != null)
Expand All @@ -48,6 +48,16 @@ public int getLightValue (IBlockAccess world, int x, int y, int z)
return lightValue[stack.itemID];
}
}

if (logic != null && logic instanceof AdvancedDrawbridgeLogic)
{
if (((AdvancedDrawbridgeLogic) logic).camoInventory.getCamoStack() != null)
{
ItemStack stack = ((AdvancedDrawbridgeLogic) logic).camoInventory.getCamoStack();
if (stack.itemID < 4096 && Block.blocksList[stack.itemID] != null)
return lightValue[stack.itemID];
}
}
}
return super.getLightValue(world, x, y, z);
}
Expand Down Expand Up @@ -80,8 +90,8 @@ public TileEntity createTileEntity (World world, int metadata)
return new DrawbridgeLogic();
case 1:
return new FirestarterLogic();
// case 2:
// return new AdvancedDrawbridgeLogic();
case 2:
return new AdvancedDrawbridgeLogic();
default:
return null;
}
Expand All @@ -95,6 +105,8 @@ public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplay
{
case 0:
return TConstruct.proxy.drawbridgeID;
case 2:
return TConstruct.proxy.advDrawbridgeID;
}
return null;
}
Expand Down Expand Up @@ -168,6 +180,26 @@ public Icon getBlockTexture (IBlockAccess world, int x, int y, int z, int side)
return icons[getTextureIndex(side)];
}
}

if (meta == 2)
{
AdvancedDrawbridgeLogic drawbridge = (AdvancedDrawbridgeLogic) logic;
ItemStack stack = drawbridge.camoInventory.getCamoStack();
if (stack != null && stack.itemID < 4096)
{
Block block = Block.blocksList[stack.itemID];
if (block != null && block.renderAsNormalBlock())
return block.getIcon(side, stack.getItemDamage());
}
if (side == direction)
{
return icons[getTextureIndex(side) + 3];
}
else
{
return icons[getTextureIndex(side)];
}
}

if (meta == 1)
{
Expand Down

0 comments on commit abdd27c

Please sign in to comment.