mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-24 05:54:27 +00:00
Fix unpainted blocks being unexpectedly unpainted
This commit is contained in:
1 parent
db8f99379b
commit
de0ca0f0dd
3 files changed
+25
-15
No files matched your search
@@ -22,6 +22,7 @@ import crazypants.enderio.machine.AbstractMachineBlock;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.machine.painter.BasicPainterTemplate;
|
||||
import crazypants.enderio.machine.painter.IPaintableTileEntity;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.util.IFacade;
|
||||
@@ -179,8 +180,11 @@ public class BlockBuffer extends AbstractMachineBlock<TileBuffer> implements IFa
|
||||
@Override
|
||||
public Block getFacade(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileBuffer) {
|
||||
return ((TileBuffer) te).getSourceBlock();
|
||||
if (te instanceof IPaintableTileEntity) {
|
||||
Block sourceBlock = ((IPaintableTileEntity) te).getSourceBlock();
|
||||
if (sourceBlock != null) {
|
||||
return sourceBlock;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -288,9 +288,11 @@ public class BlockPaintedGlowstone extends BlockEio implements ITileEntityProvid
|
||||
@Override
|
||||
public Block getFacade(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileEntityPaintedBlock) {
|
||||
TileEntityPaintedBlock tef = (TileEntityPaintedBlock) te;
|
||||
return tef.getSourceBlock();
|
||||
if (te instanceof IPaintableTileEntity) {
|
||||
Block sourceBlock = ((IPaintableTileEntity) te).getSourceBlock();
|
||||
if (sourceBlock != null) {
|
||||
return sourceBlock;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.machine.painter.BasicPainterTemplate;
|
||||
import crazypants.enderio.machine.painter.IPaintableTileEntity;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.teleport.ContainerTravelAccessable;
|
||||
@@ -95,10 +96,10 @@ public class BlockTravelAnchor extends BlockEio implements IGuiHandler, ITileEnt
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int blockSide) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileTravelAnchor) {
|
||||
TileTravelAnchor tef = (TileTravelAnchor) te;
|
||||
if (tef.getSourceBlock() != null) {
|
||||
return tef.getSourceBlock().getIcon(blockSide, tef.getSourceBlockMetadata());
|
||||
if (te instanceof IPaintableTileEntity) {
|
||||
Block sourceBlock = ((IPaintableTileEntity) te).getSourceBlock();
|
||||
if (sourceBlock != null) {
|
||||
return sourceBlock.getIcon(blockSide, ((IPaintableTileEntity) te).getSourceBlockMetadata());
|
||||
}
|
||||
}
|
||||
return super.getIcon(world, x, y, z, blockSide);
|
||||
@@ -197,10 +198,10 @@ public class BlockTravelAnchor extends BlockEio implements IGuiHandler, ITileEnt
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileTravelAnchor) {
|
||||
TileTravelAnchor tef = (TileTravelAnchor) te;
|
||||
if (tef.getSourceBlock() != null) {
|
||||
return tef.getSourceBlock().colorMultiplier(world, x, y, z);
|
||||
if (te instanceof IPaintableTileEntity) {
|
||||
Block sourceBlock = ((IPaintableTileEntity) te).getSourceBlock();
|
||||
if (sourceBlock != null) {
|
||||
return sourceBlock.colorMultiplier(world, x, y, z);
|
||||
}
|
||||
}
|
||||
return super.colorMultiplier(world, x, y, z);
|
||||
@@ -258,8 +259,11 @@ public class BlockTravelAnchor extends BlockEio implements IGuiHandler, ITileEnt
|
||||
@Override
|
||||
public Block getFacade(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileTravelAnchor) {
|
||||
return ((TileTravelAnchor) te).getSourceBlock();
|
||||
if (te instanceof IPaintableTileEntity) {
|
||||
Block sourceBlock = ((IPaintableTileEntity) te).getSourceBlock();
|
||||
if (sourceBlock != null) {
|
||||
return sourceBlock;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user