Added Feature: #0633 - [Aesthetical] Recoloring of specific blocks

This commit is contained in:
AlgorithmX2
2014-07-16 23:44:02 -05:00
parent 4e3d829f38
commit 683a5ee765
12 changed files with 254 additions and 39 deletions
+24
View File
@@ -28,6 +28,8 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.implementations.items.IMemoryCard;
import appeng.api.implementations.items.MemoryCardMessages;
import appeng.api.implementations.tiles.IColorableTile;
import appeng.api.util.AEColor;
import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock;
import appeng.block.networking.BlockCableBus;
@@ -764,6 +766,28 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
return 0;
}
@Override
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour)
{
TileEntity te = getTileEntity( world, x, y, z );
if ( te instanceof IColorableTile )
{
IColorableTile ct = (IColorableTile) te;
AEColor c = ct.getColor();
AEColor newColor = AEColor.values()[colour];
if ( c != newColor )
{
ct.setColor( newColor );
return true;
}
return false;
}
return super.recolourBlock( world, x, y, z, side, colour );
}
@Override
public void onBlockPlacedBy(World w, int x, int y, int z, EntityLivingBase player, ItemStack is)
{