Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.69 KB | None | 0 0
  1. package Yashi.Mod.mods;
  2.  
  3. import Yashi.Category.Category;
  4. import Yashi.Event.EventTarget;
  5. import Yashi.Event.events.Event3D;
  6. import Yashi.Event.events.EventPreMotionUpdates;
  7. import Yashi.Friends.FriendManager;
  8. import Yashi.Mod.Mod;
  9. import Yashi.Utils.RenderUtils;
  10. import Yashi.Yashi;
  11. import net.minecraft.client.Minecraft;
  12. import net.minecraft.client.multiplayer.WorldClient;
  13. import net.minecraft.client.renderer.OpenGlHelper;
  14. import net.minecraft.entity.Entity;
  15. import net.minecraft.entity.EntityLivingBase;
  16. import net.minecraft.entity.monster.EntityMob;
  17. import net.minecraft.entity.passive.EntityAnimal;
  18. import net.minecraft.entity.passive.EntityBat;
  19. import net.minecraft.entity.player.EntityPlayer;
  20. import org.lwjgl.opengl.GL11;
  21.  
  22. public class PlayerESP
  23. extends Mod
  24. {
  25. private static boolean players = true;
  26. private static boolean monsters;
  27. private static boolean animals;
  28. private boolean outline;
  29. private int state;
  30. private float r = 0.33F;
  31. private float g = 0.34F;
  32. private float b = 0.33F;
  33. private static float[] rainbowArray;
  34.  
  35. public PlayerESP()
  36. {
  37. super("PlayerESP", "ESP - �7Players", 0, Category.RENDER);
  38. }
  39.  
  40. @EventTarget
  41. private void onPreUpdate(EventPreMotionUpdates event)
  42. {
  43. rainbowArray = getRainbow();
  44. }
  45.  
  46. @EventTarget(4)
  47. private void onRender3D(Event3D event)
  48. {
  49. if (this.outline) {
  50. return;
  51. }
  52. for (Object o : mc.theWorld.loadedEntityList) {
  53. if (((o instanceof EntityLivingBase)) && (o != mc.thePlayer))
  54. {
  55. EntityLivingBase entity = (EntityLivingBase)o;
  56. int color = -8390808;
  57. int thingyt = 1174405120;
  58. if (entity.hurtTime != 0)
  59. {
  60. color = -6750208;
  61. thingyt = 1184432128;
  62. }
  63. if (checkValidity(entity)) {
  64. RenderUtils.drawEsp(entity, Event3D.getPartialTicks(), color, thingyt);
  65. }
  66. }
  67. }
  68. }
  69.  
  70. public static void renderOne()
  71. {
  72. GL11.glPushAttrib(1048575);
  73. GL11.glDisable(3008);
  74. GL11.glDisable(3553);
  75. GL11.glDisable(2896);
  76. GL11.glEnable(3042);
  77. GL11.glBlendFunc(770, 771);
  78. GL11.glLineWidth(3.0F);
  79. GL11.glEnable(2848);
  80. GL11.glHint(3154, 4354);
  81. GL11.glEnable(2960);
  82. GL11.glClear(1024);
  83. GL11.glClearStencil(15);
  84. GL11.glStencilFunc(512, 1, 15);
  85. GL11.glStencilOp(7681, 7681, 7681);
  86. GL11.glLineWidth(3.0F);
  87. GL11.glStencilOp(7681, 7681, 7681);
  88. GL11.glPolygonMode(1032, 6913);
  89. }
  90.  
  91. public static void renderTwo()
  92. {
  93. GL11.glStencilFunc(512, 0, 15);
  94. GL11.glStencilOp(7681, 7681, 7681);
  95. GL11.glPolygonMode(1032, 6914);
  96. }
  97.  
  98. public static void renderThree()
  99. {
  100. GL11.glStencilFunc(514, 1, 15);
  101. GL11.glStencilOp(7680, 7680, 7680);
  102. GL11.glPolygonMode(1032, 6913);
  103. }
  104.  
  105. public static void renderFour()
  106. {
  107. GL11.glEnable(10754);
  108. GL11.glPolygonOffset(1.0F, -2000000.0F);
  109. OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
  110. }
  111.  
  112. public static void renderFive()
  113. {
  114. GL11.glPolygonOffset(1.0F, 2000000.0F);
  115. GL11.glDisable(10754);
  116. GL11.glDisable(2960);
  117. GL11.glDisable(2848);
  118. GL11.glHint(3154, 4352);
  119. GL11.glDisable(3042);
  120. GL11.glEnable(2896);
  121. GL11.glEnable(3553);
  122. GL11.glEnable(3008);
  123. GL11.glPopAttrib();
  124. }
  125.  
  126. public static void renderOne(Entity ent)
  127. {
  128. if (!checkValidity((EntityLivingBase)ent)) {
  129. return;
  130. }
  131. GL11.glPushAttrib(1048575);
  132. GL11.glDisable(3008);
  133. GL11.glDisable(3553);
  134. GL11.glDisable(2896);
  135. GL11.glEnable(3042);
  136. GL11.glBlendFunc(770, 771);
  137. GL11.glLineWidth(0.2F);
  138. GL11.glEnable(2848);
  139. GL11.glHint(3154, 4354);
  140. GL11.glEnable(2960);
  141. GL11.glClear(1024);
  142. GL11.glClearStencil(15);
  143. GL11.glStencilFunc(512, 1, 15);
  144. GL11.glStencilOp(7681, 7681, 7681);
  145. colorLines(ent);
  146. GL11.glLineWidth(1.5F);
  147. GL11.glStencilOp(7681, 7681, 7681);
  148. GL11.glPolygonMode(1032, 6913);
  149. }
  150.  
  151. private static void colorLines(Entity ent)
  152. {
  153. int color = 13762557;
  154. if (FriendManager.isFriend(ent.getName()))
  155. {
  156. Yashi.getInstance();
  157. if (FriendManager.isFriend(ent.getName())) {
  158. color = -1862314667;
  159. }
  160. color(color, 1.0F);
  161. }
  162. }
  163.  
  164. private static void color(int color, float alpha)
  165. {
  166. float red = (color >> 16 & 0xFF) / 255.0F;
  167. float green = (color >> 8 & 0xFF) / 255.0F;
  168. float blue = (color & 0xFF) / 255.0F;
  169. GL11.glColor4f(red, green, blue, alpha);
  170. }
  171.  
  172. public static void renderTwo(Entity ent)
  173. {
  174. if (!checkValidity((EntityLivingBase)ent)) {
  175. return;
  176. }
  177. GL11.glStencilFunc(512, 0, 15);
  178. GL11.glStencilOp(7681, 7681, 7681);
  179. GL11.glPolygonMode(1032, 6914);
  180. }
  181.  
  182. public static void renderThree(Entity ent)
  183. {
  184. if (!checkValidity((EntityLivingBase)ent)) {
  185. return;
  186. }
  187. GL11.glStencilFunc(514, 1, 15);
  188. GL11.glStencilOp(7680, 7680, 7680);
  189. GL11.glPolygonMode(1032, 6913);
  190. }
  191.  
  192. public static void renderFour(Entity ent)
  193. {
  194. if (!checkValidity((EntityLivingBase)ent)) {
  195. return;
  196. }
  197. GL11.glEnable(10754);
  198. GL11.glPolygonOffset(1.0F, -2000000.0F);
  199. OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
  200. }
  201.  
  202. public static void renderFive(Entity ent)
  203. {
  204. if (!checkValidity((EntityLivingBase)ent)) {
  205. return;
  206. }
  207. GL11.glPolygonOffset(1.0F, 2000000.0F);
  208. GL11.glDisable(10754);
  209. GL11.glDisable(2960);
  210. GL11.glDisable(2848);
  211. GL11.glHint(3154, 4352);
  212. GL11.glDisable(3042);
  213. GL11.glEnable(2896);
  214. GL11.glEnable(3553);
  215. GL11.glEnable(3008);
  216. GL11.glPopAttrib();
  217. }
  218.  
  219. private static boolean checkValidity(EntityLivingBase entity)
  220. {
  221. if ((entity instanceof EntityPlayer)) {
  222. return players;
  223. }
  224. if (((!monsters) || (!(entity instanceof EntityMob))) && ((!animals) || (!(entity instanceof EntityAnimal))) && ((!animals) || (!(entity instanceof EntityBat)))) {
  225. return false;
  226. }
  227. return true;
  228. }
  229.  
  230. private float[] getRainbow()
  231. {
  232. if (this.state == 0)
  233. {
  234. this.r = ((float)(this.r + 0.02D));
  235. this.b = ((float)(this.b - 0.02D));
  236. if (this.r >= 0.85D) {
  237. this.state += 1;
  238. }
  239. }
  240. else if (this.state == 1)
  241. {
  242. this.g = ((float)(this.g + 0.02D));
  243. this.r = ((float)(this.r - 0.02D));
  244. if (this.g >= 0.85D) {
  245. this.state += 1;
  246. }
  247. }
  248. else
  249. {
  250. this.b = ((float)(this.b + 0.02D));
  251. this.g = ((float)(this.g - 0.02D));
  252. if (this.b >= 0.85D) {
  253. this.state = 0;
  254. }
  255. }
  256. return new float[] { this.r, this.g, this.b };
  257. }
  258. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement