Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Yashi.Mod.mods;
- import Yashi.Category.Category;
- import Yashi.Event.EventTarget;
- import Yashi.Event.events.Event3D;
- import Yashi.Event.events.EventPreMotionUpdates;
- import Yashi.Friends.FriendManager;
- import Yashi.Mod.Mod;
- import Yashi.Utils.RenderUtils;
- import Yashi.Yashi;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.multiplayer.WorldClient;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.monster.EntityMob;
- import net.minecraft.entity.passive.EntityAnimal;
- import net.minecraft.entity.passive.EntityBat;
- import net.minecraft.entity.player.EntityPlayer;
- import org.lwjgl.opengl.GL11;
- public class PlayerESP
- extends Mod
- {
- private static boolean players = true;
- private static boolean monsters;
- private static boolean animals;
- private boolean outline;
- private int state;
- private float r = 0.33F;
- private float g = 0.34F;
- private float b = 0.33F;
- private static float[] rainbowArray;
- public PlayerESP()
- {
- super("PlayerESP", "ESP - �7Players", 0, Category.RENDER);
- }
- @EventTarget
- private void onPreUpdate(EventPreMotionUpdates event)
- {
- rainbowArray = getRainbow();
- }
- @EventTarget(4)
- private void onRender3D(Event3D event)
- {
- if (this.outline) {
- return;
- }
- for (Object o : mc.theWorld.loadedEntityList) {
- if (((o instanceof EntityLivingBase)) && (o != mc.thePlayer))
- {
- EntityLivingBase entity = (EntityLivingBase)o;
- int color = -8390808;
- int thingyt = 1174405120;
- if (entity.hurtTime != 0)
- {
- color = -6750208;
- thingyt = 1184432128;
- }
- if (checkValidity(entity)) {
- RenderUtils.drawEsp(entity, Event3D.getPartialTicks(), color, thingyt);
- }
- }
- }
- }
- public static void renderOne()
- {
- GL11.glPushAttrib(1048575);
- GL11.glDisable(3008);
- GL11.glDisable(3553);
- GL11.glDisable(2896);
- GL11.glEnable(3042);
- GL11.glBlendFunc(770, 771);
- GL11.glLineWidth(3.0F);
- GL11.glEnable(2848);
- GL11.glHint(3154, 4354);
- GL11.glEnable(2960);
- GL11.glClear(1024);
- GL11.glClearStencil(15);
- GL11.glStencilFunc(512, 1, 15);
- GL11.glStencilOp(7681, 7681, 7681);
- GL11.glLineWidth(3.0F);
- GL11.glStencilOp(7681, 7681, 7681);
- GL11.glPolygonMode(1032, 6913);
- }
- public static void renderTwo()
- {
- GL11.glStencilFunc(512, 0, 15);
- GL11.glStencilOp(7681, 7681, 7681);
- GL11.glPolygonMode(1032, 6914);
- }
- public static void renderThree()
- {
- GL11.glStencilFunc(514, 1, 15);
- GL11.glStencilOp(7680, 7680, 7680);
- GL11.glPolygonMode(1032, 6913);
- }
- public static void renderFour()
- {
- GL11.glEnable(10754);
- GL11.glPolygonOffset(1.0F, -2000000.0F);
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
- }
- public static void renderFive()
- {
- GL11.glPolygonOffset(1.0F, 2000000.0F);
- GL11.glDisable(10754);
- GL11.glDisable(2960);
- GL11.glDisable(2848);
- GL11.glHint(3154, 4352);
- GL11.glDisable(3042);
- GL11.glEnable(2896);
- GL11.glEnable(3553);
- GL11.glEnable(3008);
- GL11.glPopAttrib();
- }
- public static void renderOne(Entity ent)
- {
- if (!checkValidity((EntityLivingBase)ent)) {
- return;
- }
- GL11.glPushAttrib(1048575);
- GL11.glDisable(3008);
- GL11.glDisable(3553);
- GL11.glDisable(2896);
- GL11.glEnable(3042);
- GL11.glBlendFunc(770, 771);
- GL11.glLineWidth(0.2F);
- GL11.glEnable(2848);
- GL11.glHint(3154, 4354);
- GL11.glEnable(2960);
- GL11.glClear(1024);
- GL11.glClearStencil(15);
- GL11.glStencilFunc(512, 1, 15);
- GL11.glStencilOp(7681, 7681, 7681);
- colorLines(ent);
- GL11.glLineWidth(1.5F);
- GL11.glStencilOp(7681, 7681, 7681);
- GL11.glPolygonMode(1032, 6913);
- }
- private static void colorLines(Entity ent)
- {
- int color = 13762557;
- if (FriendManager.isFriend(ent.getName()))
- {
- Yashi.getInstance();
- if (FriendManager.isFriend(ent.getName())) {
- color = -1862314667;
- }
- color(color, 1.0F);
- }
- }
- private static void color(int color, float alpha)
- {
- float red = (color >> 16 & 0xFF) / 255.0F;
- float green = (color >> 8 & 0xFF) / 255.0F;
- float blue = (color & 0xFF) / 255.0F;
- GL11.glColor4f(red, green, blue, alpha);
- }
- public static void renderTwo(Entity ent)
- {
- if (!checkValidity((EntityLivingBase)ent)) {
- return;
- }
- GL11.glStencilFunc(512, 0, 15);
- GL11.glStencilOp(7681, 7681, 7681);
- GL11.glPolygonMode(1032, 6914);
- }
- public static void renderThree(Entity ent)
- {
- if (!checkValidity((EntityLivingBase)ent)) {
- return;
- }
- GL11.glStencilFunc(514, 1, 15);
- GL11.glStencilOp(7680, 7680, 7680);
- GL11.glPolygonMode(1032, 6913);
- }
- public static void renderFour(Entity ent)
- {
- if (!checkValidity((EntityLivingBase)ent)) {
- return;
- }
- GL11.glEnable(10754);
- GL11.glPolygonOffset(1.0F, -2000000.0F);
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
- }
- public static void renderFive(Entity ent)
- {
- if (!checkValidity((EntityLivingBase)ent)) {
- return;
- }
- GL11.glPolygonOffset(1.0F, 2000000.0F);
- GL11.glDisable(10754);
- GL11.glDisable(2960);
- GL11.glDisable(2848);
- GL11.glHint(3154, 4352);
- GL11.glDisable(3042);
- GL11.glEnable(2896);
- GL11.glEnable(3553);
- GL11.glEnable(3008);
- GL11.glPopAttrib();
- }
- private static boolean checkValidity(EntityLivingBase entity)
- {
- if ((entity instanceof EntityPlayer)) {
- return players;
- }
- if (((!monsters) || (!(entity instanceof EntityMob))) && ((!animals) || (!(entity instanceof EntityAnimal))) && ((!animals) || (!(entity instanceof EntityBat)))) {
- return false;
- }
- return true;
- }
- private float[] getRainbow()
- {
- if (this.state == 0)
- {
- this.r = ((float)(this.r + 0.02D));
- this.b = ((float)(this.b - 0.02D));
- if (this.r >= 0.85D) {
- this.state += 1;
- }
- }
- else if (this.state == 1)
- {
- this.g = ((float)(this.g + 0.02D));
- this.r = ((float)(this.r - 0.02D));
- if (this.g >= 0.85D) {
- this.state += 1;
- }
- }
- else
- {
- this.b = ((float)(this.b + 0.02D));
- this.g = ((float)(this.g - 0.02D));
- if (this.b >= 0.85D) {
- this.state = 0;
- }
- }
- return new float[] { this.r, this.g, this.b };
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment