Java Code Examples for net.minecraftforge.client.model.ModelLoaderRegistry#registerLoader()

The following examples show how to use net.minecraftforge.client.model.ModelLoaderRegistry#registerLoader() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SurvivalistMod.java    From Survivalist with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public void clientSetup(FMLClientSetupEvent event)
{
    ScreenManager.registerFactory(DryingRackContainer.TYPE, DryingRackScreen::new);
    ScreenManager.registerFactory(SawmillContainer.TYPE, SawmillScreen::new);

    ModelLoaderRegistry.registerLoader(location("rack"), DryingRackBakedModel.ModelLoader.INSTANCE);

    //RenderTypeLookup.setRenderLayer(SurvivalistBlocks.RACK.get(), (layer) -> layer == RenderType.getSolid() || layer == RenderType.getCutout());
}
 
Example 2
Source File: ClientProxy.java    From enderutilities with GNU Lesser General Public License v3.0 5 votes vote down vote up
private static void registerAllItemModels()
{
    registerItemModelWithVariantsAndMeshDefinition(EnderUtilitiesItems.ENDER_CAPACITOR);
    registerItemModelWithVariants(EnderUtilitiesItems.ENDER_PART);
    registerItemModelWithVariants(EnderUtilitiesItems.LINK_CRYSTAL);

    registerItemModel(EnderUtilitiesItems.BUILDERS_WAND);
    registerItemModel(EnderUtilitiesItems.CHAIR_WAND);
    registerItemModel(EnderUtilitiesItems.DOLLY);
    registerItemModel(EnderUtilitiesItems.ENDER_ARROW);
    registerItemModelWithVariantsAndMeshDefinition(EnderUtilitiesItems.ENDER_BAG);
    registerItemModel(EnderUtilitiesItems.ENDER_BOW);
    registerItemModelWithVariantsAndMeshDefinition(EnderUtilitiesItems.ENDER_BUCKET);
    registerItemModel(EnderUtilitiesItems.ENDER_LASSO);
    registerItemModelWithVariants(EnderUtilitiesItems.ENDER_PEARL_REUSABLE);
    registerItemModelWithVariants(EnderUtilitiesItems.ENDER_PORTER);
    registerItemModelWithVariantsAndMeshDefinition(EnderUtilitiesItems.ENDER_SWORD);
    registerItemModelWithVariantsAndMeshDefinition(EnderUtilitiesItems.ENDER_TOOL);
    registerItemModelWithVariantsAndMeshDefinition(EnderUtilitiesItems.HANDY_BAG);
    registerItemModelWithVariants(EnderUtilitiesItems.ICE_MELTER);
    registerItemModelWithVariantsAndMeshDefinition(EnderUtilitiesItems.INVENTORY_SWAPPER);
    registerItemModelWithVariantsAndMeshDefinition(EnderUtilitiesItems.LIVING_MANIPULATOR);
    registerItemModel(EnderUtilitiesItems.MOB_HARNESS);
    registerItemModelWithNamePrefix(EnderUtilitiesItems.NULLIFIER, 0, "item_");
    registerItemModel(EnderUtilitiesItems.PET_CONTRACT);
    registerItemModelWithVariantsAndMeshDefinition(EnderUtilitiesItems.PICKUP_MANAGER);
    registerItemModelWithVariantsAndMeshDefinition(EnderUtilitiesItems.QUICK_STACKER);
    registerItemModel(EnderUtilitiesItems.PORTAL_SCALER);
    registerItemModel(EnderUtilitiesItems.RULER);
    registerItemModelWithVariants(EnderUtilitiesItems.SYRINGE);
    registerItemModelWithNameSuffix(EnderUtilitiesItems.VOID_PICKAXE, 0, "_normal");

    ModelLoaderRegistry.registerLoader(ModelEnderBucket.LoaderEnderBucket.instance);
    ModelLoaderRegistry.registerLoader(ModelEnderTools.LoaderEnderTools.instance);
    ModelLoaderRegistry.registerLoader(new ModelNullifierBaked.ModelLoaderNullifier());
}
 
Example 3
Source File: ClientProxy.java    From enderutilities with GNU Lesser General Public License v3.0 5 votes vote down vote up
private static void registerBlockModels()
{
    ModelLoader.setCustomStateMapper(EnderUtilitiesBlocks.BARREL, new BakedModelBarrel.StateMapper());
    ModelLoaderRegistry.registerLoader(new BakedModelBarrel.ModelLoaderBarrel());

    ModelLoader.setCustomStateMapper(EnderUtilitiesBlocks.INSERTER, new BakedModelInserter.StateMapper());
    ModelLoaderRegistry.registerLoader(new BakedModelInserter.ModelLoaderInserter());

    ModelLoaderRegistry.registerLoader(new ModelCamouflageBlock.ModelLoaderCamouflageBlocks());

    ModelLoader.setCustomStateMapper(EnderUtilitiesBlocks.ELEVATOR,       (new StateMap.Builder()).ignore(BlockElevator.COLOR).build());
    ModelLoader.setCustomStateMapper(EnderUtilitiesBlocks.ELEVATOR_SLAB,  (new StateMap.Builder()).ignore(BlockElevator.COLOR).build());
    ModelLoader.setCustomStateMapper(EnderUtilitiesBlocks.ELEVATOR_LAYER, (new StateMap.Builder()).ignore(BlockElevator.COLOR).build());
}
 
Example 4
Source File: OpenClientProxy.java    From OpenModsLib with MIT License 5 votes vote down vote up
@Override
public void preInit() {
	ClientCommandHandler.instance.registerCommand(new CommandConfig("om_config_c", false));
	ClientCommandHandler.instance.registerCommand(new CommandSource("om_source_c", false, OpenMods.instance.getCollector()));
	ClientCommandHandler.instance.registerCommand(new CommandGlDebug());

	if (LibConfig.enableCalculatorCommands) {
		final ICommandComponent commandRoot = new CommandCalcFactory(new File(getMinecraftDir(), "scripts")).getRoot();
		ClientCommandHandler.instance.registerCommand(new CommandCalc(commandRoot, "config"));
		ClientCommandHandler.instance.registerCommand(new CommandCalc(commandRoot, "eval", "="));
		ClientCommandHandler.instance.registerCommand(new CommandCalc(commandRoot, "fun"));
		ClientCommandHandler.instance.registerCommand(new CommandCalc(commandRoot, "let"));
		ClientCommandHandler.instance.registerCommand(new CommandCalc(commandRoot, "execute"));
	}

	RenderUtils.registerFogUpdater();

	MinecraftForge.EVENT_BUS.register(new BlockSelectionHandler());

	ModelLoaderRegistry.registerLoader(MappedModelLoader.builder()
			.put("with-dependencies", ModelWithDependencies.EMPTY)
			.put("multi-layer", MultiLayerModel.EMPTY)
			.put("variantmodel", VariantModel.EMPTY_MODEL)
			.put("textureditem", TexturedItemModel.INSTANCE)
			.put("stateitem", ItemStateModel.EMPTY)
			.put("eval", EvalModel.EMPTY)
			.put("eval-expand", EvalExpandModel.EMPTY)
			.put("perspective-aware", PerspectiveAwareModel.EMPTY)
			.build(OpenMods.MODID));

	((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener(hitboxManager);

	FramebufferBlitter.setup();
}
 
Example 5
Source File: GTProxyClient.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void preInit(FMLPreInitializationEvent e) {
	super.preInit(e);
	MinecraftForge.EVENT_BUS.register(this);
	ModelLoaderRegistry.registerLoader(new GTModelLoader());
}