Example #1
0
 public static String getLMMTextureArmorName(Object entity) {
   int version = Modchu_Main.getMinecraftVersion();
   if (!isLMR && !isLMMX && version > 169) {
     Object multiModel = Modchu_Reflect.getFieldObject(entity.getClass(), "multiModel", entity);
     if (multiModel != null)
       return Modchu_CastHelper.String(
           Modchu_Reflect.getFieldObject(multiModel.getClass(), "armorName", multiModel));
   } else {
     Object textureData = Modchu_Reflect.getFieldObject(entity.getClass(), "textureData", entity);
     if (textureData != null) {
       Object[] textureBox =
           Modchu_CastHelper.ObjectArray(
               Modchu_Reflect.getFieldObject(textureData.getClass(), "textureBox", textureData));
       Class MMM_TextureBoxServer = getMMMTextureBoxServerClass();
       if (MMM_TextureBoxServer != null && MMM_TextureBoxServer.isInstance(textureBox[1])) ;
       else {
         if (textureBox != null)
           return Modchu_CastHelper.String(
               Modchu_Reflect.getFieldObject(
                   textureBox[1].getClass(),
                   "textureName",
                   textureBox[1],
                   Modchu_Main.isRelease() ? -1 : 0));
       }
     }
   }
   // else {
   // return
   // Modchu_CastHelper.String(Modchu_CastHelper.ObjectArray(Modchu_Reflect.getFieldObject("LMM_EntityLittleMaid", "textureArmor1", owner))[0]);
   // }
   return null;
 }
Example #2
0
 public static Map getLmmTextureManagerModels() {
   Object instance = getLmmTextureManagerInstance();
   return Modchu_CastHelper.Map(
       Modchu_Main.getMinecraftVersion() > 169 && !isLMR && !isLMMX
           ? Modchu_Reflect.getFieldObject(instance.getClass(), "models", instance)
           : Modchu_Reflect.getFieldObject(instance.getClass(), "modelMap", instance));
 }
Example #3
0
 public static void setLmmTextureManagerModels(Map map) {
   Object instance = getLmmTextureManagerInstance();
   Modchu_Reflect.setFieldObject(
       instance.getClass(),
       Modchu_Main.getMinecraftVersion() > 169 && !isLMR && !isLMMX ? "models" : "modelMap",
       instance,
       map);
 }
Example #4
0
 public static Object getLmmTextureManagerInstance() {
   String s =
       isLMR
           ? "net.blacklab.lmr.util.manager.ModelManager"
           : isLMMX
               ? "mmmlibx.lib.MMM_TextureManager"
               : Modchu_Main.getMinecraftVersion() > 169
                   ? "mmm.lib.multiModel.MultiModelManager"
                   : "MMM_TextureManager";
   return Modchu_Reflect.getFieldObject(s, "instance");
 }
Example #5
0
 public static Class getModelLittleMaidOrignClass() {
   return Modchu_Reflect.loadClass(
       isLMR
           ? "net.blacklab.lmr.entity.maidmodel.ModelLittleMaid_Orign"
           : isLMMX
               ? "mmmlibx.lib.multiModel.model.mc162.ModelLittleMaid_Orign"
               : Modchu_Main.getMinecraftVersion() > 169
                   ? "mmmlib.lib.multiModel.model.mc162.ModelLittleMaid_Orign"
                   : "MMM_ModelLittleMaid_Orign",
       -1);
 }
Example #6
0
 public static Class getLMMModelMultiBaseClass() {
   return Modchu_Reflect.loadClass(
       isLMR
           ? "net.blacklab.lmr.entity.maidmodel.ModelMultiBase"
           : isLMMX
               ? "mmmlibx.lib.multiModel.model.mc162.ModelMultiBase"
               : Modchu_Main.getMinecraftVersion() > 169
                   ? "mmm.lib.multiModel.model.mc162.ModelMultiBase"
                   : "ModelMultiBase",
       -1);
 }
Example #7
0
 public static Class getLMMEntityLittleMaidClass() {
   return Modchu_Reflect.loadClass(
       isLMR
           ? "net.blacklab.lmr.entity.EntityLittleMaid"
           : isLMMX
               ? "littleMaidMobX.LMM_EntityLittleMaid"
               : Modchu_Main.getMinecraftVersion() < 170
                   ? "LMM_EntityLittleMaid"
                   : "mmm.littleMaidMob.entity.EntityLittleMaidBase",
       -1);
 }
Example #8
0
 public static Object newModchu_LmmTextureBox(Object mtb) {
   String Modchu_LmmTextureBoxString =
       Modchu_Main.getModchuCharacteristicClassName(
           Modchu_LMMManager.getModchuLmmTextureBoxString());
   Class ModchuModel_TextureBoxBase =
       (Class) Modchu_Reflect.loadClass("modchu.model.ModchuModel_TextureBoxBase");
   return Modchu_Reflect.newInstance(
       Modchu_LmmTextureBoxString,
       new Class[] {ModchuModel_TextureBoxBase},
       new Object[] {Modchu_Reflect.invokeMethod(mtb.getClass(), "duplicate", mtb)});
 }
Example #9
0
 public static void setMaidColor(Object owner, int i) {
   int version = Modchu_Main.getMinecraftVersion();
   if (version < 170 | isLMMX | isLMR) {
     Object textureData = Modchu_Reflect.getFieldObject(owner.getClass(), "textureData", owner);
     if (textureData != null) {
       Modchu_Reflect.setFieldObject(textureData.getClass(), "color", textureData, i);
     }
   } else {
     Object multiModel = Modchu_Reflect.getFieldObject(owner.getClass(), "multiModel", owner);
     if (multiModel != null)
       Modchu_Reflect.setFieldObject(multiModel.getClass(), "color", multiModel, i);
   }
 }
Example #10
0
 public static int getMaidColor(Object owner) {
   int version = Modchu_Main.getMinecraftVersion();
   if (version > 169 && !isLMMX && !isLMR) {
     Object multiModel = Modchu_Reflect.getFieldObject(owner.getClass(), "multiModel", owner);
     if (multiModel != null)
       return Modchu_CastHelper.Int(
           Modchu_Reflect.getFieldObject(multiModel.getClass(), "color", multiModel));
   } else if (version > 159) {
     Object textureData = Modchu_Reflect.getFieldObject(owner.getClass(), "textureData", owner);
     if (textureData != null) {
       return Modchu_CastHelper.Int(
           Modchu_Reflect.getFieldObject(textureData.getClass(), "color", textureData));
     }
   }
   return Modchu_CastHelper.Int(
       Modchu_Reflect.getFieldObject("LMM_EntityLittleMaid", "maidColor", owner));
 }
Example #11
0
 public static Object getLMMModel(Object owner, int i, int color) {
   int version = Modchu_Main.getMinecraftVersion();
   if (version < 170 | isLMMX | isLMR) {
     Object textureData = Modchu_Reflect.getFieldObject(owner.getClass(), "textureData", owner);
     if (textureData != null) {
       Object[] textureModel =
           Modchu_CastHelper.ObjectArray(
               Modchu_Reflect.getFieldObject(textureData.getClass(), "textureModel", textureData));
       if (textureModel != null) {
         return textureModel != null && i < textureModel.length ? textureModel[i] : null;
       } else {
         Modchu_Debug.mDebug("ModchuModel_ModelDataBase getModel textureModel == null !!");
       }
     } else {
       Modchu_Debug.mDebug("ModchuModel_ModelDataBase getModel textureData == null !!");
     }
   } else {
     Object multiModel = Modchu_Reflect.getFieldObject(owner.getClass(), "multiModel", owner);
     if (multiModel != null) {
       Object[] model =
           Modchu_CastHelper.ObjectArray(
               Modchu_Reflect.getFieldObject(multiModel.getClass(), "model", multiModel));
       if (model != null) {
         Object[] models =
             Modchu_CastHelper.ObjectArray(
                 Modchu_Reflect.invokeMethod(
                     model.getClass(),
                     "getModelClass",
                     new Class[] {int.class},
                     model,
                     new Object[] {color}));
         return models != null && i < models.length ? models[i] : null;
       }
     }
   }
   return null;
 }
Example #12
0
 public static void setLmmTextureManagerModelNames(Map map) {
   if (Modchu_Main.getMinecraftVersion() < 170 | isLMR | isLMMX) return;
   Object instance = getLmmTextureManagerInstance();
   Modchu_Reflect.setFieldObject(instance.getClass(), "modelNames", instance, map);
 }
Example #13
0
 public static Map getLmmTextureManagerModelNames() {
   if (Modchu_Main.getMinecraftVersion() < 170 | isLMR | isLMMX) return null;
   Object instance = getLmmTextureManagerInstance();
   return Modchu_CastHelper.Map(
       Modchu_Reflect.getFieldObject(instance.getClass(), "modelNames", instance));
 }
Example #14
0
 public static Class getModchuLmmModelClass() {
   return Modchu_Main.getModchuCharacteristicClass(
       isLMR ? "ModchuLmrModel" : isLMMX ? "ModchuLmmXModel" : "ModchuLmmModel");
 }