diff --git a/src/main/java/appeng/block/misc/BlockQuartzTorch.java b/src/main/java/appeng/block/misc/BlockQuartzTorch.java index 8804cb61..6621efc3 100644 --- a/src/main/java/appeng/block/misc/BlockQuartzTorch.java +++ b/src/main/java/appeng/block/misc/BlockQuartzTorch.java @@ -27,10 +27,12 @@ import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; +import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; @@ -52,15 +54,18 @@ import appeng.helpers.MetaRotation; public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, ICustomCollision { - + // Cannot use the vanilla FACING property here because it excludes facing DOWN - public static final PropertyDirection FACING = PropertyDirection.create("facing"); - + public static final PropertyDirection FACING = PropertyDirection.create( "facing" ); + + // Used to alternate between two variants of the torch on adjacent blocks + public static final PropertyBool ODD = PropertyBool.create( "odd" ); + public BlockQuartzTorch() { super( Material.CIRCUITS ); - this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.UP)); + this.setDefaultState( this.blockState.getBaseState().withProperty( FACING, EnumFacing.UP ).withProperty( ODD, false ) ); this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) ); this.setLightLevel( 0.9375F ); this.setLightOpacity( 0 ); @@ -68,10 +73,22 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I this.setOpaque( false ); } + /** + * Sets the "ODD" property of the block state according to the placement of the block. + */ + @Override + public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos ) + { + boolean oddPlacement = ((pos.getX() + pos.getY() + pos.getZ()) % 2) != 0; + + return super.getActualState( state, worldIn, pos ) + .withProperty( ODD, oddPlacement ); + } + @Override public int getMetaFromState( final IBlockState state ) { - return state.getValue(FACING).ordinal(); + return state.getValue( FACING ).ordinal(); } @Override @@ -84,7 +101,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I @Override protected IProperty[] getAEStates() { - return new IProperty[] { FACING }; + return new IProperty[] { FACING, ODD }; } @Override @@ -188,4 +205,23 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I { return new MetaRotation( w, pos, FACING ); } + + @Override + public boolean isOpaque() + { + return false; + } + + @Override + public boolean isFullCube( IBlockState state ) + { + return false; + } + + @SideOnly(Side.CLIENT) + public BlockRenderLayer getBlockLayer() + { + return BlockRenderLayer.CUTOUT; + } + } diff --git a/src/main/resources/assets/appliedenergistics2/blockstates/BlockQuartzTorch.json b/src/main/resources/assets/appliedenergistics2/blockstates/BlockQuartzTorch.json new file mode 100644 index 00000000..97ed478d --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/blockstates/BlockQuartzTorch.json @@ -0,0 +1,16 @@ +{ + "variants": { + "facing=up,odd=false": { "model": "appliedenergistics2:QuartzTorch.standing" }, + "facing=down,odd=false": { "model": "appliedenergistics2:QuartzTorch.standing", "x": 180 }, + "facing=north,odd=false": { "model": "appliedenergistics2:QuartzTorch.wall" }, + "facing=south,odd=false": { "model": "appliedenergistics2:QuartzTorch.wall", "y": 180 }, + "facing=east,odd=false": { "model": "appliedenergistics2:QuartzTorch.wall", "y": 90 }, + "facing=west,odd=false": { "model": "appliedenergistics2:QuartzTorch.wall", "y": 270 }, + "facing=up,odd=true": { "model": "appliedenergistics2:QuartzTorch.standing.odd" }, + "facing=down,odd=true": { "model": "appliedenergistics2:QuartzTorch.standing.odd", "x": 180 }, + "facing=north,odd=true": { "model": "appliedenergistics2:QuartzTorch.wall.odd" }, + "facing=south,odd=true": { "model": "appliedenergistics2:QuartzTorch.wall.odd", "y": 180 }, + "facing=east,odd=true": { "model": "appliedenergistics2:QuartzTorch.wall.odd", "y": 90 }, + "facing=west,odd=true": { "model": "appliedenergistics2:QuartzTorch.wall.odd", "y": 270 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/block/QuartzTorch.standing.json b/src/main/resources/assets/appliedenergistics2/models/block/QuartzTorch.standing.json new file mode 100644 index 00000000..a7e1712e --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/block/QuartzTorch.standing.json @@ -0,0 +1,125 @@ +{ + "textures": { + "quartz": "appliedenergistics2:blocks/BlockQuartzTorch", + "metal": "appliedenergistics2:blocks/BlockQuartzTorchMetal" + }, + "elements": [ + { + "name": "Middle Plate", + "from": [ 6.0, 3.0, 6.0 ], + "to": [ 10.0, 4.0, 10.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + }, + { + "name": "Lower Quartz Block", + "from": [ 7.0, 1.0, 7.0 ], + "to": [ 9.0, 3.0, 9.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Lower Quartz Tip", + "from": [ 7.0, 0.0, 7.0 ], + "to": [ 8.0, 1.0, 8.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Upper Quartz Block", + "from": [ 7.0, 4.0, 7.0 ], + "to": [ 9.0, 6.0, 9.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Upper Quartz Tip", + "from": [ 8.0, 6.0, 8.0 ], + "to": [ 9.0, 7.0, 9.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "NW Feet", + "from": [ 6.0, 0.0, 6.0 ], + "to": [ 7.0, 3.0, 7.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + }, + { + "name": "NE Feet", + "from": [ 6.0, 0.0, 9.0 ], + "to": [ 7.0, 3.0, 10.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + }, + { + "name": "SW Feet", + "from": [ 9.0, 0.0, 6.0 ], + "to": [ 10.0, 3.0, 7.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + }, + { + "name": "SE Feet", + "from": [ 9.0, 0.0, 9.0 ], + "to": [ 10.0, 3.0, 10.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/block/QuartzTorch.standing.odd.json b/src/main/resources/assets/appliedenergistics2/models/block/QuartzTorch.standing.odd.json new file mode 100644 index 00000000..acba5e70 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/block/QuartzTorch.standing.odd.json @@ -0,0 +1,125 @@ +{ + "textures": { + "quartz": "appliedenergistics2:blocks/BlockQuartzTorch", + "metal": "appliedenergistics2:blocks/BlockQuartzTorchMetal" + }, + "elements": [ + { + "name": "Middle Plate", + "from": [ 6.0, 3.0, 6.0 ], + "to": [ 10.0, 4.0, 10.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + }, + { + "name": "Lower Quartz Block", + "from": [ 7.0, 1.0, 7.0 ], + "to": [ 9.0, 3.0, 9.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Lower Quartz Tip", + "from": [ 8.0, 0.0, 8.0 ], + "to": [ 9.0, 1.0, 9.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Upper Quartz Block", + "from": [ 7.0, 4.0, 7.0 ], + "to": [ 9.0, 6.0, 9.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Upper Quartz Tip", + "from": [ 7.0, 6.0, 7.0 ], + "to": [ 8.0, 7.0, 8.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "NW Feet", + "from": [ 6.0, 0.0, 6.0 ], + "to": [ 7.0, 3.0, 7.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + }, + { + "name": "NE Feet", + "from": [ 6.0, 0.0, 9.0 ], + "to": [ 7.0, 3.0, 10.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + }, + { + "name": "SW Feet", + "from": [ 9.0, 0.0, 6.0 ], + "to": [ 10.0, 3.0, 7.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + }, + { + "name": "SE Feet", + "from": [ 9.0, 0.0, 9.0 ], + "to": [ 10.0, 3.0, 10.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/block/QuartzTorch.wall.json b/src/main/resources/assets/appliedenergistics2/models/block/QuartzTorch.wall.json new file mode 100644 index 00000000..6d6f2320 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/block/QuartzTorch.wall.json @@ -0,0 +1,87 @@ +{ + "ambientocclusion": false, + "textures": { + "quartz": "appliedenergistics2:blocks/BlockQuartzTorch", + "metal": "appliedenergistics2:blocks/BlockQuartzTorchMetal" + }, + "elements": [ + { + "name": "Connecting Strut", + "from": [ 7.0, 7.0, 14.0 ], + "to": [ 8.0, 8.0, 16.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + }, + { + "name": "Middle Plate", + "from": [ 6.0, 7.0, 10.0 ], + "to": [ 10.0, 8.0, 14.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + }, + { + "name": "Lower Quartz Block", + "from": [ 7.0, 5.0, 11.0 ], + "to": [ 9.0, 7.0, 13.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Lower Quartz Tip", + "from": [ 7.0, 4.0, 11.0 ], + "to": [ 8.0, 5.0, 12.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Upper Quartz Block", + "from": [ 7.0, 8.0, 11.0 ], + "to": [ 9.0, 10.0, 13.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Upper Quartz Tip", + "from": [ 8.0, 10.0, 12.0 ], + "to": [ 9.0, 11.0, 13.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/block/QuartzTorch.wall.odd.json b/src/main/resources/assets/appliedenergistics2/models/block/QuartzTorch.wall.odd.json new file mode 100644 index 00000000..ebfb6150 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/block/QuartzTorch.wall.odd.json @@ -0,0 +1,87 @@ +{ + "ambientocclusion": false, + "textures": { + "quartz": "appliedenergistics2:blocks/BlockQuartzTorch", + "metal": "appliedenergistics2:blocks/BlockQuartzTorchMetal" + }, + "elements": [ + { + "name": "Connecting Strut", + "from": [ 7.0, 7.0, 14.0 ], + "to": [ 8.0, 8.0, 16.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + }, + { + "name": "Middle Plate", + "from": [ 6.0, 7.0, 10.0 ], + "to": [ 10.0, 8.0, 14.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + }, + { + "name": "Lower Quartz Block", + "from": [ 7.0, 5.0, 11.0 ], + "to": [ 9.0, 7.0, 13.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Lower Quartz Tip", + "from": [ 8.0, 4.0, 12.0 ], + "to": [ 9.0, 5.0, 13.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Upper Quartz Block", + "from": [ 7.0, 8.0, 11.0 ], + "to": [ 9.0, 10.0, 13.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Upper Quartz Tip", + "from": [ 7.0, 10.0, 11.0 ], + "to": [ 8.0, 11.0, 12.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/models/item/BlockQuartzTorch.json b/src/main/resources/assets/appliedenergistics2/models/item/BlockQuartzTorch.json new file mode 100644 index 00000000..89acf775 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/item/BlockQuartzTorch.json @@ -0,0 +1,74 @@ +{ + "parent": "block/block", + "textures": { + "quartz": "appliedenergistics2:blocks/BlockQuartzTorch", + "metal": "appliedenergistics2:blocks/BlockQuartzTorchMetal" + }, + "elements": [ + { + "name": "Middle Plate", + "from": [ 6.0, 8.0, 6.0 ], + "to": [ 10.0, 9.0, 10.0 ], + "faces": { + "north": { "texture": "#metal" }, + "east": { "texture": "#metal" }, + "south": { "texture": "#metal" }, + "west": { "texture": "#metal" }, + "up": { "texture": "#metal" }, + "down": { "texture": "#metal" } + } + }, + { + "name": "Lower Quartz Block", + "from": [ 7.0, 6.0, 7.0 ], + "to": [ 9.0, 8.0, 9.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Lower Quartz Tip", + "from": [ 8.0, 5.0, 7.0 ], + "to": [ 9.0, 6.0, 8.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Upper Quartz Block", + "from": [ 7.0, 9.0, 7.0 ], + "to": [ 9.0, 11.0, 9.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + }, + { + "name": "Upper Quartz Tip", + "from": [ 7.0, 11.0, 8.0 ], + "to": [ 8.0, 12.0, 9.0 ], + "faces": { + "north": { "texture": "#quartz" }, + "east": { "texture": "#quartz" }, + "south": { "texture": "#quartz" }, + "west": { "texture": "#quartz" }, + "up": { "texture": "#quartz" }, + "down": { "texture": "#quartz" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockQuartzTorch.png b/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockQuartzTorch.png new file mode 100644 index 00000000..4c61b6dd Binary files /dev/null and b/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockQuartzTorch.png differ diff --git a/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockQuartzTorchMetal.png b/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockQuartzTorchMetal.png new file mode 100644 index 00000000..c2ef6662 Binary files /dev/null and b/src/main/resources/assets/appliedenergistics2/textures/blocks/BlockQuartzTorchMetal.png differ