Advertisement
Exception_Prototype

Untitled

Mar 18th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.17 KB | None | 0 0
  1. public class mod_MyModName extends BaseMod {
  2.     public void ModsLoaded() {
  3.         RenderPlayerAPI.register("MyModId", MyModRenderPlayerBase.class);
  4.         ModelPlayerAPI.register("MyModId", MyModModelPlayerBase.class);
  5.     }
  6. }
  7.  
  8. public class MyModRenderPlayerBase extends RenderPlayerBase {
  9.    
  10.     public MyModRenderPlayerBase(RenderPlayerAPI renderPlayerAPI) {
  11.         super(renderPlayerAPI);
  12.     }
  13.    
  14.     // one of my hook functions
  15.     public void renderPlayer(EntityPlayer entityplayer, double d, double d1, double d2, float f, float f2) {
  16.         if(myModIsActive) {
  17.             // my code
  18.         } else {
  19.             super.renderPlayer(entityplayer, d, d1, d2, f, f2);
  20.         }
  21.     }
  22.    
  23.     // another of my hook functions
  24.     public void loadTexture(String s) {
  25.             if(myModIsActive) {
  26.             // my code
  27.             if(callLoadTextureOfRenderPlayer) {
  28.                 renderPlayer.localLoadTexture(s);
  29.             } else if(callLoadTextureOfRenderLiving) {
  30.                 renderPlayer.superLoadTexture(s);
  31.             }
  32.             // my code
  33.             if(ownTextureToLoad != null)
  34.                 super.loadTexture(ownTextureToLoad);
  35.             else if(dontLoadTexture) {
  36.                 // my code
  37.                 return;
  38.             } else {
  39.                 super.setRotationAngles(s);
  40.             }              
  41.         }
  42.     }
  43. }
  44.  
  45. public class MyModModelPlayerBase extends ModelPlayerBase {
  46.  
  47.         public MyModModelPlayerBase(ModelPlayerAPI modelplayerapi) {
  48.             super(modelplayerapi);
  49.         }
  50.        
  51.         // one of my hook functions
  52.         public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
  53.             if(myModIsActive) {
  54.                 // my code
  55.             } else {
  56.                 super.render(entity, f, f1, f2, f3, f4, f5);
  57.             }
  58.         }
  59.        
  60.         // another of my hook functions
  61.         public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) {
  62.             if(myModIsActive) {
  63.                 // my code
  64.                 if(callSetRotationAnglesOfModelPlayer) {
  65.                     modelPlayer.localSetRotationAngles(f, f1, f2, f3, f4, f5);
  66.                 } else if(callSetRotationAnglesOfModelBeped) {
  67.                     modelPlayer.superSetRotationAngles(f, f1, f2, f3, f4, f5);
  68.                     // my code
  69.                 }
  70.                
  71.                 if(hideHead) {
  72.                     modelPlayer.bipedHead.isHidden = true;
  73.                 } else if(mirrorBody) {
  74.                     modelPlayer.bipedBody.mirror = true;
  75.                     // my code
  76.                 } else {
  77.                     super.setRotationAngles(f, f1, f2, f3, f4, f5);
  78.                 }
  79.             }
  80.         }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement