Search in sources :

Example 1 with ISignEditWidget

use of pneumaticCraft.common.progwidgets.ISignEditWidget in project PneumaticCraft by MineMaarten.

the class DroneAIEditSign method isValidPosition.

@Override
protected boolean isValidPosition(ChunkPosition pos) {
    TileEntity te = drone.getWorld().getTileEntity(pos.chunkPosX, pos.chunkPosY, pos.chunkPosZ);
    if (te instanceof TileEntitySign) {
        TileEntitySign sign = (TileEntitySign) te;
        String[] lines = ((ISignEditWidget) widget).getLines();
        for (int i = 0; i < 4; i++) {
            sign.signText[i] = i < lines.length ? lines[i] : "";
        }
        drone.getWorld().markBlockForUpdate(pos.chunkPosX, pos.chunkPosY, pos.chunkPosZ);
    } else if (te instanceof TileEntityAphorismTile) {
        TileEntityAphorismTile sign = (TileEntityAphorismTile) te;
        sign.setTextLines(((ISignEditWidget) widget).getLines());
    }
    return false;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntitySign(net.minecraft.tileentity.TileEntitySign) ISignEditWidget(pneumaticCraft.common.progwidgets.ISignEditWidget) TileEntityAphorismTile(pneumaticCraft.common.tileentity.TileEntityAphorismTile)

Aggregations

TileEntity (net.minecraft.tileentity.TileEntity)1 TileEntitySign (net.minecraft.tileentity.TileEntitySign)1 ISignEditWidget (pneumaticCraft.common.progwidgets.ISignEditWidget)1 TileEntityAphorismTile (pneumaticCraft.common.tileentity.TileEntityAphorismTile)1