Merge pull request #2308 from ganymedes01/6.3.x

Return false when recolouring block to it's original colour.
This commit is contained in:
Adrian Siekierka 2014-12-15 06:13:00 +01:00
commit 67aa4b4d92
2 changed files with 5 additions and 4 deletions

View file

@ -1312,8 +1312,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour) {
TileGenericPipe pipeTile = (TileGenericPipe) world.getTileEntity(x, y, z);
if (!pipeTile.hasPlug(side)) {
pipeTile.setColor(colour);
return true;
return pipeTile.setColor(colour);
}
return false;

View file

@ -434,13 +434,15 @@ public class TileGenericPipe extends TileEntity implements IFluidHandler,
return worldObj.isRemote ? renderState.glassColor : this.glassColor;
}
public void setColor(int color) {
public boolean setColor(int color) {
// -1 = no color
if (!worldObj.isRemote && color >= -1 && color < 16) {
if (!worldObj.isRemote && color >= -1 && color < 16 && glassColor != color) {
glassColor = color;
notifyBlockChanged();
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, blockType);
return true;
}
return false;
}
/**