Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted
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.2020-03-11_14_57_01.png.9b0c6150c7b2e04b9bd75c274f51e80b.png

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;
}

 

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.

  • 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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.