Advertisement
Corosus

Untitled

Oct 23rd, 2011
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.51 KB | None | 0 0
  1. package net.minecraft.src;
  2. // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
  3. // Jad home page: http://www.kpdus.com/jad.html
  4. // Decompiler options: packimports(3) braces deadcode
  5.  
  6. import java.lang.reflect.Field;
  7. import java.lang.reflect.Modifier;
  8. import java.util.HashMap;
  9. import java.util.Iterator;
  10. import java.util.List;
  11. import net.minecraft.client.Minecraft;
  12. import paulscode.sound.SoundSystem;
  13. import java.util.Random;
  14. import java.io.File;
  15. import java.io.FileInputStream;
  16. import java.io.FileOutputStream;
  17. import java.util.ArrayList;
  18.  
  19. import java.util.Map;
  20. import org.lwjgl.input.Keyboard;
  21.  
  22. import java.util.HashMap;
  23. import java.util.Iterator;
  24. import java.util.Map;
  25. import java.util.Set;
  26.  
  27.  
  28. public class mod_ExtendedRenderer extends BaseMod
  29. implements Runnable {
  30.  
  31. public static String modName = "Better Particles";
  32. public static Minecraft mc;
  33. public static World worldRef;
  34. public static EntityPlayer player;
  35. public static int timeout;
  36. public static String msg;
  37. public static int color;
  38. public static int defaultColor = 0xffffff;
  39.  
  40.  
  41. @MLProp public static float rainVolume = 0.75F;
  42. @MLProp public static boolean smoothRain = true;
  43.  
  44. public static boolean ingui;
  45. public static int effRainID;
  46.  
  47. public static RotatingEffectRenderer rotEffRenderer;
  48.  
  49. public String Version() {
  50. return "Version 1.0 for MC b1.8.1";
  51. }
  52.  
  53. public void run() {
  54. try {
  55. while(true) {
  56. if(mc == null) {
  57. mc = ModLoader.getMinecraftInstance();
  58. }
  59.  
  60. if(mc == null) {
  61. Thread.sleep(5000L);
  62. } else {
  63. if(mc.thePlayer == null) {
  64. Thread.sleep(5000L);
  65. } else {
  66. worldRef = mc.theWorld;
  67. player = mc.thePlayer;
  68.  
  69. Thread.sleep(5000L);
  70. }
  71. }
  72. }
  73. } catch(Throwable throwable) {
  74. throwable.printStackTrace();
  75. }
  76. }
  77.  
  78. public mod_ExtendedRenderer() {
  79.  
  80.  
  81. ModLoader.SetInGUIHook(this, true, false);
  82. ModLoader.SetInGameHook(this, true, false);
  83. }
  84.  
  85. public void AddRenderer(Map var1) {
  86.  
  87.  
  88. effRainID = ModLoader.addOverride("/gui/items.png", "/item/raindrop.png");
  89. }
  90.  
  91. public void ModsLoaded() {
  92. mc = ModLoader.getMinecraftInstance();
  93. this.rotEffRenderer = new RotatingEffectRenderer(mc.theWorld, mc.renderEngine);
  94. mc.entityRenderer = new EntityRendererProxyWeather(mc);
  95. }
  96.  
  97.  
  98. public static void displayMessage(String s, int i) {
  99. msg = s;
  100. timeout = 85;
  101. color = i;
  102. }
  103. public static void dM(String s) {
  104. displayMessage(s, defaultColor);
  105. }
  106. public static void dM(float f) {
  107. displayMessage((new StringBuilder()).append(f).toString(), defaultColor);
  108. }
  109. public static void displayMessage(String s) {
  110. displayMessage(s, defaultColor);
  111. }
  112.  
  113. public boolean OnTickInGame(Minecraft var1) {
  114. if(!ingui) {
  115. //playerLastTick = System.currentTimeMillis();
  116. this.OSDHook(var1, false);
  117. }
  118.  
  119. ingui = false;
  120. return true;
  121. }
  122. public boolean OnTickInGUI(Minecraft var1, GuiScreen gui) {
  123. if (ModLoader.getMinecraftInstance().thePlayer != null) {
  124. //long ticksRan = System.currentTimeMillis();
  125. if (!(gui instanceof GuiContainer) && !(gui instanceof GuiChat)) {
  126. ingui = true;
  127. //lastTickRun = 0;
  128. }
  129.  
  130. //System.out.println(gui);
  131. //playerTick(mc.thePlayer);
  132. }
  133.  
  134. return true;
  135. }
  136.  
  137.  
  138.  
  139. public static void OSDHook(Minecraft minecraft, boolean flag) {
  140. if (worldRef == null) {
  141. worldRef = ModLoader.getMinecraftInstance().theWorld;
  142. }
  143.  
  144. if (player == null) {
  145. player = ModLoader.getMinecraftInstance().thePlayer;
  146. }
  147.  
  148. if (worldRef == null || player == null) {
  149. return;
  150. }
  151.  
  152.  
  153.  
  154. if(timeout > 0 && msg != null) {
  155. //ScaledResolution scaledresolution = new ScaledResolution(minecraft.gameSettings, minecraft.displayWidth, minecraft.displayHeight);
  156. minecraft.fontRenderer.drawStringWithShadow(msg, 3, 85, 0xffffff);
  157. timeout--;
  158. }
  159. }
  160. }
  161.  
  162.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement