use of icbm.classic.client.mapper.ItemModelMapperExplosive in project ICBM-Classic by BuiltBrokenModding.
the class ClientReg method registerCartRenders.
protected static void registerCartRenders() {
for (// TODO run loop once for all 4 content types
IExplosiveData data : // TODO run loop once for all 4 content types
ICBMClassicAPI.EX_MINECART_REGISTRY.getExplosives()) {
final String resourcePath = data.getRegistryName().getNamespace() + ":bombcarts/" + data.getRegistryName().getPath();
cartModelMap.put(data, new ModelResourceLocation(resourcePath, "inventory"));
}
ModelLoader.registerItemVariants(ItemReg.itemBombCart, cartModelMap.values().stream().map(model -> new ResourceLocation(model.getNamespace() + ":" + model.getPath())).toArray(ResourceLocation[]::new));
ModelLoader.setCustomMeshDefinition(ItemReg.itemBombCart, new ItemModelMapperExplosive(cartModelMap, cartModelMap.get(ICBMExplosives.CONDENSED)));
}
use of icbm.classic.client.mapper.ItemModelMapperExplosive in project ICBM-Classic by BuiltBrokenModding.
the class ClientReg method registerExBlockRenders.
protected static void registerExBlockRenders() {
for (// TODO run loop once for all 4 content types
IExplosiveData data : // TODO run loop once for all 4 content types
ICBMClassicAPI.EX_BLOCK_REGISTRY.getExplosives()) {
// Add block state
final HashMap<EnumFacing, ModelResourceLocation> facingModelMap = new HashMap<>();
final String resourcePath = data.getRegistryName().getNamespace() + ":explosives/" + data.getRegistryName().getPath();
for (EnumFacing facing : EnumFacing.VALUES) {
facingModelMap.put(facing, new ModelResourceLocation(resourcePath, "explosive=" + data.getRegistryName().toString().replace(":", "_") + ",rotation=" + facing));
}
blockModelMap.put(data, facingModelMap);
// Add item state
// IBlockState state = BlockReg.blockExplosive.getDefaultState().withProperty(BlockICBM.ROTATION_PROP, EnumFacing.UP);
// String properties_string = getPropertyString(state.getProperties());
itemBlockModelMap.put(data, new ModelResourceLocation(resourcePath, "inventory"));
}
// Block state mapper
ModelLoader.setCustomStateMapper(BlockReg.blockExplosive, new BlockModelMapperExplosive(blockModelMap, blockModelMap.get(ICBMExplosives.CONDENSED).get(EnumFacing.UP)));
// Item state mapper
ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(BlockReg.blockExplosive), new ItemModelMapperExplosive(itemBlockModelMap, itemBlockModelMap.get(ICBMExplosives.CONDENSED)));
ModelBakery.registerItemVariants(Item.getItemFromBlock(BlockReg.blockExplosive), itemBlockModelMap.values().stream().map(mrl -> new ResourceLocation(mrl.getNamespace(), mrl.getPath())).collect(Collectors.toList()).toArray(new ResourceLocation[itemBlockModelMap.values().size()]));
}
use of icbm.classic.client.mapper.ItemModelMapperExplosive in project ICBM-Classic by BuiltBrokenModding.
the class ClientReg method registerGrenadeRenders.
protected static void registerGrenadeRenders() {
for (// TODO run loop once for all 4 content types
IExplosiveData data : // TODO run loop once for all 4 content types
ICBMClassicAPI.EX_GRENADE_REGISTRY.getExplosives()) {
final String resourcePath = data.getRegistryName().getNamespace() + ":grenades/" + data.getRegistryName().getPath();
grenadeModelMap.put(data, new ModelResourceLocation(resourcePath, "inventory"));
}
ModelLoader.registerItemVariants(ItemReg.itemGrenade, grenadeModelMap.values().stream().map(model -> new ResourceLocation(model.getNamespace() + ":" + model.getPath())).toArray(ResourceLocation[]::new));
ModelLoader.setCustomMeshDefinition(ItemReg.itemGrenade, new ItemModelMapperExplosive(grenadeModelMap, grenadeModelMap.get(ICBMExplosives.CONDENSED)));
}
use of icbm.classic.client.mapper.ItemModelMapperExplosive in project ICBM-Classic by BuiltBrokenModding.
the class ClientReg method registerMissileRenders.
protected static void registerMissileRenders() {
for (// TODO run loop once for all 4 content types
IExplosiveData data : // TODO run loop once for all 4 content types
ICBMClassicAPI.EX_MISSILE_REGISTRY.getExplosives()) {
final String resourcePath = data.getRegistryName().getNamespace() + ":missiles/" + data.getRegistryName().getPath();
missileModelMap.put(data, new ModelResourceLocation(resourcePath, "inventory"));
}
ModelLoader.registerItemVariants(ItemReg.itemMissile, missileModelMap.values().stream().map(model -> new ResourceLocation(model.getNamespace() + ":" + model.getPath())).toArray(ResourceLocation[]::new));
ModelLoader.setCustomMeshDefinition(ItemReg.itemMissile, new ItemModelMapperExplosive(missileModelMap, missileModelMap.get(ICBMExplosives.CONDENSED)));
}
Aggregations