Advertisement
Exception_Prototype

ArmorModelInstance

Mar 20th, 2018
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.18 KB | None | 0 0
  1. package net.machinemuse.powersuits.client.render.item;
  2.  
  3. import net.machinemuse.numina.general.MuseLogger;
  4. import net.machinemuse.powersuits.common.ModCompatibility;
  5. import net.minecraft.client.model.ModelBiped;
  6.  
  7. public class ArmorModelInstance
  8. {
  9.   private static ModelBiped instance = null;
  10.  
  11.   public static ModelBiped getInstance()
  12.   {
  13.     if (instance == null) {
  14.       if ((ModCompatibility.isRenderPlayerAPILoaded()) && (ModCompatibility.isSmartRendererLoaded())) {
  15.         try
  16.         {
  17.           MuseLogger.logInfo("Attempting to load SmartMoving armor model.");
  18.           instance = (ModelBiped)Class.forName("net.machinemuse.powersuits.client.render.item.SMovingArmorModel").asSubclass(ModelBiped.class).newInstance();
  19.           MuseLogger.logInfo("SmartMoving armor model loaded successfully!");
  20.         }
  21.         catch (Exception e)
  22.         {
  23.           MuseLogger.logInfo("Smart Moving armor model did not load successfully. Either Smart Moving is not installed, or there was another problem.");
  24.           instance = VanillaArmorModel.getInstance();
  25.         }
  26.       } else {
  27.         instance = VanillaArmorModel.getInstance();
  28.       }
  29.     }
  30.     return instance;
  31.   }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement