Advertisement
Camellias_

Untitled

Nov 28th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.03 KB | None | 0 0
  1.     @SubscribeEvent
  2.     public static void onPlayerRenderPre(RenderPlayerEvent.Pre event)
  3.     {
  4.         EntityPlayer player = event.getEntityPlayer();
  5.         PotionEffect growth = player.getActivePotionEffect(Main.GROWTH);
  6.         PotionEffect shrinking = player.getActivePotionEffect(Main.SHRINKING);
  7.        
  8.         if(player.isPotionActive(Main.GROWTH))
  9.         {
  10.             if(growth.getAmplifier() == 0)
  11.             {
  12.                 GlStateManager.pushMatrix();
  13.                 GlStateManager.scale(1.5F, 1.5F, 1.5F);
  14.             }
  15.            
  16.             if(growth.getAmplifier() == 1)
  17.             {
  18.                 GlStateManager.pushMatrix();
  19.                 GlStateManager.scale(2.0F, 2.0F, 2.0F);
  20.             }
  21.         }
  22.        
  23.         if(player.isPotionActive(Main.SHRINKING))
  24.         {
  25.             if(shrinking.getAmplifier() == 0)
  26.             {
  27.                 GlStateManager.pushMatrix();
  28.                 GlStateManager.scale(0.5F, 0.5F, 0.5F);
  29.             }
  30.            
  31.             if(shrinking.getAmplifier() == 1)
  32.             {
  33.                 GlStateManager.pushMatrix();
  34.                 GlStateManager.scale(0.25F, 0.25F, 0.25F);
  35.             }
  36.         }
  37.     }
  38.    
  39.     @SubscribeEvent
  40.     public static void onPlayerRenderPost(RenderPlayerEvent.Post event)
  41.     {
  42.         GlStateManager.popMatrix();
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement