Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package melonslise.hextest.client.model;
- import melonslise.hextest.HexTestCore;
- import net.minecraft.client.renderer.block.model.ModelBlockDefinition;
- import net.minecraft.client.renderer.block.model.ModelResourceLocation;
- import net.minecraft.client.renderer.block.model.VariantList;
- import net.minecraft.client.resources.IResourceManager;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.client.model.ICustomModelLoader;
- import net.minecraftforge.client.model.IModel;
- import net.minecraftforge.fml.relauncher.ReflectionHelper;
- public class ModelLoaderConnected implements ICustomModelLoader
- {
- public static final String PATH = "models/block/connected/";
- private static final ICustomModelLoader VANILLA_LOADER;
- static
- {
- try
- {
- Class cls = Class.forName("net.minecraftforge.client.model.ModelLoader$VanillaLoader");
- VANILLA_LOADER = (ICustomModelLoader) ReflectionHelper.getPrivateValue(cls, null, "INSTANCE");
- }
- catch (ClassNotFoundException e)
- {
- throw new RuntimeException(e);
- }
- }
- @Override
- public boolean accepts(ResourceLocation location)
- {
- return location.getResourceDomain().equals(HexTestCore.ID) && location.getResourcePath().startsWith(PATH);
- }
- @Override
- public IModel loadModel(ResourceLocation location) throws Exception
- {
- return new ModelConnected(VANILLA_LOADER.loadModel(location));
- }
- @Override
- public void onResourceManagerReload(IResourceManager manager) {}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement