potion status and other changes

This commit is contained in:
The Biggest skiddd 2023-07-12 16:07:03 +02:00
parent 9975632fda
commit 0de5c8b7f8
439 changed files with 5121 additions and 805 deletions

View File

@ -9,6 +9,7 @@ import com.mojang.authlib.minecraft.MinecraftSessionService;
import com.mojang.authlib.properties.Property; import com.mojang.authlib.properties.Property;
import com.mojang.authlib.properties.PropertyMap; import com.mojang.authlib.properties.PropertyMap;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
import lombok.Setter;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.audio.MusicTicker; import net.minecraft.client.audio.MusicTicker;
@ -169,6 +170,8 @@ public class Minecraft implements IThreadListener, IPlayerUsage
private Entity renderViewEntity; private Entity renderViewEntity;
public Entity pointedEntity; public Entity pointedEntity;
public EffectRenderer effectRenderer; public EffectRenderer effectRenderer;
@Setter
public Session session; public Session session;
private boolean isGamePaused; private boolean isGamePaused;
@ -1152,7 +1155,7 @@ public class Minecraft implements IThreadListener, IPlayerUsage
public void updateDisplay() public void updateDisplay()
{ {
if(Athena.INSTANCE.getModuleRepository().get(MotionBlur.class).isToggled()) { if(Athena.INSTANCE.getModuleRepository().get(MotionBlur.class).isToggled()) {
if(Minecraft.getMinecraft().thePlayer != null) { if(Minecraft.getMinecraft().thePlayer != null && Minecraft.getMinecraft().currentScreen == null) {
MotionBlur.createAccumulation(); MotionBlur.createAccumulation();
} }
} }
@ -1648,7 +1651,7 @@ public class Minecraft implements IThreadListener, IPlayerUsage
/** /**
* Called to resize the current screen. * Called to resize the current screen.
*/ */
private void resize(int width, int height) public void resize(int width, int height)
{ {
this.displayWidth = Math.max(1, width); this.displayWidth = Math.max(1, width);
this.displayHeight = Math.max(1, height); this.displayHeight = Math.max(1, height);

View File

@ -13,6 +13,9 @@ import net.minecraft.client.resources.I18n;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import rip.athena.client.Athena;
import javax.swing.table.AbstractTableModel;
public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback
{ {
@ -145,6 +148,10 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback
if (button.id == 2 && guilistextended$iguilistentry instanceof ServerListEntryNormal) if (button.id == 2 && guilistextended$iguilistentry instanceof ServerListEntryNormal)
{ {
if(Athena.INSTANCE.getPartnerManager().isPartner(((ServerListEntryNormal)guilistextended$iguilistentry).getServerData().serverIP)) {
return;
}
String s4 = ((ServerListEntryNormal)guilistextended$iguilistentry).getServerData().serverName; String s4 = ((ServerListEntryNormal)guilistextended$iguilistentry).getServerData().serverName;
if (s4 != null) if (s4 != null)
@ -174,6 +181,10 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback
} }
else if (button.id == 7 && guilistextended$iguilistentry instanceof ServerListEntryNormal) else if (button.id == 7 && guilistextended$iguilistentry instanceof ServerListEntryNormal)
{ {
if(Athena.INSTANCE.getPartnerManager().isPartner(((ServerListEntryNormal)guilistextended$iguilistentry).getServerData().serverIP)) {
return;
}
this.editingServer = true; this.editingServer = true;
ServerData serverdata = ((ServerListEntryNormal)guilistextended$iguilistentry).getServerData(); ServerData serverdata = ((ServerListEntryNormal)guilistextended$iguilistentry).getServerData();
this.selectedServer = new ServerData(serverdata.serverName, serverdata.serverIP, false); this.selectedServer = new ServerData(serverdata.serverName, serverdata.serverIP, false);
@ -465,6 +476,11 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback
public void func_175391_a(ServerListEntryNormal p_175391_1_, int p_175391_2_, boolean p_175391_3_) public void func_175391_a(ServerListEntryNormal p_175391_1_, int p_175391_2_, boolean p_175391_3_)
{ {
int i = p_175391_3_ ? 0 : p_175391_2_ - 1; int i = p_175391_3_ ? 0 : p_175391_2_ - 1;
if(Athena.INSTANCE.getPartnerManager().isPartner(getServerList().getServerData(i).serverIP)) {
return;
}
this.savedServerList.swapServers(p_175391_2_, i); this.savedServerList.swapServers(p_175391_2_, i);
if (this.serverListSelector.func_148193_k() == p_175391_2_) if (this.serverListSelector.func_148193_k() == p_175391_2_)
@ -478,6 +494,11 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback
public void func_175393_b(ServerListEntryNormal p_175393_1_, int p_175393_2_, boolean p_175393_3_) public void func_175393_b(ServerListEntryNormal p_175393_1_, int p_175393_2_, boolean p_175393_3_)
{ {
int i = p_175393_3_ ? this.savedServerList.countServers() - 1 : p_175393_2_ + 1; int i = p_175393_3_ ? this.savedServerList.countServers() - 1 : p_175393_2_ + 1;
if(Athena.INSTANCE.getPartnerManager().isPartner(getServerList().getServerData(i).serverIP)) {
return;
}
this.savedServerList.swapServers(p_175393_2_, i); this.savedServerList.swapServers(p_175393_2_, i);
if (this.serverListSelector.func_148193_k() == p_175393_2_) if (this.serverListSelector.func_148193_k() == p_175393_2_)

View File

@ -660,7 +660,9 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback
} }
else else
{ {
GlStateManager.pushMatrix();
DrawUtils.drawImage(new ResourceLocation("Athena/menu/wallpaper3.png"), 0, 0, width, height); DrawUtils.drawImage(new ResourceLocation("Athena/menu/wallpaper3.png"), 0, 0, width, height);
GlStateManager.popMatrix();
//this.drawBackground(tint); //this.drawBackground(tint);
} }
} }

View File

@ -21,6 +21,8 @@ import net.minecraft.util.ResourceLocation;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import rip.athena.client.Athena;
import rip.athena.client.utils.render.DrawUtils;
public class ServerListEntryNormal implements GuiListExtended.IGuiListEntry public class ServerListEntryNormal implements GuiListExtended.IGuiListEntry
{ {
@ -47,6 +49,12 @@ public class ServerListEntryNormal implements GuiListExtended.IGuiListEntry
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected) public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
{ {
if(Athena.INSTANCE.getPartnerManager().isPartner(field_148303_c.getServerList().getServerData(slotIndex).serverIP)) {
GlStateManager.pushMatrix();
DrawUtils.drawImage(new ResourceLocation("Athena/gui/partner/star.png"), x-20, y+8, 10, 10);
GlStateManager.popMatrix();
}
if (!this.field_148301_e.field_78841_f) if (!this.field_148301_e.field_78841_f)
{ {
this.field_148301_e.field_78841_f = true; this.field_148301_e.field_78841_f = true;
@ -202,6 +210,10 @@ public class ServerListEntryNormal implements GuiListExtended.IGuiListEntry
} }
} }
if(Athena.INSTANCE.getPartnerManager().isPartner(field_148303_c.getServerList().getServerData(slotIndex).serverIP)) {
return;
}
if (this.field_148303_c.func_175392_a(this, slotIndex)) if (this.field_148303_c.func_175392_a(this, slotIndex))
{ {
if (k1 < 16 && l1 < 16) if (k1 < 16 && l1 < 16)
@ -303,12 +315,20 @@ public class ServerListEntryNormal implements GuiListExtended.IGuiListEntry
if (p_148278_5_ < 16 && p_148278_6_ < 16 && this.field_148303_c.func_175392_a(this, slotIndex)) if (p_148278_5_ < 16 && p_148278_6_ < 16 && this.field_148303_c.func_175392_a(this, slotIndex))
{ {
if(Athena.INSTANCE.getPartnerManager().isPartner(field_148303_c.getServerList().getServerData(slotIndex).serverIP)) {
return true;
}
this.field_148303_c.func_175391_a(this, slotIndex, GuiScreen.isShiftKeyDown()); this.field_148303_c.func_175391_a(this, slotIndex, GuiScreen.isShiftKeyDown());
return true; return true;
} }
if (p_148278_5_ < 16 && p_148278_6_ > 16 && this.field_148303_c.func_175394_b(this, slotIndex)) if (p_148278_5_ < 16 && p_148278_6_ > 16 && this.field_148303_c.func_175394_b(this, slotIndex))
{ {
if(Athena.INSTANCE.getPartnerManager().isPartner(field_148303_c.getServerList().getServerData(slotIndex).serverIP)) {
return true;
}
this.field_148303_c.func_175393_b(this, slotIndex, GuiScreen.isShiftKeyDown()); this.field_148303_c.func_175393_b(this, slotIndex, GuiScreen.isShiftKeyDown());
return true; return true;
} }

View File

@ -70,13 +70,11 @@ public class ModelPlayer extends ModelBiped
/** /**
* Sets the models various rotation angles then renders the model. * Sets the models various rotation angles then renders the model.
*/ */
public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) {
{
super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale); super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale);
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
if (this.isChild) if (this.isChild) {
{
float f = 2.0F; float f = 2.0F;
GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f); GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f);
GlStateManager.translate(0.0F, 24.0F * scale, 0.0F); GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
@ -85,11 +83,8 @@ public class ModelPlayer extends ModelBiped
this.bipedLeftArmwear.render(scale); this.bipedLeftArmwear.render(scale);
this.bipedRightArmwear.render(scale); this.bipedRightArmwear.render(scale);
this.bipedBodyWear.render(scale); this.bipedBodyWear.render(scale);
} } else {
else if (entityIn.isSneaking()) {
{
if (entityIn.isSneaking())
{
GlStateManager.translate(0.0F, 0.2F, 0.0F); GlStateManager.translate(0.0F, 0.2F, 0.0F);
} }

View File

@ -1,5 +1,6 @@
package net.minecraft.client.multiplayer; package net.minecraft.client.multiplayer;
import java.awt.*;
import java.io.IOException; import java.io.IOException;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
@ -18,6 +19,7 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.ChatComponentTranslation;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import rip.athena.client.utils.render.RoundedUtils;
public class GuiConnecting extends GuiScreen public class GuiConnecting extends GuiScreen
{ {

View File

@ -9,6 +9,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import rip.athena.api.partner.Partner;
import rip.athena.client.Athena;
public class ServerList public class ServerList
{ {
@ -33,6 +35,11 @@ public class ServerList
try try
{ {
this.servers.clear(); this.servers.clear();
for(Partner partner : Athena.INSTANCE.getPartnerManager().getPartners()) {
servers.add(new ServerData(partner.getName(), partner.getIp(), false));
}
NBTTagCompound nbttagcompound = CompressedStreamTools.read(new File(this.mc.mcDataDir, "servers.dat")); NBTTagCompound nbttagcompound = CompressedStreamTools.read(new File(this.mc.mcDataDir, "servers.dat"));
if (nbttagcompound == null) if (nbttagcompound == null)
@ -65,6 +72,10 @@ public class ServerList
for (ServerData serverdata : this.servers) for (ServerData serverdata : this.servers)
{ {
if(Athena.INSTANCE.getPartnerManager().isPartner(serverdata.serverIP)) {
continue;
}
nbttaglist.appendTag(serverdata.getNBTCompound()); nbttaglist.appendTag(serverdata.getNBTCompound());
} }

View File

@ -178,7 +178,7 @@ public class EntityRenderer implements IResourceManagerReloadListener
private double cameraZoom = 1.0D; private double cameraZoom = 1.0D;
private double cameraYaw; private double cameraYaw;
private double cameraPitch; private double cameraPitch;
private ShaderGroup theShaderGroup; public ShaderGroup theShaderGroup;
private static final ResourceLocation[] shaderResourceLocations = new ResourceLocation[] {new ResourceLocation("shaders/post/notch.json"), new ResourceLocation("shaders/post/fxaa.json"), new ResourceLocation("shaders/post/art.json"), new ResourceLocation("shaders/post/bumpy.json"), new ResourceLocation("shaders/post/blobs2.json"), new ResourceLocation("shaders/post/pencil.json"), new ResourceLocation("shaders/post/color_convolve.json"), new ResourceLocation("shaders/post/deconverge.json"), new ResourceLocation("shaders/post/flip.json"), new ResourceLocation("shaders/post/invert.json"), new ResourceLocation("shaders/post/ntsc.json"), new ResourceLocation("shaders/post/outline.json"), new ResourceLocation("shaders/post/phosphor.json"), new ResourceLocation("shaders/post/scan_pincushion.json"), new ResourceLocation("shaders/post/sobel.json"), new ResourceLocation("shaders/post/bits.json"), new ResourceLocation("shaders/post/desaturate.json"), new ResourceLocation("shaders/post/green.json"), new ResourceLocation("shaders/post/blur.json"), new ResourceLocation("shaders/post/wobble.json"), new ResourceLocation("shaders/post/blobs.json"), new ResourceLocation("shaders/post/antialias.json"), new ResourceLocation("shaders/post/creeper.json"), new ResourceLocation("shaders/post/spider.json")}; private static final ResourceLocation[] shaderResourceLocations = new ResourceLocation[] {new ResourceLocation("shaders/post/notch.json"), new ResourceLocation("shaders/post/fxaa.json"), new ResourceLocation("shaders/post/art.json"), new ResourceLocation("shaders/post/bumpy.json"), new ResourceLocation("shaders/post/blobs2.json"), new ResourceLocation("shaders/post/pencil.json"), new ResourceLocation("shaders/post/color_convolve.json"), new ResourceLocation("shaders/post/deconverge.json"), new ResourceLocation("shaders/post/flip.json"), new ResourceLocation("shaders/post/invert.json"), new ResourceLocation("shaders/post/ntsc.json"), new ResourceLocation("shaders/post/outline.json"), new ResourceLocation("shaders/post/phosphor.json"), new ResourceLocation("shaders/post/scan_pincushion.json"), new ResourceLocation("shaders/post/sobel.json"), new ResourceLocation("shaders/post/bits.json"), new ResourceLocation("shaders/post/desaturate.json"), new ResourceLocation("shaders/post/green.json"), new ResourceLocation("shaders/post/blur.json"), new ResourceLocation("shaders/post/wobble.json"), new ResourceLocation("shaders/post/blobs.json"), new ResourceLocation("shaders/post/antialias.json"), new ResourceLocation("shaders/post/creeper.json"), new ResourceLocation("shaders/post/spider.json")};
public static final int shaderCount = shaderResourceLocations.length; public static final int shaderCount = shaderResourceLocations.length;
private int shaderIndex; private int shaderIndex;

View File

@ -465,35 +465,11 @@ public abstract class Render<T extends Entity>
}*/ }*/
} }
if (str.equals("deadmau5")) if (str.equals("deadmau5"))
{ {
b0 = -10; b0 = -10;
} }
if (entityIn instanceof AbstractClientPlayer) {
String username = ((AbstractClientPlayer) entityIn).getGameProfile().getId().toString();
/*if (SocketClient.isUser(username) && Settings.socketLogo) {
int i = fontrenderer.getStringWidth(str) / 2;
GlStateManager.disableTexture2D();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos((double) (-i - 14), (double) (-1 + b0), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double) (-i - 11), (double) (8 + b0), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double) (i + 1), (double) (8 + b0), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double) (i + 1), (double) (-1 + b0), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.draw();
GlStateManager.enableTexture2D();
fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, b0, 553648127);
GlStateManager.enableDepth();
GlStateManager.depthMask(true);
fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, b0, -1);
GlStateManager.enableLighting();
GlStateManager.disableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
} else {*/
int i = fontrenderer.getStringWidth(str) / 2; int i = fontrenderer.getStringWidth(str) / 2;
GlStateManager.disableTexture2D(); GlStateManager.disableTexture2D();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
@ -511,26 +487,7 @@ public abstract class Render<T extends Entity>
GlStateManager.disableBlend(); GlStateManager.disableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix(); GlStateManager.popMatrix();
//}
} else {
int i = fontrenderer.getStringWidth(str) / 2;
GlStateManager.disableTexture2D();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos((double)(-i - 1), (double)(-1 + b0), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double)(-i - 1), (double)(8 + b0), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double)(i + 1), (double)(8 + b0), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double)(i + 1), (double)(-1 + b0), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.draw();
GlStateManager.enableTexture2D();
fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, b0, 553648127);
GlStateManager.enableDepth();
GlStateManager.depthMask(true);
fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, b0, -1);
GlStateManager.enableLighting();
GlStateManager.disableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
}
} }
} }

View File

@ -11,6 +11,7 @@ import net.minecraft.block.BlockBed;
import net.minecraft.block.BlockDirectional; import net.minecraft.block.BlockDirectional;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.command.server.CommandBlockLogic; import net.minecraft.command.server.CommandBlockLogic;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@ -176,6 +177,9 @@ public abstract class EntityPlayer extends EntityLivingBase
*/ */
public EntityFishHook fishEntity; public EntityFishHook fishEntity;
public int totalViolations;
public int airTicks;
public EntityPlayer(World worldIn, GameProfile gameProfileIn) public EntityPlayer(World worldIn, GameProfile gameProfileIn)
{ {
super(worldIn); super(worldIn);
@ -268,6 +272,12 @@ public abstract class EntityPlayer extends EntityLivingBase
*/ */
public void onUpdate() public void onUpdate()
{ {
if(Minecraft.getMinecraft().theWorld.getBlockState(new BlockPos(this.posX, this.posY - 1, this.posZ)).getBlock() == Blocks.air) {
airTicks++;
} else {
airTicks = 0;
}
this.noClip = this.isSpectator(); this.noClip = this.isSpectator();
if (this.isSpectator()) if (this.isSpectator())

View File

@ -0,0 +1,37 @@
package rip.athena.api.anticheat;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.entity.player.EntityPlayer;
import rip.athena.api.anticheat.annotations.ICheckMetaData;
import rip.athena.api.module.annotations.IModuleMetaData;
import java.lang.annotation.Annotation;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/11/2023
*/
@Getter
@Setter
public abstract class AbstractCheck {
private String checkName;
private String checkDisplayName;
private String extraDetails;
private EnumCheckType checkType;
private long lastViolated;
public AbstractCheck() {
ICheckMetaData metaData = this.getClass().getAnnotation(ICheckMetaData.class);
this.checkDisplayName = metaData.displayName();
this.checkName = metaData.name();
this.checkType = metaData.type();
this.extraDetails = metaData.extraDetails();
}
public abstract boolean executeCheck(EntityPlayer player);
}

View File

@ -0,0 +1,82 @@
package rip.athena.api.anticheat;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumChatFormatting;
import org.reflections.Reflections;
import rip.athena.api.module.Module;
import rip.athena.client.Athena;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/11/2023
*/
public class CheckRepository {
private final HashMap<Class<? extends AbstractCheck>, AbstractCheck> checkList = new HashMap<>();
public CheckRepository() {
Athena.INSTANCE.sendInitializationMessage("Check Repository", false);
Reflections reflections = new Reflections("rip.athena.client.anticheat");
Set<Class<? extends AbstractCheck>> classes = reflections.getSubTypesOf(AbstractCheck.class);
for (Class<?> clazz : classes) {
try {
AbstractCheck check = (AbstractCheck) clazz.newInstance();
checkList.put(check.getClass(), check);
} catch (InstantiationException | IllegalAccessException e) {
e.printStackTrace();
}
}
Athena.INSTANCE.sendInitializationMessage("Check Repository", true);
}
public String getViolationMessage(EntityPlayer player, AbstractCheck check) {
if(check.getExtraDetails().isEmpty()) {
return EnumChatFormatting.GRAY + "[" + EnumChatFormatting.AQUA + "DETECTION" + EnumChatFormatting.GRAY + "] ┃ " + EnumChatFormatting.AQUA + player.getName() + EnumChatFormatting.WHITE + " has flagged " + EnumChatFormatting.AQUA + check.getCheckDisplayName() + EnumChatFormatting.GRAY + " ┃ [" + EnumChatFormatting.AQUA + player.totalViolations + EnumChatFormatting.GRAY + "]";
} else {
return EnumChatFormatting.GRAY + "[" + EnumChatFormatting.AQUA + "DETECTION" + EnumChatFormatting.GRAY + "] ┃ " + EnumChatFormatting.AQUA + player.getName() + EnumChatFormatting.WHITE + " has flagged " + EnumChatFormatting.AQUA + check.getCheckDisplayName() + EnumChatFormatting.GRAY + "" + EnumChatFormatting.AQUA + check.getExtraDetails() + EnumChatFormatting.GRAY + " ┃ [" + EnumChatFormatting.AQUA + player.totalViolations + EnumChatFormatting.GRAY + "]";
}
}
/**
* Retrieves a list of all registered modules.
*
* @return A list of all registered modules.
*/
public List<AbstractCheck> getChecks() {
List<AbstractCheck> checks = new ArrayList<>(checkList.values());
if (checks.isEmpty()) {
// Log a warning message indicating that there are no modules
Athena.INSTANCE.getLog().warn("No checks registered.");
}
return checks;
}
/**
* Retrieves a check with the specified name.
*
* @param name The name of the check.
* @return The check with the specified name, or null if not found.
*/
public AbstractCheck getCheck(String name) {
AbstractCheck requestedCheck = checkList.values()
.stream()
.filter(c -> c.getCheckName().equalsIgnoreCase(name))
.findFirst()
.orElse(null);
if (requestedCheck == null) {
// Log a message indicating that the module is not found
Athena.INSTANCE.getLog().warn("Tried accessing non-existing check: " + name);
}
return requestedCheck;
}
}

View File

@ -0,0 +1,27 @@
package rip.athena.api.anticheat;
import lombok.Getter;
/**
* The Category enum represents the categories of modules in the Athena Client.
* It provides predefined categories for organizing and classifying modules.
*
* @author Athena Development
* @project Athena-Client
* @date 6/1/2023
*/
@Getter
public enum EnumCheckType {
COMBAT("Combat", "COMBAT"),
MOVEMENT("Movement", "MOVEMENT"),
OTHER("Other", "OTHER");
private final String checkTypeDisplayName;
private final String checkTypeName;
EnumCheckType(String checkTypeDisplayName, String checkTypeName) {
this.checkTypeDisplayName = checkTypeDisplayName;
this.checkTypeName = checkTypeName;
}
}

View File

@ -0,0 +1,18 @@
package rip.athena.api.anticheat.annotations;
import rip.athena.api.anticheat.EnumCheckType;
import rip.athena.api.module.EnumModuleType;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ICheckMetaData {
String name();
String displayName();
String extraDetails();
EnumCheckType type();
}

View File

@ -0,0 +1,24 @@
package rip.athena.api.partner;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/12/2023
*/
public class Partner {
private String name;
private String ip;
public Partner(String name, String ip) {
this.name = name;
this.ip = ip;
}
public String getName() {
return name;
}
public String getIp() {
return ip;
}
}

View File

@ -0,0 +1,78 @@
package rip.athena.api.partner;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import rip.athena.client.Athena;
import rip.athena.client.requests.ContentType;
import rip.athena.client.requests.WebRequest;
import rip.athena.client.requests.WebRequestResult;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/12/2023
*/
public class PartnerManager {
private final List<Partner> partners = new ArrayList<>();
public PartnerManager() {
WebRequest request;
try {
request = new WebRequest("https://athena.rip/uploads/partners.json", "GET", ContentType.NONE, false);
} catch (MalformedURLException e) {
Athena.INSTANCE.getLog().error("Failed to make URL for partner URL." + e.getMessage());
return;
}
WebRequestResult result;
try {
result = request.connect();
Athena.INSTANCE.getLog().info(result.getData());
} catch (NoSuchElementException | IOException | JSONException e) {
Athena.INSTANCE.getLog().error("Failed to reach partner page." + e.getMessage());
return;
}
JSONArray jsonArray;
try {
jsonArray = new JSONArray(result.getData());
} catch (JSONException e) {
return;
}
for (int i = 0; i < jsonArray.length(); i++) {
try {
JSONObject partnerObject = jsonArray.getJSONObject(i);
String name = partnerObject.getString("name");
String ip = partnerObject.getString("ip");
partners.add(new Partner(name, ip));
} catch (JSONException e) {
Athena.INSTANCE.getLog().error("Failed to parse partner entry. " + e.getMessage());
}
}
}
public List<Partner> getPartners() {
return partners;
}
public boolean isPartner(String ip) {
for (Partner partner : partners) {
if (partner.getIp().equalsIgnoreCase(ip)) {
return true;
}
}
return false;
}
}

View File

@ -2,20 +2,25 @@ package rip.athena.client;
import lombok.Getter; import lombok.Getter;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.Display;
import rip.athena.api.account.AccountManager; import rip.athena.api.account.AccountManager;
import rip.athena.api.anticheat.CheckRepository;
import rip.athena.api.config.save.ConfigManager; import rip.athena.api.config.save.ConfigManager;
import rip.athena.api.cosmetics.CosmeticsManager; import rip.athena.api.cosmetics.CosmeticsManager;
import rip.athena.api.event.EventBus; import rip.athena.api.event.EventBus;
import rip.athena.api.event.SubscribeEvent; import rip.athena.api.event.SubscribeEvent;
import rip.athena.api.macro.MacroManager; import rip.athena.api.macro.MacroManager;
import rip.athena.api.module.ModuleRepository; import rip.athena.api.module.ModuleRepository;
import rip.athena.api.partner.PartnerManager;
import rip.athena.api.skin.SkinManager; import rip.athena.api.skin.SkinManager;
import rip.athena.client.events.client.ClientTickEvent; import rip.athena.client.events.client.ClientTickEvent;
import rip.athena.client.events.forge.FMLInitializationEvent;
import rip.athena.client.events.forge.FMLPostInitializationEvent;
import rip.athena.client.events.forge.FMLPreInitializationEvent;
import rip.athena.client.socket.SocketClient; import rip.athena.client.socket.SocketClient;
import rip.athena.client.theme.ThemeManager; import rip.athena.client.theme.ThemeManager;
import rip.athena.client.ui.hud.HUDManager; import rip.athena.client.ui.hud.HUDManager;
import rip.athena.client.ui.notifications.NotificationManager; import rip.athena.client.ui.notifications.NotificationManager;
import rip.athena.client.utils.ClientSidedAntiCheat;
import rip.athena.client.utils.PrefixedLogger; import rip.athena.client.utils.PrefixedLogger;
import rip.athena.client.utils.discord.DiscordRPC; import rip.athena.client.utils.discord.DiscordRPC;
import rip.athena.client.utils.input.KeybindManager; import rip.athena.client.utils.input.KeybindManager;
@ -26,8 +31,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/** /**
* The Athena class represents the main class of the Athena Client. * The Athena class represents the main class of the Athena Client.
* It encapsulates the client's name, version, build, and provides * It encapsulates the client's name, version, build, and provides
@ -53,17 +57,20 @@ public class Athena {
private final PrefixedLogger log = new PrefixedLogger("Athena"); private final PrefixedLogger log = new PrefixedLogger("Athena");
private final String clientName = "ATHENA"; private final String clientName = "ATHENA";
private final String clientVersionInteger = "0.0.3"; private final String clientVersionInteger = "0.0.4";
private final String clientVersion = "(" + clientVersionInteger + ")"; private final String clientVersion = "(" + clientVersionInteger + ")";
private final String clientBuild = "062623"; private final String clientBuild = "071023";
private final boolean debug = false; private final boolean debug = true;
private ClientSidedAntiCheat clientSidedAntiCheat;
private NotificationManager notificationManager; private NotificationManager notificationManager;
//private CosmeticsController cosmeticsController; //private CosmeticsController cosmeticsController;
private CosmeticsManager cosmeticsManager; private CosmeticsManager cosmeticsManager;
private ModuleRepository moduleRepository; private ModuleRepository moduleRepository;
private CheckRepository checkRepository;
private AccountManager accountManager; private AccountManager accountManager;
private PartnerManager partnerManager;
private ConfigManager configManager; private ConfigManager configManager;
private ThemeManager themeManager; private ThemeManager themeManager;
private MacroManager macroManager; private MacroManager macroManager;
@ -72,7 +79,6 @@ public class Athena {
private DiscordRPC discordRPC; private DiscordRPC discordRPC;
private EventBus eventBus; private EventBus eventBus;
private boolean isGameRunningForeground = true;
private boolean hasSent = false; private boolean hasSent = false;
/** /**
@ -112,7 +118,10 @@ public class Athena {
private void handleManagers() { private void handleManagers() {
this.configManager = new ConfigManager(CONFIGS_DIR); this.configManager = new ConfigManager(CONFIGS_DIR);
this.accountManager = new AccountManager(); this.accountManager = new AccountManager();
this.checkRepository = new CheckRepository();
this.moduleRepository = new ModuleRepository(); this.moduleRepository = new ModuleRepository();
this.clientSidedAntiCheat = new ClientSidedAntiCheat();
this.partnerManager = new PartnerManager();
this.themeManager = new ThemeManager(); this.themeManager = new ThemeManager();
this.macroManager = new MacroManager(); this.macroManager = new MacroManager();
this.skinManager = new SkinManager(); this.skinManager = new SkinManager();
@ -124,6 +133,7 @@ public class Athena {
//this.cosmeticsController = new CosmeticsController(); //this.cosmeticsController = new CosmeticsController();
this.configManager.postInit(); this.configManager.postInit();
} }
private void checkCosmetics() { private void checkCosmetics() {
@ -171,6 +181,10 @@ public class Athena {
eventBus.register(macroManager); eventBus.register(macroManager);
eventBus.register(hudManager); eventBus.register(hudManager);
eventBus.register(this); eventBus.register(this);
eventBus.post(new FMLPreInitializationEvent());
eventBus.post(new FMLInitializationEvent());
eventBus.post(new FMLPostInitializationEvent());
} }
/** /**
@ -182,7 +196,6 @@ public class Athena {
public void onClientTick(ClientTickEvent event) { public void onClientTick(ClientTickEvent event) {
if (Minecraft.getMinecraft().thePlayer != null && Minecraft.getMinecraft().theWorld != null) { if (Minecraft.getMinecraft().thePlayer != null && Minecraft.getMinecraft().theWorld != null) {
String currentUsername = Minecraft.getMinecraft().thePlayer.getGameProfile().getName(); String currentUsername = Minecraft.getMinecraft().thePlayer.getGameProfile().getName();
if (!hasSent || !currentUsername.equals(SocketClient.getCurrentUsername())) { if (!hasSent || !currentUsername.equals(SocketClient.getCurrentUsername())) {
if (hasSent) { if (hasSent) {
// Player has changed their Minecraft account, disconnect the previous user // Player has changed their Minecraft account, disconnect the previous user
@ -194,21 +207,13 @@ public class Athena {
// Send the modified "start" request with the username and UUID // Send the modified "start" request with the username and UUID
System.out.println(SocketClient.sendRequest("start", currentUsername + ":" + uuid + ":true")); System.out.println(SocketClient.sendRequest("start", currentUsername + ":" + uuid + ":true"));
Athena.INSTANCE.getLog().debug("Sent player initialize request"); Athena.INSTANCE.getLog().debug("Sent player initialize request" + hasSent);
SocketClient.setCurrentUsername(currentUsername); SocketClient.setCurrentUsername(currentUsername);
hasSent = true; hasSent = true;
} }
} else {
if (hasSent && isGameRunningForeground) {
// Minecraft game is not running in the foreground, disconnect the user
hasSent = false; // Reset the hasSent flag
}
isGameRunningForeground = false;
}
if (Minecraft.getMinecraft().isFullScreen() || Display.isActive()) { clientSidedAntiCheat.runChecks();
isGameRunningForeground = true;
} }
} }
@ -238,19 +243,4 @@ public class Athena {
public void shutdownClient() { public void shutdownClient() {
log.info("Shutting down client"); log.info("Shutting down client");
} }
public static String getStringHash(String str, String hashType) throws NoSuchAlgorithmException
{
// hash string into byte array
MessageDigest md = MessageDigest.getInstance(hashType);
byte[] hashbytes = md.digest(str.getBytes());
// convert byte array into hex string and return
StringBuffer stringBuffer = new StringBuffer();
for (int i = 0; i < 3; i++) {
stringBuffer.append(Integer.toString((hashbytes[i] & 0xff) + 0x100, 16)
.substring(1));
}
return stringBuffer.toString();
}
} }

View File

@ -0,0 +1,27 @@
package rip.athena.client.anticheat.movement.fly;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import rip.athena.api.anticheat.AbstractCheck;
import rip.athena.api.anticheat.EnumCheckType;
import rip.athena.api.anticheat.annotations.ICheckMetaData;
import rip.athena.client.Athena;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/11/2023
*/
@ICheckMetaData(displayName = "Fly A", name = "FlyA", extraDetails = "", type = EnumCheckType.MOVEMENT)
public class FlyA extends AbstractCheck {
@Override
public boolean executeCheck(EntityPlayer player) {
return !player.onGround && player.motionY == 0 && isMoving(player);
}
public static boolean isMoving(EntityPlayer player) {
return player.moveForward != 0F || player.moveStrafing != 0F;
}
}

View File

@ -0,0 +1,25 @@
package rip.athena.client.anticheat.movement.fly;
import net.minecraft.entity.player.EntityPlayer;
import rip.athena.api.anticheat.AbstractCheck;
import rip.athena.api.anticheat.EnumCheckType;
import rip.athena.api.anticheat.annotations.ICheckMetaData;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/11/2023
*/
@ICheckMetaData(displayName = "Fly B", name = "FlyB", extraDetails = "", type = EnumCheckType.MOVEMENT)
public class FlyB extends AbstractCheck {
@Override
public boolean executeCheck(EntityPlayer player) {
return player.airTicks > 20 && player.motionY == 0 && isMoving(player);
}
public static boolean isMoving(EntityPlayer player) {
return player.moveForward != 0F || player.moveStrafing != 0F;
}
}

View File

@ -0,0 +1,21 @@
package rip.athena.client.anticheat.movement.noslow;
import net.minecraft.entity.player.EntityPlayer;
import rip.athena.api.anticheat.AbstractCheck;
import rip.athena.api.anticheat.EnumCheckType;
import rip.athena.api.anticheat.annotations.ICheckMetaData;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/11/2023
*/
@ICheckMetaData(displayName = "NoSlowDown A", name = "NoSlowDownA", extraDetails = "", type = EnumCheckType.MOVEMENT)
public class NoSlownDownA extends AbstractCheck {
@Override
public boolean executeCheck(EntityPlayer player) {
return player.isBlocking() && player.isSprinting();
}
}

View File

@ -0,0 +1,43 @@
package rip.athena.client.anticheat.movement.speed;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import rip.athena.api.anticheat.AbstractCheck;
import rip.athena.api.anticheat.EnumCheckType;
import rip.athena.api.anticheat.annotations.ICheckMetaData;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/11/2023
*/
@ICheckMetaData(displayName = "Speed A", name = "SpeedA", extraDetails = "", type = EnumCheckType.MOVEMENT)
public class SpeedA extends AbstractCheck {
private double lastDist;
@Override
public boolean executeCheck(EntityPlayer player) {
return false;
/*double distX = player.posX - player.prevPosX;
double distZ = player.posZ - player.prevPosZ;
double dist = (distX * distX) + (distZ * distZ);
double lastDist = this.lastDist;
this.lastDist = dist;
float friction = 1.08F;
double shiftedLastDist = lastDist * friction;
double equalness = dist - shiftedLastDist;
// Max Jumping Speed
boolean maxSpeed = player.isPotionActive(Potion.moveSpeed) ? equalness >= 0.39 : equalness >= 0.03;
setExtraDetails(!player.onGround && maxSpeed ? "A Speed: " + EnumChatFormatting.WHITE + (Math.round(equalness * 100.0) / 100.0) : "G Speed: " + EnumChatFormatting.WHITE + (Math.round(equalness * 100.0) / 100.0));
return (maxSpeed && !player.onGround) || (equalness >= 0.07 && player.onGround);*/
}
}

View File

@ -0,0 +1,25 @@
package rip.athena.client.anticheat.movement.speed;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import rip.athena.api.anticheat.AbstractCheck;
import rip.athena.api.anticheat.EnumCheckType;
import rip.athena.api.anticheat.annotations.ICheckMetaData;
import rip.athena.client.Athena;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/11/2023
*/
@ICheckMetaData(displayName = "Speed B", name = "SpeedB", extraDetails = "", type = EnumCheckType.MOVEMENT)
public class SpeedB extends AbstractCheck {
@Override
public boolean executeCheck(EntityPlayer player) {
return false;
}
}

View File

@ -0,0 +1,21 @@
package rip.athena.client.anticheat.other;
import net.minecraft.entity.player.EntityPlayer;
import rip.athena.api.anticheat.AbstractCheck;
import rip.athena.api.anticheat.EnumCheckType;
import rip.athena.api.anticheat.annotations.ICheckMetaData;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/11/2023
*/
@ICheckMetaData(displayName = "Blink", name = "BLINK", extraDetails = "", type = EnumCheckType.OTHER)
public class Blink extends AbstractCheck {
@Override
public boolean executeCheck(EntityPlayer player) {
return false;
}
}

View File

@ -0,0 +1,7 @@
package rip.athena.client.events.forge;
import rip.athena.api.event.Event;
public class FMLInitializationEvent extends Event {
}

View File

@ -0,0 +1,7 @@
package rip.athena.client.events.forge;
import rip.athena.api.event.Event;
public class FMLPostInitializationEvent extends Event {
}

View File

@ -0,0 +1,7 @@
package rip.athena.client.events.forge;
import rip.athena.api.event.Event;
public class FMLPreInitializationEvent extends Event {
}

View File

@ -0,0 +1,15 @@
package rip.athena.client.events.network;
import rip.athena.api.event.Event;
public class ServerSwitchEvent extends Event {
private String serverData;
public ServerSwitchEvent(String serverData) {
this.serverData = serverData;
}
public String getServerData() {
return serverData;
}
}

View File

@ -12,6 +12,9 @@ public class FPSBoostMod extends Module {
@ConfigValue.Boolean(name = "Disable FPS Smoothing") @ConfigValue.Boolean(name = "Disable FPS Smoothing")
private boolean disableFpsSmoothing = true; private boolean disableFpsSmoothing = true;
@ConfigValue.Boolean(name = "Disable World Smoothing")
private boolean disableWorldSmoothing = true;
// Previous settings // Previous settings
private boolean lastFpsSmoothing; private boolean lastFpsSmoothing;
private boolean lastWorldSmoothing; private boolean lastWorldSmoothing;
@ -23,7 +26,7 @@ public class FPSBoostMod extends Module {
lastWorldSmoothing = Minecraft.getMinecraft().gameSettings.ofSmoothWorld; lastWorldSmoothing = Minecraft.getMinecraft().gameSettings.ofSmoothWorld;
if(disableFpsSmoothing) Minecraft.getMinecraft().gameSettings.ofSmoothFps = false; if(disableFpsSmoothing) Minecraft.getMinecraft().gameSettings.ofSmoothFps = false;
if(lastWorldSmoothing) Minecraft.getMinecraft().gameSettings.ofSmoothFps = false; if(disableWorldSmoothing) Minecraft.getMinecraft().gameSettings.ofSmoothFps = false;
super.onEnable(); super.onEnable();
} }

View File

@ -0,0 +1,54 @@
package rip.athena.client.modules.mods;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import rip.athena.api.anticheat.AbstractCheck;
import rip.athena.api.event.SubscribeEvent;
import rip.athena.api.module.EnumModuleType;
import rip.athena.api.module.Module;
import rip.athena.api.module.annotations.IModuleMetaData;
import rip.athena.client.Athena;
import rip.athena.client.events.client.ClientTickEvent;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/11/2023
*/
@IModuleMetaData(name = "Hacker Detector", type = EnumModuleType.MODS, icon = "")
public class HackerDetector extends Module {
@SubscribeEvent
public void onTick(ClientTickEvent event) {
if(mc.theWorld == null || mc.thePlayer == null) return;
for(Entity entity : mc.theWorld.getLoadedEntityList()) {
if(entity instanceof EntityPlayer) {
EntityPlayer entityPlayer = (EntityPlayer) entity;
if(entityPlayer != mc.thePlayer) {
for (AbstractCheck check : Athena.INSTANCE.getCheckRepository().getChecks()) {
if (check.executeCheck(entityPlayer) && System.currentTimeMillis() > check.getLastViolated() + 500) {
entityPlayer.totalViolations++;
check.setLastViolated(System.currentTimeMillis());
Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(Athena.INSTANCE.getCheckRepository().getViolationMessage(entityPlayer, check)));
}
}
}
}
}
}
@Override
public void onEnable() {
super.onEnable();
}
@Override
public void onDisable() {
super.onDisable();
}
}

View File

@ -1,6 +1,7 @@
package rip.athena.client.modules.render; package rip.athena.client.modules.render;
import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import rip.athena.api.module.EnumModuleType; import rip.athena.api.module.EnumModuleType;
import rip.athena.api.module.Module; import rip.athena.api.module.Module;
@ -127,8 +128,8 @@ public class CPS extends Module {
mc.fontRendererObj.drawStringWithShadow(string, (float) (posX), (float) posY+ 3, color.getRGB()); mc.fontRendererObj.drawStringWithShadow(string, (float) (posX), (float) posY+ 3, color.getRGB());
} }
} }
GL11.glColor3f(1, 1, 1);
GL11.glPopMatrix(); GL11.glPopMatrix();
GlStateManager.color(1,1,1);
} }
@SubscribeEvent @SubscribeEvent

View File

@ -72,6 +72,7 @@ public class Crosshair extends Module {
*/ */
@SubscribeEvent @SubscribeEvent
public void onTick(ClientTickEvent event) { public void onTick(ClientTickEvent event) {
if(mc.thePlayer == null) return;
if(rainbowSpeedNerfProg >= rainbowSpeedNerf) { if(rainbowSpeedNerfProg >= rainbowSpeedNerf) {
if(rainbowR == 255 && rainbowG != 255 && rainbowB == 0) if(rainbowR == 255 && rainbowG != 255 && rainbowB == 0)
rainbowG++; rainbowG++;

View File

@ -1,6 +1,7 @@
package rip.athena.client.modules.render; package rip.athena.client.modules.render;
import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import rip.athena.api.module.EnumModuleType; import rip.athena.api.module.EnumModuleType;
import rip.athena.api.module.Module; import rip.athena.api.module.Module;
@ -121,8 +122,8 @@ public class FPSMod extends Module {
mc.fontRendererObj.drawStringWithShadow(string, (float) (posX), (float) posY+ 3, color.getRGB()); mc.fontRendererObj.drawStringWithShadow(string, (float) (posX), (float) posY+ 3, color.getRGB());
} }
} }
GL11.glColor3f(1, 1, 1);
GL11.glPopMatrix(); GL11.glPopMatrix();
GlStateManager.color(1,1,1);
} }

View File

@ -0,0 +1,133 @@
package rip.athena.client.modules.render;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.network.NetworkPlayerInfo;
import org.lwjgl.opengl.GL11;
import rip.athena.api.config.ConfigValue;
import rip.athena.api.font.FontManager;
import rip.athena.api.module.EnumModuleType;
import rip.athena.api.module.Module;
import rip.athena.api.module.annotations.IModuleMetaData;
import rip.athena.client.Athena;
import rip.athena.client.ui.hud.HUDElement;
import rip.athena.client.utils.render.ColorUtil;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/12/2023
*/
@IModuleMetaData(name = "Ping Display", type = EnumModuleType.RENDER, icon = "")
public class Ping extends Module {
@ConfigValue.List(name = "Display Mode", values = {"Circle", "Modern", "Fade", "Old"}, description = "Chose display of background")
private String backgroundMode = "Circle";
@ConfigValue.Boolean(name = "Background")
private boolean backGround = true;
@ConfigValue.Color(name = "Color")
private Color color = Color.WHITE;
@ConfigValue.Double(name = "Scale", min = 0.5D, max = 1.5D)
private double scaled = 1.0;
@ConfigValue.Color(name = "Background Color")
private Color background = new Color(0, 0, 0, 150);
@ConfigValue.Boolean(name = "Custom Font")
private boolean customFont = false;
@ConfigValue.Boolean(name = "Static Chroma")
private boolean isUsingStaticChroma = false;
@ConfigValue.Boolean(name = "Wave Chroma")
private boolean isUsingWaveChroma = false;
private HUDElement hud;
private int width = 56;
private int height = 18;
public Ping() {
hud = new HUDElement("ping", width, height) {
@Override
public void onRender() {
render();
}
};
hud.setX(1);
hud.setY(117);
addHUD(hud);
}
public void render() {
if (mc.gameSettings.showDebugInfo) {
return;
}
GL11.glPushMatrix();
EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer;
String string = "0 ms";
if (thePlayer != null) {
NetworkPlayerInfo playerInfo = Minecraft.getMinecraft().getNetHandler().getPlayerInfo(Minecraft.getMinecraft().thePlayer.getUniqueID());
string = (playerInfo == null ? "0" : playerInfo.getResponseTime()) + " ms";
}
int width = hud.getWidth();
int height = hud.getHeight();
if(backGround) {
if(backgroundMode.equalsIgnoreCase("Modern")) {
if(Athena.INSTANCE.getThemeManager().getTheme().isTriColor()) {
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getThirdColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor());
} else {
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
}
} else if (backgroundMode.equalsIgnoreCase("Circle")) {
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, ColorUtil.getClientColor(0, 255), ColorUtil.getClientColor(90, 255), ColorUtil.getClientColor(180, 255), ColorUtil.getClientColor(270, 255));
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
} else {
Gui.drawRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB());
}
}
float posY = hud.getY() + 2;
float posX = hud.getX() + 9;
if(customFont) {
hud.setWidth(rip.athena.client.utils.font.FontManager.getProductSansRegular(25).width(string) + 16);
hud.setHeight((int) FontManager.baloo17.getHeight(string) + 5);
if(isUsingStaticChroma) {
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), string, (int) (posX), (int) posY, true, true);
} else if(isUsingWaveChroma) {
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), string, (int) (posX), (int) posY, false, true);
} else {
rip.athena.client.utils.font.FontManager.getProductSansRegular(25).drawString(string,(int) (posX), (int)posY, color.getRGB());
}
} else {
hud.setWidth(mc.fontRendererObj.getStringWidth(string) + 16);
hud.setHeight(mc.fontRendererObj.FONT_HEIGHT + 9);
if(isUsingStaticChroma) {
DrawUtils.drawChromaString(string, posX, posY + 3, true, true);
} else if(isUsingWaveChroma) {
DrawUtils.drawChromaString(string, posX, posY+ 3, false, true);
} else {
mc.fontRendererObj.drawStringWithShadow(string, (float) (posX), (float) posY+ 3, color.getRGB());
}
}
GL11.glColor3f(1, 1, 1);
GL11.glPopMatrix();
}
}

View File

@ -1,96 +0,0 @@
package rip.athena.client.modules.render;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
import rip.athena.api.config.ConfigValue;
import rip.athena.api.module.EnumModuleType;
import rip.athena.api.module.Module;
import rip.athena.api.module.annotations.IModuleMetaData;
import rip.athena.client.ui.hud.HUDElement;
import rip.athena.client.utils.font.FontManager;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
import java.util.Collection;
@IModuleMetaData(name = "Potion Effects", type = EnumModuleType.RENDER, icon = "")
public class PotionEffects extends Module {
@ConfigValue.Boolean(name = "Background")
private boolean background = true;
protected static final ResourceLocation inventoryBackground = new ResourceLocation("textures/gui/container/inventory.png");
HUDElement hud;
private int width = 140;
private int height = 32;
public PotionEffects() {
hud = new HUDElement("potioneffects", width, height) {
@Override
public void onRender() {
render();
}
};
hud.setX(5);
hud.setY(300);
addHUD(hud);
}
private void render() {
int x = hud.getX();
int y = hud.getY();
int width = hud.getWidth();
int height = hud.getHeight();
Collection<PotionEffect> collection = mc.thePlayer.getActivePotionEffects();
if (!collection.isEmpty()) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableLighting();
int spacing = 35;
if (collection.size() > 5) {
spacing = 132 / (collection.size() - 1);
}
for (PotionEffect potioneffect : mc.thePlayer.getActivePotionEffects()) {
Potion potion = Potion.potionTypes[potioneffect.getPotionID()];
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(inventoryBackground);
if(background) {
RoundedUtils.drawRound(x, y, width, height, 6, new Color(0, 0, 0, 150));
}
if (potion.hasStatusIcon()) {
int statusIconIndex = potion.getStatusIconIndex();
//Gui.drawTexturedModalRect(x, y + 7, statusIconIndex % 8 * 18, 198 + statusIconIndex / 8 * 18, 18, 18);
}
String s1 = I18n.format(potion.getName());
if (potioneffect.getAmplifier() == 1) {
s1 = s1 + " " + I18n.format("enchantment.level.2");
} else if (potioneffect.getAmplifier() == 2) {
s1 = s1 + " " + I18n.format("enchantment.level.3");
} else if (potioneffect.getAmplifier() == 3) {
s1 = s1 + " " + I18n.format("enchantment.level.4");
}
FontManager.getProductSansRegular(20).drawString(s1, x + 28, y + 6, -1);
String s = Potion.getDurationString(potioneffect);
FontManager.getProductSansRegular(20).drawString(s, (float) (x + 10 + 18), (float) (y + 6 + 10), -1);
// Spacing between each element
y += spacing;
}
}
}
}

View File

@ -0,0 +1,284 @@
package rip.athena.client.modules.render;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import rip.athena.api.config.ConfigValue;
import rip.athena.api.module.EnumModuleType;
import rip.athena.api.module.Module;
import rip.athena.api.module.annotations.IModuleMetaData;
import rip.athena.client.ui.hud.HUDElement;
import rip.athena.client.utils.render.ColorUtil;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
import java.util.*;
import java.util.List;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/12/2023
*/
@IModuleMetaData(name = "Potion Status", type = EnumModuleType.RENDER, icon = "")
public class PotionStatus extends Module {
@ConfigValue.List(name = "Design", values = { "Boxes", "Icon", "Slim" })
private static String potionstatusdesign = "Boxes";
@ConfigValue.Boolean(name = "Preset Potion Color")
private boolean presetColor = true;
@ConfigValue.Boolean(name = "Custom Font")
private boolean customFont = false;
@ConfigValue.Boolean(name = "Theme Colored Box")
private boolean themeColoredBox = false;
@ConfigValue.Boolean(name = "Static Chroma")
private boolean isUsingStaticChroma = false;
@ConfigValue.Boolean(name = "Wave Chroma")
private boolean isUsingWaveChroma = false;
@ConfigValue.Color(name = "Potion Color")
private Color potionColor = Color.WHITE;
private Map<PotionEffect, Integer> potionMaxDurationMap = new HashMap<PotionEffect, Integer>();
protected float zLevel = -150.0F;
public int xOffset = 0;
public int yOffset = 10;
public int yBase;
private HUDElement hud;
private int width = 10;
private int height = 10;
public PotionStatus() {
hud = new HUDElement("potionstatus", width, height) {
@Override
public void onRender() {
render();
}
};
hud.setX(0);
hud.setY(175);
addHUD(hud);
}
public void render() {
if (mc.gameSettings.showDebugInfo) {
return;
}
Collection<?> activeEffects = mc.thePlayer.getActivePotionEffects();
if (!activeEffects.isEmpty()) {
GL11.glPushMatrix();
yBase = 0;
for (Object activeEffect : activeEffects) {
PotionEffect potionEffect = (PotionEffect) activeEffect;
if (!potionMaxDurationMap.containsKey(potionEffect)
|| potionMaxDurationMap.get(potionEffect) < potionEffect.getDuration())
potionMaxDurationMap.put(potionEffect, potionEffect.getDuration());
Potion potion = Potion.potionTypes[potionEffect.getPotionID()];
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/inventory.png"));
boolean enableBackground = true;
int xBase = 0;
String potionName = "";
potionName = StatCollector.translateToLocal(potion.getName());
if (potionEffect.getAmplifier() == 1) {
potionName = potionName + " II";
} else if (potionEffect.getAmplifier() == 2) {
potionName = potionName + " III";
} else if (potionEffect.getAmplifier() == 3) {
potionName = potionName + " IV";
} else if (potionEffect.getAmplifier() == 4) {
potionName = potionName + " V";
} else if (potionEffect.getAmplifier() == 5) {
potionName = potionName + " VI";
} else if (potionEffect.getAmplifier() == 6) {
potionName = potionName + " VII";
} else if (potionEffect.getAmplifier() == 7) {
potionName = potionName + " VIII";
} else if (potionEffect.getAmplifier() == 8) {
potionName = potionName + " IX";
} else if (potionEffect.getAmplifier() == 9) {
potionName = potionName + " X";
} else if (potionEffect.getAmplifier() > 9) {
potionName = potionName + " " + (potionEffect.getAmplifier() + 1);
}
int posX = hud.getX();
int posY = hud.getY();
String effectDuration = Potion.getDurationString(potionEffect);
if (potionstatusdesign.contains("Boxes")) {
RoundedUtils.drawRound(1, 1, 1, 1, 1, new Color(0,0,0));
if (potion.hasStatusIcon()) {
int potionStatusIcon = potion.getStatusIconIndex();
drawTexturedModalRect((int) posX + xBase + 5, (int) posY + yBase + (enableBackground ? 7 : 0),
0 + potionStatusIcon % 8 * 18, 166 + 32 + potionStatusIcon / 8 * 18, 18, 18, zLevel);
}
if(themeColoredBox) {
RoundedUtils.drawRoundedGradientOutlineCorner(posX + xBase, (int) posY + yBase, 140 + xBase + posX, 32 + yBase + posY, 2, 6, ColorUtil.getClientColor(0, 255).getRGB(), ColorUtil.getClientColor(90, 255).getRGB(), ColorUtil.getClientColor(180, 255).getRGB(), ColorUtil.getClientColor(270, 255).getRGB());
} else {
RoundedUtils.drawRoundedOutline(posX + xBase, (int) posY + yBase, 140 + xBase + posX, 32 + yBase + posY, 6, 2, new Color(0, 0, 0, 150).getRGB());
}
if(customFont) {
if (isUsingStaticChroma) {
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), potionName, posX + xBase + 26, posY + yBase + 7, true, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(20), effectDuration, posX + xBase + 26, posY + yBase + 18, true, true);
} else if (isUsingWaveChroma) {
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), potionName, posX + xBase + 26, posY + yBase + 7, false, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(20), effectDuration, posX + xBase + 26, posY + yBase + 18, true, true);
} else {
rip.athena.client.utils.font.FontManager.getProductSansRegular(25).drawString(potionName, posX + xBase + 26, posY + yBase + 7, presetColor ? new Color(potion.getLiquidColor()).getRGB() : potionColor.getRGB());
rip.athena.client.utils.font.FontManager.getProductSansRegular(20).drawString(effectDuration, posX + xBase + 26, posY + yBase + 18, -1);
}
} else {
if (isUsingStaticChroma) {
DrawUtils.drawChromaString(potionName, posX + xBase + 26, posY + yBase + 7, true, true);
DrawUtils.drawChromaString(effectDuration, posX + xBase + 26, posY + yBase + 17, true, true);
} else if (isUsingWaveChroma) {
DrawUtils.drawChromaString(potionName, posX + xBase + 26, posY + yBase + 7, false, true);
DrawUtils.drawChromaString(effectDuration, posX + xBase + 26, posY + yBase + 17, false, true);
} else {
mc.fontRendererObj.drawStringWithShadow(potionName, (float) posX + xBase + 26,
(float) posY + yBase + 7, presetColor ? potion.getLiquidColor() : potionColor.getRGB());
mc.fontRendererObj.drawStringWithShadow(effectDuration, (float) posX + xBase + 26,
(float) posY + yBase + 17, 0xffffff);
}
}
/*mc.fontRendererObj.drawStringWithShadow(potionName, (float) posX + xBase + 26,
(float) posY + yBase + 7, presetColor ? potion.getLiquidColor() : potionColor.getRGB());
mc.fontRendererObj.drawStringWithShadow(effectDuration, (float) posX + xBase + 26,
(float) posY + yBase + 17, 0xffffff);*/
yBase += 35;
} else if (potionstatusdesign.contains("Slim")) {
if(customFont) {
if (isUsingStaticChroma) {
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), potionName + " - " + effectDuration, posX, posY + yBase + 7, true, true);
} else if (isUsingWaveChroma) {
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), potionName + " - " + effectDuration, posX, posY + yBase + 7, false, true);
} else {
rip.athena.client.utils.font.FontManager.getProductSansRegular(25).drawString(potionName + " - " + effectDuration, posX, posY + yBase + 7, presetColor ? new Color(potion.getLiquidColor()).getRGB() : potionColor.getRGB());
}
} else {
if (isUsingStaticChroma) {
DrawUtils.drawChromaString(potionName + " - " + effectDuration, posX, posY + yBase + 7, true, true);
} else if (isUsingWaveChroma) {
DrawUtils.drawChromaString(potionName + " - " + effectDuration, posX, posY + yBase + 7, false, true);
} else {
mc.fontRendererObj.drawStringWithShadow(potionName + " - " + effectDuration, (float) posX,
(float) posY + yBase + 7, presetColor ? potion.getLiquidColor() : potionColor.getRGB());
}
}
/*mc.fontRendererObj.drawStringWithShadow(potionName + " - " + effectDuration, (float) posX,
(float) posY + yBase + 7, presetColor ? potion.getLiquidColor() : potionColor.getRGB());*/
yBase += 10;
} else if (potionstatusdesign.contains("Icon")) {
RoundedUtils.drawRound(1, 1, 1, 1, 1, new Color(0,0,0));
if (potion.hasStatusIcon()) {
int potionStatusIcon = potion.getStatusIconIndex();
drawTexturedModalRect((int) posX + xBase, (int) posY + yBase - 2, 0 + potionStatusIcon % 8 * 18,
166 + 32 + potionStatusIcon / 8 * 18, 18, 18, zLevel);
}
if(customFont) {
if (isUsingStaticChroma) {
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), potionName, posX + xBase + 21, posY + yBase, true, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(20), effectDuration, posX + xBase + 21, posY + yBase + 10, true, true);
} else if (isUsingWaveChroma) {
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), potionName, posX + xBase + 21, posY + yBase, false, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(20), effectDuration, posX + xBase + 21, posY + yBase + 10, true, true);
} else {
rip.athena.client.utils.font.FontManager.getProductSansRegular(25).drawString(potionName, posX + xBase + 21, posY + yBase, presetColor ? new Color(potion.getLiquidColor()).getRGB() : potionColor.getRGB());
rip.athena.client.utils.font.FontManager.getProductSansRegular(20).drawString(effectDuration, posX + xBase + 21, posY + yBase + 10, -1);
}
} else {
if (isUsingStaticChroma) {
DrawUtils.drawChromaString(potionName, posX + xBase + 21, posY + yBase, true, true);
DrawUtils.drawChromaString(effectDuration, posX + xBase + 21, posY + yBase + 9, true, true);
} else if (isUsingWaveChroma) {
DrawUtils.drawChromaString(potionName, posX + xBase + 21, posY + yBase, false, true);
DrawUtils.drawChromaString(effectDuration, posX + xBase + 21, posY + yBase + 9, false, true);
} else {
mc.fontRendererObj.drawStringWithShadow(potionName, (float) posX + xBase + 21,
(float) posY + yBase, presetColor ? potion.getLiquidColor() : potionColor.getRGB());
mc.fontRendererObj.drawStringWithShadow(effectDuration, (float) posX + xBase + 21,
(float) posY + yBase + 9, 0xffffff);
}
}
/*mc.fontRendererObj.drawStringWithShadow(potionName, (float) posX + xBase + 21, (float) posY + yBase,
presetColor ? potion.getLiquidColor() : potionColor.getRGB());
mc.fontRendererObj.drawStringWithShadow(effectDuration, (float) posX + xBase + 21,
(float) posY + yBase + 9, presetColor ? potion.getLiquidColor() : potionColor.getRGB());*/
yBase += 24;
}
}
GL11.glScaled(1, 1, 1);
GL11.glColor3f(1, 1, 1);
GL11.glPopMatrix();
}
width = 10;
if (activeEffects.isEmpty()) {
yBase = 10;
}
if (PotionStatus.potionstatusdesign.contains("Slim")) {
width += 110;
yBase += 5;
} else {
width += 120;
}
hud.setHeight(yBase);
hud.setWidth(width);
List<PotionEffect> toRemove = new LinkedList<PotionEffect>();
for (PotionEffect pe : potionMaxDurationMap.keySet())
if (!activeEffects.contains(pe))
toRemove.add(pe);
for (PotionEffect pe : toRemove)
potionMaxDurationMap.remove(pe);
}
public void drawTexturedModalRect(int x, int y, int u, int v, int width, int height, float zLevel) {
float var7 = 0.00390625F;
float var8 = 0.00390625F;
WorldRenderer tessellator = Tessellator.getInstance().getWorldRenderer();
tessellator.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
tessellator.pos((x + 0), (y + height), zLevel).tex(((u + 0) * var7), ((v + height) * var8)).endVertex();
tessellator.pos((x + width), (y + height), zLevel).tex(((u + width) * var7), ((v + height) * var8)).endVertex();
tessellator.pos((x + width), (y + 0), zLevel).tex(((u + width) * var7), ((v + 0) * var8)).endVertex();
tessellator.pos((x + 0), (y + 0), zLevel).tex(((u + 0) * var7), ((v + 0) * var8)).endVertex();
Tessellator.getInstance().draw();
}
}

View File

@ -8,6 +8,9 @@ import java.net.SocketException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/** /**
* @author Athena Development * @author Athena Development
@ -18,6 +21,7 @@ public class SocketClient {
public static final Client client = new Client("141.145.209.142", 45376); public static final Client client = new Client("141.145.209.142", 45376);
private static final Map<String, Boolean> userCache = new HashMap<>(); private static final Map<String, Boolean> userCache = new HashMap<>();
private static final long HEARTBEAT_INTERVAL = 3000;
private static Map<String, String> rankCache = new HashMap<>(); private static Map<String, String> rankCache = new HashMap<>();
private static Map<String, Long> cacheTime = new HashMap<>(); private static Map<String, Long> cacheTime = new HashMap<>();
@ -38,6 +42,14 @@ public class SocketClient {
} }
} }
public static void startHeartbeatCheck() {
ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
executorService.scheduleAtFixedRate(() -> {
// Send a heartbeat message to the server
client.request("heartbeat", SocketClient.getCurrentUsername());
}, 0, HEARTBEAT_INTERVAL, TimeUnit.MILLISECONDS);
}
public static Object sendRequest(String command, String payload) { public static Object sendRequest(String command, String payload) {
return client.request(command, payload); return client.request(command, payload);
} }

View File

@ -2,6 +2,8 @@ package rip.athena.client.ui.clickgui;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import rip.athena.api.config.save.Config; import rip.athena.api.config.save.Config;
import rip.athena.api.module.Module; import rip.athena.api.module.Module;

View File

@ -34,7 +34,7 @@ public class MenuModColorPicker extends MenuColorPicker {
public void onRender() { public void onRender() {
int x = this.getRenderX(); int x = this.getRenderX();
int y = this.getRenderY(); int y = this.getRenderY();
int lineColor = getColor(DrawType.LINE, lastState); //int lineColor = getColor(DrawType.LINE, lastState);
GlStateManager.color(1, 1, 1); GlStateManager.color(1, 1, 1);
@ -43,16 +43,16 @@ public class MenuModColorPicker extends MenuColorPicker {
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);*/ drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);*/
rip.athena.client.ui.framework.draw.DrawImpl.drawRect(x + 3, y + 2, width - 1, height - 3, lineColor); /*rip.athena.client.ui.framework.draw.DrawImpl.drawRect(x + 3, y + 2, width - 1, height - 3, lineColor);
int index = 0; int index = 0;
for(int h = y; h < y + height - 5; h++) { for(int h = y; h < y + height - 5; h++) {
rip.athena.client.ui.framework.draw.DrawImpl.drawRect(x + 5, h + 3, width - 5, 1, /*disabled ? */lightenColor(index, 0, color).getRGB()/* : darkenColor(index, 7, color).getRGB()*/); rip.athena.client.ui.framework.draw.DrawImpl.drawRect(x + 5, h + 3, width - 5, 1, /*disabled ? *///lightenColor(index, 0, color).getRGB()/* : darkenColor(index, 7, color).getRGB()*/);
index++; //index++;
} //}
if(startType <= 0) { /*if(startType <= 0) {
if(alphaSlider.getParent() == null) { if(alphaSlider.getParent() == null) {
alphaSlider.setParent(getParent()); alphaSlider.setParent(getParent());
} }
@ -68,6 +68,6 @@ public class MenuModColorPicker extends MenuColorPicker {
} }
mouseDown = false; mouseDown = false;
mouseDragging = false; mouseDragging = false;*/
} }
} }

View File

@ -11,6 +11,7 @@ import rip.athena.client.config.entries.*;
import rip.athena.client.ui.framework.Menu; import rip.athena.client.ui.framework.Menu;
import rip.athena.client.ui.framework.TextPattern; import rip.athena.client.ui.framework.TextPattern;
import rip.athena.client.ui.framework.components.MenuButton; import rip.athena.client.ui.framework.components.MenuButton;
import rip.athena.client.ui.framework.components.MenuColorPicker;
import rip.athena.client.ui.framework.components.MenuTextField; import rip.athena.client.ui.framework.components.MenuTextField;
import rip.athena.client.ui.clickgui.IngameMenu; import rip.athena.client.ui.clickgui.IngameMenu;
import rip.athena.client.ui.clickgui.Page; import rip.athena.client.ui.clickgui.Page;

View File

@ -760,7 +760,7 @@ public class SettingsPage extends Page {
} else if(configEntry instanceof ColorEntry) { } else if(configEntry instanceof ColorEntry) {
ColorEntry entry = (ColorEntry) configEntry; ColorEntry entry = (ColorEntry) configEntry;
toAdd.add(new MenuModColorPicker(0, 0, 15, 15, ((Color) entry.getValue(module)).getRGB()) { toAdd.add(new MenuModNewColorPicker(0, 0, 15, 15, ((Color) entry.getValue(module)).getRGB()) {
@Override @Override
public void onAction() { public void onAction() {
entry.setValue(module, getColor()); entry.setValue(module, getColor());

View File

@ -3,6 +3,9 @@ package rip.athena.client.ui.framework;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import rip.athena.api.module.Module; import rip.athena.api.module.Module;
@ -38,6 +41,14 @@ public class MinecraftMenuImpl extends GuiScreen {
*/ */
@Override @Override
public void initGui() { public void initGui() {
if (OpenGlHelper.shadersSupported && mc.getRenderViewEntity() instanceof EntityPlayer) {
if (mc.entityRenderer.theShaderGroup != null) {
mc.entityRenderer.theShaderGroup.deleteShaderGroup();
}
mc.entityRenderer.loadShader(new ResourceLocation("shaders/post/blur.json"));
}
Keyboard.enableRepeatEvents(true); Keyboard.enableRepeatEvents(true);
} }
@ -142,6 +153,10 @@ public class MinecraftMenuImpl extends GuiScreen {
if(feature != null) { if(feature != null) {
feature.setEnabled(false); feature.setEnabled(false);
} }
if (mc.entityRenderer.theShaderGroup != null) {
mc.entityRenderer.theShaderGroup.deleteShaderGroup();
mc.entityRenderer.theShaderGroup = null;
}
ready = false; ready = false;
super.onGuiClosed(); super.onGuiClosed();

View File

@ -1,5 +1,6 @@
package rip.athena.client.ui.framework.components; package rip.athena.client.ui.framework.components;
import net.minecraft.client.gui.Gui;
import rip.athena.client.ui.framework.MenuComponent; import rip.athena.client.ui.framework.MenuComponent;
import rip.athena.client.ui.framework.MenuPriority; import rip.athena.client.ui.framework.MenuPriority;
import rip.athena.client.ui.framework.draw.ButtonState; import rip.athena.client.ui.framework.draw.ButtonState;
@ -9,6 +10,8 @@ import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.texture.DynamicTexture; import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import rip.athena.client.utils.render.ColorUtil;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@ -20,46 +23,9 @@ import java.awt.image.BufferedImage;
*/ */
public class MenuColorPicker extends MenuComponent { public class MenuColorPicker extends MenuComponent {
protected Color color;
protected Color temp;
protected Point startPos;
protected ButtonState lastState = ButtonState.NORMAL;
protected ResourceLocation colorPickerMain;
protected boolean mouseDown = false;
protected int lastYPress;
protected int startType = 0;
protected boolean wantsToDrag = false;
protected boolean mouseDragging = false;
protected boolean pickingColor = false;
protected boolean canPick = true;
protected int size = 80;
protected int colorOffset = 10;
protected int alphaOffset = 10;
protected int pickerWindowWidth = size + colorOffset;
protected int pickerWindowHeight = size + alphaOffset;
protected MenuSlider alphaSlider;
public MenuColorPicker(int x, int y, int width, int height, int defaultColor) { public MenuColorPicker(int x, int y, int width, int height, int defaultColor) {
super(x, y, width, height); super(x, y, width, height);
lastYPress = -1;
Color theColor = new Color(defaultColor, true);
color = theColor;
temp = theColor;
alphaSlider = new MenuSlider(1f, 0f, 1f, 1, 0, 0, pickerWindowWidth, 10){
@Override
public void onAction() {
color = new Color(color.getRed(), color.getGreen(), color.getBlue(), Math.round(alphaSlider.getValue() * 255));
MenuColorPicker.this.onAction();
}
};
alphaSlider.setValue((float)theColor.getAlpha() / 255);
} }
@Override @Override
@ -88,421 +54,44 @@ public class MenuColorPicker extends MenuComponent {
@Override @Override
public void onMouseClick(int button) { public void onMouseClick(int button) {
if(button == 0 && alphaSlider.passesThrough()) {
mouseDown = true;
}
alphaSlider.onMouseClick(button);
} }
@Override @Override
public void onMouseClickMove(int button) { public void onMouseClickMove(int button) {
if(button == 0 && alphaSlider.passesThrough()) {
mouseDragging = true;
}
alphaSlider.onMouseClickMove(button);
} }
@Override @Override
public boolean onExitGui(int key) { public boolean onExitGui(int key) {
if(pickingColor) {
pickingColor = false;
}
alphaSlider.onExitGui(key);
return false; return false;
} }
@Override @Override
public boolean passesThrough() { public boolean passesThrough() {
if(pickingColor) {
return false;
}
if(disabled) {
return true;
}
int x = this.getRenderX(); int x = this.getRenderX();
int y = this.getRenderY(); int y = this.getRenderY();
int mouseX = parent.getMouseX(); int mouseX = parent.getMouseX();
int mouseY = parent.getMouseY(); int mouseY = parent.getMouseY();
if(startPos != null) {
if(mouseX >= startPos.x && mouseX <= startPos.x + pickerWindowWidth) {
if(mouseY >= startPos.y && mouseY <= startPos.y + pickerWindowHeight) {
return false;
}
}
} else if(mouseDown) {
if(mouseX >= x && mouseX <= x + width) {
if(mouseY >= y && mouseY <= y + height + 1) {
return false;
}
}
}
return true; return true;
} }
@Override @Override
public void onPreSort() { public void onPreSort() {
if(alphaSlider.getParent() == null && getParent() != null) {
alphaSlider.setParent(getParent());
}
int x = this.getRenderX(); int x = this.getRenderX();
int y = this.getRenderY(); int y = this.getRenderY();
int mouseX = parent.getMouseX(); int mouseX = parent.getMouseX();
int mouseY = parent.getMouseY(); int mouseY = parent.getMouseY();
ButtonState state = ButtonState.NORMAL; ButtonState state = ButtonState.NORMAL;
if(!disabled) {
if(mouseX >= x && mouseX <= x + width) {
if(mouseY >= y && mouseY <= y + height + 1) {
state = ButtonState.HOVER;
}
}
if(startPos != null) {
boolean hover = false;
if(mouseX >= startPos.x && mouseX <= startPos.x + pickerWindowWidth) {
if(mouseY >= startPos.y && mouseY <= startPos.y + pickerWindowHeight + 1) {
hover = true;
}
}
if(hover && mouseDown) {
wantsToDrag = true;
}
pickingColor = (mouseDown && hover) || (!mouseDown && pickingColor);
if(pickingColor) {
state = ButtonState.HOVER;
}
} else if(state == ButtonState.HOVER && mouseDown) {
pickingColor = true;
}
} else {
state = ButtonState.DISABLED;
}
if(pickingColor) {
setPriority(MenuPriority.HIGHEST);
} else {
if(state == ButtonState.HOVER || state == ButtonState.HOVERACTIVE) {
setPriority(MenuPriority.HIGH);
} else {
setPriority(MenuPriority.MEDIUM);
}
}
lastState = state;
} }
@Override @Override
public void onRender() { public void onRender() {
int x = this.getRenderX(); int x = this.getRenderX();
int y = this.getRenderY(); int y = this.getRenderY();
int lineColor = getColor(DrawType.LINE, lastState);
int index = 0;
for(int h = y; h < y + height; h++) {
rip.athena.client.ui.framework.draw.DrawImpl.drawRect(x + 1, h, width - 1, 1, disabled ? lightenColor(index, 7, color).getRGB() : darkenColor(index, 7, color).getRGB());
index++;
}
drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);
if(startType <= 0) {
if(alphaSlider.getParent() == null) {
alphaSlider.setParent(getParent());
}
alphaSlider.onPreSort();
}
drawPicker();
if(wantsToDrag) {
mouseDragging = Mouse.isButtonDown(0);
wantsToDrag = mouseDragging;
}
mouseDown = false;
mouseDragging = false;
}
public void drawPicker() {
if(pickingColor) {
int mouseX = parent.getMouseX();
int mouseY = parent.getMouseY();
int backgroundColor = getColor(DrawType.BACKGROUND, ButtonState.POPUP);
int lineColor = getColor(DrawType.LINE, lastState);
if(!mouseDown) {
canPick = true;
}
if(!wantsToDrag) {
startType = 0;
}
if(startPos == null) {
ScaledResolution res = new ScaledResolution(Minecraft.getMinecraft());
int windowX = mouseX;
int windowY = mouseY;
if(windowX + pickerWindowWidth >= res.getScaledWidth()) {
windowX -= pickerWindowWidth;
}
if(windowY + pickerWindowHeight >= res.getScaledHeight()) {
windowY -= pickerWindowHeight;
}
startPos = new Point(windowX, windowY);
alphaSlider.setX(startPos.x);
alphaSlider.setY(startPos.y + pickerWindowHeight - alphaSlider.getHeight());
canPick = false;
}
if(canPick && startType == 0) {
if(mouseY > startPos.y && mouseY < startPos.y + pickerWindowHeight - alphaSlider.getHeight()) {
if(mouseX > startPos.x + pickerWindowWidth - colorOffset && mouseX < startPos.x + pickerWindowWidth) {
startType = 1;
} else if(mouseX > startPos.x && mouseX < startPos.x + size) {
startType = 2;
}
} else {
startType = -1;
canPick = false;
}
}
if(startType != 0) {
if(startType == 2) {
if(mouseX >= startPos.x + pickerWindowWidth) {
mouseX = startPos.x + pickerWindowWidth - size - 1;
} else if(mouseX <= startPos.x) {
mouseX = startPos.x + pickerWindowWidth - size + 1;
}
} else {
if(mouseX >= startPos.x + pickerWindowWidth) {
mouseX = startPos.x + pickerWindowWidth - 1;
} else if(mouseX <= startPos.x + size) {
mouseX = startPos.x + size + 1;
}
}
if(mouseY >= startPos.y + pickerWindowHeight - alphaSlider.getHeight()) {
mouseY = startPos.y + pickerWindowHeight - alphaSlider.getHeight() - 1;
} else if(mouseY <= startPos.y) {
mouseY = startPos.y + 1;
}
}
rip.athena.client.ui.framework.draw.DrawImpl.drawRect(startPos.x + 1, startPos.y + 1, pickerWindowWidth - 1, pickerWindowHeight - 1, backgroundColor );
drawHorizontalLine(startPos.x, startPos.y, pickerWindowWidth + 1, 1, lineColor);
drawVerticalLine(startPos.x, startPos.y + 1, pickerWindowHeight - 1, 1, lineColor);
drawHorizontalLine(startPos.x, startPos.y + pickerWindowHeight, pickerWindowWidth + 1, 1, lineColor);
drawVerticalLine(startPos.x + pickerWindowWidth, startPos.y + 1, pickerWindowHeight - 1, 1, lineColor);
if(colorPickerMain == null) {
BufferedImage bufferedPicker = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB);
for(int y = 0; y < size; y++) {
float blackMod = 255 * (float)y / size;
for(int x = 0; x < size; x++) {
Color color = new Color(clampColor(temp.getRed() - blackMod), clampColor(temp.getGreen() - blackMod), clampColor(temp.getBlue() - blackMod));
bufferedPicker.setRGB(x, y, color.getRGB());
}
}
DynamicTexture texture = new DynamicTexture(bufferedPicker);
bufferedPicker.getRGB(0, 0, bufferedPicker.getWidth(), bufferedPicker.getHeight(), texture.getTextureData(), 0, bufferedPicker.getWidth());
final ResourceLocation resource = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("color-picker-active", texture);
colorPickerMain = resource;
}
if((mouseDown || mouseDragging || wantsToDrag) && canPick && startType == 2) {
if(mouseX > startPos.x && mouseX < startPos.x + size && mouseY > startPos.y && mouseY < startPos.y + size) {
int y = mouseY - startPos.y;
float blackMod = 255 * (float)y / size;
this.color = new Color(clampColor(temp.getRed() - blackMod), clampColor(temp.getGreen() - blackMod), clampColor(temp.getBlue() - blackMod));
onAction();
}
}
drawImage(colorPickerMain, startPos.x + 1, startPos.y + 1, size - 1, size - 1);
float colorSpeed = size / 3.8f;
float red = 275;
float green = 275;
float blue = 275;
for(int y = startPos.y + 1; y < startPos.y + size; y++) {
if(red > 255) {
red--;
}
if(green > 255) {
green--;
}
if(blue > 255) {
blue--;
}
if(red >= 255 && green >= 255 && blue > 0) {
blue -= colorSpeed;
} else if(red >= 255 && green > 0 && blue <= 0) {
green -= colorSpeed;
} else if(red >= 255 && green <= 0 && blue < 255) {
blue += colorSpeed;
} else if(red > 0 && green <= 0 && blue >= 255) {
red -= colorSpeed;
} else if(red <= 0 && green < 255 && blue >= 255) {
green += colorSpeed;
} else if(red <= 0 && green >= 255 && blue > 0) {
blue -= colorSpeed;
} else if(red < 255 && green >= 255 && blue <= 0) {
red += colorSpeed;
}
for(int x = startPos.x + size + 1; x < startPos.x + pickerWindowWidth; x++) {
Color color = new Color(clampColor(red), clampColor(green), clampColor(blue));
if((mouseDown || mouseDragging || wantsToDrag) && canPick && startType == 1 && isInPixel(mouseX, mouseY, x, y)) {
temp = color;
lastYPress = y;
onMiniAction();
Minecraft.getMinecraft().getTextureManager().deleteTexture(colorPickerMain);
colorPickerMain = null;
}
if(lastYPress == -1) {
if(Math.abs(color.getRGB() - temp.getRGB()) < 3) {
lastYPress = y;
}
}
drawPixel(x, y, color.getRGB());
}
}
if(lastYPress != -1) {
drawHorizontalLine(startPos.x + pickerWindowWidth - colorOffset, lastYPress, colorOffset, 1, lineColor);
}
alphaSlider.onRender();
drawVerticalLine(startPos.x + size, startPos.y + 1, pickerWindowHeight - alphaOffset - 1, 1, lineColor);
} else if(startPos != null) {
startPos = null;
if(colorPickerMain != null) {
Minecraft.getMinecraft().getTextureManager().deleteTexture(colorPickerMain);
colorPickerMain = null;
}
alphaSlider.setX(Integer.MAX_VALUE);
alphaSlider.setY(Integer.MAX_VALUE);
}
}
private boolean isInPixel(int mouseX, int mouseY, int x, int y) {
return mouseX == x && mouseY == y;
}
private int clampColor(float color) {
int theColor = Math.round(color);
if(theColor > 255) {
return 255;
}
else if(theColor < 0) {
return 0;
}
return theColor;
}
protected Color darkenColor(int index, int modifier, Color color) {
int newRed = color.getRed() - index * modifier;
int newGreen = color.getGreen() - index * modifier;
int newBlue = color.getBlue() - index * modifier;
if(newRed < 0) {
newRed = 0;
}
if(newGreen < 0) {
newGreen = 0;
}
if(newBlue < 0) {
newBlue = 0;
}
return new Color(newRed, newGreen, newBlue, Math.round(alphaSlider.getValue() * 255));
}
protected Color lightenColor(int index, int modifier, Color color) {
int newRed = color.getRed() + index * modifier;
int newGreen = color.getGreen() + index * modifier;
int newBlue = color.getBlue() + index * modifier;
if(newRed > 255) {
newRed = 255;
}
if(newGreen > 255) {
newGreen = 255;
}
if(newBlue > 255) {
newBlue = 255;
}
return new Color(newRed, newGreen, newBlue, color.getAlpha());
}
public Color getColor() {
return color;
}
public void setColor(int color) {
this.color = new Color(color);
Minecraft.getMinecraft().getTextureManager().deleteTexture(colorPickerMain);
colorPickerMain = null;
}
public Color getColorCategory() {
return temp;
}
public void setColorCategory(int color) {
this.temp = new Color(color);
lastYPress = -1;
}
public MenuSlider getAlphaSlider() {
return alphaSlider;
} }
public void onAction() {} public void onAction() {}

View File

@ -411,7 +411,7 @@ public class MenuScrollPane extends MenuComponent {
for(MenuComponent component : components) { for(MenuComponent component : components) {
if(component instanceof MenuColorPicker) { if(component instanceof MenuColorPicker) {
MenuColorPicker picker = (MenuColorPicker) component; MenuColorPicker picker = (MenuColorPicker) component;
picker.drawPicker(); //picker.drawPicker();
} else if(component instanceof MenuLabel) { } else if(component instanceof MenuLabel) {
MenuLabel label = (MenuLabel) component; MenuLabel label = (MenuLabel) component;
label.drawTooltip(); label.drawTooltip();

View File

@ -247,7 +247,9 @@ public class AthenaMenu extends GuiScreen implements GuiYesNoCallback
public void drawScreen(int mouseX, int mouseY, float partialTicks) public void drawScreen(int mouseX, int mouseY, float partialTicks)
{ {
GlStateManager.pushMatrix();
DrawUtils.drawImage(new ResourceLocation("Athena/menu/wallpaper3.png"), 0, 0, width, height); DrawUtils.drawImage(new ResourceLocation("Athena/menu/wallpaper3.png"), 0, 0, width, height);
GlStateManager.popMatrix();
int[] size = InputUtils.getWindowsSize(); int[] size = InputUtils.getWindowsSize();
int startX = size[0] / 2; int startX = size[0] / 2;
@ -273,9 +275,9 @@ public class AthenaMenu extends GuiScreen implements GuiYesNoCallback
RoundedUtils.drawRoundedRect(startX+startX - 25, startY - startY + 5, startX+startX - 5, startY - startY + 25, 14, isOverAccountManager ? new Color(150,150,150,100).getRGB() : new Color(100,100,100,100).getRGB()); RoundedUtils.drawRoundedRect(startX+startX - 25, startY - startY + 5, startX+startX - 5, startY - startY + 25, 14, isOverAccountManager ? new Color(150,150,150,100).getRGB() : new Color(100,100,100,100).getRGB());
RoundedUtils.drawRoundedGradientOutlineCorner(startX+startX - 25 + 1, startY - startY + 5 + 1, startX+startX - 5 - 1, startY - startY + 25 - 1, 3, 12, ColorUtil.getClientColor(0, 255).getRGB(), ColorUtil.getClientColor(90, 255).getRGB(), ColorUtil.getClientColor(180, 255).getRGB(), ColorUtil.getClientColor(270, 255).getRGB()); RoundedUtils.drawRoundedGradientOutlineCorner(startX+startX - 25 + 1, startY - startY + 5 + 1, startX+startX - 5 - 1, startY - startY + 25 - 1, 3, 12, ColorUtil.getClientColor(0, 255).getRGB(), ColorUtil.getClientColor(90, 255).getRGB(), ColorUtil.getClientColor(180, 255).getRGB(), ColorUtil.getClientColor(270, 255).getRGB());
boolean isOverSkinManager = mouseX >= startX+startX-50 && mouseX <= startX+startX-30 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25; //boolean isOverSkinManager = mouseX >= startX+startX-50 && mouseX <= startX+startX-30 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25;
RoundedUtils.drawRoundedRect(startX+startX - 50, startY - startY + 5, startX+startX - 30, startY - startY + 25, 14, isOverSkinManager ? new Color(150,150,150,100).getRGB() : new Color(100,100,100,100).getRGB()); //RoundedUtils.drawRoundedRect(startX+startX - 50, startY - startY + 5, startX+startX - 30, startY - startY + 25, 14, isOverSkinManager ? new Color(150,150,150,100).getRGB() : new Color(100,100,100,100).getRGB());
RoundedUtils.drawRoundedGradientOutlineCorner(startX+startX - 50 + 1, startY - startY + 5 + 1, startX+startX - 30 - 1, startY - startY + 25 - 1, 3, 12, ColorUtil.getClientColor(0, 255).getRGB(), ColorUtil.getClientColor(90, 255).getRGB(), ColorUtil.getClientColor(180, 255).getRGB(), ColorUtil.getClientColor(270, 255).getRGB()); //RoundedUtils.drawRoundedGradientOutlineCorner(startX+startX - 50 + 1, startY - startY + 5 + 1, startX+startX - 30 - 1, startY - startY + 25 - 1, 3, 12, ColorUtil.getClientColor(0, 255).getRGB(), ColorUtil.getClientColor(90, 255).getRGB(), ColorUtil.getClientColor(180, 255).getRGB(), ColorUtil.getClientColor(270, 255).getRGB());
boolean isOverExit = mouseX >= 5 && mouseX <= 25 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25; boolean isOverExit = mouseX >= 5 && mouseX <= 25 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25;
RoundedUtils.drawRoundedRect(5, startY - startY + 5, 25, startY - startY + 25, 14, isOverExit ? new Color(150,150,150,100).getRGB() : new Color(100,100,100,100).getRGB()); RoundedUtils.drawRoundedRect(5, startY - startY + 5, 25, startY - startY + 25, 14, isOverExit ? new Color(150,150,150,100).getRGB() : new Color(100,100,100,100).getRGB());
@ -298,7 +300,7 @@ public class AthenaMenu extends GuiScreen implements GuiYesNoCallback
boolean isOverExit = mouseX >= 5 && mouseX <= 25 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25; boolean isOverExit = mouseX >= 5 && mouseX <= 25 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25;
boolean isOverAccountManager = mouseX >= startX+startX-25 && mouseX <= startX+startX-5 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25; boolean isOverAccountManager = mouseX >= startX+startX-25 && mouseX <= startX+startX-5 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25;
boolean isOverSkinManager = mouseX >= startX+startX-50 && mouseX <= startX+startX-30 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25; //boolean isOverSkinManager = mouseX >= startX+startX-50 && mouseX <= startX+startX-30 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25;
if(isOverExit) { if(isOverExit) {
this.mc.shutdown(); this.mc.shutdown();
@ -308,9 +310,9 @@ public class AthenaMenu extends GuiScreen implements GuiYesNoCallback
this.mc.displayGuiScreen(new GuiAccountManager(this)); this.mc.displayGuiScreen(new GuiAccountManager(this));
} }
if(isOverSkinManager) { /*if(isOverSkinManager) {
this.mc.displayGuiScreen(new GuiSkinManager(this)); this.mc.displayGuiScreen(new GuiSkinManager(this));
} }*/
synchronized (this.threadLock) synchronized (this.threadLock)
{ {

View File

@ -30,6 +30,8 @@ public class LoginPanel extends Panel {
public final List<TextField> textFields = new ArrayList<>(); public final List<TextField> textFields = new ArrayList<>();
private String status = ""; private String status = "";
private boolean sendToMenu = false;
public LoginPanel() { public LoginPanel() {
setHeight(200); setHeight(200);
actionButtons.add(new AltButton("Offline Login")); actionButtons.add(new AltButton("Offline Login"));
@ -111,7 +113,7 @@ public class LoginPanel extends Panel {
if (actionButton.getName().equals("Offline Login")) { if (actionButton.getName().equals("Offline Login")) {
TextField cracked = textFields.get(0); TextField cracked = textFields.get(0);
if(cracked.getText() == null) { if(cracked.getText().isEmpty()) {
status = "Username field is null"; status = "Username field is null";
return; return;
} }
@ -151,6 +153,10 @@ public class LoginPanel extends Panel {
float logoSize = 22; float logoSize = 22;
DrawUtils.drawMicrosoftLogo(microX + microWidth - (10 + logoSize), microsoftY + (microHeight / 2f) - (logoSize / 2f), logoSize, 1.5f); DrawUtils.drawMicrosoftLogo(microX + microWidth - (10 + logoSize), microsoftY + (microHeight / 2f) - (logoSize / 2f), logoSize, 1.5f);
if(sendToMenu) {
Minecraft.getMinecraft().displayGuiScreen(new AthenaMenu());
}
} }
@Override @Override
@ -174,6 +180,9 @@ public class LoginPanel extends Panel {
try { try {
MicrosoftAuthResult acc = authenticator.loginWithCredentials(email, password); MicrosoftAuthResult acc = authenticator.loginWithCredentials(email, password);
//MicrosoftAuthResult acc = authenticator.loginWithWebview();
//Minecraft.getMinecraft().setSession(new Session(acc.getProfile().getName(), acc.getProfile().getId(), acc.getAccessToken(), "mojang"));
Minecraft.getMinecraft().session = new Session(acc.getProfile().getName(), acc.getProfile().getId(), acc.getAccessToken(), "legacy"); Minecraft.getMinecraft().session = new Session(acc.getProfile().getName(), acc.getProfile().getId(), acc.getAccessToken(), "legacy");
status = "Logged into " + acc.getProfile().getName(); status = "Logged into " + acc.getProfile().getName();
@ -190,9 +199,10 @@ public class LoginPanel extends Panel {
} }
// Send to main menu // Send to main menu
Minecraft.getMinecraft().displayGuiScreen(new AthenaMenu()); sendToMenu = true;
} catch (MicrosoftAuthenticationException e) { } catch (Exception e) {
status = e.getMessage();
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -0,0 +1,26 @@
package rip.athena.client.utils;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import rip.athena.api.anticheat.AbstractCheck;
import rip.athena.api.event.SubscribeEvent;
import rip.athena.client.Athena;
/**
* @author Athena Development
* @project Athena-Client
* @date 7/11/2023
*/
public class ClientSidedAntiCheat {
public void runChecks() {
if(Minecraft.getMinecraft().theWorld == null || Minecraft.getMinecraft().thePlayer == null) return;
for(AbstractCheck check : Athena.INSTANCE.getCheckRepository().getChecks()) {
if (check.executeCheck(Minecraft.getMinecraft().thePlayer) && System.currentTimeMillis() > check.getLastViolated() + 500) {
Minecraft.getMinecraft().thePlayer.totalViolations++;
check.setLastViolated(System.currentTimeMillis());
}
}
}
}

View File

@ -72,7 +72,7 @@ public class AsyncScreenshot implements Runnable {
e.printStackTrace(); e.printStackTrace();
} }
String clientID = ""; String clientID = "05134ff84f31635";
String data = ""; String data = "";
data = URLEncoder.encode("image", "UTF-8") + "=" + URLEncoder.encode(Base64.getEncoder().encodeToString(byteArrayOutputStream.toByteArray()), "UTF-8"); data = URLEncoder.encode("image", "UTF-8") + "=" + URLEncoder.encode(Base64.getEncoder().encodeToString(byteArrayOutputStream.toByteArray()), "UTF-8");

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -0,0 +1,37 @@
{
"targets": [
"swap"
],
"passes": [
{
"name": "blur",
"intarget": "minecraft:main",
"outtarget": "swap",
"uniforms": [
{
"name": "BlurDir",
"values": [ 1.0, 0.0 ]
},
{
"name": "Radius",
"values": [ 20.0 ]
}
]
},
{
"name": "blur",
"intarget": "swap",
"outtarget": "minecraft:main",
"uniforms": [
{
"name": "BlurDir",
"values": [ 0.0, 1.0 ]
},
{
"name": "Radius",
"values": [ 20.0 ]
}
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 993 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 935 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1019 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

Some files were not shown because too many files have changed in this diff Show More