Added the "rainbow" effect to molecular assemblers.
This commit is contained in:
parent
5493757d25
commit
21f4d5e6b6
|
@ -22,6 +22,8 @@ package appeng.block.crafting;
|
|||
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;
|
||||
|
@ -29,7 +31,10 @@ import net.minecraft.util.BlockRenderLayer;
|
|||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
|
@ -40,6 +45,8 @@ import appeng.util.Platform;
|
|||
public class BlockMolecularAssembler extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
public static final PropertyBool POWERED = PropertyBool.create( "powered" );
|
||||
|
||||
public BlockMolecularAssembler()
|
||||
{
|
||||
super( Material.IRON );
|
||||
|
@ -50,9 +57,33 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInLayer( final IBlockState state, final BlockRenderLayer layer )
|
||||
protected IProperty[] getAEStates()
|
||||
{
|
||||
return layer == BlockRenderLayer.CUTOUT_MIPPED;
|
||||
return new IProperty[] { POWERED };
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
|
||||
{
|
||||
boolean powered = false;
|
||||
TileMolecularAssembler te = getTileEntity( worldIn, pos );
|
||||
if( te != null )
|
||||
{
|
||||
powered = te.isPowered();
|
||||
}
|
||||
|
||||
return super.getActualState( state, worldIn, pos ).withProperty( POWERED, powered );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT)
|
||||
public BlockRenderLayer getBlockLayer()
|
||||
{
|
||||
return BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "appliedenergistics2:molecular_assembler"
|
||||
},
|
||||
"variants": {
|
||||
"normal": { "model": "appliedenergistics2:molecular_assembler" }
|
||||
"powered": {
|
||||
"false": {},
|
||||
"true": {
|
||||
"submodel": "appliedenergistics2:molecular_assembler_lights"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"uvlMarker": true,
|
||||
"parent": "block/block",
|
||||
"textures": {
|
||||
"all": "appliedenergistics2:blocks/molecular_assembler_lights"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [2, 2, 2],
|
||||
"to": [14, 14, 14],
|
||||
"faces": {
|
||||
"down": { "texture": "#all", "uv": [2.6, 2.6, 13.4, 13.4], "cullface": "down" },
|
||||
"up": { "texture": "#all", "uv": [2.6, 2.6, 13.4, 13.4], "cullface": "up" },
|
||||
"north": { "texture": "#all", "uv": [2.6, 2.6, 13.4, 13.4], "cullface": "north" },
|
||||
"south": { "texture": "#all", "uv": [2.6, 2.6, 13.4, 13.4], "cullface": "south" },
|
||||
"west": { "texture": "#all", "uv": [2.6, 2.6, 13.4, 13.4], "cullface": "west" },
|
||||
"east": { "texture": "#all", "uv": [2.6, 2.6, 13.4, 13.4], "cullface": "east" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 1006 B After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in New Issue