start working on reachcircle

This commit is contained in:
ThisIsALegitUsername 2023-04-02 00:36:07 +00:00
parent bc35b56465
commit 92cc896f4a
6 changed files with 56481 additions and 56371 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -32,6 +32,7 @@ import dev.resent.module.impl.misc.FPSOptions;
import dev.resent.module.impl.misc.Fullbright;
import dev.resent.module.impl.misc.HUD;
import dev.resent.module.impl.misc.ParticleMultiplier;
import dev.resent.module.impl.misc.ReachCircle;
import dev.resent.module.impl.misc.Scoreboard;
import dev.resent.module.impl.misc.Sprint;
import dev.resent.module.impl.setting.Animations;
@ -82,8 +83,12 @@ public class ModManager {
public static AdminSpawner adminSpawner =new AdminSpawner();
public static ParticleMultiplier particleMultiplier = new ParticleMultiplier();
public static Hand hand;
public static ReachCircle reachCircle = new ReachCircle();
public ModManager() {
register(reachCircle);
//Hud
register(hand = new Hand());
register(adminSpawner);

View File

@ -0,0 +1,73 @@
package dev.resent.module.impl.misc;
import java.util.Iterator;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL;
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@Module(name = "Reach circle", category = Category.MISC)
public class ReachCircle extends Mod{
public void uwu(float partialTicks){
GlStateManager.pushMatrix();
mc.entityRenderer.disableLightmap();
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 771);
GlStateManager.disableDepth();
//PlatformOpenGL._wglEnable(RealOpenGLEnums.GL_LINE_SMOOTH);
GlStateManager.depthMask(false);
Iterator<Entity> iterator = mc.theWorld.loadedEntityList.iterator();
while (iterator.hasNext()) {
Object o = iterator.next();
Entity entity = (Entity) o;
if (entity instanceof EntityLivingBase && !entity.isInvisible() && !entity.isSneaking() && entity != mc.thePlayer && ((EntityLivingBase) entity).canEntityBeSeen(mc.thePlayer) && !entity.isInvisible() && entity instanceof EntityPlayer) {
double posX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks - mc.getRenderManager().viewerPosX;
double posY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks - mc.getRenderManager().viewerPosY;
double posZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks - mc.getRenderManager().viewerPosZ;
this.circle(posX, posY, posZ, mc.playerController.isInCreativeMode() ? 4.7D : 3.4D);
}
}
GlStateManager.depthMask(true);
//PlatformOpenGL._wglDisable(RealOpenGLEnums.GL_LINE_SMOOTH);
GlStateManager.enableDepth();
GlStateManager.disableBlend();
GlStateManager.enableTexture2D();
mc.entityRenderer.enableLightmap();
GlStateManager.popMatrix();
}
public void circle(double x, double y, double z, double rad) {
GlStateManager.pushMatrix();
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
EaglercraftGPU.glLineWidth(2);
GlStateManager.color(1, 1, 1);
worldrenderer.begin(1, DefaultVertexFormats.POSITION_COLOR);
for (int i = 0; i <= 90; ++i) {
GlStateManager.color(1, 0, 0);
worldrenderer.pos(x + rad * Math.cos((double) i * 6.283185307179586D / 45.0D), y, z + rad * Math.sin((double) i * 6.283185307179586D / 45.0D));
}
tessellator.draw();
GlStateManager.popMatrix();
}
}

View File

@ -1061,6 +1061,8 @@ public class EntityRenderer implements IResourceManagerReloadListener {
}
private void renderWorldPass(int pass, float partialTicks, long finishTimeNano) {
if(ModManager.reachCircle.isEnabled())
ModManager.reachCircle.uwu(partialTicks);
RenderGlobal renderglobal = this.mc.renderGlobal;
EffectRenderer effectrenderer = this.mc.effectRenderer;
boolean flag = this.isDrawBlockOutline();