diff --git a/src/main/java/com/minelittlepony/unicopia/block/BlockDirected.java b/src/main/java/com/minelittlepony/unicopia/block/BlockDirected.java new file mode 100644 index 00000000..1215c1c9 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/BlockDirected.java @@ -0,0 +1,53 @@ +package com.minelittlepony.unicopia.block; + +import net.minecraft.block.BlockDirectional; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.Mirror; +import net.minecraft.util.Rotation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class BlockDirected extends BlockDirectional { + + public BlockDirected(Material material, String domain, String name) { + super(material); + setTranslationKey(name); + setRegistryName(domain, name); + + setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.UP)); + } + + @Override + public IBlockState withRotation(IBlockState state, Rotation rot) { + return state.withProperty(FACING, rot.rotate(state.getValue(FACING))); + } + + @Override + public IBlockState withMirror(IBlockState state, Mirror mirror) { + return state.withProperty(FACING, mirror.mirror(state.getValue(FACING))); + } + + @Override + public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { + return getDefaultState().withProperty(FACING, facing); + } + + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(FACING, EnumFacing.byIndex(meta)); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(FACING).getIndex(); + } + + @Override + protected BlockStateContainer createBlockState() { + return new BlockStateContainer(this, FACING); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/init/UBlocks.java b/src/main/java/com/minelittlepony/unicopia/init/UBlocks.java index 0b5b1c15..815c7561 100644 --- a/src/main/java/com/minelittlepony/unicopia/init/UBlocks.java +++ b/src/main/java/com/minelittlepony/unicopia/init/UBlocks.java @@ -13,6 +13,7 @@ import com.minelittlepony.unicopia.block.BlockCloudAnvil; import com.minelittlepony.unicopia.block.BlockCloudBanister; import com.minelittlepony.unicopia.block.BlockCloudSlab; import com.minelittlepony.unicopia.block.BlockCloudStairs; +import com.minelittlepony.unicopia.block.BlockDirected; import com.minelittlepony.unicopia.block.BlockDutchDoor; import com.minelittlepony.unicopia.block.BlockSugar; import com.minelittlepony.unicopia.block.BlockTomatoPlant; @@ -31,6 +32,7 @@ import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.color.BlockColors; import net.minecraft.client.renderer.color.ItemColors; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -75,6 +77,11 @@ public class UBlocks { public static final BlockHiveWall hive = new BlockHiveWall(Unicopia.MODID, "hive"); public static final BlockChitin chitin = new BlockChitin(Unicopia.MODID, "chitin_block"); + public static final Block chissled_chitin = new BlockDirected(UMaterials.hive, Unicopia.MODID, "chissled_chitin") + .setCreativeTab(CreativeTabs.BUILDING_BLOCKS) + .setHardness(50) + .setResistance(2000); + public static final BlockGrowingCuccoon cuccoon = new BlockGrowingCuccoon(Unicopia.MODID, "cuccoon"); public static final BlockSlimeLayer slime_layer = new BlockSlimeLayer(Unicopia.MODID, "slime_layer"); @@ -97,7 +104,7 @@ public class UBlocks { packed_cloud_slab, packed_cloud_slab.doubleSlab, cloud_fence, cloud_banister, mist_door, library_door, bakery_door, - hive, chitin, cuccoon, slime_layer, + hive, chitin, chissled_chitin, cuccoon, slime_layer, anvil, cloud_farmland, sugar_block, flower_pot, alfalfa, diff --git a/src/main/java/com/minelittlepony/unicopia/init/UItems.java b/src/main/java/com/minelittlepony/unicopia/init/UItems.java index 1eb34600..15e737f9 100644 --- a/src/main/java/com/minelittlepony/unicopia/init/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/init/UItems.java @@ -109,6 +109,8 @@ public class UItems { .setRegistryName(Unicopia.MODID, "chitin_shell"); public static final Item chitin = new ItemBlock(UBlocks.chitin) .setRegistryName(Unicopia.MODID, "chitin_block"); + public static final Item chissled_chitin = new ItemBlock(UBlocks.chissled_chitin) + .setRegistryName(Unicopia.MODID, "chissled_chitin"); public static final Item cuccoon = new ItemBlock(UBlocks.cuccoon) .setRegistryName(Unicopia.MODID, "cuccoon"); public static final Item slime_layer = new UnFuckedItemSnow(UBlocks.slime_layer) @@ -249,7 +251,7 @@ public class UItems { cloudsdale_tomato, tomato_seeds, tomato, moss, - hive, chitin_shell, chitin, cuccoon, slime_layer, + hive, chitin_shell, chitin, chissled_chitin, cuccoon, slime_layer, apple_seeds, apple_leaves, @@ -282,7 +284,7 @@ public class UItems { cereal, sugar_cereal, sugar_block, tomato_seeds, - hive, chitin_shell, chitin, cuccoon, slime_layer, + hive, chitin_shell, chitin, chissled_chitin, cuccoon, slime_layer, apple_seeds, apple_leaves, diff --git a/src/main/resources/assets/unicopia/blockstates/chissled_chitin.json b/src/main/resources/assets/unicopia/blockstates/chissled_chitin.json new file mode 100644 index 00000000..81a3c03a --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/chissled_chitin.json @@ -0,0 +1,10 @@ +{ + "variants": { + "facing=up": { "model": "unicopia:chissled_chitin" }, + "facing=down": { "model": "unicopia:chissled_chitin", "x": 180 }, + "facing=north": { "model": "unicopia:chissled_chitin", "x": 90 }, + "facing=south": { "model": "unicopia:chissled_chitin", "x": -90 }, + "facing=east": { "model": "unicopia:chissled_chitin", "x": 90, "y": 90 }, + "facing=west": { "model": "unicopia:chissled_chitin", "x": 90, "y": -90 } + } +} diff --git a/src/main/resources/assets/unicopia/lang/en_US.lang b/src/main/resources/assets/unicopia/lang/en_US.lang index 51b7594f..cb61a11c 100644 --- a/src/main/resources/assets/unicopia/lang/en_US.lang +++ b/src/main/resources/assets/unicopia/lang/en_US.lang @@ -16,6 +16,7 @@ tile.cloud_farmland.name=Tilled Clouds tile.hive.name=Hive Wall tile.chitin_block.name=Chitin Block +tile.chissled_chitin.name=Chiseled Chitin Block tile.chitin_shell.name=Chitin Shell tile.cuccoon.name=Cocoon tile.slime_layer.name=Slime diff --git a/src/main/resources/assets/unicopia/models/block/chissled_chitin.json b/src/main/resources/assets/unicopia/models/block/chissled_chitin.json new file mode 100644 index 00000000..8b2206ab --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/chissled_chitin.json @@ -0,0 +1,22 @@ +{ + "parent": "block/cube_all", + "textures": { + "bottom": "unicopia:blocks/chitin_block_covered", + "particle": "unicopia:blocks/chitin_block_uncovered", + "top": "unicopia:blocks/chitin_block_chissled_full", + "side": "unicopia:blocks/chitin_block_chissled_half" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "texture": "#bottom", "cullface": "down" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/chissled_chitin.json b/src/main/resources/assets/unicopia/models/item/chissled_chitin.json new file mode 100644 index 00000000..344120f8 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/chissled_chitin.json @@ -0,0 +1,3 @@ +{ + "parent": "unicopia:block/chissled_chitin" +} diff --git a/src/main/resources/assets/unicopia/recipes/chissled_chitin.json b/src/main/resources/assets/unicopia/recipes/chissled_chitin.json new file mode 100644 index 00000000..6edc05fe --- /dev/null +++ b/src/main/resources/assets/unicopia/recipes/chissled_chitin.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shaped", + + "pattern": [ + "##", + "##" + ], + "key": { + "#": [ + { "item": "unicopia:chitin_block" } + ] + }, + "result": { "item": "unicopia:chissled_chitin", "count": 4 } +} diff --git a/src/main/resources/assets/unicopia/textures/blocks/chitin_block_chissled_full.png b/src/main/resources/assets/unicopia/textures/blocks/chitin_block_chissled_full.png new file mode 100644 index 00000000..737bdd46 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/blocks/chitin_block_chissled_full.png differ diff --git a/src/main/resources/assets/unicopia/textures/blocks/chitin_block_chissled_half.png b/src/main/resources/assets/unicopia/textures/blocks/chitin_block_chissled_half.png new file mode 100644 index 00000000..d76f25f8 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/blocks/chitin_block_chissled_half.png differ