SHARE
TWEET

TickClientHandlerEvent

a guest Dec 4th, 2017 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.altiscube.deadcook.Event;
  2. import com.altiscube.deadcook.mod.Altiscube;
  3.  
  4. import cpw.mods.fml.common.ObfuscationReflectionHelper;
  5. import cpw.mods.fml.common.eventhandler.SubscribeEvent;
  6. import net.minecraft.client.Minecraft;
  7. import net.minecraft.client.renderer.EntityRenderer;
  8. import net.minecraft.item.ItemStack;
  9. import net.minecraftforge.client.event.RenderGameOverlayEvent;
  10.  
  11. public class TickClientHandlerEvent
  12.  
  13. {
  14.  
  15. @SubscribeEvent
  16.  
  17. public void onRenderExperienceBar(RenderGameOverlayEvent event)
  18.  
  19. {
  20.  
  21.   if(Altiscube.zoom)
  22.  
  23.   {
  24.  
  25.       ItemStack itemstack = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem();
  26.      
  27.       if(itemstack != null && itemstack.getItem() == Altiscube.ItemZoomer && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0)
  28.      
  29.       {
  30.      
  31.       zoom(6.0D); //c'est déjà pas mal, mais libre à vous de jongler sur la valeur
  32.      
  33.       }
  34.      
  35.       }
  36.   else{
  37.      
  38.       zoom(1.0D); //par défaut, le zoom de la caméra est à 1.0D
  39.      
  40.       }
  41. }
  42.  
  43.  
  44. public static void zoom(double zoomValue)
  45.  
  46. {
  47.  
  48. ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, zoomValue, "cameraZoom", "field_78503_V");
  49.  
  50. }
  51.  
  52. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top