Advertisement
Camellias_

Untitled

Nov 28th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 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.         GlStateManager.pushMatrix();
  9.        
  10.         if(player.isPotionActive(Main.GROWTH))
  11.         {
  12.             if(growth.getAmplifier() == 0)
  13.             {
  14.                 GlStateManager.scale(1.5F, 1.5F, 1.5F);
  15.             }
  16.            
  17.             if(growth.getAmplifier() == 1)
  18.             {
  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.scale(0.5F, 0.5F, 0.5F);
  28.             }
  29.            
  30.             if(shrinking.getAmplifier() == 1)
  31.             {
  32.                 GlStateManager.scale(0.25F, 0.25F, 0.25F);
  33.             }
  34.         }
  35.        
  36.         if(player.isPotionActive(Main.GROWTH) == false || player.isPotionActive(Main.SHRINKING) == false)
  37.         {
  38.             GlStateManager.scale(1.0F, 1.0F, 1.0F);
  39.         }
  40.     }
  41.    
  42.     @SubscribeEvent
  43.     public static void onPlayerRenderPost(RenderPlayerEvent.Post event)
  44.     {
  45.         GlStateManager.popMatrix();
  46.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement