Jump to content

shane020482

Members
  • Posts

    72
  • Joined

  • Last visited

Everything posted by shane020482

  1. Thanks that will make things easier going further
  2. Yea sry a cpl typos fixed them. As to the #0 thats the way the model references the textures ( "north": {"uv": [0, 0, 16, 16], "texture": "#0"} ). But are you saying i dont need to rename the textures in the model file
  3. Ok i see what you mean in the model json //this "textures": { "0": "cbm:blocks/steel", "1": "cbm:blocks/steel2", "particle": "cbm:blocks/steel" }, //becomes this "textures": { "0": "#0", "1": "#1" }, and in the blockstate you add this to default "textures": { "0": "cbm:blocks/steel", "1": "cbm:blocks/steel2", "particle": "cbm:blocks/steel" }
  4. I have a custom model that uses diff textures that i would like to reuse by putting a diff set of textures on it. Sry for the bad wording
  5. This is a quick and hopefully easy question. I have a custom model that uses diff textures that i would like to reuse using a diff set of textures. So the question is can i put the textures in the Forge Blockstate and if so how would i do this
  6. Yea im just not that good ? maybe one day. And yes i agreed with your Easy Registry class tho i may not use it now i will be one of those things ill go back to time and again to see what you are doing and slowly learn to create my own Easy Registry. Thats how iv been learning start with a basic tutorial to learn the basics of a MC version then look at other mods that are doing what i want to do, find a method that i like and learn to create my own based off of it.
  7. 1. I never calmed it to be the best way or that it was correct just that it worked. ? 2.I thought you meant writing the function per block, yes you do need the function in each base class but thats it. 3.Just goes to show theirs more than one way to skin a cat. 4.My old mod should shows i dont like copy past i like to explore and see what all is possible. Whether right or wrong i learn and that to me is the most important part . 5.I think we should rename this thread to How many ways are there to Register Blocks
  8. 1.Yes you need to register via the client proxy 2.Not necessarily https://github.com/Shane2482/Deadly-World-1.10/blob/master/src/main/java/shane2482/deadlyworld/proxy/ClientProxy.java
  9. By registering in the base class anything you put in the init class is automatically registered therefore you dont need to register each block separately. If im being stupid please forgive me im still trying to get a understanding of 1.12
  10. I know GameRegistry is private. But are you saying i cant even use the event method in the base class
  11. Its fine after sleeping on it i think im going to do it like i did in the past and register in the base class https://github.com/Shane2482/Deadly-World-1.10/blob/master/src/main/java/shane2482/deadlyworld/blocks/base/blockbase.java that is if i can figure out how to do that in 1.12. And even if i dont use enums if i use Forge Blocktates ill still need to create blockstates for all of my blocks but i wont need the models.
  12. sry for not being clearer what i was trying to do was get the full code in one place so i could see what i needed to do to make this work for me and thats where i get lost. i myself dont like copy pasting i always modified to to fit my needs
  13. chasing things down and this is what iv got so far and im still lost. Im not a complete noob to java or MC code but i am self taught and this may just be outside my grasp public void _registerBlockWithCustomItem(Block block, ItemBlock iBlock, String registryname) { StateMapperBase b = new DefaultStateMapper(); BlockStateContainer bsc = block.getBlockState(); ImmutableList<IBlockState> values = bsc.getValidStates(); for(IBlockState state : values) { String str = b.getPropertyString(state.getProperties()); _registerBlockItemModelForMeta(block, block.getMetaFromState(state), str); } } private void _registerBlockItemModelForMeta(Block block, int metadata, String variant) { final Item item = blockItems.get(block); if (item != null) { _registerItemModelForMeta(item, metadata, variant); } } private void _registerItemModelForMeta(Item item, int metadata, String variant) { ModelResourceLocation res = new ModelResourceLocation(item.getRegistryName(), variant); _registerItemModelForMeta(item, metadata, res); } private void _registerItemModelForMeta(Item item, int metadata, ModelResourceLocation modelResourceLocation) { modelsToReg.add(new ModelRegistryObj(item, metadata, modelResourceLocation)); } protected static class ModelRegistryObj { final Item item; final int meta; final ModelResourceLocation resource; public ModelRegistryObj(Item i, int m, ModelResourceLocation loc) { item = i; meta = m; resource = loc; } }
  14. Man thats a rabbit hole ill havw to sit down and really dig in to see if i can figure it out. ?
  15. Yea i was afraid of that im already using that method for blocks that dont have variants. i was just hoping to use Forge Blockstate to cover block models item models and blockstates for up to 16 blocks with just one blockstate. But if i cant get Forge to work then i guess ill just have to suck it up. Thanks for the advice anyways
  16. I know im doing something wrong i just cant figure out what and if i dont use meta what could i use for variants. My mod is going to have a lot of blocks and i would like to cut down on the amount of blockstates an models needed.
  17. That only works with blocks that dont have meta and the method calls for block not item. And yes iv tried block.getRegistryName() it doesnt work ether. This method worked fine on older versions i just cant find what has changed. Even looking at the non meta block method the change was from itemstack to item so not a big change there.
  18. this is the code i used to get that error and iv tried several other naming methods as well @SubscribeEvent public static void registerRenders(ModelRegistryEvent event) { registerRender(ItemBlockEnum.getItemFromBlock(block_steel)); for (int i = 0; i < metalType.values().length; i++) { registerRender(block_steel, i, "block_steel_" + metalType.values()[i].getName()); } } private static void registerRender(Block block, int meta, String fileName) { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), meta, new ModelResourceLocation(new ResourceLocation(Reference.MOD_ID, fileName), "inventory")); }
  19. i thought the point of Forge Blockstate "inventory": [{}], was to provide that info. And yes iv used it as well as removed it from my blockstate and it changes nothing.
  20. While trying to use Forge Blockstate the block model variants work fine however im getting a inventory error. Exception loading model for variant cbm:block_steel_steel_plating#inventory Blockstate: https://pastebin.com/j0JTAH5p Console: https://pastebin.com/QyVd7agK
  21. OMG some how some way my got deleated @SubscribeEvent public static void registerRenders(ModelRegistryEvent event) {}
  22. Thats what im doing for both blocks with and without meta public static void registerRender(Item item) { ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } public static void registerRender(Block block, int meta, Item item) { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), meta, new ModelResourceLocation(item.getRegistryName(), "inventory")); }
  23. is there a reason that the following doesn't work for item blocks in 1.12 blocks show fine but item is a null model and texture { "forge_marker": 1, "defaults": { "transform": "forge:default-block", "model": "cube_all", "textures": {"all": "cbm:blocks/block_test"} }, "variants": { "normal": [{}], "inventory": [{}] } }
  24. well that was easy completely forgot about the dispenser
×
×
  • Create New...

Important Information

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