Jump to content

CorwinJ

Members
  • Posts

    7
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Personal Text
    y helo thar

CorwinJ's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. 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?
  2. 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 ] } } }
  3. 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")); }
  4. 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 .
  5. 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:
×
×
  • Create New...

Important Information

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