diff --git a/src/main/java/appeng/block/misc/BlockVibrationChamber.java b/src/main/java/appeng/block/misc/BlockVibrationChamber.java index 4da37d99..9dacb715 100644 --- a/src/main/java/appeng/block/misc/BlockVibrationChamber.java +++ b/src/main/java/appeng/block/misc/BlockVibrationChamber.java @@ -21,10 +21,11 @@ package appeng.block.misc; import java.util.EnumSet; import java.util.Random; - import javax.annotation.Nullable; 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.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -32,6 +33,7 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import appeng.api.util.AEPartLocation; @@ -47,12 +49,32 @@ import appeng.util.Platform; public final class BlockVibrationChamber extends AEBaseTileBlock { + // Indicates that the vibration chamber is currently working + private static final PropertyBool ACTIVE = PropertyBool.create( "active" ); + public BlockVibrationChamber() { super( Material.IRON ); this.setTileEntity( TileVibrationChamber.class ); this.setHardness( 4.2F ); this.setFeature( EnumSet.of( AEFeature.PowerGen ) ); + this.setDefaultState( getDefaultState().withProperty( ACTIVE, false ) ); + } + + @Override + public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos ) + { + TileVibrationChamber te = this.getTileEntity( world, pos ); + boolean active = te != null && te.isOn; + + return super.getActualState( state, world, pos ) + .withProperty( ACTIVE, active ); + } + + @Override + protected IProperty[] getAEStates() + { + return new IProperty[]{ AE_BLOCK_FORWARD, AE_BLOCK_UP, ACTIVE }; } @Override diff --git a/src/main/resources/assets/appliedenergistics2/blockstates/tile.BlockVibrationChamber.json b/src/main/resources/assets/appliedenergistics2/blockstates/tile.BlockVibrationChamber.json new file mode 100644 index 00000000..676b9081 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/blockstates/tile.BlockVibrationChamber.json @@ -0,0 +1,6 @@ +{ + "variants": { + "active=false": { "model": "appliedenergistics2:tile.BlockVibrationChamber.off" }, + "active=true": { "model": "appliedenergistics2:tile.BlockVibrationChamber.on" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/block/tile.BlockVibrationChamber.off.json b/src/main/resources/assets/appliedenergistics2/models/block/tile.BlockVibrationChamber.off.json new file mode 100644 index 00000000..7901c0b8 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/block/tile.BlockVibrationChamber.off.json @@ -0,0 +1,9 @@ +{ + "parent": "appliedenergistics2:block/cube/cube_AE_machine", + "textures": { + "front": "appliedenergistics2:blocks/BlockVibrationChamberFront", + "side": "appliedenergistics2:blocks/BlockVibrationChamber", + "top": "appliedenergistics2:blocks/BlockVibrationChamber", + "bottom": "appliedenergistics2:blocks/BlockVibrationChamber" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/block/tile.BlockVibrationChamber.on.json b/src/main/resources/assets/appliedenergistics2/models/block/tile.BlockVibrationChamber.on.json new file mode 100644 index 00000000..4c1e3776 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/block/tile.BlockVibrationChamber.on.json @@ -0,0 +1,6 @@ +{ + "parent": "appliedenergistics2:block/tile.BlockVibrationChamber.off", + "textures": { + "front": "appliedenergistics2:blocks/BlockVibrationChamberFrontOn" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/item/tile.BlockVibrationChamber.json b/src/main/resources/assets/appliedenergistics2/models/item/tile.BlockVibrationChamber.json new file mode 100644 index 00000000..19fd2abb --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/item/tile.BlockVibrationChamber.json @@ -0,0 +1,3 @@ +{ + "parent": "appliedenergistics2:block/tile.BlockVibrationChamber.off" +} \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockVibrationChamber.png b/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockVibrationChamber.png new file mode 100644 index 00000000..4381c6f1 Binary files /dev/null and b/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockVibrationChamber.png differ diff --git a/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockVibrationChamberFront.png b/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockVibrationChamberFront.png new file mode 100644 index 00000000..0ec54535 Binary files /dev/null and b/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockVibrationChamberFront.png differ diff --git a/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockVibrationChamberFrontOn.png b/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockVibrationChamberFrontOn.png new file mode 100644 index 00000000..9257adb7 Binary files /dev/null and b/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockVibrationChamberFrontOn.png differ