Jump to content

leagris

Members
  • Posts

    3
  • Joined

  • Last visited

leagris's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I am not sure how it cause issues with the CustomStateMapper working only for the first Block ID pedestal0. It is common pre-init where a dynamic amount of pedestal blocks are created: for (int i = 0; i < configuration.getInt("amountOfPedestals", Configuration.CATEGORY_GENERAL, 1, 0, Integer.MAX_VALUE, "The amount of pedestal multiplied by 16 that will be generated"); ++i) { BRPedestal pedestal = new BRPedestal("pedestal" + i , buildingBlocks){ @Override public void registerItem(IForgeRegistry<Item> itemIForgeRegistry) { itemIForgeRegistry.register(new ItemBlock(this) { @Override public String getUnlocalizedName(ItemStack stack) { return getUnlocalizedName() + "." + stack.getItemDamage(); } }.setCreativeTab(buildingBlocks).setRegistryName(this.getRegistryName()).setHasSubtypes(true)); } }; logger.printf(Level.INFO, "adding %s to pedestalList.", pedestal.getUnlocalizedName()); pedestalList.add(pedestal); } It is not like the configuration is supposed to change, between launches. It is intended for mod-pack/map making with specific purpose, creative blocks interacting with other mods about progression and, stuffs like that. The number of pedestal blocks needed may var,y depending on: map or mod-pack rules. It indeed will not change between different runs of a game or map. So I have a list containing all pedestal blocks pedestalList created during global pre-init: BRPedestal pedestal = new BRPedestal("pedestal" + i , buildingBlocks) ... pedestalList.add(pedestal); It iterates this list in client-side pre-init after calling the global pre-init that is registering said blocks. pedestalList.forEach((pedestal) -> { To set a CustomStateMapper ModelLoader.setCustomStateMapper(pedestal, new StateMap.Builder().ignore(BRPedestal.TYPE).build()); And my logger reports it is setting it for all pedestal block id pedestal0 and pedestal1 here. But as it turns-out, the CustomStateMapper is not working for pedestal1. I am fairly new to modding with Forge, I read through your comment about: But really could not get it why, or how it causes CustomStateMapper not working for pedestal1 and above.
  2. 1. I already use meta that is exactly mapped to the TYPE blockstate. This is the reason I need to ignore this Block State to have same model used for all the different META. 2. I don't want or need Tile Entities here. I already have all the blockstates I need. TYPE is mapped to block Meta so one block ID provides me with 16 different pedestals (one per meta) UP and DOWN are dynamic computed blockstates that only serve to differentiate block connection with same block (like fence).
  3. I want to ignore a blockstate TYPE from all my BRPedestal blocks for the model loader. So I loop through pedestal blocks in client-side pre-init with setCustomStateMapper to have the model loader ignore this specific blockstate. @Override public void preInit(FMLPreInitializationEvent event) throws IOException { super.preInit(event); pedestalList.forEach((pedestal) -> { logger.printf(Level.INFO, "Setting a CustomStateMapper for %s.", pedestal.getUnlocalizedName()); ModelLoader.setCustomStateMapper(pedestal, new StateMap.Builder().ignore(BRPedestal.TYPE).build()); }); } My issue is that it works perfectly for the first block ID pedestal0, but only for it. All other blocks pedestal1 and above are claiming model variants on type=. My logger report: Setting a CustomStateMapper for tile.beyondreality:pedestal0 Setting a CustomStateMapper for tile.beyondreality:pedestal1 But after that I have pedestal1 erroring with: [main/ERROR] [FML]: Exception loading model for variant beyondreality:pedestal1#down=true,type=0,up=false for blockstate "beyondreality:pedestal1[down=true,type=0,up=false]" net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model beyondreality:pedestal1#down=true,type=0,up=false with loader VariantLoader.INSTANCE, skipping See: https://github.com/leagris/BeyondRealityCore/blob/patch-1/src/main/java/com/beyondrealitygaming/core/proxy/ClientProxy.java#L36
×
×
  • Create New...

Important Information

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