Merge pull request #2308 from ganymedes01/6.3.x
Return false when recolouring block to it's original colour.
This commit is contained in:
commit
67aa4b4d92
2 changed files with 5 additions and 4 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue