Posted March 11, 20205 yr comment_387921 I am trying to implement a cable block, I have made a model that is smaller than a full block but when I place it it doesn't render the ground or any adjacent block sides. Here is a link to my project: https://github.com/FuturisticLux/engineerstech Model: { "textures": { "all": "minecraft:block/glass" }, "elements": [ { "from": [4,4,4], "to": [12,12,12], "faces": { "down": { "uv": [4,4, 12,12], "texture": "#all" }, "up": { "uv": [4,4, 12,12], "texture": "#all" }, "north": { "uv": [4,4, 12,12], "texture": "#all" }, "south": { "uv": [4,4, 12,12], "texture": "#all" }, "west": { "uv": [4,4, 12,12], "texture": "#all" }, "east": { "uv": [4,4, 12,12], "texture": "#all" } } } ] } BlockState: { "forge_marker": 1, "defaults": { "textures": { "all": "minecraft:block/glass" }, "model": "engineerstech:block/cable", "uvlock": true }, "variants": { "": [{ "textures": { "all": "minecraft:block/glass" }, "model": "engineerstech:block/cable", "uvlock": true }] } } I am registering it like this: registerBlock(new OreBlock(Block.Properties.create( Material.GLASS ).hardnessAndResistance(3, 3).sound( SoundType.GLASS ).variableOpacity()), "cable"); public static Block registerBlock(Block block, String name) { BlockItem itemBlock = new BlockItem(block, new Item.Properties().group(EngineersTechTab.instance)); block.setRegistryName(name); itemBlock.setRegistryName(name); ForgeRegistries.BLOCKS.register(block); ForgeRegistries.ITEMS.register(itemBlock); return block; }
March 11, 20205 yr comment_387928 Fix its returned voxel shape. Your block is not a full cube, so don't return a full cube voxel shape. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
March 11, 20205 yr Author comment_387937 I changed my Cable class to this: public class CableBlock extends Block{ public static final AxisAlignedBB BASIC_AABB = new AxisAlignedBB(4, 4, 4, 12, 12, 12); public static VoxelShape shape; public CableBlock(Properties properties) { super(properties); shape = VoxelShapes.create(BASIC_AABB); } @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { return shape; } @Override public VoxelShape getRenderShape(BlockState p_196247_1_, IBlockReader p_196247_2_, BlockPos p_196247_3_) { return shape; } @Override public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { return shape; } } The shape of the block in game hasn't changed.
March 11, 20205 yr Author comment_387938 Sorry, I am an idiot. I was creating an OreBlock instead ob my CableBlock. It works now, thank you Edited March 11, 20205 yr by FuturisticLux I forgot to say thank you
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.