wireless transmitter texture

This commit is contained in:
Raoul Van den Berge
2015-12-29 22:42:40 +01:00
parent 9a31aa1029
commit 8d93592217
7 changed files with 80 additions and 0 deletions

View File

@@ -1,10 +1,14 @@
package storagecraft.block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import storagecraft.StorageCraft;
import storagecraft.StorageCraftGUI;
@@ -13,11 +17,31 @@ import storagecraft.tile.TileWirelessTransmitter;
// @TODO: This texture behaves differently
public class BlockWirelessTransmitter extends BlockMachine
{
public static final PropertyBool WORKING = PropertyBool.create("working");
public BlockWirelessTransmitter()
{
super("wireless_transmitter");
}
@Override
protected BlockState createBlockState()
{
return new BlockState(this, new IProperty[]
{
DIRECTION,
CONNECTED,
WORKING
});
}
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
{
return super.getActualState(state, world, pos)
.withProperty(WORKING, ((TileWirelessTransmitter) world.getTileEntity(pos)).isWorking());
}
@Override
public TileEntity createTileEntity(World world, IBlockState state)
{

View File

@@ -113,5 +113,6 @@ public class ClientProxy extends CommonProxy
mesher.register(Item.getItemFromBlock(StorageCraftBlocks.CONSTRUCTOR), 0, new ModelResourceLocation("storagecraft:constructor", "inventory"));
mesher.register(Item.getItemFromBlock(StorageCraftBlocks.DESTRUCTOR), 0, new ModelResourceLocation("storagecraft:destructor", "inventory"));
mesher.register(Item.getItemFromBlock(StorageCraftBlocks.SOLDERER), 0, new ModelResourceLocation("storagecraft:solderer", "inventory"));
mesher.register(Item.getItemFromBlock(StorageCraftBlocks.WIRELESS_TRANSMITTER), 0, new ModelResourceLocation("storagecraft:wireless_transmitter", "inventory"));
}
}