Posted January 10, 20178 yr From what I understand using useNeighborBrightness and isFullBlock should be enough to make this work but I'm having issues: public class PathBlock extends ModBlock { private static final AxisAlignedBB PATH_AABB = new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, 0.3, 1.0); PathBlock() { super(Material.ROCK); this.setHardness(4.0f); this.setSoundType(SoundType.STONE); this.setLightOpacity(0); this.useNeighborBrightness = true; this.fullBlock = false; } // Rendering stuff @Override public boolean isFullyOpaque(IBlockState state) { return false; } @Override public boolean isFullBlock(IBlockState state) { return false; } @Override public boolean isOpaqueCube(IBlockState state) { return false; } public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face) { return false; } public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { return PATH_AABB; } } The base class: public class ModBlock extends Block { public ModBlock(Material aMaterial) { super(aMaterial); this.init(); } public ModBlock() { super(Material.WOOD); this.init(); } public void init() { this.setCreativeTab(CreativeTab.ATB_TAB); } @Override public String getUnlocalizedName() { return String.format("tiles.%s%s", Reference.RESOURCE_PREFIX, getUnwrappedUnlocalizedName(super.getUnlocalizedName())); } protected String getUnwrappedUnlocalizedName(String unlocalizedName) { return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1); } } Model JSON: { "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", "textures": { "0": "blocks/stone", "particle": "blocks/stone" }, "elements": [ { "name": "Cube", "from": [ 2.0, 0.0, 2.0 ], "to": [ 5.0, 1.0, 7.0 ], "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, "east": { "texture": "#0", "uv": [ 0.0, 0.0, 5.0, 1.0 ] }, "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, "west": { "texture": "#0", "uv": [ 0.0, 0.0, 5.0, 1.0 ] }, "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 5.0 ] } } }, { "name": "Cube", "from": [ 7.0, 0.0, 6.0 ], "to": [ 10.0, 1.0, 11.0 ], "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, "east": { "texture": "#0", "uv": [ 0.0, 0.0, 5.0, 1.0 ] }, "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, "west": { "texture": "#0", "uv": [ 0.0, 0.0, 5.0, 1.0 ] }, "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 5.0 ] } } }, { "name": "Cube", "from": [ 12.0, 0.0, 10.0 ], "to": [ 15.0, 1.0, 15.0 ], "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, "east": { "texture": "#0", "uv": [ 0.0, 0.0, 5.0, 1.0 ] }, "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, "west": { "texture": "#0", "uv": [ 0.0, 0.0, 5.0, 1.0 ] }, "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 5.0 ] } } }, { "name": "Cube", "from": [ 12.0, 0.0, 2.0 ], "to": [ 15.0, 1.0, 5.0 ], "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, "south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, "down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] } } }, { "name": "Cube", "from": [ 11.0, 0.0, 2.0 ], "to": [ 12.0, 1.0, 3.0 ], "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] } } }, { "name": "Cube", "from": [ 5.0, 0.0, 4.0 ], "to": [ 6.0, 1.0, 5.0 ], "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] } } }, { "name": "Cube", "from": [ 6.0, 0.0, 9.0 ], "to": [ 7.0, 1.0, 11.0 ], "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "west": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] }, "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] } } }, { "name": "Cube", "from": [ 11.0, 0.0, 13.0 ], "to": [ 12.0, 1.0, 14.0 ], "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] } } }, { "name": "Cube", "from": [ 3.0, 0.0, 11.0 ], "to": [ 5.0, 1.0, 14.0 ], "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, "east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, "south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] }, "up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 3.0 ] }, "down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 3.0 ] } } }, { "name": "Cube", "from": [ 7.0, 0.0, 13.0 ], "to": [ 9.0, 1.0, 15.0 ], "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, "east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, "south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, "west": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, "up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, "down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] } } }, { "name": "Cube", "from": [ 8.0, 0.0, 3.0 ], "to": [ 10.0, 1.0, 5.0 ], "shade": false, "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, "east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, "south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, "west": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }, "up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }, "down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] } } } ] } What I'm seeing:
January 10, 20178 yr I'm not sure this is it, but there is a shade tag that you can set to false for each element in the model. The wiki reads this: shade: Defines if shadows are rendered (true - default), not (false).
January 10, 20178 yr I'm not sure this is it, but there is a shade tag that you can set to false for each element in the model. The wiki reads this: shade: Defines if shadows are rendered (true - default), not (false). While this is true, that's not actually what that does. The "shade" tag is what controls whether the block's model itself uses lighting information or is fullbright (i.e. even in a pitch dark room you can still see it, as if the block itself was "glowing"). 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.
January 10, 20178 yr I'm not sure this is it, but there is a shade tag that you can set to false for each element in the model. The wiki reads this: shade: Defines if shadows are rendered (true - default), not (false). Ah I see, makes sense While this is true, that's not actually what that does. The "shade" tag is what controls whether the block's model itself uses lighting information or is fullbright (i.e. even in a pitch dark room you can still see it, as if the block itself was "glowing").
January 10, 20178 yr Author I'm not sure this is it, but there is a shade tag that you can set to false for each element in the model. The wiki reads this: shade: Defines if shadows are rendered (true - default), not (false). Tested that and yeah, no change in the way it rendered. The "ambientocclusion" tag on the model made the texture fullbright but didn't effect the shadowing .
January 11, 20178 yr Author For reference, this is how I'm registering my block. Maybe there's something wrong there? At the top of my ModBlocks.java public static final Block PATH_BLOCK = new PathBlock().setUnlocalizedName(PATH_BLOCK_TAG); In preInit: GameRegistry.register(PATH_BLOCK.setRegistryName(new ResourceLocation(Reference.MOD_ID, PATH_BLOCK_TAG))); GameRegistry.register(new ItemBlock(PATH_BLOCK), PATH_BLOCK.getRegistryName()); In init (thru a proxy): registerRender(PATH_BLOCK, PATH_BLOCK_TAG); private static void registerRender(Block block, String key) { Item item = Item.getItemFromBlock(block); Minecraft.getMinecraft().getRenderItem().getItemModelMesher() .register(item, 0, new ModelResourceLocation(Reference.RESOURCE_PREFIX + key, "inventory")); }
January 11, 20178 yr Try isFullCube instead of isFullBlock . Not 100% sure but I think that's what causing it IGN: matte006 Played Minecraft since summer 2011. Modding is my life now. Please check out my mod https://minecraft.curseforge.com/projects/gadgets-n-goodies-mod?gameCategorySlug=mc-mods&projectID=230028
January 11, 20178 yr Author Try isFullCube instead of isFullBlock . Not 100% sure but I think that's what causing it That was definitely it, thanks.
January 11, 20178 yr Minecraft.getMinecraft().getRenderItem().getItemModelMesher() You also shouldn't use the ModelMesher, you should use ModelLoader.setCustomModelResourceLocation 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.
January 13, 20178 yr Author Minecraft.getMinecraft().getRenderItem().getItemModelMesher() You also shouldn't use the ModelMesher, you should use ModelLoader.setCustomModelResourceLocation Switching to ModelLoader.setCustomModelResourceLocation makes all of the items render as MissingTexture/Model blocks. Do I have to change my item jsons? My current item json: { "parent": "mymod:block/pathblock", "display": { "thirdperson_righthand": { "rotation": [ 62, 41, 0 ], "translation": [ 0, 0, 0 ], "scale": [ 0.4, 0.4, 0.4 ] }, "thirdperson_lefthand": { "rotation": [ 62, 41, 0 ], "translation": [ 0, 0, 0 ], "scale": [ 0.4, 0.4, 0.4 ] }, "ground": { "rotation": [ 0, 0, 0 ], "translation": [ 0, 0, 0 ], "scale": [ 1, 1, 1 ] }, "fixed": { "rotation": [ 0, 0, 0 ], "translation": [ 0, 0, 0 ], "scale": [ 1, 1, 1 ] }, "firstperson_righthand": { "rotation": [ 10, 48, -3 ], "translation": [ -1.89, 0, 0 ], "scale": [ 0.38, 0.38, 0.38 ] }, "firstperson_lefthand": { "rotation": [ 10, 48, -3 ], "translation": [ -1.89, 0, 0 ], "scale": [ 0.38, 0.38, 0.38 ] }, "gui": { "rotation": [ 30, 45, 0 ], "translation": [ 0, 0, 0], "scale":[ 0.6, 0.6, 0.6 ] } } }
January 13, 20178 yr Author No, you have to do it in ModelRegistryEvent . Note that you will need to use @EventBusSubscriber to subscribe to this event, registering for it in preInit is too late. Read the Event Documentation if you are unfamiliar with @EventBusSubscriber . I've got the ModelRegistryEvent firing and I'm using setCustomModelResourceLocation. Not seeing any errors but still pink missing textures. @Mod.EventBusSubscriber(Side.CLIENT) public class ModelRenders { @SubscribeEvent public static void registerRenders(ModelRegistryEvent e) { Item item = Item.getItemFromBlock(PATH); ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(Reference.RESOURCE_PREFIX + "pathblock", "inventory")); } } And I've changed around my block registration; In my ModBlocks class: public static final Block PATH = new PathBlock().setUnlocalizedName("pathblock"); preInit: GameRegistry.register(PATH.setRegistryName(new ResourceLocation(Reference.MOD_ID, "pathblock"))); GameRegistry.register(new ItemBlock(PATH), PATH.getRegistryName()); I think the problem might be that the item block is being registered too late for the ModelRegistryEvent?
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.