Added a powered state for the crystal growth accelerator and added corresponding models. (#39)
This commit is contained in:
parent
5a7d099413
commit
7f923d7f25
|
@ -24,10 +24,13 @@ import java.util.Random;
|
|||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
|
@ -41,12 +44,32 @@ import appeng.util.Platform;
|
|||
|
||||
public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
private static final PropertyBool POWERED = PropertyBool.create( "powered" );
|
||||
|
||||
public BlockQuartzGrowthAccelerator()
|
||||
{
|
||||
super( Material.ROCK );
|
||||
this.setSoundType( SoundType.METAL );
|
||||
this.setTileEntity( TileQuartzGrowthAccelerator.class );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
this.setDefaultState( getDefaultState().withProperty( POWERED, false ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
TileQuartzGrowthAccelerator te = getTileEntity( world, pos );
|
||||
boolean powered = te != null && te.isPowered();
|
||||
|
||||
return super.getActualState( state, world, pos )
|
||||
.withProperty( POWERED, powered );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IProperty[] getAEStates()
|
||||
{
|
||||
return new IProperty[] { AE_BLOCK_FORWARD, AE_BLOCK_UP, POWERED };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"variants": {
|
||||
"powered=false": { "model": "appliedenergistics2:tile.BlockQuartzGrowthAccelerator.off" },
|
||||
"powered=true": { "model": "appliedenergistics2:tile.BlockQuartzGrowthAccelerator.on" }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "block/cube_bottom_top",
|
||||
"textures": {
|
||||
"side": "appliedenergistics2:blocks/BlockQuartzGrowthAcceleratorSide",
|
||||
"bottom": "appliedenergistics2:blocks/BlockQuartzGrowthAccelerator",
|
||||
"top": "appliedenergistics2:blocks/BlockQuartzGrowthAccelerator"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "block/cube_bottom_top",
|
||||
"textures": {
|
||||
"side": "appliedenergistics2:blocks/BlockQuartzGrowthAcceleratorSideOn",
|
||||
"bottom": "appliedenergistics2:blocks/BlockQuartzGrowthAcceleratorOn",
|
||||
"top": "appliedenergistics2:blocks/BlockQuartzGrowthAcceleratorOn"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "appliedenergistics2:block/tile.BlockQuartzGrowthAccelerator.off"
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 646 B |
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"animation": {
|
||||
"frametime": 4,
|
||||
"frames": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 655 B |
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"animation": {
|
||||
"frametime": 4,
|
||||
"frames": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue