Merge pull request #600 from Bluskript/feature/master

add option to hide invisibles in ESP and Tracers
This commit is contained in:
Bella Who 2020-03-25 14:53:56 +00:00 committed by GitHub
commit c0cef8ccd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import static org.lwjgl.opengl.GL11.*;
/** /**
* Created by 086 on 14/12/2017. * Created by 086 on 14/12/2017.
* Updated by d1gress/Qther on 27/11/2019. * Updated by d1gress/Qther on 27/11/2019.
* Kurisu Makise is cute
*/ */
@Module.Info(name = "ESP", category = Module.Category.RENDER, description = "Highlights entities") @Module.Info(name = "ESP", category = Module.Category.RENDER, description = "Highlights entities")
public class ESP extends Module { public class ESP extends Module {
@ -26,6 +27,7 @@ public class ESP extends Module {
private Setting<Boolean> players = register(Settings.b("Players", true)); private Setting<Boolean> players = register(Settings.b("Players", true));
private Setting<Boolean> animals = register(Settings.b("Animals", false)); private Setting<Boolean> animals = register(Settings.b("Animals", false));
private Setting<Boolean> mobs = register(Settings.b("Mobs", false)); private Setting<Boolean> mobs = register(Settings.b("Mobs", false));
private Setting<Boolean> renderInvis = register(Settings.b("Invisible", false));
public enum ESPMode { public enum ESPMode {
RECTANGLE, GLOW RECTANGLE, GLOW
@ -43,6 +45,12 @@ public class ESP extends Module {
mc.world.loadedEntityList.stream() mc.world.loadedEntityList.stream()
.filter(EntityUtil::isLiving) .filter(EntityUtil::isLiving)
.filter(entity -> {
if (entity.isInvisible()) {
return renderInvis.getValue();
}
return true;
})
.filter(entity -> mc.player != entity) .filter(entity -> mc.player != entity)
.map(entity -> (EntityLivingBase) entity) .map(entity -> (EntityLivingBase) entity)
.filter(entityLivingBase -> !entityLivingBase.isDead) .filter(entityLivingBase -> !entityLivingBase.isDead)

View File

@ -17,6 +17,8 @@ import org.lwjgl.opengl.GL11;
/** /**
* Created by 086 on 11/12/2017. * Created by 086 on 11/12/2017.
* <p>
* Kurisu Makise is best girl
*/ */
@Module.Info(name = "Tracers", description = "Draws lines to other living entities", category = Module.Category.RENDER) @Module.Info(name = "Tracers", description = "Draws lines to other living entities", category = Module.Category.RENDER)
public class Tracers extends Module { public class Tracers extends Module {
@ -27,6 +29,7 @@ public class Tracers extends Module {
private Setting<Boolean> mobs = register(Settings.b("Mobs", false)); private Setting<Boolean> mobs = register(Settings.b("Mobs", false));
private Setting<Double> range = register(Settings.d("Range", 200)); private Setting<Double> range = register(Settings.d("Range", 200));
private Setting<Float> opacity = register(Settings.floatBuilder("Opacity").withRange(0f, 1f).withValue(1f)); private Setting<Float> opacity = register(Settings.floatBuilder("Opacity").withRange(0f, 1f).withValue(1f));
private Setting<Boolean> renderInvis = register(Settings.b("Invisible", false));
HueCycler cycler = new HueCycler(3600); HueCycler cycler = new HueCycler(3600);
@ -35,6 +38,12 @@ public class Tracers extends Module {
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
Minecraft.getMinecraft().world.loadedEntityList.stream() Minecraft.getMinecraft().world.loadedEntityList.stream()
.filter(EntityUtil::isLiving) .filter(EntityUtil::isLiving)
.filter(entity -> {
if (entity.isInvisible()) {
return renderInvis.getValue();
}
return true;
})
.filter(entity -> !EntityUtil.isFakeLocalPlayer(entity)) .filter(entity -> !EntityUtil.isFakeLocalPlayer(entity))
.filter(entity -> (entity instanceof EntityPlayer ? players.getValue() && mc.player != entity : (EntityUtil.isPassive(entity) ? animals.getValue() : mobs.getValue()))) .filter(entity -> (entity instanceof EntityPlayer ? players.getValue() && mc.player != entity : (EntityUtil.isPassive(entity) ? animals.getValue() : mobs.getValue())))
.filter(entity -> mc.player.getDistance(entity) < range.getValue()) .filter(entity -> mc.player.getDistance(entity) < range.getValue())