add websocket
6
pom.xml
|
@ -28,6 +28,12 @@
|
||||||
<version>1.8.8</version>
|
<version>1.8.8</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>co.gongzh.procbridge</groupId>
|
||||||
|
<artifactId>procbridge</artifactId>
|
||||||
|
<version>1.1.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.json</groupId>
|
<groupId>org.json</groupId>
|
||||||
<artifactId>json</artifactId>
|
<artifactId>json</artifactId>
|
||||||
|
|
|
@ -195,6 +195,7 @@ import rip.athena.client.events.types.input.MouseMoveEvent;
|
||||||
import rip.athena.client.events.types.render.RenderEvent;
|
import rip.athena.client.events.types.render.RenderEvent;
|
||||||
import rip.athena.client.events.types.render.RenderType;
|
import rip.athena.client.events.types.render.RenderType;
|
||||||
import rip.athena.client.gui.menu.AthenaMenu;
|
import rip.athena.client.gui.menu.AthenaMenu;
|
||||||
|
import rip.athena.client.modules.impl.fpssettings.OptimizerMod;
|
||||||
|
|
||||||
public class Minecraft implements IThreadListener, IPlayerUsage
|
public class Minecraft implements IThreadListener, IPlayerUsage
|
||||||
{
|
{
|
||||||
|
@ -240,7 +241,7 @@ public class Minecraft implements IThreadListener, IPlayerUsage
|
||||||
private Entity renderViewEntity;
|
private Entity renderViewEntity;
|
||||||
public Entity pointedEntity;
|
public Entity pointedEntity;
|
||||||
public EffectRenderer effectRenderer;
|
public EffectRenderer effectRenderer;
|
||||||
private final Session session;
|
public Session session;
|
||||||
private boolean isGamePaused;
|
private boolean isGamePaused;
|
||||||
|
|
||||||
/** The font renderer used for displaying and measuring text */
|
/** The font renderer used for displaying and measuring text */
|
||||||
|
@ -1055,6 +1056,7 @@ public class Minecraft implements IThreadListener, IPlayerUsage
|
||||||
{
|
{
|
||||||
this.stream.shutdownStream();
|
this.stream.shutdownStream();
|
||||||
logger.info("Stopping!");
|
logger.info("Stopping!");
|
||||||
|
Athena.INSTANCE.shutdownClient();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -2291,10 +2293,15 @@ public class Minecraft implements IThreadListener, IPlayerUsage
|
||||||
/**
|
/**
|
||||||
* Arguments: World foldername, World ingame name, WorldSettings
|
* Arguments: World foldername, World ingame name, WorldSettings
|
||||||
*/
|
*/
|
||||||
public void launchIntegratedServer(String folderName, String worldName, WorldSettings worldSettingsIn)
|
public void launchIntegratedServer(String folderName, String worldName, WorldSettings worldSettingsIn) {
|
||||||
{
|
this.loadWorld((WorldClient) null);
|
||||||
this.loadWorld((WorldClient)null);
|
|
||||||
|
OptimizerMod mod = (OptimizerMod) Athena.INSTANCE.getModuleManager().get(OptimizerMod.class);
|
||||||
|
|
||||||
|
if (!mod.FAST_WORLD_LOADING) {
|
||||||
System.gc();
|
System.gc();
|
||||||
|
}
|
||||||
|
|
||||||
ISaveHandler isavehandler = this.saveLoader.getSaveLoader(folderName, false);
|
ISaveHandler isavehandler = this.saveLoader.getSaveLoader(folderName, false);
|
||||||
WorldInfo worldinfo = isavehandler.loadWorldInfo();
|
WorldInfo worldinfo = isavehandler.loadWorldInfo();
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import net.minecraft.client.multiplayer.WorldClient;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import rip.athena.client.gui.menu.AthenaMenu;
|
||||||
|
|
||||||
public class GuiGameOver extends GuiScreen implements GuiYesNoCallback
|
public class GuiGameOver extends GuiScreen implements GuiYesNoCallback
|
||||||
{
|
{
|
||||||
|
@ -73,7 +74,7 @@ public class GuiGameOver extends GuiScreen implements GuiYesNoCallback
|
||||||
case 1:
|
case 1:
|
||||||
if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled())
|
if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled())
|
||||||
{
|
{
|
||||||
this.mc.displayGuiScreen(new GuiMainMenu());
|
this.mc.displayGuiScreen(new AthenaMenu());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -90,7 +91,7 @@ public class GuiGameOver extends GuiScreen implements GuiYesNoCallback
|
||||||
{
|
{
|
||||||
this.mc.theWorld.sendQuittingDisconnectingPacket();
|
this.mc.theWorld.sendQuittingDisconnectingPacket();
|
||||||
this.mc.loadWorld((WorldClient)null);
|
this.mc.loadWorld((WorldClient)null);
|
||||||
this.mc.displayGuiScreen(new GuiMainMenu());
|
this.mc.displayGuiScreen(new AthenaMenu());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,6 +46,7 @@ import optifine.CustomColors;
|
||||||
import rip.athena.client.Athena;
|
import rip.athena.client.Athena;
|
||||||
import rip.athena.client.events.types.render.RenderEvent;
|
import rip.athena.client.events.types.render.RenderEvent;
|
||||||
import rip.athena.client.events.types.render.RenderType;
|
import rip.athena.client.events.types.render.RenderType;
|
||||||
|
import rip.athena.client.modules.impl.mods.OldAnimations;
|
||||||
|
|
||||||
public class GuiIngame extends Gui
|
public class GuiIngame extends Gui
|
||||||
{
|
{
|
||||||
|
@ -626,6 +627,12 @@ public class GuiIngame extends Gui
|
||||||
int i = MathHelper.ceiling_float_int(entityplayer.getHealth());
|
int i = MathHelper.ceiling_float_int(entityplayer.getHealth());
|
||||||
boolean flag = this.healthUpdateCounter > (long)this.updateCounter && (this.healthUpdateCounter - (long)this.updateCounter) / 3L % 2L == 1L;
|
boolean flag = this.healthUpdateCounter > (long)this.updateCounter && (this.healthUpdateCounter - (long)this.updateCounter) / 3L % 2L == 1L;
|
||||||
|
|
||||||
|
OldAnimations mod = (OldAnimations) Athena.INSTANCE.getModuleManager().get(OldAnimations.class);
|
||||||
|
|
||||||
|
if(Athena.INSTANCE.getModuleManager().get(OldAnimations.class).isToggled() && mod.DISABLE_HEALTH_FLASH) {
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (i < this.playerHealth && entityplayer.hurtResistantTime > 0)
|
if (i < this.playerHealth && entityplayer.hurtResistantTime > 0)
|
||||||
{
|
{
|
||||||
this.lastSystemTime = Minecraft.getSystemTime();
|
this.lastSystemTime = Minecraft.getSystemTime();
|
||||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.client.gui.achievement.GuiStats;
|
||||||
import net.minecraft.client.multiplayer.WorldClient;
|
import net.minecraft.client.multiplayer.WorldClient;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.realms.RealmsBridge;
|
import net.minecraft.realms.RealmsBridge;
|
||||||
|
import rip.athena.client.gui.menu.AthenaMenu;
|
||||||
|
|
||||||
public class GuiIngameMenu extends GuiScreen
|
public class GuiIngameMenu extends GuiScreen
|
||||||
{
|
{
|
||||||
|
@ -58,16 +59,16 @@ public class GuiIngameMenu extends GuiScreen
|
||||||
|
|
||||||
if (flag)
|
if (flag)
|
||||||
{
|
{
|
||||||
this.mc.displayGuiScreen(new GuiMainMenu());
|
this.mc.displayGuiScreen(new AthenaMenu());
|
||||||
}
|
}
|
||||||
else if (flag1)
|
else if (flag1)
|
||||||
{
|
{
|
||||||
RealmsBridge realmsbridge = new RealmsBridge();
|
RealmsBridge realmsbridge = new RealmsBridge();
|
||||||
realmsbridge.switchToRealms(new GuiMainMenu());
|
realmsbridge.switchToRealms(new AthenaMenu());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.mc.displayGuiScreen(new GuiMultiplayer(new GuiMainMenu()));
|
this.mc.displayGuiScreen(new GuiMultiplayer(new AthenaMenu()));
|
||||||
}
|
}
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
|
|
|
@ -2,6 +2,7 @@ package net.minecraft.client.gui;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
|
import rip.athena.client.gui.menu.AthenaMenu;
|
||||||
|
|
||||||
public class GuiMemoryErrorScreen extends GuiScreen
|
public class GuiMemoryErrorScreen extends GuiScreen
|
||||||
{
|
{
|
||||||
|
@ -23,7 +24,7 @@ public class GuiMemoryErrorScreen extends GuiScreen
|
||||||
{
|
{
|
||||||
if (button.id == 0)
|
if (button.id == 0)
|
||||||
{
|
{
|
||||||
this.mc.displayGuiScreen(new GuiMainMenu());
|
this.mc.displayGuiScreen(new AthenaMenu());
|
||||||
}
|
}
|
||||||
else if (button.id == 1)
|
else if (button.id == 1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,6 +11,8 @@ import net.minecraft.util.IChatComponent;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
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.font.FontManager;
|
||||||
|
import rip.athena.client.modules.impl.render.Chat;
|
||||||
|
|
||||||
public class GuiNewChat extends Gui
|
public class GuiNewChat extends Gui
|
||||||
{
|
{
|
||||||
|
@ -81,8 +83,13 @@ public class GuiNewChat extends Gui
|
||||||
int j2 = -i1 * 9;
|
int j2 = -i1 * 9;
|
||||||
drawRect(i2, j2 - 9, i2 + l + 4, j2, l1 / 2 << 24);
|
drawRect(i2, j2 - 9, i2 + l + 4, j2, l1 / 2 << 24);
|
||||||
String s = chatline.getChatComponent().getFormattedText();
|
String s = chatline.getChatComponent().getFormattedText();
|
||||||
|
GlStateManager.color(1,1,1);
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
this.mc.fontRendererObj.drawStringWithShadow(s, (float)i2, (float)(j2 - 8), 16777215 + (l1 << 24));
|
if(Chat.customFont) {
|
||||||
|
FontManager.baloo17.drawStringWithShadow(s, (float) i2, (float) (j2 - 10), 16777215 + (l1 << 24));
|
||||||
|
} else {
|
||||||
|
this.mc.fontRendererObj.drawStringWithShadow(s, (float) i2, (float) (j2 - 8), 16777215 + (l1 << 24));
|
||||||
|
}
|
||||||
GlStateManager.disableAlpha();
|
GlStateManager.disableAlpha();
|
||||||
GlStateManager.disableBlend();
|
GlStateManager.disableBlend();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,11 +37,13 @@ import net.minecraft.stats.StatList;
|
||||||
import net.minecraft.util.ChatComponentTranslation;
|
import net.minecraft.util.ChatComponentTranslation;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.IChatComponent;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
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 org.lwjgl.input.Mouse;
|
import org.lwjgl.input.Mouse;
|
||||||
|
import rip.athena.client.utils.render.DrawUtils;
|
||||||
import tv.twitch.chat.ChatUserInfo;
|
import tv.twitch.chat.ChatUserInfo;
|
||||||
|
|
||||||
public abstract class GuiScreen extends Gui implements GuiYesNoCallback
|
public abstract class GuiScreen extends Gui implements GuiYesNoCallback
|
||||||
|
@ -658,7 +660,8 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.drawBackground(tint);
|
DrawUtils.drawImage(new ResourceLocation("Athena/menu/wallpaper.jpg"), 0, 0, width, height);
|
||||||
|
//this.drawBackground(tint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package net.minecraft.client.model;
|
package net.minecraft.client.model;
|
||||||
|
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.modules.impl.fpssettings.OptimizerMod;
|
||||||
|
|
||||||
public class ModelChest extends ModelBase
|
public class ModelChest extends ModelBase
|
||||||
{
|
{
|
||||||
/** The chest lid in the chest's model. */
|
/** The chest lid in the chest's model. */
|
||||||
|
@ -34,9 +37,15 @@ public class ModelChest extends ModelBase
|
||||||
*/
|
*/
|
||||||
public void renderAll()
|
public void renderAll()
|
||||||
{
|
{
|
||||||
|
OptimizerMod mod = (OptimizerMod) Athena.INSTANCE.getModuleManager().get(OptimizerMod.class);
|
||||||
|
|
||||||
|
if(mod.noBetterChests) {
|
||||||
|
this.chestBelow.render(0.0625F);
|
||||||
|
} else {
|
||||||
this.chestKnob.rotateAngleX = this.chestLid.rotateAngleX;
|
this.chestKnob.rotateAngleX = this.chestLid.rotateAngleX;
|
||||||
this.chestLid.render(0.0625F);
|
this.chestLid.render(0.0625F);
|
||||||
this.chestKnob.render(0.0625F);
|
this.chestKnob.render(0.0625F);
|
||||||
this.chestBelow.render(0.0625F);
|
this.chestBelow.render(0.0625F);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,6 +211,7 @@ import net.minecraft.world.chunk.Chunk;
|
||||||
import net.minecraft.world.storage.MapData;
|
import net.minecraft.world.storage.MapData;
|
||||||
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.gui.menu.AthenaMenu;
|
||||||
|
|
||||||
public class NetHandlerPlayClient implements INetHandlerPlayClient
|
public class NetHandlerPlayClient implements INetHandlerPlayClient
|
||||||
{
|
{
|
||||||
|
@ -807,7 +808,7 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.gameController.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", reason));
|
this.gameController.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new AthenaMenu()), "disconnect.lost", reason));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@ import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.modules.impl.fpssettings.OptimizerMod;
|
||||||
|
|
||||||
public class EntityFX extends Entity
|
public class EntityFX extends Entity
|
||||||
{
|
{
|
||||||
|
@ -192,7 +194,14 @@ public class EntityFX extends Entity
|
||||||
float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX);
|
float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX);
|
||||||
float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY);
|
float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY);
|
||||||
float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ);
|
float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ);
|
||||||
int i = this.getBrightnessForRender(partialTicks);
|
|
||||||
|
int i = 15728880;
|
||||||
|
|
||||||
|
OptimizerMod mod = (OptimizerMod) Athena.INSTANCE.getModuleManager().get(OptimizerMod.class);
|
||||||
|
|
||||||
|
if(!mod.STATIC_PARTICLE_COLOR) {
|
||||||
|
i = this.getBrightnessForRender(partialTicks);
|
||||||
|
}
|
||||||
int j = i >> 16 & 65535;
|
int j = i >> 16 & 65535;
|
||||||
int k = i & 65535;
|
int k = i & 65535;
|
||||||
worldRendererIn.pos((double)(f5 - p_180434_4_ * f4 - p_180434_7_ * f4), (double)(f6 - p_180434_5_ * f4), (double)(f7 - p_180434_6_ * f4 - p_180434_8_ * f4)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
|
worldRendererIn.pos((double)(f5 - p_180434_4_ * f4 - p_180434_7_ * f4), (double)(f6 - p_180434_5_ * f4), (double)(f7 - p_180434_6_ * f4 - p_180434_8_ * f4)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex();
|
||||||
|
|
|
@ -12,6 +12,8 @@ import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import optifine.CustomColors;
|
import optifine.CustomColors;
|
||||||
import optifine.RenderEnv;
|
import optifine.RenderEnv;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.modules.impl.fpssettings.OptimizerMod;
|
||||||
|
|
||||||
public class BlockFluidRenderer
|
public class BlockFluidRenderer
|
||||||
{
|
{
|
||||||
|
@ -35,6 +37,12 @@ public class BlockFluidRenderer
|
||||||
|
|
||||||
public boolean renderFluid(IBlockAccess blockAccess, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn)
|
public boolean renderFluid(IBlockAccess blockAccess, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn)
|
||||||
{
|
{
|
||||||
|
OptimizerMod mod = (OptimizerMod) Athena.INSTANCE.getModuleManager().get(OptimizerMod.class);
|
||||||
|
|
||||||
|
if(mod.noLagClearWater) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
BlockLiquid blockliquid = (BlockLiquid)blockStateIn.getBlock();
|
BlockLiquid blockliquid = (BlockLiquid)blockStateIn.getBlock();
|
||||||
blockliquid.setBlockBoundsBasedOnState(blockAccess, blockPosIn);
|
blockliquid.setBlockBoundsBasedOnState(blockAccess, blockPosIn);
|
||||||
TextureAtlasSprite[] atextureatlassprite = blockliquid.getMaterial() == Material.lava ? this.atlasSpritesLava : this.atlasSpritesWater;
|
TextureAtlasSprite[] atextureatlassprite = blockliquid.getMaterial() == Material.lava ? this.atlasSpritesLava : this.atlasSpritesWater;
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package net.minecraft.client.renderer;
|
package net.minecraft.client.renderer;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockReed;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.resources.IResourceManager;
|
import net.minecraft.client.resources.IResourceManager;
|
||||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||||
|
@ -19,6 +21,8 @@ import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.WorldType;
|
import net.minecraft.world.WorldType;
|
||||||
import optifine.Config;
|
import optifine.Config;
|
||||||
import optifine.Reflector;
|
import optifine.Reflector;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.modules.impl.fpssettings.OptimizerMod;
|
||||||
import shadersmod.client.SVertexBuilder;
|
import shadersmod.client.SVertexBuilder;
|
||||||
|
|
||||||
public class BlockRendererDispatcher implements IResourceManagerReloadListener
|
public class BlockRendererDispatcher implements IResourceManagerReloadListener
|
||||||
|
@ -109,6 +113,14 @@ public class BlockRendererDispatcher implements IResourceManagerReloadListener
|
||||||
case 3:
|
case 3:
|
||||||
IBakedModel ibakedmodel = this.getModelFromBlockState(state, blockAccess, pos);
|
IBakedModel ibakedmodel = this.getModelFromBlockState(state, blockAccess, pos);
|
||||||
|
|
||||||
|
OptimizerMod mod = (OptimizerMod) Athena.INSTANCE.getModuleManager().get(OptimizerMod.class);
|
||||||
|
|
||||||
|
if(state.getBlock() instanceof BlockReed && mod.noLagCane) {
|
||||||
|
if(Math.sqrt(Minecraft.getMinecraft().thePlayer.getPosition().distanceSq(pos.getX(),pos.getY(),pos.getZ())) >= 16) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Config.isShaders())
|
if (Config.isShaders())
|
||||||
{
|
{
|
||||||
SVertexBuilder.pushEntity(state, pos, blockAccess, worldRendererIn);
|
SVertexBuilder.pushEntity(state, pos, blockAccess, worldRendererIn);
|
||||||
|
|
|
@ -22,8 +22,6 @@ import net.minecraft.client.gui.MapItemRenderer;
|
||||||
import net.minecraft.client.gui.ScaledResolution;
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
import net.minecraft.client.multiplayer.WorldClient;
|
import net.minecraft.client.multiplayer.WorldClient;
|
||||||
import net.minecraft.client.particle.EffectRenderer;
|
import net.minecraft.client.particle.EffectRenderer;
|
||||||
import net.minecraft.client.renderer.EntityRenderer1;
|
|
||||||
import net.minecraft.client.renderer.EntityRenderer2;
|
|
||||||
import net.minecraft.client.renderer.culling.ClippingHelperImpl;
|
import net.minecraft.client.renderer.culling.ClippingHelperImpl;
|
||||||
import net.minecraft.client.renderer.culling.Frustum;
|
import net.minecraft.client.renderer.culling.Frustum;
|
||||||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||||
|
@ -87,7 +85,12 @@ import org.lwjgl.opengl.GLContext;
|
||||||
import org.lwjgl.util.glu.GLU;
|
import org.lwjgl.util.glu.GLU;
|
||||||
import org.lwjgl.util.glu.Project;
|
import org.lwjgl.util.glu.Project;
|
||||||
import rip.athena.client.Athena;
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.events.types.render.RenderEvent;
|
||||||
|
import rip.athena.client.events.types.render.RenderType;
|
||||||
|
import rip.athena.client.modules.impl.mods.NoHurtCam;
|
||||||
import rip.athena.client.modules.impl.mods.Zoom;
|
import rip.athena.client.modules.impl.mods.Zoom;
|
||||||
|
import rip.athena.client.modules.impl.mods.Freelook;
|
||||||
|
import rip.athena.client.modules.impl.mods.OldAnimations;
|
||||||
import shadersmod.client.Shaders;
|
import shadersmod.client.Shaders;
|
||||||
import shadersmod.client.ShadersRender;
|
import shadersmod.client.ShadersRender;
|
||||||
|
|
||||||
|
@ -675,6 +678,9 @@ public class EntityRenderer implements IResourceManagerReloadListener
|
||||||
|
|
||||||
private void hurtCameraEffect(float partialTicks)
|
private void hurtCameraEffect(float partialTicks)
|
||||||
{
|
{
|
||||||
|
if(Athena.INSTANCE.getModuleManager().get(NoHurtCam.class).isToggled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.mc.getRenderViewEntity() instanceof EntityLivingBase)
|
if (this.mc.getRenderViewEntity() instanceof EntityLivingBase)
|
||||||
{
|
{
|
||||||
EntityLivingBase entitylivingbase = (EntityLivingBase)this.mc.getRenderViewEntity();
|
EntityLivingBase entitylivingbase = (EntityLivingBase)this.mc.getRenderViewEntity();
|
||||||
|
@ -773,6 +779,13 @@ public class EntityRenderer implements IResourceManagerReloadListener
|
||||||
f2 += 180.0F;
|
f2 += 180.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Freelook mod = (Freelook) Athena.INSTANCE.getModuleManager().get(Freelook.class);
|
||||||
|
|
||||||
|
if(mod.isToggled() && mod.perspectiveToggled) {
|
||||||
|
f1 = mod.getCameraYaw();
|
||||||
|
f2 = mod.getCameraPitch();
|
||||||
|
}
|
||||||
|
|
||||||
double d4 = (double)(-MathHelper.sin(f1 / 180.0F * (float)Math.PI) * MathHelper.cos(f2 / 180.0F * (float)Math.PI)) * d3;
|
double d4 = (double)(-MathHelper.sin(f1 / 180.0F * (float)Math.PI) * MathHelper.cos(f2 / 180.0F * (float)Math.PI)) * d3;
|
||||||
double d5 = (double)(MathHelper.cos(f1 / 180.0F * (float)Math.PI) * MathHelper.cos(f2 / 180.0F * (float)Math.PI)) * d3;
|
double d5 = (double)(MathHelper.cos(f1 / 180.0F * (float)Math.PI) * MathHelper.cos(f2 / 180.0F * (float)Math.PI)) * d3;
|
||||||
double d6 = (double)(-MathHelper.sin(f2 / 180.0F * (float)Math.PI)) * d3;
|
double d6 = (double)(-MathHelper.sin(f2 / 180.0F * (float)Math.PI)) * d3;
|
||||||
|
@ -803,6 +816,13 @@ public class EntityRenderer implements IResourceManagerReloadListener
|
||||||
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
|
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mod.isToggled() || mod.perspectiveToggled) {
|
||||||
|
GlStateManager.rotate(mod.getCameraPitch() - f2, 1.0f, 0.0f, 0.0f);
|
||||||
|
GlStateManager.rotate(mod.getCameraYaw() - f1, 0.0f, 1.0f, 0.0f);
|
||||||
|
GlStateManager.translate(0.0f, 0.0f, (float) (-d3));
|
||||||
|
GlStateManager.rotate(f1 - mod.getCameraYaw(), 0.0f, 1.0f, 0.0f);
|
||||||
|
GlStateManager.rotate(f2 - mod.getCameraPitch(), 1.0f, 0.0f, 0.0f);
|
||||||
|
} else {
|
||||||
GlStateManager.rotate(entity.rotationPitch - f2, 1.0F, 0.0F, 0.0F);
|
GlStateManager.rotate(entity.rotationPitch - f2, 1.0F, 0.0F, 0.0F);
|
||||||
GlStateManager.rotate(entity.rotationYaw - f1, 0.0F, 1.0F, 0.0F);
|
GlStateManager.rotate(entity.rotationYaw - f1, 0.0F, 1.0F, 0.0F);
|
||||||
GlStateManager.translate(0.0F, 0.0F, (float)(-d3));
|
GlStateManager.translate(0.0F, 0.0F, (float)(-d3));
|
||||||
|
@ -810,12 +830,14 @@ public class EntityRenderer implements IResourceManagerReloadListener
|
||||||
GlStateManager.rotate(f2 - entity.rotationPitch, 1.0F, 0.0F, 0.0F);
|
GlStateManager.rotate(f2 - entity.rotationPitch, 1.0F, 0.0F, 0.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GlStateManager.translate(0.0F, 0.0F, -0.1F);
|
GlStateManager.translate(0.0F, 0.0F, -0.1F);
|
||||||
}
|
}
|
||||||
|
Freelook mod = (Freelook) Athena.INSTANCE.getModuleManager().get(Freelook.class);
|
||||||
|
|
||||||
if (Reflector.EntityViewRenderEvent_CameraSetup_Constructor.exists())
|
if (Reflector.EntityViewRenderEvent_CameraSetup_Constructor.exists() || (mod.isToggled() && mod.perspectiveToggled))
|
||||||
{
|
{
|
||||||
if (!this.mc.gameSettings.debugCamEnable)
|
if (!this.mc.gameSettings.debugCamEnable)
|
||||||
{
|
{
|
||||||
|
@ -978,6 +1000,12 @@ public class EntityRenderer implements IResourceManagerReloadListener
|
||||||
|
|
||||||
public void renderHand(float p_renderHand_1_, int p_renderHand_2_, boolean p_renderHand_3_, boolean p_renderHand_4_, boolean p_renderHand_5_)
|
public void renderHand(float p_renderHand_1_, int p_renderHand_2_, boolean p_renderHand_3_, boolean p_renderHand_4_, boolean p_renderHand_5_)
|
||||||
{
|
{
|
||||||
|
OldAnimations mod = (OldAnimations) Athena.INSTANCE.getModuleManager().get(OldAnimations.class);
|
||||||
|
|
||||||
|
if(Athena.INSTANCE.getModuleManager().get(OldAnimations.class).isToggled() && mod.OLD_EAT_USE_ANIMATION) {
|
||||||
|
mod.attemptSwing();
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.debugView)
|
if (!this.debugView)
|
||||||
{
|
{
|
||||||
GlStateManager.matrixMode(5889);
|
GlStateManager.matrixMode(5889);
|
||||||
|
@ -1285,35 +1313,36 @@ public class EntityRenderer implements IResourceManagerReloadListener
|
||||||
Mouse.setGrabbed(true);
|
Mouse.setGrabbed(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.mc.inGameHasFocus && flag)
|
Freelook mod = Athena.INSTANCE.getModuleManager() == null ? null : (Freelook) Athena.INSTANCE.getModuleManager().get(Freelook.class);
|
||||||
{
|
|
||||||
|
if(mod != null && mod.isToggled() && mod.perspectiveToggled) {
|
||||||
|
mod.overrideMouse();
|
||||||
|
} else {
|
||||||
|
if (this.mc.inGameHasFocus && flag) {
|
||||||
this.mc.mouseHelper.mouseXYChange();
|
this.mc.mouseHelper.mouseXYChange();
|
||||||
float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
|
float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
|
||||||
float f1 = f * f * f * 8.0F;
|
float f1 = f * f * f * 8.0F;
|
||||||
float f2 = (float)this.mc.mouseHelper.deltaX * f1;
|
float f2 = (float) this.mc.mouseHelper.deltaX * f1;
|
||||||
float f3 = (float)this.mc.mouseHelper.deltaY * f1;
|
float f3 = (float) this.mc.mouseHelper.deltaY * f1;
|
||||||
byte b0 = 1;
|
byte b0 = 1;
|
||||||
|
|
||||||
if (this.mc.gameSettings.invertMouse)
|
if (this.mc.gameSettings.invertMouse) {
|
||||||
{
|
|
||||||
b0 = -1;
|
b0 = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.mc.gameSettings.smoothCamera)
|
if (this.mc.gameSettings.smoothCamera) {
|
||||||
{
|
|
||||||
this.smoothCamYaw += f2;
|
this.smoothCamYaw += f2;
|
||||||
this.smoothCamPitch += f3;
|
this.smoothCamPitch += f3;
|
||||||
float f4 = p_181560_1_ - this.smoothCamPartialTicks;
|
float f4 = p_181560_1_ - this.smoothCamPartialTicks;
|
||||||
this.smoothCamPartialTicks = p_181560_1_;
|
this.smoothCamPartialTicks = p_181560_1_;
|
||||||
f2 = this.smoothCamFilterX * f4;
|
f2 = this.smoothCamFilterX * f4;
|
||||||
f3 = this.smoothCamFilterY * f4;
|
f3 = this.smoothCamFilterY * f4;
|
||||||
this.mc.thePlayer.setAngles(f2, f3 * (float)b0);
|
this.mc.thePlayer.setAngles(f2, f3 * (float) b0);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
this.smoothCamYaw = 0.0F;
|
this.smoothCamYaw = 0.0F;
|
||||||
this.smoothCamPitch = 0.0F;
|
this.smoothCamPitch = 0.0F;
|
||||||
this.mc.thePlayer.setAngles(f2, f3 * (float)b0);
|
this.mc.thePlayer.setAngles(f2, f3 * (float) b0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1889,6 +1918,12 @@ public class EntityRenderer implements IResourceManagerReloadListener
|
||||||
Reflector.callVoid(Reflector.ForgeHooksClient_dispatchRenderLast, new Object[] {renderglobal, Float.valueOf(partialTicks)});
|
Reflector.callVoid(Reflector.ForgeHooksClient_dispatchRenderLast, new Object[] {renderglobal, Float.valueOf(partialTicks)});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!Athena.INSTANCE.getEventBus().post(new RenderEvent(RenderType.WORLD, partialTicks))) {
|
||||||
|
Shaders.endRender();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.mc.mcProfiler.endStartSection("hand");
|
this.mc.mcProfiler.endStartSection("hand");
|
||||||
boolean flag2 = ReflectorForge.renderFirstPersonHand(this.mc.renderGlobal, partialTicks, pass);
|
boolean flag2 = ReflectorForge.renderFirstPersonHand(this.mc.renderGlobal, partialTicks, pass);
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@ import optifine.DynamicLights;
|
||||||
import optifine.Reflector;
|
import optifine.Reflector;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.modules.impl.mods.OldAnimations;
|
||||||
import shadersmod.client.Shaders;
|
import shadersmod.client.Shaders;
|
||||||
|
|
||||||
public class ItemRenderer
|
public class ItemRenderer
|
||||||
|
@ -346,6 +348,7 @@ public class ItemRenderer
|
||||||
else if (entityplayersp.getItemInUseCount() > 0)
|
else if (entityplayersp.getItemInUseCount() > 0)
|
||||||
{
|
{
|
||||||
EnumAction enumaction = this.itemToRender.getItemUseAction();
|
EnumAction enumaction = this.itemToRender.getItemUseAction();
|
||||||
|
OldAnimations mod = (OldAnimations) Athena.INSTANCE.getModuleManager().get(OldAnimations.class);
|
||||||
|
|
||||||
switch (ItemRenderer.ItemRenderer$1.field_178094_a[enumaction.ordinal()])
|
switch (ItemRenderer.ItemRenderer$1.field_178094_a[enumaction.ordinal()])
|
||||||
{
|
{
|
||||||
|
@ -355,20 +358,38 @@ public class ItemRenderer
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
|
if(Athena.INSTANCE.getModuleManager().get(OldAnimations.class).isToggled()) {
|
||||||
|
this.func_178104_a(entityplayersp, partialTicks);
|
||||||
|
this.transformFirstPersonItem(f,f1);
|
||||||
|
} else {
|
||||||
this.func_178104_a(entityplayersp, partialTicks);
|
this.func_178104_a(entityplayersp, partialTicks);
|
||||||
this.transformFirstPersonItem(f, 0.0F);
|
this.transformFirstPersonItem(f, 0.0F);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
|
if(Athena.INSTANCE.getModuleManager().get(OldAnimations.class).isToggled() && mod.OLD_BLOCKING_HITTING) {
|
||||||
|
transformFirstPersonItem(f, f1);
|
||||||
|
this.func_178103_d();
|
||||||
|
GlStateManager.scale(0.83f, 0.88f, 0.85f);
|
||||||
|
GlStateManager.translate(-0.3f, 0.1f, 0.0f);
|
||||||
|
} else {
|
||||||
this.transformFirstPersonItem(f, 0.0F);
|
this.transformFirstPersonItem(f, 0.0F);
|
||||||
this.func_178103_d();
|
this.func_178103_d();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
|
if(Athena.INSTANCE.getModuleManager().get(OldAnimations.class).isToggled() && mod.OLD_BOW) {
|
||||||
|
this.transformFirstPersonItem(f, f1);
|
||||||
|
this.func_178098_a(partialTicks, entityplayersp);
|
||||||
|
GlStateManager.translate(0.0F, 0.1F, -0.15F);
|
||||||
|
} else {
|
||||||
this.transformFirstPersonItem(f, 0.0F);
|
this.transformFirstPersonItem(f, 0.0F);
|
||||||
this.func_178098_a(partialTicks, entityplayersp);
|
this.func_178098_a(partialTicks, entityplayersp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.func_178105_d(f1);
|
this.func_178105_d(f1);
|
||||||
|
|
|
@ -62,6 +62,7 @@ import net.minecraft.crash.CrashReport;
|
||||||
import net.minecraft.crash.CrashReportCategory;
|
import net.minecraft.crash.CrashReportCategory;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.item.EntityEnderPearl;
|
||||||
import net.minecraft.entity.item.EntityItemFrame;
|
import net.minecraft.entity.item.EntityItemFrame;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.projectile.EntityWitherSkull;
|
import net.minecraft.entity.projectile.EntityWitherSkull;
|
||||||
|
@ -107,6 +108,9 @@ import org.lwjgl.input.Keyboard;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import org.lwjgl.util.vector.Vector3f;
|
import org.lwjgl.util.vector.Vector3f;
|
||||||
import org.lwjgl.util.vector.Vector4f;
|
import org.lwjgl.util.vector.Vector4f;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.gui.clickgui.pages.SettingsPage;
|
||||||
|
import rip.athena.client.modules.impl.fpssettings.OptimizerMod;
|
||||||
import shadersmod.client.Shaders;
|
import shadersmod.client.Shaders;
|
||||||
import shadersmod.client.ShadersRender;
|
import shadersmod.client.ShadersRender;
|
||||||
import shadersmod.client.ShadowUtils;
|
import shadersmod.client.ShadowUtils;
|
||||||
|
@ -762,39 +766,48 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
||||||
Entity entity2;
|
Entity entity2;
|
||||||
boolean flag5;
|
boolean flag5;
|
||||||
|
|
||||||
while (true)
|
while (true) {
|
||||||
{
|
if (!iterator.hasNext()) {
|
||||||
if (!iterator.hasNext())
|
|
||||||
{
|
|
||||||
continue label920;
|
continue label920;
|
||||||
}
|
}
|
||||||
|
|
||||||
entity2 = (Entity)iterator.next();
|
entity2 = (Entity) iterator.next();
|
||||||
|
|
||||||
if (!flag || Reflector.callBoolean(entity2, Reflector.ForgeEntity_shouldRenderInPass, new Object[] {Integer.valueOf(i)}))
|
if (SettingsPage.ENTITIES.contains(entity2.getClass())) {
|
||||||
{
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
OptimizerMod mod = (OptimizerMod) Athena.INSTANCE.getModuleManager().get(OptimizerMod.class);
|
||||||
|
|
||||||
|
boolean newRenderE = false;
|
||||||
|
int entDist = mod.noLagEntityDistance;
|
||||||
|
|
||||||
|
if (entDist != 64)
|
||||||
|
newRenderE = true;
|
||||||
|
|
||||||
|
boolean doIt = (newRenderE && entity2.getDistanceToEntity(mc.thePlayer) <= entDist);
|
||||||
|
doIt = (entity2 instanceof EntityPlayer) || (entity2 instanceof EntityEnderPearl) || doIt;
|
||||||
|
|
||||||
|
if (!newRenderE || doIt) {
|
||||||
|
if (!flag || Reflector.callBoolean(entity2, Reflector.ForgeEntity_shouldRenderInPass, new Object[]{Integer.valueOf(i)})) {
|
||||||
flag5 = this.renderManager.shouldRender(entity2, camera, d0, d1, d2) || entity2.riddenByEntity == this.mc.thePlayer;
|
flag5 = this.renderManager.shouldRender(entity2, camera, d0, d1, d2) || entity2.riddenByEntity == this.mc.thePlayer;
|
||||||
|
|
||||||
if (!flag5)
|
if (!flag5) {
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean flag6 = this.mc.getRenderViewEntity() instanceof EntityLivingBase ? ((EntityLivingBase)this.mc.getRenderViewEntity()).isPlayerSleeping() : false;
|
boolean flag6 = this.mc.getRenderViewEntity() instanceof EntityLivingBase ? ((EntityLivingBase) this.mc.getRenderViewEntity()).isPlayerSleeping() : false;
|
||||||
|
|
||||||
if ((entity2 != this.mc.getRenderViewEntity() || this.mc.gameSettings.thirdPersonView != 0 || flag6) && (entity2.posY < 0.0D || entity2.posY >= 256.0D || this.theWorld.isBlockLoaded(new BlockPos(entity2))))
|
if ((entity2 != this.mc.getRenderViewEntity() || this.mc.gameSettings.thirdPersonView != 0 || flag6) && (entity2.posY < 0.0D || entity2.posY >= 256.0D || this.theWorld.isBlockLoaded(new BlockPos(entity2)))) {
|
||||||
{
|
|
||||||
++this.countEntitiesRendered;
|
++this.countEntitiesRendered;
|
||||||
|
|
||||||
if (entity2.getClass() == EntityItemFrame.class)
|
if (entity2.getClass() == EntityItemFrame.class) {
|
||||||
{
|
|
||||||
entity2.renderDistanceWeight = 0.06D;
|
entity2.renderDistanceWeight = 0.06D;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.renderedEntity = entity2;
|
this.renderedEntity = entity2;
|
||||||
|
|
||||||
if (flag7)
|
if (flag7) {
|
||||||
{
|
|
||||||
Shaders.nextEntity(entity2);
|
Shaders.nextEntity(entity2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -804,6 +817,7 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!flag5 && entity2 instanceof EntityWitherSkull)
|
if (!flag5 && entity2 instanceof EntityWitherSkull)
|
||||||
{
|
{
|
||||||
|
@ -894,8 +908,18 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
||||||
Shaders.nextBlockEntity(tileentity);
|
Shaders.nextBlockEntity(tileentity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OptimizerMod mod = (OptimizerMod) Athena.INSTANCE.getModuleManager().get(OptimizerMod.class);
|
||||||
|
|
||||||
|
int dist = mod.noLagBlockDistance;
|
||||||
|
boolean rdy = dist != 64;
|
||||||
|
|
||||||
|
if(!rdy || (rdy && Minecraft.getMinecraft().thePlayer != null && Math.sqrt(tileentity.getDistanceSq(Minecraft.getMinecraft().thePlayer.posX, Minecraft.getMinecraft().thePlayer.posY, Minecraft.getMinecraft().thePlayer.posZ)) <= dist)) {
|
||||||
TileEntityRendererDispatcher.instance.renderTileEntity(tileentity, partialTicks, -1);
|
TileEntityRendererDispatcher.instance.renderTileEntity(tileentity, partialTicks, -1);
|
||||||
++this.countTileEntitiesRendered;
|
++this.countTileEntitiesRendered;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*TileEntityRendererDispatcher.instance.renderTileEntity(tileentity, partialTicks, -1);
|
||||||
|
++this.countTileEntitiesRendered;*/
|
||||||
fontrenderer.enabled = true;
|
fontrenderer.enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,8 @@ import net.minecraft.util.EnumWorldBlockLayer;
|
||||||
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.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.modules.impl.fpssettings.OptimizerMod;
|
||||||
|
|
||||||
public class ChunkRenderDispatcher
|
public class ChunkRenderDispatcher
|
||||||
{
|
{
|
||||||
|
@ -190,6 +192,17 @@ public class ChunkRenderDispatcher
|
||||||
|
|
||||||
public ChunkCompileTaskGenerator getNextChunkUpdate() throws InterruptedException
|
public ChunkCompileTaskGenerator getNextChunkUpdate() throws InterruptedException
|
||||||
{
|
{
|
||||||
|
OptimizerMod mod = (OptimizerMod) Athena.INSTANCE.getModuleManager().get(OptimizerMod.class);
|
||||||
|
|
||||||
|
if (mod.CHUNK_UPDATE_LIMITE_ENABLED) {
|
||||||
|
int limiter = mod.CHUNK_UPDATE_LIMITER;
|
||||||
|
if (limiter > 0) {
|
||||||
|
while (RenderChunk.renderChunksUpdated > limiter) {
|
||||||
|
Thread.sleep(50L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (ChunkCompileTaskGenerator)this.queueChunkUpdates.take();
|
return (ChunkCompileTaskGenerator)this.queueChunkUpdates.take();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@ import java.util.Set;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import optifine.IntegerCache;
|
import optifine.IntegerCache;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.modules.impl.fpssettings.OptimizerMod;
|
||||||
|
|
||||||
public class VisGraph
|
public class VisGraph
|
||||||
{
|
{
|
||||||
|
@ -78,6 +80,14 @@ public class VisGraph
|
||||||
int i = ((Integer)arraydeque.poll()).intValue();
|
int i = ((Integer)arraydeque.poll()).intValue();
|
||||||
this.func_178610_a(i, enumset);
|
this.func_178610_a(i, enumset);
|
||||||
|
|
||||||
|
OptimizerMod mod = (OptimizerMod) Athena.INSTANCE.getModuleManager().get(OptimizerMod.class);
|
||||||
|
|
||||||
|
if(mod.CULLING_FIX) {
|
||||||
|
if(p_178604_1_ < enumset.size()) {
|
||||||
|
return enumset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (EnumFacing enumfacing : EnumFacing.VALUES)
|
for (EnumFacing enumfacing : EnumFacing.VALUES)
|
||||||
{
|
{
|
||||||
int j = this.func_178603_a(i, enumfacing);
|
int j = this.func_178603_a(i, enumfacing);
|
||||||
|
|
|
@ -2,7 +2,9 @@ package net.minecraft.client.renderer.entity;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.WorldRenderer;
|
||||||
|
@ -21,6 +23,7 @@ import net.minecraft.world.World;
|
||||||
import optifine.Config;
|
import optifine.Config;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import rip.athena.client.socket.SocketClient;
|
||||||
import shadersmod.client.Shaders;
|
import shadersmod.client.Shaders;
|
||||||
|
|
||||||
public abstract class Render<T extends Entity>
|
public abstract class Render<T extends Entity>
|
||||||
|
@ -363,6 +366,12 @@ public abstract class Render<T extends Entity>
|
||||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||||
byte b0 = 0;
|
byte b0 = 0;
|
||||||
|
|
||||||
|
if(entityIn instanceof AbstractClientPlayer) {
|
||||||
|
if (SocketClient.isUser(((AbstractClientPlayer) entityIn).getGameProfile().getName()) && entityIn.ticksExisted > 10) {
|
||||||
|
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("Athena/logo/Athena.png"));
|
||||||
|
Gui.drawModalRectWithCustomSizedTexture(-fontrenderer.getStringWidth(entityIn.getDisplayName().getFormattedText()) / 2 - 12, (int) -1.5, 10, 10, 10, 10, 10, 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (str.equals("deadmau5"))
|
if (str.equals("deadmau5"))
|
||||||
{
|
{
|
||||||
b0 = -10;
|
b0 = -10;
|
||||||
|
|
|
@ -10,6 +10,8 @@ import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.modules.impl.fpssettings.OptimizerMod;
|
||||||
|
|
||||||
public class RenderEntityItem extends Render<EntityItem>
|
public class RenderEntityItem extends Render<EntityItem>
|
||||||
{
|
{
|
||||||
|
@ -42,19 +44,21 @@ public class RenderEntityItem extends Render<EntityItem>
|
||||||
float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y;
|
float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y;
|
||||||
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_);
|
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_);
|
||||||
|
|
||||||
if (flag || this.renderManager.options != null)
|
OptimizerMod mod = (OptimizerMod) Athena.INSTANCE.getModuleManager().get(OptimizerMod.class);
|
||||||
{
|
|
||||||
float f3 = (((float)itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float)Math.PI);
|
if(!mod.STATIC_DROPS) {
|
||||||
|
if (flag || this.renderManager.options != null) {
|
||||||
|
float f3 = (((float) itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float) Math.PI);
|
||||||
GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F);
|
GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!flag)
|
if (!flag) {
|
||||||
{
|
float f6 = -0.0F * (float) (i - 1) * 0.5F;
|
||||||
float f6 = -0.0F * (float)(i - 1) * 0.5F;
|
float f4 = -0.0F * (float) (i - 1) * 0.5F;
|
||||||
float f4 = -0.0F * (float)(i - 1) * 0.5F;
|
float f5 = -0.046875F * (float) (i - 1) * 0.5F;
|
||||||
float f5 = -0.046875F * (float)(i - 1) * 0.5F;
|
|
||||||
GlStateManager.translate(f6, f4, f5);
|
GlStateManager.translate(f6, f4, f5);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
return i;
|
return i;
|
||||||
|
|
|
@ -103,6 +103,8 @@ import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import optifine.PlayerItemsLayer;
|
import optifine.PlayerItemsLayer;
|
||||||
import optifine.Reflector;
|
import optifine.Reflector;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.modules.impl.mods.Freelook;
|
||||||
|
|
||||||
public class RenderManager
|
public class RenderManager
|
||||||
{
|
{
|
||||||
|
@ -117,9 +119,9 @@ public class RenderManager
|
||||||
|
|
||||||
/** Renders fonts */
|
/** Renders fonts */
|
||||||
private FontRenderer textRenderer;
|
private FontRenderer textRenderer;
|
||||||
private double renderPosX;
|
public double renderPosX;
|
||||||
private double renderPosY;
|
public double renderPosY;
|
||||||
private double renderPosZ;
|
public double renderPosZ;
|
||||||
public TextureManager renderEngine;
|
public TextureManager renderEngine;
|
||||||
|
|
||||||
/** Reference to the World object. */
|
/** Reference to the World object. */
|
||||||
|
@ -288,6 +290,13 @@ public class RenderManager
|
||||||
this.playerViewY += 180.0F;
|
this.playerViewY += 180.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Freelook mod = (Freelook) Athena.INSTANCE.getModuleManager().get(Freelook.class);
|
||||||
|
|
||||||
|
if (mod.isToggled() && mod.perspectiveToggled) {
|
||||||
|
this.playerViewY = mod.getCameraYaw();
|
||||||
|
this.playerViewX = mod.getCameraPitch();
|
||||||
|
}
|
||||||
|
|
||||||
this.viewerPosX = livingPlayerIn.lastTickPosX + (livingPlayerIn.posX - livingPlayerIn.lastTickPosX) * (double)partialTicks;
|
this.viewerPosX = livingPlayerIn.lastTickPosX + (livingPlayerIn.posX - livingPlayerIn.lastTickPosX) * (double)partialTicks;
|
||||||
this.viewerPosY = livingPlayerIn.lastTickPosY + (livingPlayerIn.posY - livingPlayerIn.lastTickPosY) * (double)partialTicks;
|
this.viewerPosY = livingPlayerIn.lastTickPosY + (livingPlayerIn.posY - livingPlayerIn.lastTickPosY) * (double)partialTicks;
|
||||||
this.viewerPosZ = livingPlayerIn.lastTickPosZ + (livingPlayerIn.posZ - livingPlayerIn.lastTickPosZ) * (double)partialTicks;
|
this.viewerPosZ = livingPlayerIn.lastTickPosZ + (livingPlayerIn.posZ - livingPlayerIn.lastTickPosZ) * (double)partialTicks;
|
||||||
|
|
|
@ -29,6 +29,10 @@ import optifine.Reflector;
|
||||||
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.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.events.types.render.RenderEntityEvent;
|
||||||
|
import rip.athena.client.modules.impl.other.Settings;
|
||||||
|
import rip.athena.client.modules.impl.render.CustomHitColor;
|
||||||
import shadersmod.client.Shaders;
|
import shadersmod.client.Shaders;
|
||||||
|
|
||||||
public abstract class RendererLivingEntity<T extends EntityLivingBase> extends Render<T>
|
public abstract class RendererLivingEntity<T extends EntityLivingBase> extends Render<T>
|
||||||
|
@ -99,6 +103,10 @@ public abstract class RendererLivingEntity<T extends EntityLivingBase> extends R
|
||||||
*/
|
*/
|
||||||
public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks)
|
public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks)
|
||||||
{
|
{
|
||||||
|
if(!Athena.INSTANCE.getEventBus().post(new RenderEntityEvent(entity, this, x, y, z))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!Reflector.RenderLivingEvent_Pre_Constructor.exists() || !Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Pre_Constructor, new Object[] {entity, this, Double.valueOf(x), Double.valueOf(y), Double.valueOf(z)}))
|
if (!Reflector.RenderLivingEvent_Pre_Constructor.exists() || !Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Pre_Constructor, new Object[] {entity, this, Double.valueOf(x), Double.valueOf(y), Double.valueOf(z)}))
|
||||||
{
|
{
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
@ -350,13 +358,21 @@ public abstract class RendererLivingEntity<T extends EntityLivingBase> extends R
|
||||||
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_ALPHA, GL11.GL_SRC_ALPHA);
|
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_ALPHA, GL11.GL_SRC_ALPHA);
|
||||||
this.brightnessBuffer.position(0);
|
this.brightnessBuffer.position(0);
|
||||||
|
|
||||||
if (flag1)
|
if (flag1) {
|
||||||
{
|
|
||||||
|
CustomHitColor mod = (CustomHitColor) Athena.INSTANCE.getModuleManager().get(CustomHitColor.class);
|
||||||
|
|
||||||
|
if(Athena.INSTANCE.getModuleManager().get(CustomHitColor.class).isToggled()) {
|
||||||
|
this.brightnessBuffer.put(mod.color.getRed() / 255F);
|
||||||
|
this.brightnessBuffer.put(mod.color.getGreen() / 255F);
|
||||||
|
this.brightnessBuffer.put(mod.color.getBlue() / 255F);
|
||||||
|
this.brightnessBuffer.put(mod.color.getAlpha() / 255F);
|
||||||
|
} else {
|
||||||
this.brightnessBuffer.put(1.0F);
|
this.brightnessBuffer.put(1.0F);
|
||||||
this.brightnessBuffer.put(0.0F);
|
this.brightnessBuffer.put(0.0F);
|
||||||
this.brightnessBuffer.put(0.0F);
|
this.brightnessBuffer.put(0.0F);
|
||||||
this.brightnessBuffer.put(0.3F);
|
this.brightnessBuffer.put(0.3F);
|
||||||
|
}
|
||||||
if (Config.isShaders())
|
if (Config.isShaders())
|
||||||
{
|
{
|
||||||
Shaders.setEntityColor(1.0F, 0.0F, 0.0F, 0.3F);
|
Shaders.setEntityColor(1.0F, 0.0F, 0.0F, 0.3F);
|
||||||
|
@ -535,7 +551,9 @@ public abstract class RendererLivingEntity<T extends EntityLivingBase> extends R
|
||||||
{
|
{
|
||||||
if (!Reflector.RenderLivingEvent_Specials_Pre_Constructor.exists() || !Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Specials_Pre_Constructor, new Object[] {entity, this, Double.valueOf(x), Double.valueOf(y), Double.valueOf(z)}))
|
if (!Reflector.RenderLivingEvent_Specials_Pre_Constructor.exists() || !Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Specials_Pre_Constructor, new Object[] {entity, this, Double.valueOf(x), Double.valueOf(y), Double.valueOf(z)}))
|
||||||
{
|
{
|
||||||
if (this.canRenderName(entity))
|
Settings settings = (Settings) Athena.INSTANCE.getModuleManager().get(Settings.class);
|
||||||
|
|
||||||
|
if (this.canRenderName(entity) || settings.F5Nametags && entity instanceof EntityPlayer && entity == Minecraft.getMinecraft().thePlayer)
|
||||||
{
|
{
|
||||||
double d0 = entity.getDistanceSqToEntity(this.renderManager.livingPlayer);
|
double d0 = entity.getDistanceSqToEntity(this.renderManager.livingPlayer);
|
||||||
float f = entity.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE;
|
float f = entity.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE;
|
||||||
|
|
|
@ -12,6 +12,8 @@ import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.modules.impl.mods.OldAnimations;
|
||||||
|
|
||||||
public class LayerHeldItem implements LayerRenderer<EntityLivingBase>
|
public class LayerHeldItem implements LayerRenderer<EntityLivingBase>
|
||||||
{
|
{
|
||||||
|
@ -38,8 +40,52 @@ public class LayerHeldItem implements LayerRenderer<EntityLivingBase>
|
||||||
GlStateManager.scale(f, f, f);
|
GlStateManager.scale(f, f, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
((ModelBiped)this.livingEntityRenderer.getMainModel()).postRenderArm(0.0625F);
|
//((ModelBiped)this.livingEntityRenderer.getMainModel()).postRenderArm(0.0625F);
|
||||||
GlStateManager.translate(-0.0625F, 0.4375F, 0.0625F);
|
//GlStateManager.translate(-0.0625F, 0.4375F, 0.0625F);
|
||||||
|
|
||||||
|
OldAnimations mod = (OldAnimations) Athena.INSTANCE.getModuleManager().get(OldAnimations.class);
|
||||||
|
|
||||||
|
Label_0327:
|
||||||
|
if (entitylivingbaseIn instanceof EntityPlayer) {
|
||||||
|
if (Athena.INSTANCE.getModuleManager().get(OldAnimations.class).isToggled() && mod.OLD_BLOCKING) {
|
||||||
|
if (((EntityPlayer) entitylivingbaseIn).isBlocking()) {
|
||||||
|
if (entitylivingbaseIn.isSneaking()) {
|
||||||
|
((ModelBiped) livingEntityRenderer.getMainModel()).postRenderArm(0.0325f);
|
||||||
|
GlStateManager.scale(1.05f, 1.05f, 1.05f);
|
||||||
|
GlStateManager.translate(-0.58f, 0.32f, -0.07f);
|
||||||
|
GlStateManager
|
||||||
|
.rotate(-24405.0f, 137290.0f, -2009900.0f, -2654900.0f);
|
||||||
|
} else {
|
||||||
|
((ModelBiped) livingEntityRenderer.getMainModel()).postRenderArm(0.0325f);
|
||||||
|
GlStateManager.scale(1.05f, 1.05f, 1.05f);
|
||||||
|
GlStateManager.translate(-0.45f, 0.25f, -0.07f);
|
||||||
|
GlStateManager
|
||||||
|
.rotate(-24405.0f, 137290.0f, -2009900.0f, -2654900.0f);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
((ModelBiped) livingEntityRenderer.getMainModel())
|
||||||
|
.postRenderArm(0.0625f);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
((ModelBiped) livingEntityRenderer.getMainModel()).postRenderArm(0.0625f);
|
||||||
|
}
|
||||||
|
if (Athena.INSTANCE.getModuleManager().get(OldAnimations.class).isToggled() && mod.OLD_ITEM_HELD) {
|
||||||
|
if (!((EntityPlayer) entitylivingbaseIn).isBlocking()) {
|
||||||
|
GlStateManager.translate(-0.0855f, 0.4775f, 0.1585f);
|
||||||
|
GlStateManager.rotate(-19.0f, 20.0f, 0.0f, -6.0f);
|
||||||
|
break Label_0327;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((EntityPlayer) entitylivingbaseIn).isBlocking()) {
|
||||||
|
GlStateManager.translate(-0.0625f, 0.4375f, 0.0625f);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
GlStateManager.translate(-0.0625f, 0.4375f, 0.0625f);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
((ModelBiped) livingEntityRenderer.getMainModel()).postRenderArm(0.0625f);
|
||||||
|
GlStateManager.translate(-0.0625f, 0.4375f, 0.0625f);
|
||||||
|
}
|
||||||
|
|
||||||
if (entitylivingbaseIn instanceof EntityPlayer && ((EntityPlayer)entitylivingbaseIn).fishEntity != null)
|
if (entitylivingbaseIn instanceof EntityPlayer && ((EntityPlayer)entitylivingbaseIn).fishEntity != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -235,6 +235,7 @@ public abstract class Entity implements ICommandSender
|
||||||
private final CommandResultStats cmdResultStats;
|
private final CommandResultStats cmdResultStats;
|
||||||
|
|
||||||
private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities;
|
private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities;
|
||||||
|
public boolean isMobSpawner;
|
||||||
|
|
||||||
public int getEntityId()
|
public int getEntityId()
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,6 +12,7 @@ import java.util.UUID;
|
||||||
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.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
import net.minecraft.enchantment.EnchantmentHelper;
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||||
import net.minecraft.entity.ai.attributes.BaseAttributeMap;
|
import net.minecraft.entity.ai.attributes.BaseAttributeMap;
|
||||||
|
@ -50,6 +51,8 @@ import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldServer;
|
import net.minecraft.world.WorldServer;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.modules.impl.mods.MouseDelayFix;
|
||||||
|
|
||||||
public abstract class EntityLivingBase extends Entity
|
public abstract class EntityLivingBase extends Entity
|
||||||
{
|
{
|
||||||
|
@ -2157,14 +2160,24 @@ public abstract class EntityLivingBase extends Entity
|
||||||
/**
|
/**
|
||||||
* interpolated look vector
|
* interpolated look vector
|
||||||
*/
|
*/
|
||||||
public Vec3 getLook(float partialTicks)
|
public Vec3 getLook(float partialTicks) {
|
||||||
{
|
/*if (partialTicks == 1.0F) {
|
||||||
if (partialTicks == 1.0F)
|
|
||||||
{
|
|
||||||
return this.getVectorForRotation(this.rotationPitch, this.rotationYawHead);
|
return this.getVectorForRotation(this.rotationPitch, this.rotationYawHead);
|
||||||
|
} else {*/
|
||||||
|
if (Athena.INSTANCE.getModuleManager().get(MouseDelayFix.class).isToggled()) {
|
||||||
|
if (this instanceof EntityPlayerSP) {
|
||||||
|
return super.getLook(partialTicks);
|
||||||
|
} else {
|
||||||
|
if (partialTicks == 1.0F) {
|
||||||
|
return this.getVectorForRotation(this.rotationPitch, this.rotationYawHead);
|
||||||
|
} else {
|
||||||
|
float f = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * partialTicks;
|
||||||
|
float f1 = this.prevRotationYawHead
|
||||||
|
+ (this.rotationYawHead - this.prevRotationYawHead) * partialTicks;
|
||||||
|
return this.getVectorForRotation(f, f1);
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
} else {
|
||||||
float f = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * partialTicks;
|
float f = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * partialTicks;
|
||||||
float f1 = this.prevRotationYawHead + (this.rotationYawHead - this.prevRotationYawHead) * partialTicks;
|
float f1 = this.prevRotationYawHead + (this.rotationYawHead - this.prevRotationYawHead) * partialTicks;
|
||||||
return this.getVectorForRotation(f, f1);
|
return this.getVectorForRotation(f, f1);
|
||||||
|
|
|
@ -345,6 +345,7 @@ public abstract class MobSpawnerBaseLogic
|
||||||
if (entity != null)
|
if (entity != null)
|
||||||
{
|
{
|
||||||
entity = this.spawnNewEntity(entity, false);
|
entity = this.spawnNewEntity(entity, false);
|
||||||
|
entity.isMobSpawner = true;
|
||||||
this.cachedEntity = entity;
|
this.cachedEntity = entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,19 @@ package rip.athena.client;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import org.lwjgl.Sys;
|
||||||
|
import org.lwjgl.opengl.Display;
|
||||||
import rip.athena.client.events.EventBus;
|
import rip.athena.client.events.EventBus;
|
||||||
|
import rip.athena.client.events.SubscribeEvent;
|
||||||
|
import rip.athena.client.events.types.client.ClientTickEvent;
|
||||||
import rip.athena.client.gui.hud.HUDManager;
|
import rip.athena.client.gui.hud.HUDManager;
|
||||||
|
import rip.athena.client.macros.MacroManager;
|
||||||
import rip.athena.client.modules.ModuleManager;
|
import rip.athena.client.modules.ModuleManager;
|
||||||
|
import rip.athena.client.socket.SocketClient;
|
||||||
import rip.athena.client.utils.PrefixedLogger;
|
import rip.athena.client.utils.PrefixedLogger;
|
||||||
import rip.athena.client.utils.input.KeybindManager;
|
import rip.athena.client.utils.input.KeybindManager;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
|
@ -52,9 +59,12 @@ public class Athena {
|
||||||
private final String clientBuild = "230601";
|
private final String clientBuild = "230601";
|
||||||
|
|
||||||
private ModuleManager moduleManager;
|
private ModuleManager moduleManager;
|
||||||
|
private MacroManager macroManager;
|
||||||
private HUDManager hudManager;
|
private HUDManager hudManager;
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
|
|
||||||
|
public static boolean hasSent = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the client resources and setup.
|
* Initializes the client resources and setup.
|
||||||
* This method is responsible for any necessary initialization tasks,
|
* This method is responsible for any necessary initialization tasks,
|
||||||
|
@ -65,21 +75,62 @@ public class Athena {
|
||||||
if(!MAIN_DIR.exists()) {
|
if(!MAIN_DIR.exists()) {
|
||||||
MAIN_DIR.mkdir();
|
MAIN_DIR.mkdir();
|
||||||
}
|
}
|
||||||
|
if(SocketClient.isClientRunning()) {
|
||||||
|
JOptionPane.showMessageDialog(null, "If the client is currently running, please close it before proceeding. \nOtherwise, delete the 'client.lock' file in the '.minecraft/Athena' directory.");
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
this.moduleManager = new ModuleManager();
|
this.moduleManager = new ModuleManager();
|
||||||
|
this.macroManager = new MacroManager();
|
||||||
this.hudManager = new HUDManager();
|
this.hudManager = new HUDManager();
|
||||||
this.eventBus = new EventBus();
|
this.eventBus = new EventBus();
|
||||||
|
|
||||||
registerEvents();
|
registerEvents();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerEvents() {
|
public void registerEvents() {
|
||||||
eventBus.register(new KeybindManager());
|
eventBus.register(new KeybindManager());
|
||||||
|
eventBus.register(macroManager);
|
||||||
eventBus.register(hudManager);
|
eventBus.register(hudManager);
|
||||||
eventBus.register(this);
|
eventBus.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isGameRunningForeground = true;
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onTick(ClientTickEvent event) {
|
||||||
|
if (Minecraft.getMinecraft().thePlayer != null && Minecraft.getMinecraft().theWorld != null) {
|
||||||
|
String currentUsername = Minecraft.getMinecraft().thePlayer.getGameProfile().getName();
|
||||||
|
|
||||||
|
if (!hasSent || !currentUsername.equals(SocketClient.getCurrentUsername())) {
|
||||||
|
if (hasSent && !currentUsername.equals(SocketClient.getCurrentUsername())) {
|
||||||
|
// Player has changed their Minecraft account, disconnect the previous user
|
||||||
|
System.out.println(SocketClient.client.request("stop", SocketClient.getCurrentUsername() + ":true"));
|
||||||
|
hasSent = false; // Reset the hasSent flag
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println(SocketClient.client.request("start", currentUsername + ":true"));
|
||||||
|
SocketClient.setCurrentUsername(currentUsername);
|
||||||
|
hasSent = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (hasSent && isGameRunningForeground) {
|
||||||
|
// Minecraft game is not running in the foreground, disconnect the user
|
||||||
|
System.out.println(SocketClient.client.request("stop", SocketClient.getCurrentUsername() + ":false"));
|
||||||
|
hasSent = false; // Reset the hasSent flag
|
||||||
|
}
|
||||||
|
isGameRunningForeground = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Minecraft.getMinecraft().isFullScreen() || Display.isActive()) {
|
||||||
|
isGameRunningForeground = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cleans up and shuts down the client.
|
* Cleans up and shuts down the client.
|
||||||
* This method is responsible for any necessary cleanup tasks,
|
* This method is responsible for any necessary cleanup tasks,
|
||||||
|
@ -87,5 +138,8 @@ public class Athena {
|
||||||
*/
|
*/
|
||||||
public void shutdownClient() {
|
public void shutdownClient() {
|
||||||
log.info("Shutting down client");
|
log.info("Shutting down client");
|
||||||
|
if(hasSent) {
|
||||||
|
System.out.println(SocketClient.client.request("stop", Minecraft.getMinecraft().thePlayer.getGameProfile().getName() + ":true"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
package rip.athena.client.events.types.render;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import rip.athena.client.events.Event;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/4/2023
|
||||||
|
*/
|
||||||
|
public class RenderEntityEvent<T extends EntityLivingBase> extends Event {
|
||||||
|
private T entity;
|
||||||
|
private RendererLivingEntity<T> renderer;
|
||||||
|
private double x;
|
||||||
|
private double y;
|
||||||
|
private double z;
|
||||||
|
|
||||||
|
public RenderEntityEvent(T entity, RendererLivingEntity<T> renderer, double x, double y, double z) {
|
||||||
|
this.entity = entity;
|
||||||
|
this.renderer = renderer;
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.z = z;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T getEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RendererLivingEntity<T> getRenderer() {
|
||||||
|
return renderer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getX() {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getY() {
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getZ() {
|
||||||
|
return z;
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,6 +18,7 @@ import net.minecraft.util.ResourceLocation;
|
||||||
import rip.athena.client.modules.Module;
|
import rip.athena.client.modules.Module;
|
||||||
import rip.athena.client.modules.impl.other.Settings;
|
import rip.athena.client.modules.impl.other.Settings;
|
||||||
import rip.athena.client.utils.render.AssetUtils;
|
import rip.athena.client.utils.render.AssetUtils;
|
||||||
|
import rip.athena.client.utils.render.DrawUtils;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -127,18 +128,16 @@ public class IngameMenu extends MinecraftMenuImpl implements DrawImpl {
|
||||||
float value = guiScale / new ScaledResolution(mc).getScaleFactor();
|
float value = guiScale / new ScaledResolution(mc).getScaleFactor();
|
||||||
GlStateManager.scale(value, value, value);
|
GlStateManager.scale(value, value, value);
|
||||||
|
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX(), menu.getY(), menu.getWidth(), 58, MENU_TOP_BG_COLOR);
|
|
||||||
|
|
||||||
FontManager.font1.drawString(Athena.INSTANCE.getClientName().toUpperCase(), menu.getX() + 70, menu.getY() + 20, MENU_HEADER_TEXT_COLOR);
|
DrawUtils.drawRoundedRect(menu.getX(), menu.getY(), menu.getX() + menu.getWidth(), menu.getY() + 58, 4, MENU_TOP_BG_COLOR);
|
||||||
|
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX(), menu.getY() + 58, menu.getWidth(), menu.getHeight() - 58, MENU_PANE_BG_COLOR);
|
|
||||||
|
|
||||||
drawShadowDown(menu.getX(), menu.getY() + 58, menu.getWidth());
|
drawShadowDown(menu.getX(), menu.getY() + 58, menu.getWidth());
|
||||||
|
|
||||||
drawShadowUp(menu.getX(), menu.getY(), menu.getWidth());
|
FontManager.font1.drawString(Athena.INSTANCE.getClientName().toUpperCase(), menu.getX() + 70, menu.getY() + 20, MENU_HEADER_TEXT_COLOR);
|
||||||
drawShadowDown(menu.getX(), menu.getY() + menu.getHeight(), menu.getWidth());
|
|
||||||
drawShadowLeft(menu.getX(), menu.getY(), menu.getHeight());
|
DrawUtils.drawRoundedRect(menu.getX(), menu.getY() + 54, menu.getX() + menu.getWidth(), menu.getY() + menu.getHeight(), 4, new Color(30, 30, 30, 255).getRGB());
|
||||||
drawShadowRight(menu.getX() + menu.getWidth(), menu.getY(), menu.getHeight());
|
|
||||||
|
drawShadowDown(menu.getX(), menu.getY() + 58, menu.getWidth());
|
||||||
|
|
||||||
if(category != null) {
|
if(category != null) {
|
||||||
pageManager.getPage(category).onRender();
|
pageManager.getPage(category).onRender();
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package rip.athena.client.gui.clickgui.components.macros;
|
package rip.athena.client.gui.clickgui.components.macros;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import rip.athena.client.font.FontManager;
|
||||||
import rip.athena.client.gui.framework.components.MenuButton;
|
import rip.athena.client.gui.framework.components.MenuButton;
|
||||||
import rip.athena.client.gui.framework.draw.ButtonState;
|
import rip.athena.client.gui.framework.draw.ButtonState;
|
||||||
import rip.athena.client.gui.framework.draw.DrawType;
|
import rip.athena.client.gui.framework.draw.DrawType;
|
||||||
import rip.athena.client.gui.clickgui.IngameMenu;
|
import rip.athena.client.gui.clickgui.IngameMenu;
|
||||||
|
import rip.athena.client.modules.impl.other.Settings;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -99,18 +101,31 @@ public class FlipButton extends MenuButton {
|
||||||
mouseDown = false;
|
mouseDown = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawText(String string, int x, int y, int color) {
|
public void drawText(String string, int x, int y, int color) {
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
FontManager.baloo17.drawString(string, x, y, color);
|
||||||
|
} else {
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color);
|
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getStringWidth(String string) {
|
public int getStringWidth(String string) {
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
return (int) FontManager.baloo17.getStringWidth(string);
|
||||||
|
} else {
|
||||||
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
|
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getStringHeight(String string) {
|
public int getStringHeight(String string) {
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
return (int) FontManager.baloo17.getHeight(string);
|
||||||
|
} else {
|
||||||
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
|
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
package rip.athena.client.gui.clickgui.components.macros;
|
package rip.athena.client.gui.clickgui.components.macros;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import rip.athena.client.font.FontManager;
|
||||||
import rip.athena.client.gui.framework.MenuComponent;
|
import rip.athena.client.gui.framework.MenuComponent;
|
||||||
import rip.athena.client.gui.framework.MenuPriority;
|
import rip.athena.client.gui.framework.MenuPriority;
|
||||||
import rip.athena.client.gui.framework.draw.ButtonState;
|
import rip.athena.client.gui.framework.draw.ButtonState;
|
||||||
import rip.athena.client.gui.framework.draw.DrawType;
|
import rip.athena.client.gui.framework.draw.DrawType;
|
||||||
import rip.athena.client.gui.clickgui.IngameMenu;
|
import rip.athena.client.gui.clickgui.IngameMenu;
|
||||||
|
import rip.athena.client.modules.impl.other.Settings;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -83,16 +85,28 @@ public class MacroBase extends MenuComponent {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawText(String string, int x, int y, int color) {
|
public void drawText(String string, int x, int y, int color) {
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
FontManager.baloo17.drawString(string, x, y, color);
|
||||||
|
} else {
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color);
|
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getStringWidth(String string) {
|
public int getStringWidth(String string) {
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
return (int) FontManager.baloo17.getStringWidth(string);
|
||||||
|
} else {
|
||||||
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
|
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getStringHeight(String string) {
|
public int getStringHeight(String string) {
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
return (int) FontManager.baloo17.getHeight(string);
|
||||||
|
} else {
|
||||||
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
|
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
package rip.athena.client.gui.clickgui.components.macros;
|
package rip.athena.client.gui.clickgui.components.macros;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import rip.athena.client.font.FontManager;
|
||||||
import rip.athena.client.gui.framework.TextPattern;
|
import rip.athena.client.gui.framework.TextPattern;
|
||||||
import rip.athena.client.gui.framework.draw.ButtonState;
|
import rip.athena.client.gui.framework.draw.ButtonState;
|
||||||
import rip.athena.client.gui.framework.draw.DrawType;
|
import rip.athena.client.gui.framework.draw.DrawType;
|
||||||
import rip.athena.client.gui.clickgui.IngameMenu;
|
import rip.athena.client.gui.clickgui.IngameMenu;
|
||||||
import rip.athena.client.gui.clickgui.components.mods.SearchTextfield;
|
import rip.athena.client.gui.clickgui.components.mods.SearchTextfield;
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
import rip.athena.client.modules.impl.other.Settings;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -84,17 +86,32 @@ public class MacroSlimTextField extends SearchTextfield {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int labelWidth = (int) Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
|
int labelWidth;
|
||||||
|
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
labelWidth = (int) FontManager.baloo17.getStringWidth(textToDraw + 1);
|
||||||
|
} else {
|
||||||
|
labelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
|
||||||
|
}
|
||||||
|
|
||||||
int comp = 0;
|
int comp = 0;
|
||||||
int toRender = index;
|
int toRender = index;
|
||||||
while(labelWidth >= width) {
|
while(labelWidth >= width) {
|
||||||
if(comp < index){
|
if(comp < index){
|
||||||
textToDraw = textToDraw.substring(1);
|
textToDraw = textToDraw.substring(1);
|
||||||
labelWidth = (int)Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
|
if(Settings.customGuiFont) {
|
||||||
|
labelWidth = (int) FontManager.baloo17.getStringWidth(textToDraw + 1);
|
||||||
|
} else {
|
||||||
|
labelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
|
||||||
|
}
|
||||||
toRender--;
|
toRender--;
|
||||||
} else if(comp > index){
|
} else if(comp > index){
|
||||||
textToDraw = textToDraw.substring(0, textToDraw.length() - 1);
|
textToDraw = textToDraw.substring(0, textToDraw.length() - 1);
|
||||||
labelWidth = (int)Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
|
if(Settings.customGuiFont) {
|
||||||
|
labelWidth = (int) FontManager.baloo17.getStringWidth(textToDraw + 1);
|
||||||
|
} else {
|
||||||
|
labelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
comp++;
|
comp++;
|
||||||
|
@ -109,10 +126,15 @@ public class MacroSlimTextField extends SearchTextfield {
|
||||||
toRender = 0;
|
toRender = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int textHeight = (int)Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
|
int textHeight;
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
textHeight = (int) FontManager.baloo17.getHeight(textToDraw);
|
||||||
|
drawVerticalLine(x + (int)FontManager.baloo17.getStringWidth(textToDraw.substring(0, toRender)) + 1, y + height / 2 - textHeight / 2, textHeight, 1, textColor);
|
||||||
|
} else {
|
||||||
|
textHeight = Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
|
||||||
drawVerticalLine(x + (int)Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw.substring(0, toRender)) + 1, y + height / 2 - textHeight / 2, textHeight, 1, textColor);
|
drawVerticalLine(x + (int)Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw.substring(0, toRender)) + 1, y + height / 2 - textHeight / 2, textHeight, 1, textColor);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int renderIndex = comp;
|
int renderIndex = comp;
|
||||||
int renderStopIndex = comp + textToDraw.length();
|
int renderStopIndex = comp + textToDraw.length();
|
||||||
|
@ -120,8 +142,11 @@ public class MacroSlimTextField extends SearchTextfield {
|
||||||
while(index > text.length()) {
|
while(index > text.length()) {
|
||||||
index--;
|
index--;
|
||||||
}
|
}
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
FontManager.baloo17.drawString(textToDraw, x, y + height / 2 - (int)Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT / 2, textColor);
|
||||||
|
} else {
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawString(textToDraw, x, y + height / 2 - (int)Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT / 2, textColor);
|
Minecraft.getMinecraft().fontRendererObj.drawString(textToDraw, x, y + height / 2 - (int)Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT / 2, textColor);
|
||||||
|
}
|
||||||
|
|
||||||
if(lastState == ButtonState.HOVER && mouseDown) {
|
if(lastState == ButtonState.HOVER && mouseDown) {
|
||||||
focused = true;
|
focused = true;
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package rip.athena.client.gui.clickgui.components.macros;
|
package rip.athena.client.gui.clickgui.components.macros;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import rip.athena.client.font.FontManager;
|
||||||
import rip.athena.client.gui.framework.components.MenuButton;
|
import rip.athena.client.gui.framework.components.MenuButton;
|
||||||
import rip.athena.client.gui.framework.draw.ButtonState;
|
import rip.athena.client.gui.framework.draw.ButtonState;
|
||||||
import rip.athena.client.gui.framework.draw.DrawType;
|
import rip.athena.client.gui.framework.draw.DrawType;
|
||||||
import rip.athena.client.gui.clickgui.IngameMenu;
|
import rip.athena.client.gui.clickgui.IngameMenu;
|
||||||
|
import rip.athena.client.modules.impl.other.Settings;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -70,16 +72,28 @@ public class SimpleTextButton extends MenuButton {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawText(String string, int x, int y, int color) {
|
public void drawText(String string, int x, int y, int color) {
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
FontManager.baloo17.drawString(string, x, y, color);
|
||||||
|
} else {
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color);
|
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getStringWidth(String string) {
|
public int getStringWidth(String string) {
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
return (int) FontManager.baloo17.getStringWidth(string);
|
||||||
|
} else {
|
||||||
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
|
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getStringHeight(String string) {
|
public int getStringHeight(String string) {
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
return (int) FontManager.baloo17.getHeight(string);
|
||||||
|
} else {
|
||||||
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
|
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package rip.athena.client.gui.clickgui.components.mods;
|
package rip.athena.client.gui.clickgui.components.mods;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import rip.athena.client.font.FontManager;
|
import rip.athena.client.font.FontManager;
|
||||||
import rip.athena.client.gui.framework.components.MenuButton;
|
import rip.athena.client.gui.framework.components.MenuButton;
|
||||||
import rip.athena.client.gui.framework.draw.ButtonState;
|
import rip.athena.client.gui.framework.draw.ButtonState;
|
||||||
|
@ -118,6 +119,8 @@ public class GoBackButton extends MenuButton {
|
||||||
x -= 2;
|
x -= 2;
|
||||||
y -= 2;
|
y -= 2;
|
||||||
|
|
||||||
|
GlStateManager.color(1, 1,1);
|
||||||
|
|
||||||
DrawUtils.drawRoundedRect(x - 4, y - 4, x + width + 5, y + height + 5, rounding, 83886080);
|
DrawUtils.drawRoundedRect(x - 4, y - 4, x + width + 5, y + height + 5, rounding, 83886080);
|
||||||
DrawUtils.drawRoundedRect(x - 3, y - 3, x + width + 4, y + height + 4, rounding, 335544320);
|
DrawUtils.drawRoundedRect(x - 3, y - 3, x + width + 4, y + height + 4, rounding, 335544320);
|
||||||
DrawUtils.drawRoundedRect(x - 2, y - 2, x + width + 3, y + height + 3, rounding, 436207616);
|
DrawUtils.drawRoundedRect(x - 2, y - 2, x + width + 3, y + height + 3, rounding, 436207616);
|
||||||
|
@ -127,9 +130,9 @@ public class GoBackButton extends MenuButton {
|
||||||
x += 2;
|
x += 2;
|
||||||
y += 2;
|
y += 2;
|
||||||
|
|
||||||
DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 2, y + height + 2, rounding, lineColor);
|
/*DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 2, y + height + 2, rounding, lineColor);
|
||||||
DrawUtils.drawRoundedRect(x, y, x + width + 1, y + height + 1, rounding, lineColor);
|
DrawUtils.drawRoundedRect(x, y, x + width + 1, y + height + 1, rounding, lineColor);
|
||||||
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width, y + height, rounding, backgroundColor);
|
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width, y + height, rounding, backgroundColor);*/
|
||||||
|
|
||||||
if(Settings.customGuiFont) {
|
if(Settings.customGuiFont) {
|
||||||
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor);
|
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor);
|
||||||
|
|
|
@ -4,6 +4,7 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||||
import rip.athena.client.gui.framework.components.MenuCheckbox;
|
import rip.athena.client.gui.framework.components.MenuCheckbox;
|
||||||
import rip.athena.client.gui.framework.draw.ButtonState;
|
import rip.athena.client.gui.framework.draw.ButtonState;
|
||||||
import rip.athena.client.gui.framework.draw.DrawType;
|
import rip.athena.client.gui.framework.draw.DrawType;
|
||||||
|
import rip.athena.client.utils.render.DrawUtils;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -24,9 +25,9 @@ public class MenuModCheckbox extends MenuCheckbox {
|
||||||
super.onInitColors();
|
super.onInitColors();
|
||||||
|
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(0, 0, 0, 0));
|
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(0, 0, 0, 0));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(231, 27, 44, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(100, 100, 100, 255));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(100, 40, 40, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(70, 70, 70, 255));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(239, 46, 90, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(150, 150, 150, 255));
|
||||||
|
|
||||||
setColor(DrawType.LINE, ButtonState.NORMAL, new Color(43, 43, 43, 255));
|
setColor(DrawType.LINE, ButtonState.NORMAL, new Color(43, 43, 43, 255));
|
||||||
setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(53, 53, 53, 255));
|
setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(53, 53, 53, 255));
|
||||||
|
@ -42,6 +43,7 @@ public class MenuModCheckbox extends MenuCheckbox {
|
||||||
|
|
||||||
int backgroundColor = getColor(DrawType.BACKGROUND, lastState);
|
int backgroundColor = getColor(DrawType.BACKGROUND, lastState);
|
||||||
int lineColor = getColor(DrawType.LINE, lastState);
|
int lineColor = getColor(DrawType.LINE, lastState);
|
||||||
|
|
||||||
GlStateManager.color(1, 1, 1);
|
GlStateManager.color(1, 1, 1);
|
||||||
|
|
||||||
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
||||||
|
@ -53,6 +55,9 @@ public class MenuModCheckbox extends MenuCheckbox {
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 2, y + 2, width - 3, height - 3, lineColor);
|
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 2, y + 2, width - 3, height - 3, lineColor);
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 3, y + 3, width - 5, height - 5, backgroundColor);
|
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 3, y + 3, width - 5, height - 5, backgroundColor);
|
||||||
|
|
||||||
|
//DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4, lineColor);
|
||||||
|
//DrawUtils.drawRoundedRect(x + 4, y + 4, x + width - 4, y + height - 4, 1, backgroundColor);
|
||||||
|
|
||||||
drawTooltip();
|
drawTooltip();
|
||||||
|
|
||||||
mouseDown = false;
|
mouseDown = false;
|
||||||
|
|
|
@ -35,6 +35,7 @@ public class MenuModColorPicker extends MenuColorPicker {
|
||||||
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);
|
||||||
|
|
||||||
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package rip.athena.client.gui.clickgui.components.mods;
|
package rip.athena.client.gui.clickgui.components.mods;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import rip.athena.client.font.FontManager;
|
import rip.athena.client.font.FontManager;
|
||||||
import rip.athena.client.gui.framework.MenuComponent;
|
import rip.athena.client.gui.framework.MenuComponent;
|
||||||
import rip.athena.client.gui.framework.MenuPriority;
|
import rip.athena.client.gui.framework.MenuPriority;
|
||||||
|
@ -157,6 +158,8 @@ public class MenuModKeybind extends MenuComponent {
|
||||||
int lineColor = getColor(DrawType.LINE, lastState);
|
int lineColor = getColor(DrawType.LINE, lastState);
|
||||||
int textColor = getColor(DrawType.TEXT, ButtonState.NORMAL);
|
int textColor = getColor(DrawType.TEXT, ButtonState.NORMAL);
|
||||||
|
|
||||||
|
GlStateManager.color(1,1,1);
|
||||||
|
|
||||||
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
||||||
drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
|
drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
|
||||||
drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
|
drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package rip.athena.client.gui.clickgui.components.mods;
|
package rip.athena.client.gui.clickgui.components.mods;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import rip.athena.client.font.FontManager;
|
import rip.athena.client.font.FontManager;
|
||||||
import rip.athena.client.gui.framework.components.MenuSlider;
|
import rip.athena.client.gui.framework.components.MenuSlider;
|
||||||
import rip.athena.client.gui.framework.draw.ButtonState;
|
import rip.athena.client.gui.framework.draw.ButtonState;
|
||||||
|
@ -69,6 +70,8 @@ public class MenuModSlider extends MenuSlider {
|
||||||
int lineColor = getColor(DrawType.LINE, lastState);
|
int lineColor = getColor(DrawType.LINE, lastState);
|
||||||
int textColor = getColor(DrawType.TEXT, lastState);
|
int textColor = getColor(DrawType.TEXT, lastState);
|
||||||
|
|
||||||
|
GlStateManager.color(1,1,1);
|
||||||
|
|
||||||
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
||||||
drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
|
drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
|
||||||
drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
|
drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
|
||||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import rip.athena.client.modules.Category;
|
import rip.athena.client.modules.Category;
|
||||||
import rip.athena.client.modules.impl.other.Settings;
|
import rip.athena.client.modules.impl.other.Settings;
|
||||||
|
import rip.athena.client.utils.render.DrawUtils;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -39,7 +40,7 @@ public class ModCategoryButton extends MenuButton {
|
||||||
public void onInitColors() {
|
public void onInitColors() {
|
||||||
super.onInitColors();
|
super.onInitColors();
|
||||||
|
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(MAIN_COLOR, true));
|
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(25, 25, 25, IngameMenu.MENU_ALPHA));
|
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(25, 25, 25, IngameMenu.MENU_ALPHA));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(20, 20, 20, IngameMenu.MENU_ALPHA));
|
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(20, 20, 20, IngameMenu.MENU_ALPHA));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(35, 35, 39, IngameMenu.MENU_ALPHA));
|
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(35, 35, 39, IngameMenu.MENU_ALPHA));
|
||||||
|
@ -57,10 +58,12 @@ public class ModCategoryButton extends MenuButton {
|
||||||
int textColor = getColor(DrawType.TEXT, lastState);
|
int textColor = getColor(DrawType.TEXT, lastState);
|
||||||
|
|
||||||
GlStateManager.color(1, 1, 1);
|
GlStateManager.color(1, 1, 1);
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width - 10, height, backgroundColor);
|
|
||||||
|
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width - 10, height, backgroundColor);
|
||||||
|
DrawUtils.drawRoundedRect(x + 10, y, x + width - 20, y + height, 4, backgroundColor);
|
||||||
|
|
||||||
if(Settings.customGuiFont) {
|
if(Settings.customGuiFont) {
|
||||||
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor);
|
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2) - 3, y + height / 2 - (getStringHeight(text) / 2), textColor);
|
||||||
} else {
|
} else {
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor);
|
Minecraft.getMinecraft().fontRendererObj.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package rip.athena.client.gui.clickgui.components.mods;
|
package rip.athena.client.gui.clickgui.components.mods;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import rip.athena.client.gui.framework.MenuComponent;
|
import rip.athena.client.gui.framework.MenuComponent;
|
||||||
import rip.athena.client.gui.framework.MenuPriority;
|
import rip.athena.client.gui.framework.MenuPriority;
|
||||||
import rip.athena.client.gui.framework.components.MenuDraggable;
|
import rip.athena.client.gui.framework.components.MenuDraggable;
|
||||||
|
@ -35,7 +36,7 @@ public class ModScrollPane extends MenuScrollPane {
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.POPUP, new Color(35, 35, 35, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.POPUP, new Color(35, 35, 35, 255));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, 255));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(25, 24, 29, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(25, 24, 29, 255));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(25, 24, 29, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(30, 30, 30, 255));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(25, 24, 29, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(25, 24, 29, 255));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.DISABLED, new Color(100, 100, 100, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.DISABLED, new Color(100, 100, 100, 255));
|
||||||
|
|
||||||
|
@ -224,6 +225,8 @@ public class ModScrollPane extends MenuScrollPane {
|
||||||
if(newSize > 4) {
|
if(newSize > 4) {
|
||||||
if(scrollerSizeDelta < 1) {
|
if(scrollerSizeDelta < 1) {
|
||||||
scrollerHeight -= 3;
|
scrollerHeight -= 3;
|
||||||
|
GlStateManager.color(1, 1,1);
|
||||||
|
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 3, y - 2, scrollerWidth + 6, scrollerHeight + 8, 83886080);
|
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 3, y - 2, scrollerWidth + 6, scrollerHeight + 8, 83886080);
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 2, y - 1, scrollerWidth + 4, scrollerHeight + 6, 369098752);
|
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 2, y - 1, scrollerWidth + 4, scrollerHeight + 6, 369098752);
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 1, y, scrollerWidth + 2, scrollerHeight + 4, 587202560);
|
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 1, y, scrollerWidth + 2, scrollerHeight + 4, 587202560);
|
||||||
|
@ -235,7 +238,7 @@ public class ModScrollPane extends MenuScrollPane {
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 2, newY - 2, scrollerWidth + 4, newSize + 4, 369098752);
|
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 2, newY - 2, scrollerWidth + 4, newSize + 4, 369098752);
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 1, newY - 1, scrollerWidth + 2, newSize + 2, 587202560);
|
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 1, newY - 1, scrollerWidth + 2, newSize + 2, 587202560);
|
||||||
|
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX, newY, scrollerWidth, newSize, getColor(DrawType.LINE, scrollerState));
|
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX, newY, scrollerWidth, newSize, getColor(DrawType.LINE, scrollerState));
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX + 1, newY + 1, scrollerWidth - 2, newSize - 2, getColor(DrawType.BACKGROUND, scrollerState));
|
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX + 1, newY + 1, scrollerWidth - 2, newSize - 2, getColor(DrawType.BACKGROUND, scrollerState));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package rip.athena.client.gui.clickgui.components.mods;
|
package rip.athena.client.gui.clickgui.components.mods;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import rip.athena.client.font.FontManager;
|
import rip.athena.client.font.FontManager;
|
||||||
import rip.athena.client.gui.framework.TextPattern;
|
import rip.athena.client.gui.framework.TextPattern;
|
||||||
import rip.athena.client.gui.framework.components.MenuTextField;
|
import rip.athena.client.gui.framework.components.MenuTextField;
|
||||||
|
@ -60,13 +61,15 @@ public class ModTextbox extends MenuTextField {
|
||||||
int lineColor = getColor(DrawType.LINE, lastState);
|
int lineColor = getColor(DrawType.LINE, lastState);
|
||||||
int textColor = getColor(DrawType.TEXT, lastState);
|
int textColor = getColor(DrawType.TEXT, lastState);
|
||||||
|
|
||||||
DrawUtils.drawRoundedRect(x - 4, y - 4, x + width + 5, y + height + 5, 10, 83886080);
|
GlStateManager.color(1, 1,1);
|
||||||
DrawUtils.drawRoundedRect(x - 3, y - 3, x + width + 4, y + height + 4, 10, 369098752);
|
|
||||||
DrawUtils.drawRoundedRect(x - 2, y - 2, x + width + 3, y + height + 3, 10, 587202560);
|
|
||||||
|
|
||||||
DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 2, y + height + 2, 10, lineColor);
|
DrawUtils.drawRoundedRect(x - 4, y - 4, x + width + 5, y + height + 5, 4, 83886080);
|
||||||
DrawUtils.drawRoundedRect(x, y, x + width + 1, y + height + 1, 10, lineColor);
|
DrawUtils.drawRoundedRect(x - 3, y - 3, x + width + 4, y + height + 4, 4, 369098752);
|
||||||
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width, y + height, 10, backgroundColor);
|
DrawUtils.drawRoundedRect(x - 2, y - 2, x + width + 3, y + height + 3, 4, 587202560);
|
||||||
|
|
||||||
|
//DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 2, y + height + 2, 10, lineColor);
|
||||||
|
//DrawUtils.drawRoundedRect(x, y, x + width + 1, y + height + 1, 10, lineColor);
|
||||||
|
//DrawUtils.drawRoundedRect(x + 1, y + 1, x + width, y + height, 10, backgroundColor);
|
||||||
|
|
||||||
String textToDraw = text;
|
String textToDraw = text;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package rip.athena.client.gui.clickgui.components.mods;
|
package rip.athena.client.gui.clickgui.components.mods;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import rip.athena.client.font.FontManager;
|
import rip.athena.client.font.FontManager;
|
||||||
import rip.athena.client.gui.framework.components.MenuButton;
|
import rip.athena.client.gui.framework.components.MenuButton;
|
||||||
import rip.athena.client.gui.framework.draw.ButtonState;
|
import rip.athena.client.gui.framework.draw.ButtonState;
|
||||||
|
@ -112,6 +113,8 @@ public class ModsButton extends MenuButton {
|
||||||
int lineColor = getColor(DrawType.LINE, lastState);
|
int lineColor = getColor(DrawType.LINE, lastState);
|
||||||
int textColor = getColor(DrawType.TEXT, lastState);
|
int textColor = getColor(DrawType.TEXT, lastState);
|
||||||
|
|
||||||
|
GlStateManager.color(1,1,1);
|
||||||
|
|
||||||
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
||||||
drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
|
drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
|
||||||
drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
|
drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
|
||||||
|
|
|
@ -11,6 +11,7 @@ import rip.athena.client.gui.framework.draw.DrawType;
|
||||||
import rip.athena.client.gui.clickgui.IngameMenu;
|
import rip.athena.client.gui.clickgui.IngameMenu;
|
||||||
import rip.athena.client.modules.Module;
|
import rip.athena.client.modules.Module;
|
||||||
import rip.athena.client.modules.impl.other.Settings;
|
import rip.athena.client.modules.impl.other.Settings;
|
||||||
|
import rip.athena.client.utils.render.DrawUtils;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -178,19 +179,11 @@ public class ModuleBox extends MenuComponent {
|
||||||
|
|
||||||
int defaultColor = getColor(DrawType.BACKGROUND, ButtonState.NORMAL);
|
int defaultColor = getColor(DrawType.BACKGROUND, ButtonState.NORMAL);
|
||||||
int drawColor = defaultColor;
|
int drawColor = defaultColor;
|
||||||
|
|
||||||
GlStateManager.color(1, 1, 1);
|
GlStateManager.color(1, 1, 1);
|
||||||
|
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 1, y + 1, width - 1, height - 1, defaultColor);
|
DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(50,50,50,255).getRGB());
|
||||||
|
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width - 1, y + height - 1, 4.0f, new Color(35,35,35,255).getRGB());
|
||||||
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);
|
|
||||||
|
|
||||||
drawShadowUp(x, y, width + 1);
|
|
||||||
drawShadowLeft(x, y, height + 1);
|
|
||||||
drawShadowDown(x, y + height + 1, width + 1);
|
|
||||||
drawShadowRight(x + width + 1, y, height + 1);
|
|
||||||
|
|
||||||
int yPos = y + (height / 2) - tHeight / 2 - 5;
|
int yPos = y + (height / 2) - tHeight / 2 - 5;
|
||||||
|
|
||||||
|
@ -213,18 +206,8 @@ public class ModuleBox extends MenuComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*drawShadowUp(x + 10, y + height - 30, width - 20);
|
DrawUtils.drawRoundedRect(x + 10, y + height - 10 - 20, x + width - 10, y + height - 10, 4.0f, module.isToggled() ? new Color(0, 200, 0, 255).getRGB() : new Color(200, 0, 0, 225).getRGB());
|
||||||
drawShadowLeft(x + 10, y + height - 30, 20);
|
DrawUtils.drawRoundedRect(x + 11, y + height - 10 - 19, x + width - 11, y + height - 11, 4.0f, module.isToggled() ? new Color(40, 157, 93, 255).getRGB() : new Color(157, 40, 40, 225).getRGB());
|
||||||
drawShadowDown(x + 10, y + height - 10, width - 20);
|
|
||||||
drawShadowRight(x + width - 10, y + height - 30, 20);*/
|
|
||||||
|
|
||||||
drawHorizontalLine(x + 10, y + height - 30, width - 20, 1, new Color(43, 43, 43, 225).getRGB());
|
|
||||||
drawVerticalLine(x + 10, y + height - 30, 20, 1, new Color(43, 43, 43, 225).getRGB());
|
|
||||||
drawHorizontalLine(x + 10, y + height - 10, width - 20, 1, new Color(43, 43, 43, 225).getRGB());
|
|
||||||
drawVerticalLine(x + width - 10, y + height - 30, 20, 1, new Color(43, 43, 43, 225).getRGB());
|
|
||||||
|
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 10, y + height - 10 - 20, width - 20, 20, module.isToggled() ? new Color(0, 200, 0, 255).getRGB() : new Color(200, 0, 0, 225).getRGB());
|
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 11, y + height - 10 - 19, width - 22, 18, module.isToggled() ? new Color(40, 157, 93, 255).getRGB() : new Color(157, 40, 40, 225).getRGB());
|
|
||||||
|
|
||||||
String text = module.isToggled() ? "ENABLED" : "DISABLED";
|
String text = module.isToggled() ? "ENABLED" : "DISABLED";
|
||||||
|
|
||||||
|
|
|
@ -62,15 +62,14 @@ public class SearchTextfield extends MenuTextField {
|
||||||
int lineColor = getColor(DrawType.LINE, lastState);
|
int lineColor = getColor(DrawType.LINE, lastState);
|
||||||
int textColor = getColor(DrawType.TEXT, lastState);
|
int textColor = getColor(DrawType.TEXT, lastState);
|
||||||
|
|
||||||
GlStateManager.color(1, 1,1,1);
|
GlStateManager.color(1, 1,1);
|
||||||
|
|
||||||
DrawUtils.drawRoundedRect(x - 4, y - 4, x + width + 5, y + height + 5, 10, 83886080);
|
DrawUtils.drawRoundedRect(x - 4, y - 4, x + width + 5, y + height + 5, 10, 83886080);
|
||||||
DrawUtils.drawRoundedRect(x - 3, y - 3, x + width + 4, y + height + 4, 10, 369098752);
|
|
||||||
DrawUtils.drawRoundedRect(x - 2, y - 2, x + width + 3, y + height + 3, 10, 587202560);
|
DrawUtils.drawRoundedRect(x - 2, y - 2, x + width + 3, y + height + 3, 10, 587202560);
|
||||||
|
|
||||||
DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 2, y + height + 2, 10, lineColor);
|
/*DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 2, y + height + 2, 10, lineColor);
|
||||||
DrawUtils.drawRoundedRect(x, y, x + width + 1, y + height + 1, 10, lineColor);
|
DrawUtils.drawRoundedRect(x, y, x + width + 1, y + height + 1, 10, lineColor);
|
||||||
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width, y + height, 10, backgroundColor);
|
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width, y + height, 10, backgroundColor);*/
|
||||||
|
|
||||||
String textToDraw = text;
|
String textToDraw = text;
|
||||||
|
|
||||||
|
@ -152,6 +151,7 @@ public class SearchTextfield extends MenuTextField {
|
||||||
|
|
||||||
int xAdd = 0;
|
int xAdd = 0;
|
||||||
|
|
||||||
|
|
||||||
if(textToDraw.isEmpty() && !isFocused()) {
|
if(textToDraw.isEmpty() && !isFocused()) {
|
||||||
textToDraw = "SEARCH MODS...";
|
textToDraw = "SEARCH MODS...";
|
||||||
xAdd = 5;
|
xAdd = 5;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package rip.athena.client.gui.clickgui.pages;
|
package rip.athena.client.gui.clickgui.pages;
|
||||||
|
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.font.FontManager;
|
||||||
import rip.athena.client.gui.framework.Menu;
|
import rip.athena.client.gui.framework.Menu;
|
||||||
import rip.athena.client.gui.framework.TextPattern;
|
import rip.athena.client.gui.framework.TextPattern;
|
||||||
import rip.athena.client.gui.clickgui.IngameMenu;
|
import rip.athena.client.gui.clickgui.IngameMenu;
|
||||||
|
@ -10,6 +12,8 @@ import rip.athena.client.gui.clickgui.components.mods.ModCategoryButton;
|
||||||
import rip.athena.client.gui.clickgui.components.mods.ModScrollPane;
|
import rip.athena.client.gui.clickgui.components.mods.ModScrollPane;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
import rip.athena.client.macros.Macro;
|
||||||
|
import rip.athena.client.modules.impl.other.Settings;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -65,7 +69,7 @@ public class MacrosPage extends Page {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Athena.INSTANCE.macroManager.getMacros().add(new Macro(name.getText(), commandLine.getText(), bind.getBind()));
|
Athena.INSTANCE.getMacroManager().getMacros().add(new Macro(name.getText(), commandLine.getText(), bind.getBind()));
|
||||||
|
|
||||||
name.setText("");
|
name.setText("");
|
||||||
commandLine.setText("");
|
commandLine.setText("");
|
||||||
|
@ -79,7 +83,7 @@ public class MacrosPage extends Page {
|
||||||
public void onAction() {
|
public void onAction() {
|
||||||
setActive(false);
|
setActive(false);
|
||||||
|
|
||||||
//Athena.INSTANCE.macroManager.getMacros().clear();
|
Athena.INSTANCE.getMacroManager().getMacros().clear();
|
||||||
populateScrollPane();
|
populateScrollPane();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -100,7 +104,7 @@ public class MacrosPage extends Page {
|
||||||
|
|
||||||
int width = scrollPane.getWidth() - spacing * 2;
|
int width = scrollPane.getWidth() - spacing * 2;
|
||||||
|
|
||||||
/*for(Macro macro : Athena.INSTANCE.macroManager.getMacros()) {
|
for(Macro macro : Athena.INSTANCE.getMacroManager().getMacros()) {
|
||||||
scrollPane.addComponent(new MacroBase(macro.getName(), x, y, width, height));
|
scrollPane.addComponent(new MacroBase(macro.getName(), x, y, width, height));
|
||||||
|
|
||||||
MacroSlimTextField field = new MacroSlimTextField(TextPattern.NONE, x + 160 + spacing, y, width - 160 - spacing * 4 - 90, height - 5) {
|
MacroSlimTextField field = new MacroSlimTextField(TextPattern.NONE, x + 160 + spacing, y, width - 160 - spacing * 4 - 90, height - 5) {
|
||||||
|
@ -128,13 +132,13 @@ public class MacrosPage extends Page {
|
||||||
scrollPane.addComponent(new SimpleTextButton("X", width - spacing, y, 30, height, true) {
|
scrollPane.addComponent(new SimpleTextButton("X", width - spacing, y, 30, height, true) {
|
||||||
@Override
|
@Override
|
||||||
public void onAction() {
|
public void onAction() {
|
||||||
Athena.INSTANCE.macroManager.getMacros().remove(macro);
|
Athena.INSTANCE.getMacroManager().getMacros().remove(macro);
|
||||||
populateScrollPane();
|
populateScrollPane();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
y += height + spacing;
|
y += height + spacing;
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -144,30 +148,45 @@ public class MacrosPage extends Page {
|
||||||
int y = menu.getY() + 59;
|
int y = menu.getY() + 59;
|
||||||
int height = 32;
|
int height = 32;
|
||||||
|
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
FontManager.baloo17.drawString("MACROS", menu.getX() + 31, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
||||||
|
} else {
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawString("MACROS", menu.getX() + 31, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
Minecraft.getMinecraft().fontRendererObj.drawString("MACROS", menu.getX() + 31, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
||||||
|
}
|
||||||
drawHorizontalLine(menu.getX() + 31, menu.getY() + 110, menu.getWidth() - width - 31 * 2, 3, IngameMenu.MENU_LINE_COLOR);
|
drawHorizontalLine(menu.getX() + 31, menu.getY() + 110, menu.getWidth() - width - 31 * 2, 3, IngameMenu.MENU_LINE_COLOR);
|
||||||
|
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + menu.getWidth() - width, menu.getY() + 58, width, menu.getHeight() - 58, MENU_SIDE_BG_COLOR);
|
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + menu.getWidth() - width, menu.getY() + 58, width, menu.getHeight() - 58, MENU_SIDE_BG_COLOR);
|
||||||
|
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + menu.getWidth() - width, menu.getY() + 58, width, height + 1, ModCategoryButton.MAIN_COLOR);
|
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + menu.getWidth() - width, menu.getY() + 58, width, height + 1, ModCategoryButton.MAIN_COLOR);
|
||||||
drawShadowDown(menu.getX() + menu.getWidth() - width, y + height, width);
|
drawShadowDown(menu.getX() + menu.getWidth() - width, y + height, width);
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawString("ADD NEW MACRO", menu.getX() + menu.getWidth() - width / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth("ADD NEW MACRO") / 2, y + height / 2 - Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT / 2, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
|
||||||
|
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
FontManager.baloo17.drawString("ADD NEW MACRO", menu.getX() + menu.getWidth() - width / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth("ADD NEW MACRO") / 2, y + height / 2 - Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT / 2, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
||||||
|
} else {
|
||||||
|
Minecraft.getMinecraft().fontRendererObj.drawString("ADD NEW MACRO", menu.getX() + menu.getWidth() - width / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth("ADD NEW MACRO") / 2, y + height / 2 - Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT / 2, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
||||||
|
}
|
||||||
drawShadowDown(menu.getX() + menu.getWidth() - width, y - 1, width);
|
drawShadowDown(menu.getX() + menu.getWidth() - width, y - 1, width);
|
||||||
|
|
||||||
y += 60;
|
y += 60;
|
||||||
|
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
FontManager.baloo17.drawString("ENTER NAME", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
||||||
|
} else {
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawString("ENTER NAME", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
Minecraft.getMinecraft().fontRendererObj.drawString("ENTER NAME", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
||||||
|
}
|
||||||
y += 70;
|
y += 70;
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
FontManager.baloo17.drawString("ENTER COMMAND LINE", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
||||||
|
} else {
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawString("ENTER COMMAND LINE", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
Minecraft.getMinecraft().fontRendererObj.drawString("ENTER COMMAND LINE", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
||||||
|
}
|
||||||
y += 70;
|
y += 70;
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
FontManager.baloo17.drawString("ADD KEYBIND", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
||||||
|
} else {
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawString("ADD KEYBIND", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
Minecraft.getMinecraft().fontRendererObj.drawString("ADD KEYBIND", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package rip.athena.client.gui.clickgui.pages;
|
package rip.athena.client.gui.clickgui.pages;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import rip.athena.client.Athena;
|
import rip.athena.client.Athena;
|
||||||
import rip.athena.client.config.ConfigEntry;
|
import rip.athena.client.config.ConfigEntry;
|
||||||
|
@ -20,6 +21,7 @@ import rip.athena.client.modules.impl.other.Settings;
|
||||||
import rip.athena.client.modules.impl.render.Crosshair;
|
import rip.athena.client.modules.impl.render.Crosshair;
|
||||||
import rip.athena.client.utils.input.BindType;
|
import rip.athena.client.utils.input.BindType;
|
||||||
import rip.athena.client.utils.render.AssetUtils;
|
import rip.athena.client.utils.render.AssetUtils;
|
||||||
|
import rip.athena.client.utils.render.DrawUtils;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -67,7 +69,6 @@ public class ModsPage extends Page {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRender() {
|
public void onRender() {
|
||||||
|
|
||||||
int y = menu.getY() + 59;
|
int y = menu.getY() + 59;
|
||||||
int height = 32;
|
int height = 32;
|
||||||
|
|
||||||
|
@ -86,7 +87,7 @@ public class ModsPage extends Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
y = menu.getY() + menu.getHeight() - height;
|
y = menu.getY() + menu.getHeight() - height;
|
||||||
drawShadowUp(menu.getX(), y - 2, 215);
|
drawShadowUp(menu.getX(), y - 10, 215);
|
||||||
|
|
||||||
if (modCategory != null) {
|
if (modCategory != null) {
|
||||||
if (Settings.customGuiFont) {
|
if (Settings.customGuiFont) {
|
||||||
|
@ -229,7 +230,7 @@ public class ModsPage extends Page {
|
||||||
ModScrollPane pane = new ModScrollPane(255, 140, menu.getWidth() - 255 - 32, menu.getHeight() - 141, false);
|
ModScrollPane pane = new ModScrollPane(255, 140, menu.getWidth() - 255 - 32, menu.getHeight() - 141, false);
|
||||||
menu.addComponent(pane);
|
menu.addComponent(pane);
|
||||||
|
|
||||||
menu.addComponent(new ModCategoryButton("EDIT HUD", 0, menu.getHeight() - height - 2, 225, height) {
|
menu.addComponent(new ModCategoryButton("EDIT HUD", 0, menu.getHeight() - height - 5, 225, height) {
|
||||||
@Override
|
@Override
|
||||||
public void onAction() {
|
public void onAction() {
|
||||||
setActive(false);
|
setActive(false);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package rip.athena.client.gui.framework.components;
|
package rip.athena.client.gui.framework.components;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import rip.athena.client.gui.framework.MenuComponent;
|
import rip.athena.client.gui.framework.MenuComponent;
|
||||||
import rip.athena.client.gui.framework.draw.ButtonState;
|
import rip.athena.client.gui.framework.draw.ButtonState;
|
||||||
import rip.athena.client.gui.framework.draw.DrawType;
|
import rip.athena.client.gui.framework.draw.DrawType;
|
||||||
|
@ -122,6 +123,8 @@ public class MenuButton extends MenuComponent {
|
||||||
int lineColor = getColor(DrawType.LINE, lastState);
|
int lineColor = getColor(DrawType.LINE, lastState);
|
||||||
int textColor = getColor(DrawType.TEXT, lastState);
|
int textColor = getColor(DrawType.TEXT, lastState);
|
||||||
|
|
||||||
|
GlStateManager.color(1, 1,1);
|
||||||
|
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 1, y + 1, width - 1, height - 1, backgroundColor);
|
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 1, y + 1, width - 1, height - 1, backgroundColor);
|
||||||
|
|
||||||
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package rip.athena.client.gui.framework.components;
|
package rip.athena.client.gui.framework.components;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import rip.athena.client.Athena;
|
import rip.athena.client.Athena;
|
||||||
import rip.athena.client.gui.framework.MenuComponent;
|
import rip.athena.client.gui.framework.MenuComponent;
|
||||||
import rip.athena.client.gui.framework.MenuPriority;
|
import rip.athena.client.gui.framework.MenuPriority;
|
||||||
|
@ -264,6 +265,8 @@ public class MenuTextField extends MenuComponent {
|
||||||
int lineColor = getColor(DrawType.LINE, lastState);
|
int lineColor = getColor(DrawType.LINE, lastState);
|
||||||
int textColor = getColor(DrawType.TEXT, lastState);
|
int textColor = getColor(DrawType.TEXT, lastState);
|
||||||
|
|
||||||
|
GlStateManager.color(1, 1,1);
|
||||||
|
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 1, y + 1, width - 1, height - 1, backgroundColor);
|
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 1, y + 1, width - 1, height - 1, backgroundColor);
|
||||||
|
|
||||||
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
||||||
|
|
|
@ -135,8 +135,6 @@ public class HUDEditor extends MinecraftMenuImpl implements DrawImpl {
|
||||||
int border = element.isVisible() ? BORDER : BORDER_HIDDEN;
|
int border = element.isVisible() ? BORDER : BORDER_HIDDEN;
|
||||||
int background = element.isVisible() ? BACKGROUND : BACKGROUND_HIDDEN;
|
int background = element.isVisible() ? BACKGROUND : BACKGROUND_HIDDEN;
|
||||||
|
|
||||||
drawText("X", x + 1, y + height - 10, TEXT_COLOR);
|
|
||||||
|
|
||||||
drawHorizontalLine(x, y, width + 1, 1, border);
|
drawHorizontalLine(x, y, width + 1, 1, border);
|
||||||
drawVerticalLine(x, y + 1, height - 1, 1, border);
|
drawVerticalLine(x, y + 1, height - 1, 1, border);
|
||||||
drawHorizontalLine(x, y + height, width + 1, 1, border);
|
drawHorizontalLine(x, y + height, width + 1, 1, border);
|
||||||
|
@ -157,7 +155,7 @@ public class HUDEditor extends MinecraftMenuImpl implements DrawImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(height > SETTINGS_SIZE) {
|
if(height > SETTINGS_SIZE) {
|
||||||
//drawImage(SETTINGS, x + 1, y + height - SETTINGS_SIZE, SETTINGS_SIZE, SETTINGS_SIZE);
|
drawImage(new ResourceLocation("Athena/menu/exit.png"), x + 1, y + height - SETTINGS_SIZE, SETTINGS_SIZE, SETTINGS_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int resizeSize = RESIZE_SIZE;
|
int resizeSize = RESIZE_SIZE;
|
||||||
|
|
|
@ -50,6 +50,7 @@ import net.minecraft.world.demo.DemoWorldServer;
|
||||||
import net.minecraft.world.storage.ISaveFormat;
|
import net.minecraft.world.storage.ISaveFormat;
|
||||||
import net.minecraft.world.storage.WorldInfo;
|
import net.minecraft.world.storage.WorldInfo;
|
||||||
import rip.athena.client.Athena;
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.font.FontManager;
|
||||||
import rip.athena.client.utils.input.InputUtils;
|
import rip.athena.client.utils.input.InputUtils;
|
||||||
import rip.athena.client.utils.render.DrawUtils;
|
import rip.athena.client.utils.render.DrawUtils;
|
||||||
|
|
||||||
|
@ -58,7 +59,6 @@ import rip.athena.client.utils.render.DrawUtils;
|
||||||
* @project Athena-Client
|
* @project Athena-Client
|
||||||
* @date 6/2/2023
|
* @date 6/2/2023
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class AthenaMenu extends GuiScreen implements GuiYesNoCallback
|
public class AthenaMenu extends GuiScreen implements GuiYesNoCallback
|
||||||
{
|
{
|
||||||
private static final AtomicInteger field_175373_f = new AtomicInteger(0);
|
private static final AtomicInteger field_175373_f = new AtomicInteger(0);
|
||||||
|
@ -317,177 +317,27 @@ public class AthenaMenu extends GuiScreen implements GuiYesNoCallback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawPanorama(int p_73970_1_, int p_73970_2_, float p_73970_3_)
|
|
||||||
{
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
|
||||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
|
||||||
GlStateManager.matrixMode(5889);
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
GlStateManager.loadIdentity();
|
|
||||||
Project.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F);
|
|
||||||
GlStateManager.matrixMode(5888);
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
GlStateManager.loadIdentity();
|
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F);
|
|
||||||
GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F);
|
|
||||||
GlStateManager.enableBlend();
|
|
||||||
GlStateManager.disableAlpha();
|
|
||||||
GlStateManager.disableCull();
|
|
||||||
GlStateManager.depthMask(false);
|
|
||||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
|
||||||
int i = 8;
|
|
||||||
|
|
||||||
for (int j = 0; j < i * i; ++j)
|
|
||||||
{
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
float f = ((float)(j % i) / (float)i - 0.5F) / 64.0F;
|
|
||||||
float f1 = ((float)(j / i) / (float)i - 0.5F) / 64.0F;
|
|
||||||
float f2 = 0.0F;
|
|
||||||
GlStateManager.translate(f, f1, f2);
|
|
||||||
GlStateManager.rotate(MathHelper.sin(((float)this.panoramaTimer + p_73970_3_) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F);
|
|
||||||
GlStateManager.rotate(-((float)this.panoramaTimer + p_73970_3_) * 0.1F, 0.0F, 1.0F, 0.0F);
|
|
||||||
|
|
||||||
for (int k = 0; k < 6; ++k)
|
|
||||||
{
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
|
|
||||||
if (k == 1)
|
|
||||||
{
|
|
||||||
GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (k == 2)
|
|
||||||
{
|
|
||||||
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (k == 3)
|
|
||||||
{
|
|
||||||
GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (k == 4)
|
|
||||||
{
|
|
||||||
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (k == 5)
|
|
||||||
{
|
|
||||||
GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.mc.getTextureManager().bindTexture(titlePanoramaPaths[k]);
|
|
||||||
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
|
|
||||||
int l = 255 / (j + 1);
|
|
||||||
float f3 = 0.0F;
|
|
||||||
worldrenderer.pos(-1.0D, -1.0D, 1.0D).tex(0.0D, 0.0D).color(255, 255, 255, l).endVertex();
|
|
||||||
worldrenderer.pos(1.0D, -1.0D, 1.0D).tex(1.0D, 0.0D).color(255, 255, 255, l).endVertex();
|
|
||||||
worldrenderer.pos(1.0D, 1.0D, 1.0D).tex(1.0D, 1.0D).color(255, 255, 255, l).endVertex();
|
|
||||||
worldrenderer.pos(-1.0D, 1.0D, 1.0D).tex(0.0D, 1.0D).color(255, 255, 255, l).endVertex();
|
|
||||||
tessellator.draw();
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
}
|
|
||||||
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
GlStateManager.colorMask(true, true, true, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
worldrenderer.setTranslation(0.0D, 0.0D, 0.0D);
|
|
||||||
GlStateManager.colorMask(true, true, true, true);
|
|
||||||
GlStateManager.matrixMode(5889);
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
GlStateManager.matrixMode(5888);
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
GlStateManager.depthMask(true);
|
|
||||||
GlStateManager.enableCull();
|
|
||||||
GlStateManager.enableDepth();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void rotateAndBlurSkybox(float p_73968_1_)
|
|
||||||
{
|
|
||||||
this.mc.getTextureManager().bindTexture(this.backgroundTexture);
|
|
||||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
|
|
||||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
|
|
||||||
GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256);
|
|
||||||
GlStateManager.enableBlend();
|
|
||||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
|
||||||
GlStateManager.colorMask(true, true, true, false);
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
|
||||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
|
||||||
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
|
|
||||||
GlStateManager.disableAlpha();
|
|
||||||
int i = 3;
|
|
||||||
|
|
||||||
for (int j = 0; j < i; ++j)
|
|
||||||
{
|
|
||||||
float f = 1.0F / (float)(j + 1);
|
|
||||||
int k = this.width;
|
|
||||||
int l = this.height;
|
|
||||||
float f1 = (float)(j - i / 2) / 256.0F;
|
|
||||||
|
|
||||||
worldrenderer.pos((double)k, (double)l, (double)this.zLevel).tex((double)(0.0F + f1), 1.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
|
|
||||||
worldrenderer.pos((double)k, 0.0D, (double)this.zLevel).tex((double)(1.0F + f1), 1.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
|
|
||||||
worldrenderer.pos(0.0D, 0.0D, (double)this.zLevel).tex((double)(1.0F + f1), 0.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
|
|
||||||
worldrenderer.pos(0.0D, (double)l, (double)this.zLevel).tex((double)(0.0F + f1), 0.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
|
|
||||||
}
|
|
||||||
|
|
||||||
tessellator.draw();
|
|
||||||
GlStateManager.enableAlpha();
|
|
||||||
GlStateManager.colorMask(true, true, true, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renderSkybox(int p_73971_1_, int p_73971_2_, float p_73971_3_)
|
|
||||||
{
|
|
||||||
this.mc.getFramebuffer().unbindFramebuffer();
|
|
||||||
GlStateManager.viewport(0, 0, 256, 256);
|
|
||||||
this.drawPanorama(p_73971_1_, p_73971_2_, p_73971_3_);
|
|
||||||
this.rotateAndBlurSkybox(p_73971_3_);
|
|
||||||
this.rotateAndBlurSkybox(p_73971_3_);
|
|
||||||
this.rotateAndBlurSkybox(p_73971_3_);
|
|
||||||
this.rotateAndBlurSkybox(p_73971_3_);
|
|
||||||
this.rotateAndBlurSkybox(p_73971_3_);
|
|
||||||
this.rotateAndBlurSkybox(p_73971_3_);
|
|
||||||
this.rotateAndBlurSkybox(p_73971_3_);
|
|
||||||
this.mc.getFramebuffer().bindFramebuffer(true);
|
|
||||||
GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
|
|
||||||
float f = this.width > this.height ? 120.0F / (float)this.width : 120.0F / (float)this.height;
|
|
||||||
float f1 = (float)this.height * f / 256.0F;
|
|
||||||
float f2 = (float)this.width * f / 256.0F;
|
|
||||||
int i = this.width;
|
|
||||||
int j = this.height;
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
|
||||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
|
||||||
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
|
|
||||||
worldrenderer.pos(0.0D, (double)j, (double)this.zLevel).tex((double)(0.5F - f1), (double)(0.5F + f2)).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex();
|
|
||||||
worldrenderer.pos((double)i, (double)j, (double)this.zLevel).tex((double)(0.5F - f1), (double)(0.5F - f2)).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex();
|
|
||||||
worldrenderer.pos((double)i, 0.0D, (double)this.zLevel).tex((double)(0.5F + f1), (double)(0.5F - f2)).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex();
|
|
||||||
worldrenderer.pos(0.0D, 0.0D, (double)this.zLevel).tex((double)(0.5F + f1), (double)(0.5F + f2)).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex();
|
|
||||||
tessellator.draw();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
||||||
{
|
{
|
||||||
GlStateManager.disableAlpha();
|
DrawUtils.drawImage(new ResourceLocation("Athena/menu/wallpaper.jpg"), 0, 0, width, height);
|
||||||
this.renderSkybox(mouseX, mouseY, partialTicks);
|
|
||||||
GlStateManager.enableAlpha();
|
|
||||||
|
|
||||||
this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215);
|
|
||||||
this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE);
|
|
||||||
|
|
||||||
String s = "Athena Client v" + Athena.INSTANCE.getClientVersion();
|
|
||||||
|
|
||||||
this.drawString(this.fontRendererObj, s, 2, this.height - 10, -1);
|
|
||||||
|
|
||||||
int[] size = InputUtils.getWindowsSize();
|
int[] size = InputUtils.getWindowsSize();
|
||||||
int startX = size[0] / 2;
|
int startX = size[0] / 2;
|
||||||
int startY = size[1] / 2;
|
int startY = size[1] / 2;
|
||||||
|
|
||||||
int x = startX - 75;
|
int x = startX - 75;
|
||||||
int y = this.height / 4 - 49;
|
int y = this.height / 4 + 18;
|
||||||
int width = 150;
|
int width = 150;
|
||||||
int height = 100;
|
int height = 100;
|
||||||
|
|
||||||
|
FontManager.vision30.drawString(Athena.INSTANCE.getClientName().toUpperCase(),
|
||||||
|
this.width / 2 - 88 + FontManager.vision30.getStringWidth(Athena.INSTANCE.getClientName().toUpperCase()), y, new Color(255, 255, 255).getRGB());
|
||||||
|
|
||||||
|
GlStateManager.pushMatrix();
|
||||||
|
DrawUtils.drawImage(new ResourceLocation("Athena/menu/exit.png"),startX + startX - 20, 10, 10, 10);
|
||||||
|
DrawUtils.drawImage(new ResourceLocation("Athena/menu/usericon.png"), startX + startX - 45, 10, 10, 10);
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
boolean isOverAccountManager = mouseX >= startX+startX-50 && mouseX <= startX+startX-30 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25;
|
boolean isOverAccountManager = mouseX >= startX+startX-50 && mouseX <= startX+startX-30 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25;
|
||||||
DrawUtils.drawRoundedRect(startX+startX - 50, startY - startY + 5, startX+startX - 30, startY - startY + 25, 4, isOverAccountManager ? new Color(200,200,200,100).getRGB() : new Color(100,100,100,100).getRGB());
|
DrawUtils.drawRoundedRect(startX+startX - 50, startY - startY + 5, startX+startX - 30, startY - startY + 25, 4, isOverAccountManager ? new Color(200,200,200,100).getRGB() : new Color(100,100,100,100).getRGB());
|
||||||
|
@ -498,12 +348,6 @@ public class AthenaMenu extends GuiScreen implements GuiYesNoCallback
|
||||||
DrawUtils.drawRoundedRect(startX+startX - 25 + 1, startY - startY + 5 + 1, startX+startX - 5 - 1, startY - startY + 25 - 1, 3, new Color(22, 24, 27,80).getRGB());
|
DrawUtils.drawRoundedRect(startX+startX - 25 + 1, startY - startY + 5 + 1, startX+startX - 5 - 1, startY - startY + 25 - 1, 3, new Color(22, 24, 27,80).getRGB());
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
|
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
DrawUtils.drawImage(new ResourceLocation("Athena/menu/exit.png"),startX + startX - 20, 10, 10, 10);
|
|
||||||
DrawUtils.drawImage(new ResourceLocation("Athena/menu/usericon.png"), startX + startX - 45, 10, 10, 10);
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
|
|
||||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,14 +361,13 @@ public class AthenaMenu extends GuiScreen implements GuiYesNoCallback
|
||||||
|
|
||||||
boolean isOverExit = mouseX >= startX+startX-25 && mouseX <= startX+startX - 5 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25;
|
boolean isOverExit = mouseX >= startX+startX-25 && mouseX <= startX+startX - 5 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25;
|
||||||
boolean isOverAccountManager = mouseX >= startX+startX-50 && mouseX <= startX+startX-30 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25;
|
boolean isOverAccountManager = mouseX >= startX+startX-50 && mouseX <= startX+startX-30 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25;
|
||||||
boolean isOverReplay = mouseX >= startX+startX-75 && mouseX <= startX+startX-55 && mouseY >= startY - startY + 5 && mouseY <= startY - startY + 25;
|
|
||||||
|
|
||||||
if(isOverExit) {
|
if(isOverExit) {
|
||||||
this.mc.shutdown();
|
this.mc.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isOverAccountManager) {
|
if(isOverAccountManager) {
|
||||||
//this.mc.displayGuiScreen(new GuiAccountManager());
|
this.mc.displayGuiScreen(new SessionGui(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,116 @@
|
||||||
|
package rip.athena.client.gui.menu;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
import net.minecraft.client.gui.GuiTextField;
|
||||||
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
|
import net.minecraft.util.Session;
|
||||||
|
import org.apache.commons.io.IOUtils;
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
|
||||||
|
import java.awt .*;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/4/2023
|
||||||
|
*/
|
||||||
|
public class SessionGui extends GuiScreen {
|
||||||
|
private GuiScreen previousScreen;
|
||||||
|
|
||||||
|
private String status = "Session:";
|
||||||
|
private GuiTextField sessionField;
|
||||||
|
private ScaledResolution sr;
|
||||||
|
|
||||||
|
public SessionGui(GuiScreen previousScreen) {
|
||||||
|
this.previousScreen = previousScreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initGui() {
|
||||||
|
Keyboard.enableRepeatEvents(true);
|
||||||
|
sr = new ScaledResolution(mc);
|
||||||
|
|
||||||
|
sessionField = new GuiTextField(1, mc.fontRendererObj, sr.getScaledWidth() / 2 - 100, sr.getScaledHeight() / 2, 200, 20);
|
||||||
|
sessionField.setMaxStringLength(32767);
|
||||||
|
sessionField.setFocused(true);
|
||||||
|
|
||||||
|
buttonList.add(new GuiButton(998, sr.getScaledWidth() / 2 - 100, sr.getScaledHeight() / 2 + 30, 200, 20, "Login"));
|
||||||
|
|
||||||
|
super.initGui();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onGuiClosed() {
|
||||||
|
Keyboard.enableRepeatEvents(false);
|
||||||
|
|
||||||
|
super.onGuiClosed();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||||
|
drawDefaultBackground();
|
||||||
|
|
||||||
|
mc.fontRendererObj.drawString(status, sr.getScaledWidth() / 2 - mc.fontRendererObj.getStringWidth(status) / 2, sr.getScaledHeight() / 2 - 30, Color.WHITE.getRGB());
|
||||||
|
sessionField.drawTextBox();
|
||||||
|
|
||||||
|
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void actionPerformed(GuiButton button) throws IOException {
|
||||||
|
//login button
|
||||||
|
if (button.id == 998) {
|
||||||
|
try {
|
||||||
|
String username, uuid, token, session = sessionField.getText();
|
||||||
|
|
||||||
|
if (session.contains(":")) { //if fully formatted string (ign:uuid:token)
|
||||||
|
//split string to data
|
||||||
|
username = session.split(":")[0];
|
||||||
|
uuid = session.split(":")[1];
|
||||||
|
token = session.split(":")[2];
|
||||||
|
} else { //if only token
|
||||||
|
//make request
|
||||||
|
HttpURLConnection c = (HttpURLConnection) new URL("https://api.minecraftservices.com/minecraft/profile/").openConnection();
|
||||||
|
c.setRequestProperty("Content-type", "application/json");
|
||||||
|
c.setRequestProperty("Authorization", "Bearer " + sessionField.getText());
|
||||||
|
c.setDoOutput(true);
|
||||||
|
|
||||||
|
//get json
|
||||||
|
JsonObject json = new JsonParser().parse(IOUtils.toString(c.getInputStream())).getAsJsonObject();
|
||||||
|
|
||||||
|
//get data
|
||||||
|
username = json.get("name").getAsString();
|
||||||
|
uuid = json.get("id").getAsString();
|
||||||
|
token = session;
|
||||||
|
}
|
||||||
|
|
||||||
|
//set session and return to previous screen
|
||||||
|
mc.session = new Session(username, uuid, token, "mojang");
|
||||||
|
status = "§aSuccess: Logged into " + username;
|
||||||
|
//mc.displayGuiScreen(previousScreen);
|
||||||
|
//in case we couldn't set session for some reason
|
||||||
|
} catch (Exception e) {
|
||||||
|
status = "§cError: Couldn't set session (check mc logs)";
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
super.actionPerformed(button);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void keyTyped(char typedChar, int keyCode) throws IOException {
|
||||||
|
sessionField.textboxKeyTyped(typedChar, keyCode);
|
||||||
|
|
||||||
|
if (Keyboard.KEY_ESCAPE == keyCode) mc.displayGuiScreen(previousScreen);
|
||||||
|
else super.keyTyped(typedChar, keyCode);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package rip.athena.client.macros;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/4/2023
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class Macro {
|
||||||
|
|
||||||
|
private String name, command;
|
||||||
|
private boolean enabled;
|
||||||
|
private int key;
|
||||||
|
|
||||||
|
public Macro(String name, String command, int key, boolean enabled) {
|
||||||
|
this.name = name;
|
||||||
|
this.command = command;
|
||||||
|
this.key = key;
|
||||||
|
this.enabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Macro(String name, String command, int key) {
|
||||||
|
this(name, command, key, true);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package rip.athena.client.macros;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.events.SubscribeEvent;
|
||||||
|
import rip.athena.client.events.types.input.KeyDownEvent;
|
||||||
|
import rip.athena.client.events.types.input.MouseDownEvent;
|
||||||
|
import rip.athena.client.gui.clickgui.components.mods.MenuModKeybind;
|
||||||
|
import sun.rmi.transport.proxy.RMIHttpToCGISocketFactory;
|
||||||
|
|
||||||
|
import javax.crypto.Mac;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/4/2023
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class MacroManager {
|
||||||
|
|
||||||
|
private List<Macro> macros;
|
||||||
|
|
||||||
|
public MacroManager() {
|
||||||
|
this.macros = new CopyOnWriteArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onMouseDown(MouseDownEvent event) {
|
||||||
|
if(Minecraft.getMinecraft().currentScreen != null) return;
|
||||||
|
|
||||||
|
for(Macro macro : macros) {
|
||||||
|
if(!macro.isEnabled()) continue;
|
||||||
|
|
||||||
|
if(macro.getKey() == event.getButton() - MenuModKeybind.mouseOffset) {
|
||||||
|
Minecraft.getMinecraft().thePlayer.sendChatMessage(macro.getCommand());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onKeyDown(KeyDownEvent event) {
|
||||||
|
if(Minecraft.getMinecraft().currentScreen != null) return;
|
||||||
|
|
||||||
|
for(Macro macro : macros) {
|
||||||
|
if(!macro.isEnabled()) continue;
|
||||||
|
|
||||||
|
if(macro.getKey() == event.getKey() && event.getKey() > 0) {
|
||||||
|
Minecraft.getMinecraft().thePlayer.sendChatMessage(macro.getCommand());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,8 +11,94 @@ import rip.athena.client.modules.Module;
|
||||||
*/
|
*/
|
||||||
public class OptimizerMod extends Module {
|
public class OptimizerMod extends Module {
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Culling fix", description = "Fixes a bug which can cause chunks to not sometimes render, this can affect fps negatively.")
|
||||||
|
public boolean CULLING_FIX = true;
|
||||||
|
public boolean ENTITY_CULLING = true;
|
||||||
|
public int ENTITY_CULLING_INTERVAL = 0;
|
||||||
|
public boolean SMART_ENTITY_CULLING = true;
|
||||||
|
public boolean DONT_CULL_PLAYER_NAMETAGS = true;
|
||||||
|
public boolean DONT_CULL_ENTITY_NAMETAGS = true;
|
||||||
|
public boolean DONT_CULL_ARMOR_STANDS_NAMETAGS = true;
|
||||||
|
public boolean PARTICLE_CULLING = true;
|
||||||
|
public boolean ITEM_SEARCHING = true;
|
||||||
|
public boolean OPTIMISED_ITEM_RENDERER = true;
|
||||||
|
public boolean OPTIMISED_FONT_RENDERER = true;
|
||||||
|
public boolean CACHED_FONT_DATA = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Low animation tick", description = "Renders animations slower for better performance.")
|
||||||
|
public boolean LOW_ANIMATION_TICK = true;
|
||||||
|
public boolean BATCH_MODEL_RENDERING = true;
|
||||||
|
public boolean DISABLE_GL_ERROR_CHECKING = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Static particle color", description = "Makes particles render at full brightness.")
|
||||||
|
public boolean STATIC_PARTICLE_COLOR = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Better skin loading", description = "Makes so skin loading should be less stuttery when you join servers.")
|
||||||
|
public boolean BETTER_SKIN_LOADING = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Remove light calculation", description = "Removes light calculations, rendering the game in full brightness.")
|
||||||
|
public boolean LIGHT_CALCULATION_REMOVAL = true;
|
||||||
|
|
||||||
@ConfigValue.Boolean(name = "Chunk update limiter", description = "Enable a chunk update limiter to improve performance")
|
@ConfigValue.Boolean(name = "Chunk update limiter", description = "Enable a chunk update limiter to improve performance")
|
||||||
public boolean CHUNK_UPDATE_LIMITER_ENABLED = true;
|
public boolean CHUNK_UPDATE_LIMITE_ENABLED = true;
|
||||||
|
|
||||||
|
@ConfigValue.Integer(name = "Chunk updates per second", description = "Lower value, better fps.", min = 1, max = 250)
|
||||||
|
public int CHUNK_UPDATE_LIMITER = 50;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Remove text shadows", description = "Removes all text shadows.")
|
||||||
|
public boolean REMOVE_TEXT_SHADOWS= false;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Remove chat background", description = "Removes the chat background.")
|
||||||
|
public boolean REMOVE_CHAT_BACKGROUND = false;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Remove mob spawner entity", description = "Removes the spinning entity inside of mob spawners.")
|
||||||
|
public boolean REMOVE_ENTITY_SPAWNER = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Static drops", description = "Items on ground no longer rotate.")
|
||||||
|
public boolean STATIC_DROPS = true;
|
||||||
|
public boolean FAST_WORLD_LOADING = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Remove item glint", description = "Removes the enchantment glint from all items.")
|
||||||
|
public boolean REMOVE_ITEM_GLINT = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Remove Piston Extentions", description = "Removes Piston Extentions Animation.")
|
||||||
|
public static boolean REMOVE_PISTON_EXTENTION = false;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Disable TNT Flashing", description = "Disables Prime TNT Flashing to help FPS")
|
||||||
|
public boolean noLagTNTFlash = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Remove TNT", description = "Removes all primed tnt blocks.")
|
||||||
|
public boolean REMOVE_TNT = false;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Disable TNT Expand", description = "Disables Prime TNT Expanding to help FPS")
|
||||||
|
public boolean noLagTNTExpand = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Merge TNT", description = "If Prime TNT is in the same block, render it as 1 Prime TNT")
|
||||||
|
public boolean noLagStackTNT = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Holograms Render", description = "Disables the render of holograms")
|
||||||
|
public boolean noLagHolograms = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Custom Cane Renderer", description = "Only render cane in a certain radius to help FPS")
|
||||||
|
public boolean noLagCane = false;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Liquid Vision", description = "Makes it clear in water an lava")
|
||||||
|
public boolean noLagLiquidVision = false;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Remove Water", description = "Removes the render of water")
|
||||||
|
public static boolean noLagClearWater = false;
|
||||||
|
|
||||||
|
@ConfigValue.Integer(name = "Tile Entity Render Distance", min = 1, max = 64)
|
||||||
|
public int noLagBlockDistance = 32;
|
||||||
|
|
||||||
|
@ConfigValue.Integer(name = "Entity Render Distance", min = 1, max = 64)
|
||||||
|
public int noLagEntityDistance = 32;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Disable fog", description = "Disables fog")
|
||||||
|
public boolean noFog = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Better Chests", description = "Disable render of knob/lid/reduce size of chests")
|
||||||
|
public boolean noBetterChests = false;
|
||||||
|
|
||||||
public OptimizerMod() {
|
public OptimizerMod() {
|
||||||
super("Optimizer", Category.FPS_SETTINGS);
|
super("Optimizer", Category.FPS_SETTINGS);
|
||||||
|
|
|
@ -0,0 +1,238 @@
|
||||||
|
package rip.athena.client.modules.impl.fpssettings.impl;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
|
import net.minecraft.client.multiplayer.WorldClient;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.WorldRenderer;
|
||||||
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.item.EntityArmorStand;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.scoreboard.Team;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import optifine.Config;
|
||||||
|
import org.lwjgl.opengl.GL15;
|
||||||
|
import org.lwjgl.opengl.GLContext;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.events.SubscribeEvent;
|
||||||
|
import rip.athena.client.events.types.client.ClientTickEvent;
|
||||||
|
import rip.athena.client.events.types.render.RenderEntityEvent;
|
||||||
|
import rip.athena.client.modules.impl.fpssettings.OptimizerMod;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/4/2023
|
||||||
|
*/
|
||||||
|
public class EntityCulling {
|
||||||
|
public static boolean shouldPerformCulling = false;
|
||||||
|
private static final ConcurrentHashMap<UUID, OcclusionQuery> queries = new ConcurrentHashMap<>();
|
||||||
|
private static final boolean SUPPORT_NEW_GL = (GLContext.getCapabilities()).OpenGL33;
|
||||||
|
private static OptimizerMod settings;
|
||||||
|
|
||||||
|
public static boolean canRenderName(EntityLivingBase entity) {
|
||||||
|
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
|
||||||
|
if (entity instanceof EntityPlayer && entity != player) {
|
||||||
|
Team otherEntityTeam = entity.getTeam();
|
||||||
|
Team playerTeam = player.getTeam();
|
||||||
|
if (otherEntityTeam != null) {
|
||||||
|
Team.EnumVisible teamVisibilityRule = otherEntityTeam.getNameTagVisibility();
|
||||||
|
switch (teamVisibilityRule) {
|
||||||
|
case NEVER:
|
||||||
|
return false;
|
||||||
|
case HIDE_FOR_OTHER_TEAMS:
|
||||||
|
return (playerTeam == null || otherEntityTeam.isSameTeam(playerTeam));
|
||||||
|
case HIDE_FOR_OWN_TEAM:
|
||||||
|
return (playerTeam == null || !otherEntityTeam.isSameTeam(playerTeam));
|
||||||
|
|
||||||
|
case ALWAYS:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void shouldRenderEntity(RenderEntityEvent<EntityLivingBase> event) {
|
||||||
|
if(settings == null) {
|
||||||
|
settings = (OptimizerMod) Athena.INSTANCE.getModuleManager().get(OptimizerMod.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(settings.SMART_ENTITY_CULLING && Config.isShaders()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!settings.ENTITY_CULLING || !shouldPerformCulling)
|
||||||
|
return;
|
||||||
|
|
||||||
|
EntityLivingBase entity = event.getEntity();
|
||||||
|
|
||||||
|
if(entity.isMobSpawner) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean armorstand = entity instanceof EntityArmorStand;
|
||||||
|
if (entity == Minecraft.getMinecraft().thePlayer || entity.worldObj != Minecraft.getMinecraft().thePlayer.worldObj
|
||||||
|
|| (entity.isInvisibleToPlayer((EntityPlayer) Minecraft.getMinecraft().thePlayer) && !armorstand))
|
||||||
|
return;
|
||||||
|
if (checkEntity((Entity) entity)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
if (!canRenderName(entity))
|
||||||
|
return;
|
||||||
|
if ((settings.DONT_CULL_PLAYER_NAMETAGS && entity instanceof EntityPlayer)
|
||||||
|
|| (settings.DONT_CULL_ENTITY_NAMETAGS && !armorstand)
|
||||||
|
|| (settings.DONT_CULL_ARMOR_STANDS_NAMETAGS && armorstand))
|
||||||
|
event.getRenderer().renderName(entity, event.getX(), event.getY(), event.getZ());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void drawSelectionBoundingBox(AxisAlignedBB b) {
|
||||||
|
GlStateManager.disableAlpha();
|
||||||
|
GlStateManager.disableCull();
|
||||||
|
GlStateManager.depthMask(false);
|
||||||
|
GlStateManager.colorMask(false, false, false, false);
|
||||||
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
|
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||||
|
worldrenderer.begin(8, DefaultVertexFormats.POSITION);
|
||||||
|
worldrenderer.pos(b.maxX, b.maxY, b.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(b.maxX, b.maxY, b.minZ).endVertex();
|
||||||
|
worldrenderer.pos(b.minX, b.maxY, b.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(b.minX, b.maxY, b.minZ).endVertex();
|
||||||
|
worldrenderer.pos(b.minX, b.minY, b.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(b.minX, b.minY, b.minZ).endVertex();
|
||||||
|
worldrenderer.pos(b.minX, b.maxY, b.minZ).endVertex();
|
||||||
|
worldrenderer.pos(b.minX, b.minY, b.minZ).endVertex();
|
||||||
|
worldrenderer.pos(b.maxX, b.maxY, b.minZ).endVertex();
|
||||||
|
worldrenderer.pos(b.maxX, b.minY, b.minZ).endVertex();
|
||||||
|
worldrenderer.pos(b.maxX, b.maxY, b.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(b.maxX, b.minY, b.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(b.minX, b.maxY, b.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(b.minX, b.minY, b.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(b.minX, b.minY, b.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(b.maxX, b.minY, b.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(b.minX, b.minY, b.minZ).endVertex();
|
||||||
|
worldrenderer.pos(b.maxX, b.minY, b.minZ).endVertex();
|
||||||
|
tessellator.draw();
|
||||||
|
GlStateManager.depthMask(true);
|
||||||
|
GlStateManager.colorMask(true, true, true, true);
|
||||||
|
GlStateManager.enableAlpha();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean checkEntity(Entity entity) {
|
||||||
|
OcclusionQuery query = queries.computeIfAbsent(entity.getUniqueID(), OcclusionQuery::new);
|
||||||
|
if (query.refresh) {
|
||||||
|
query.nextQuery = getQuery();
|
||||||
|
query.refresh = false;
|
||||||
|
GlStateManager.pushMatrix();
|
||||||
|
GlStateManager.translate(-Minecraft.getMinecraft().getRenderManager().renderPosX, -Minecraft.getMinecraft().getRenderManager().renderPosY,
|
||||||
|
-Minecraft.getMinecraft().getRenderManager().renderPosZ);
|
||||||
|
int mode = SUPPORT_NEW_GL ? 35887 : 35092;
|
||||||
|
GL15.glBeginQuery(mode, query.nextQuery);
|
||||||
|
drawSelectionBoundingBox(entity.getEntityBoundingBox().expand(0.2D, 0.2D, 0.2D));
|
||||||
|
GL15.glEndQuery(mode);
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
}
|
||||||
|
return query.occluded;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int getQuery() {
|
||||||
|
try {
|
||||||
|
return GL15.glGenQueries();
|
||||||
|
} catch (Throwable throwable) {
|
||||||
|
Athena.INSTANCE.getLog().error(
|
||||||
|
"Failed to run GL15.glGenQueries(). User's computer is likely too old to support OpenGL 1.5, Entity Culling has been force disabled." + throwable);
|
||||||
|
settings.ENTITY_CULLING = false;
|
||||||
|
Athena.INSTANCE.getLog().info(
|
||||||
|
"Entity Culling has forcefully been disabled as your computer is too old and does not support the technology behind it.\nIf you believe this is a mistake, please contact us at discord.gg/sk1er");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void check() {
|
||||||
|
if(settings == null) {
|
||||||
|
settings = (OptimizerMod) Athena.INSTANCE.getModuleManager().get(OptimizerMod.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
long delay = 0L;
|
||||||
|
switch (settings.ENTITY_CULLING_INTERVAL) {
|
||||||
|
case 0:
|
||||||
|
delay = 50L;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
delay = 25L;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
delay = 10L;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
long nanoTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
|
||||||
|
for (OcclusionQuery query : queries.values()) {
|
||||||
|
if (query.nextQuery != 0) {
|
||||||
|
long queryObject = GL15.glGetQueryObjecti(query.nextQuery, 34919);
|
||||||
|
if (queryObject != 0L) {
|
||||||
|
query.occluded = (GL15.glGetQueryObjecti(query.nextQuery, 34918) == 0);
|
||||||
|
GL15.glDeleteQueries(query.nextQuery);
|
||||||
|
query.nextQuery = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (query.nextQuery == 0 && nanoTime - query.executionTime > delay) {
|
||||||
|
query.executionTime = nanoTime;
|
||||||
|
query.refresh = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void tick(ClientTickEvent event) {
|
||||||
|
WorldClient theWorld = Minecraft.getMinecraft().theWorld;
|
||||||
|
if (theWorld == null)
|
||||||
|
return;
|
||||||
|
List<UUID> remove = new ArrayList<>();
|
||||||
|
label26: for (OcclusionQuery value : queries.values()) {
|
||||||
|
for (Entity entity : theWorld.loadedEntityList) {
|
||||||
|
if (entity.getUniqueID() == value.uuid)
|
||||||
|
continue label26;
|
||||||
|
}
|
||||||
|
remove.add(value.uuid);
|
||||||
|
if (value.nextQuery != 0)
|
||||||
|
GL15.glDeleteQueries(value.nextQuery);
|
||||||
|
}
|
||||||
|
for (UUID uuid : remove)
|
||||||
|
queries.remove(uuid);
|
||||||
|
|
||||||
|
Minecraft.getMinecraft().addScheduledTask(this::check);
|
||||||
|
}
|
||||||
|
|
||||||
|
static class OcclusionQuery {
|
||||||
|
private final UUID uuid;
|
||||||
|
|
||||||
|
private int nextQuery;
|
||||||
|
|
||||||
|
private boolean refresh = true;
|
||||||
|
|
||||||
|
private boolean occluded;
|
||||||
|
|
||||||
|
private long executionTime = 0L;
|
||||||
|
|
||||||
|
public OcclusionQuery(UUID uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getUuid() {
|
||||||
|
return this.uuid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,114 @@
|
||||||
|
package rip.athena.client.modules.impl.mods;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import org.lwjgl.opengl.Display;
|
||||||
|
import rip.athena.client.config.ConfigValue;
|
||||||
|
import rip.athena.client.events.SubscribeEvent;
|
||||||
|
import rip.athena.client.events.types.input.KeyDownEvent;
|
||||||
|
import rip.athena.client.events.types.input.KeyUpEvent;
|
||||||
|
import rip.athena.client.modules.Category;
|
||||||
|
import rip.athena.client.modules.Module;
|
||||||
|
import rip.athena.client.utils.input.KeybindManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/3/2023
|
||||||
|
*/
|
||||||
|
public class Freelook extends Module {
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Require Hold")
|
||||||
|
private boolean returnOnRelease = false;
|
||||||
|
|
||||||
|
@ConfigValue.Keybind(name = "Perspective Key")
|
||||||
|
private int keyBind = 0;
|
||||||
|
|
||||||
|
public static boolean perspectiveToggled = false;
|
||||||
|
public int previousPerspective = 0;
|
||||||
|
|
||||||
|
public static float cameraYaw, cameraPitch = 0F;
|
||||||
|
|
||||||
|
|
||||||
|
public Freelook() {
|
||||||
|
super("Freelook", Category.MODS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onKeyPress(KeyDownEvent event) {
|
||||||
|
if(KeybindManager.isInvalidScreen(mc.currentScreen)) return;
|
||||||
|
|
||||||
|
if(keyBind == 0) return;
|
||||||
|
|
||||||
|
if(event.getKey() == keyBind) {
|
||||||
|
perspectiveToggled = !perspectiveToggled;
|
||||||
|
|
||||||
|
if(perspectiveToggled) {
|
||||||
|
previousPerspective = mc.gameSettings.thirdPersonView;
|
||||||
|
mc.gameSettings.thirdPersonView = 1;
|
||||||
|
cameraPitch = mc.thePlayer.rotationPitch;
|
||||||
|
cameraYaw = mc.thePlayer.rotationYaw;
|
||||||
|
mc.entityRenderer.loadEntityShader(null);
|
||||||
|
mc.renderGlobal.setDisplayListEntitiesDirty();
|
||||||
|
} else {
|
||||||
|
mc.gameSettings.thirdPersonView = previousPerspective;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(event.getKey() == mc.gameSettings.keyBindTogglePerspective.getKeyCode()) {
|
||||||
|
perspectiveToggled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onKeyUp(KeyUpEvent event) {
|
||||||
|
if(event.getKey() == keyBind) {
|
||||||
|
if(returnOnRelease) {
|
||||||
|
perspectiveToggled = false;
|
||||||
|
mc.gameSettings.thirdPersonView = previousPerspective;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getCameraYaw() {
|
||||||
|
return perspectiveToggled ? cameraYaw : Minecraft.getMinecraft().thePlayer.rotationYaw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getCameraPitch() {
|
||||||
|
return perspectiveToggled ? cameraPitch : Minecraft.getMinecraft().thePlayer.rotationPitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean overrideMouse() {
|
||||||
|
if (Minecraft.getMinecraft().inGameHasFocus && Display.isActive() && (isToggled())) {
|
||||||
|
if (!perspectiveToggled) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Minecraft.getMinecraft().mouseHelper.mouseXYChange();
|
||||||
|
float f1 = Minecraft.getMinecraft().gameSettings.mouseSensitivity * 0.6F + 0.2F;
|
||||||
|
float f2 = f1 * f1 * f1 * 8.0F;
|
||||||
|
float f3 = (float) Minecraft.getMinecraft().mouseHelper.deltaX * f2;
|
||||||
|
float f4 = (float) Minecraft.getMinecraft().mouseHelper.deltaY * f2;
|
||||||
|
|
||||||
|
cameraYaw += f3 * 0.15F;
|
||||||
|
cameraPitch -= f4 * 0.15F;
|
||||||
|
|
||||||
|
if (cameraPitch > 90)
|
||||||
|
cameraPitch = 90;
|
||||||
|
if (cameraPitch < -90)
|
||||||
|
cameraPitch = -90;
|
||||||
|
Minecraft.getMinecraft().renderGlobal.setDisplayListEntitiesDirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
super.onEnable();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
super.onDisable();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package rip.athena.client.modules.impl.mods;
|
||||||
|
|
||||||
|
import rip.athena.client.modules.Category;
|
||||||
|
import rip.athena.client.modules.Module;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/4/2023
|
||||||
|
*/
|
||||||
|
public class MouseDelayFix extends Module {
|
||||||
|
|
||||||
|
public MouseDelayFix() {
|
||||||
|
super("MouseDelayFix", Category.MODS);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package rip.athena.client.modules.impl.mods;
|
||||||
|
|
||||||
|
import rip.athena.client.modules.Category;
|
||||||
|
import rip.athena.client.modules.Module;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/4/2023
|
||||||
|
*/
|
||||||
|
public class NoHurtCam extends Module {
|
||||||
|
|
||||||
|
public NoHurtCam() {
|
||||||
|
super("NoHurtCam", Category.MODS);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
package rip.athena.client.modules.impl.mods;
|
||||||
|
|
||||||
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import rip.athena.client.config.ConfigValue;
|
||||||
|
import rip.athena.client.modules.Category;
|
||||||
|
import rip.athena.client.modules.Module;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/4/2023
|
||||||
|
*/
|
||||||
|
public class OldAnimations extends Module {
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Blocking")
|
||||||
|
public boolean OLD_BLOCKING = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Blocking Hitting")
|
||||||
|
public boolean OLD_BLOCKING_HITTING= true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Item Held")
|
||||||
|
public boolean OLD_ITEM_HELD = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Bow")
|
||||||
|
public boolean OLD_BOW = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Eat/Break Animation")
|
||||||
|
public boolean OLD_EAT_USE_ANIMATION = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Armor Damage Flash")
|
||||||
|
public boolean ARMOR = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Disable Health Flash")
|
||||||
|
public boolean DISABLE_HEALTH_FLASH = true;
|
||||||
|
|
||||||
|
public OldAnimations() {
|
||||||
|
super("Old Animations", Category.MODS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void attemptSwing() {
|
||||||
|
if (this.mc.thePlayer.getHeldItem() != null && this.isToggled() && OLD_EAT_USE_ANIMATION) {
|
||||||
|
boolean mouseDown = this.mc.gameSettings.keyBindAttack.isKeyDown()
|
||||||
|
&& this.mc.gameSettings.keyBindUseItem.isKeyDown();
|
||||||
|
|
||||||
|
if (mouseDown && this.mc.objectMouseOver != null
|
||||||
|
&& this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||||
|
this.swingItem(this.mc.thePlayer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void swingItem(EntityPlayerSP entityplayersp) {
|
||||||
|
final int swingAnimationEnd = entityplayersp.isPotionActive(Potion.digSpeed)
|
||||||
|
? (6 - (1 + entityplayersp.getActivePotionEffect(Potion.digSpeed).getAmplifier()) * 1)
|
||||||
|
: (entityplayersp.isPotionActive(Potion.digSlowdown)
|
||||||
|
? (6 + (1 + entityplayersp.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2)
|
||||||
|
: 6);
|
||||||
|
if (!entityplayersp.isSwingInProgress || entityplayersp.swingProgressInt >= swingAnimationEnd / 2
|
||||||
|
|| entityplayersp.swingProgressInt < 0) {
|
||||||
|
entityplayersp.swingProgressInt = -1;
|
||||||
|
entityplayersp.isSwingInProgress = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,330 @@
|
||||||
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
import net.minecraft.client.renderer.RenderHelper;
|
||||||
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import rip.athena.client.config.ConfigValue;
|
||||||
|
import rip.athena.client.font.FontManager;
|
||||||
|
import rip.athena.client.gui.hud.HUDElement;
|
||||||
|
import rip.athena.client.modules.Category;
|
||||||
|
import rip.athena.client.modules.Module;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/4/2023
|
||||||
|
*/
|
||||||
|
public class ArmorStatus extends Module {
|
||||||
|
@ConfigValue.Boolean(name = "Item Name")
|
||||||
|
private boolean armorstatusitemname = false;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Item Equipped")
|
||||||
|
private boolean armorstatusitemequipped = true;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Preset Durability Colors")
|
||||||
|
private boolean duraColors = true;
|
||||||
|
|
||||||
|
@ConfigValue.Color(name = "Durability Color")
|
||||||
|
private Color valueColor = Color.WHITE;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Custom Font")
|
||||||
|
private boolean customFont = true;
|
||||||
|
|
||||||
|
@ConfigValue.List(name = "Direction", values = { "Vertical", "Horizontal"})
|
||||||
|
private String armourstatusdirection = "Vertical";
|
||||||
|
|
||||||
|
@ConfigValue.List(name = "Value Display", values = {"Percent", "Value Damage/Max", "Value Damage"})
|
||||||
|
private String armorstatusdisplay = "Value Damage";
|
||||||
|
|
||||||
|
@ConfigValue.List(name = "Value Left/Right", values = {"Left", "Right"})
|
||||||
|
private String leftRight = "Left";
|
||||||
|
|
||||||
|
private HUDElement hud;
|
||||||
|
private int armorstatuswidth = 10;
|
||||||
|
private int armorstatusheight = 10;
|
||||||
|
|
||||||
|
public ArmorStatus() {
|
||||||
|
super("Armor Status", Category.RENDER);
|
||||||
|
|
||||||
|
hud = new HUDElement("armorstatus", armorstatuswidth, armorstatusheight) {
|
||||||
|
@Override
|
||||||
|
public void onRender() {
|
||||||
|
render();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
hud.setX(0);
|
||||||
|
hud.setY(200);
|
||||||
|
|
||||||
|
addHUD(hud);
|
||||||
|
}
|
||||||
|
|
||||||
|
private EnumChatFormatting getColorThreshold(int percent) {
|
||||||
|
if (percent > 75 && percent <= 100)
|
||||||
|
return EnumChatFormatting.GREEN;
|
||||||
|
else if (percent > 50 && percent <= 75)
|
||||||
|
return EnumChatFormatting.YELLOW;
|
||||||
|
else if (percent > 25 && percent <= 50)
|
||||||
|
return EnumChatFormatting.RED;
|
||||||
|
else if (percent >= 0 && percent <= 25)
|
||||||
|
return EnumChatFormatting.DARK_RED;
|
||||||
|
|
||||||
|
return EnumChatFormatting.WHITE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render() {
|
||||||
|
if (armourstatusdirection.contains("Horizontal")) {
|
||||||
|
armorstatuswidth = 170;
|
||||||
|
if (armorstatusdisplay.contains("Value Damage/Max")) {
|
||||||
|
armorstatuswidth += 80;
|
||||||
|
if (armorstatusitemequipped) {
|
||||||
|
armorstatuswidth += 35;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (armorstatusdisplay.equals("Percent")) {
|
||||||
|
armorstatuswidth += 20;
|
||||||
|
}
|
||||||
|
if (armorstatusitemequipped) {
|
||||||
|
armorstatuswidth += 35;
|
||||||
|
}
|
||||||
|
armorstatusheight = 15;
|
||||||
|
} else {
|
||||||
|
armorstatuswidth = 50;
|
||||||
|
armorstatusheight = 65;
|
||||||
|
if (armorstatusitemequipped) {
|
||||||
|
armorstatusheight += 20;
|
||||||
|
}
|
||||||
|
if (armorstatusitemname) {
|
||||||
|
armorstatuswidth += 100;
|
||||||
|
}
|
||||||
|
if (armorstatusdisplay.contains("Value Damage/Max")) {
|
||||||
|
armorstatuswidth += 20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
hud.setHeight(armorstatusheight);
|
||||||
|
hud.setWidth(armorstatuswidth);
|
||||||
|
|
||||||
|
if (this.mc.gameSettings.showDebugInfo) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
GlStateManager.enableAlpha();
|
||||||
|
GlStateManager.enableRescaleNormal();
|
||||||
|
GlStateManager.enableBlend();
|
||||||
|
GlStateManager.disableLighting();
|
||||||
|
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||||
|
RenderHelper.enableGUIStandardItemLighting();
|
||||||
|
/*
|
||||||
|
* VERTICAL MODE
|
||||||
|
*/
|
||||||
|
int posX = hud.getX();
|
||||||
|
int posY = hud.getY();
|
||||||
|
|
||||||
|
int xdraw = armorstatusheight - 17;
|
||||||
|
if (armourstatusdirection.contains("Vertical")) {
|
||||||
|
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
|
||||||
|
ItemStack[] reversed = new ItemStack[4];
|
||||||
|
for (int i = 0; i < mc.thePlayer.inventory.armorInventory.length; i++) {
|
||||||
|
ItemStack itemStack = mc.thePlayer.inventory.armorInventory[i];
|
||||||
|
if (itemStack != null) {
|
||||||
|
reversed[3 - i] = itemStack;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (armorstatusitemequipped) {
|
||||||
|
if (Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem() != null) {
|
||||||
|
GlStateManager.disableLighting();
|
||||||
|
GlStateManager.enableBlend();
|
||||||
|
ItemStack itemStack = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem();
|
||||||
|
int maxDamage = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getMaxDamage();
|
||||||
|
int damage = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getItemDamage();
|
||||||
|
int percent = maxDamage > 0 ? 100 - (damage * 100) / maxDamage : 1000;
|
||||||
|
String toDisplay = maxDamage > 0 ? (armorstatusdisplay.equalsIgnoreCase("Percent") ? percent + "% "
|
||||||
|
: armorstatusdisplay.equalsIgnoreCase("Value Damage/Max")
|
||||||
|
? (maxDamage - damage) + "/" + maxDamage
|
||||||
|
: "" + (maxDamage - damage))
|
||||||
|
: "";
|
||||||
|
String color = EnumChatFormatting.WHITE.toString();
|
||||||
|
if (this.armorstatusitemname) {
|
||||||
|
toDisplay += " " + EnumChatFormatting.WHITE.toString() + itemStack.getDisplayName();
|
||||||
|
}
|
||||||
|
if (duraColors) {
|
||||||
|
color = getColorThreshold(percent).toString();
|
||||||
|
} else {
|
||||||
|
color = "";
|
||||||
|
}
|
||||||
|
int width = mc.fontRendererObj.getStringWidth(toDisplay);
|
||||||
|
if (!customFont) {
|
||||||
|
mc.fontRendererObj.drawStringWithShadow(color + toDisplay,
|
||||||
|
(float) (posX + (leftRight.equalsIgnoreCase("Left")
|
||||||
|
? maxDamage > 0 ? armorstatuswidth - width - 21 : armorstatuswidth - width - 21
|
||||||
|
: maxDamage > 0 ? 20 : 16)),
|
||||||
|
(float) (xdraw + posY + 5), valueColor.getRGB());
|
||||||
|
} else {
|
||||||
|
width = (int) FontManager.baloo17.getStringWidth(EnumChatFormatting.getTextWithoutFormattingCodes(toDisplay));
|
||||||
|
FontManager.baloo17.drawString(EnumChatFormatting.getTextWithoutFormattingCodes(toDisplay), (int) (posX - 3
|
||||||
|
+ (leftRight.equalsIgnoreCase("Left")
|
||||||
|
? maxDamage > 0 ? armorstatuswidth - width - 21 : armorstatuswidth - width - 21
|
||||||
|
: maxDamage > 0 ? 20 : 16)),
|
||||||
|
(int) (xdraw + posY + 1), valueColor.getRGB());
|
||||||
|
}
|
||||||
|
|
||||||
|
itemRenderer.renderItemAndEffectIntoGUI(itemStack,
|
||||||
|
(int) ((leftRight.equalsIgnoreCase("Left") ? posX + armorstatuswidth - 20 : posX)),
|
||||||
|
(int) (xdraw + posY + 0));
|
||||||
|
itemRenderer.renderItemOverlayIntoGUI(mc.fontRendererObj, itemStack,
|
||||||
|
(int) ((leftRight.equalsIgnoreCase("Left") ? posX + armorstatuswidth - 20 : posX)),
|
||||||
|
(int) (xdraw + posY + 2), null);
|
||||||
|
xdraw -= 17;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ItemStack itemStack : mc.thePlayer.inventory.armorInventory) {
|
||||||
|
|
||||||
|
if (itemStack != null) {
|
||||||
|
GlStateManager.disableLighting();
|
||||||
|
GlStateManager.enableBlend();
|
||||||
|
int maxDamage = itemStack.getMaxDamage();
|
||||||
|
int damage = itemStack.getItemDamage();
|
||||||
|
int percent = maxDamage > 0 ? 100 - (damage * 100) / maxDamage : 1000;
|
||||||
|
String toDisplay = armorstatusdisplay.equalsIgnoreCase("Percent") ? percent + "% "
|
||||||
|
: armorstatusdisplay.equalsIgnoreCase("Value Damage/Max")
|
||||||
|
? (maxDamage - damage) + "/" + maxDamage
|
||||||
|
: "" + (maxDamage - damage);
|
||||||
|
String color = EnumChatFormatting.WHITE.toString();
|
||||||
|
if (this.armorstatusitemname) {
|
||||||
|
toDisplay += " " + EnumChatFormatting.WHITE.toString() + itemStack.getDisplayName();
|
||||||
|
}
|
||||||
|
if (duraColors) {
|
||||||
|
color = getColorThreshold(percent).toString();
|
||||||
|
} else {
|
||||||
|
color = "";
|
||||||
|
}
|
||||||
|
int width = mc.fontRendererObj.getStringWidth(toDisplay);
|
||||||
|
if (!customFont) {
|
||||||
|
mc.fontRendererObj.drawStringWithShadow(color + toDisplay,
|
||||||
|
(float) (posX
|
||||||
|
+ (leftRight.equalsIgnoreCase("Left") ? (armorstatuswidth) - width - 21 : 20)),
|
||||||
|
(float) (xdraw + posY + 5), valueColor.getRGB());
|
||||||
|
} else {
|
||||||
|
width = (int) FontManager.baloo17.getStringWidth(EnumChatFormatting.getTextWithoutFormattingCodes(toDisplay));
|
||||||
|
FontManager.baloo17.drawString(EnumChatFormatting.getTextWithoutFormattingCodes(toDisplay),
|
||||||
|
(int) (posX - 3
|
||||||
|
+ (leftRight.equalsIgnoreCase("Left") ? (armorstatuswidth) - width - 21 : 20)),
|
||||||
|
(int) (xdraw + posY + 1), valueColor.getRGB());
|
||||||
|
}
|
||||||
|
itemRenderer.renderItemAndEffectIntoGUI(itemStack,
|
||||||
|
(int) ((leftRight.equalsIgnoreCase("Left") ? posX + armorstatuswidth - 20 : posX)),
|
||||||
|
(int) (xdraw + posY + 0));
|
||||||
|
|
||||||
|
itemRenderer.renderItemOverlayIntoGUI(mc.fontRendererObj, itemStack,
|
||||||
|
(int) ((leftRight.equalsIgnoreCase("Left") ? posX + armorstatuswidth - 20 : posX)),
|
||||||
|
(int) (xdraw + posY + 2), null);
|
||||||
|
xdraw -= 17;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int ydraw = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* HORIZONTAL MODE
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (armourstatusdirection.contains("Horizontal")) {
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
|
||||||
|
ItemStack[] reversed = new ItemStack[4];
|
||||||
|
for (int i = 0; i < mc.thePlayer.inventory.armorInventory.length; i++) {
|
||||||
|
ItemStack itemStack = mc.thePlayer.inventory.armorInventory[i];
|
||||||
|
if (itemStack != null) {
|
||||||
|
reversed[3 - i] = itemStack;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ItemStack itemStack : reversed) {
|
||||||
|
if (itemStack != null) {
|
||||||
|
GlStateManager.disableLighting();
|
||||||
|
GlStateManager.enableBlend();
|
||||||
|
int maxDamage = itemStack.getMaxDamage();
|
||||||
|
int damage = itemStack.getItemDamage();
|
||||||
|
int percent = maxDamage > 0 ? 100 - (damage * 100) / maxDamage : 1000;
|
||||||
|
String toDraw = armorstatusdisplay.equalsIgnoreCase("Percent") ? percent + "%"
|
||||||
|
: armorstatusdisplay.equalsIgnoreCase("Value Damage/Max")
|
||||||
|
? "" + (maxDamage - damage) + "/" + maxDamage
|
||||||
|
: "" + (maxDamage - damage);
|
||||||
|
String color = EnumChatFormatting.WHITE.toString();
|
||||||
|
int width = mc.fontRendererObj.getStringWidth(toDraw);
|
||||||
|
if (duraColors) {
|
||||||
|
color = getColorThreshold(percent).toString();
|
||||||
|
} else {
|
||||||
|
color = "";
|
||||||
|
}
|
||||||
|
if (this.customFont) {
|
||||||
|
width = (int) FontManager.baloo17.getStringWidth(EnumChatFormatting.getTextWithoutFormattingCodes(toDraw));
|
||||||
|
FontManager.baloo17.drawString(EnumChatFormatting.getTextWithoutFormattingCodes(toDraw), (int) (posX + ydraw + 16), (int) (posY + 1),
|
||||||
|
valueColor.getRGB());
|
||||||
|
} else {
|
||||||
|
mc.fontRendererObj.drawStringWithShadow(color + toDraw, (float) (posX + ydraw + 18),
|
||||||
|
(float) (posY + 5), valueColor.getRGB());
|
||||||
|
}
|
||||||
|
itemRenderer.renderItemAndEffectIntoGUI(itemStack, (int) (posX + ydraw + 0), (int) (posY + 0));
|
||||||
|
itemRenderer.renderItemOverlayIntoGUI(mc.fontRendererObj, itemStack, (int) (posX + ydraw + 0),
|
||||||
|
(int) (posY + 0), "");
|
||||||
|
ydraw += width + 20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (armorstatusitemequipped) {
|
||||||
|
if (Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem() != null) {
|
||||||
|
GlStateManager.disableLighting();
|
||||||
|
GlStateManager.enableBlend();
|
||||||
|
ItemStack itemStack = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem();
|
||||||
|
int maxDamage = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getMaxDamage();
|
||||||
|
int damage = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getItemDamage();
|
||||||
|
int percent = maxDamage > 0 ? 100 - (damage * 100) / maxDamage : 1000;
|
||||||
|
String toDraw = maxDamage > 0 ? (armorstatusdisplay.equalsIgnoreCase("Percent") ? percent + "% "
|
||||||
|
: armorstatusdisplay.equalsIgnoreCase("Value Damage/Max")
|
||||||
|
? (maxDamage - damage) + "/" + maxDamage
|
||||||
|
: "" + (maxDamage - damage))
|
||||||
|
: "";
|
||||||
|
String color = EnumChatFormatting.WHITE.toString();
|
||||||
|
int width = mc.fontRendererObj.getStringWidth(toDraw);
|
||||||
|
if (duraColors) {
|
||||||
|
color = getColorThreshold(percent).toString();
|
||||||
|
} else {
|
||||||
|
color = "";
|
||||||
|
}
|
||||||
|
if (this.customFont) {
|
||||||
|
width = (int) FontManager.baloo17.getStringWidth(EnumChatFormatting.getTextWithoutFormattingCodes(toDraw));
|
||||||
|
FontManager.baloo17.drawString(EnumChatFormatting.getTextWithoutFormattingCodes(toDraw), (int) (posX + ydraw + 15), (int) (posY + 1),
|
||||||
|
valueColor.getRGB());
|
||||||
|
} else {
|
||||||
|
mc.fontRendererObj.drawStringWithShadow(color + toDraw, (float) (posX + ydraw + 18),
|
||||||
|
(float) (posY + 5), valueColor.getRGB());
|
||||||
|
}
|
||||||
|
itemRenderer.renderItemAndEffectIntoGUI(itemStack, (int) (posX + ydraw), (int) posY);
|
||||||
|
itemRenderer.renderItemOverlayIntoGUI(mc.fontRendererObj, itemStack, (int) (posX + ydraw + 0),
|
||||||
|
(int) (posY + 0), "");
|
||||||
|
|
||||||
|
ydraw += width + 20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GlStateManager.disableLighting();
|
||||||
|
GlStateManager.enableBlend();
|
||||||
|
GlStateManager.disableAlpha();
|
||||||
|
GlStateManager.disableRescaleNormal();
|
||||||
|
RenderHelper.disableStandardItemLighting();
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,263 @@
|
||||||
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.WorldRenderer;
|
||||||
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import rip.athena.client.config.ConfigValue;
|
||||||
|
import rip.athena.client.events.SubscribeEvent;
|
||||||
|
import rip.athena.client.events.types.render.RenderEvent;
|
||||||
|
import rip.athena.client.events.types.render.RenderType;
|
||||||
|
import rip.athena.client.modules.Category;
|
||||||
|
import rip.athena.client.modules.Module;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
public class BlockOverlay extends Module {
|
||||||
|
@ConfigValue.List(name = "Mode", values = { "Outline", "Highlight", "Both" })
|
||||||
|
private String mode = "Outline";
|
||||||
|
|
||||||
|
@ConfigValue.Color(name = "Outline Color")
|
||||||
|
private Color vColor = Color.BLUE;
|
||||||
|
|
||||||
|
@ConfigValue.Color(name = "Highlight Color")
|
||||||
|
private Color hColor = Color.BLUE;
|
||||||
|
|
||||||
|
@ConfigValue.Float(name = "Line Width", min = 0.1F, max = 7.5F)
|
||||||
|
private float lineWidth = 1;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Chroma")
|
||||||
|
private boolean isUsingChroma = false;
|
||||||
|
|
||||||
|
public BlockOverlay() {
|
||||||
|
super("Block Overlay", Category.RENDER);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onWorldRenderLast(RenderEvent event) {
|
||||||
|
if (event.getRenderType() != RenderType.WORLD) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
float f = event.getPartialTicks();
|
||||||
|
float px = (float) mc.thePlayer.posX;
|
||||||
|
float py = (float) mc.thePlayer.posY;
|
||||||
|
float pz = (float) mc.thePlayer.posZ;
|
||||||
|
float mx = (float) mc.thePlayer.prevPosX;
|
||||||
|
float my = (float) mc.thePlayer.prevPosY;
|
||||||
|
float mz = (float) mc.thePlayer.prevPosZ;
|
||||||
|
float dx = mx + (px - mx) * f;
|
||||||
|
float dy = my + (py - my) * f;
|
||||||
|
float dz = mz + (pz - mz) * f;
|
||||||
|
|
||||||
|
MovingObjectPosition mop = mc.objectMouseOver;
|
||||||
|
|
||||||
|
if (mop == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectType.BLOCK) {
|
||||||
|
Block block = mc.theWorld.getBlockState(mop.getBlockPos()).getBlock();
|
||||||
|
BlockPos blockPos = mop.getBlockPos();
|
||||||
|
|
||||||
|
if (mode.equalsIgnoreCase("Outline") || mode.equalsIgnoreCase("Both")) {
|
||||||
|
drawLines(block, blockPos, dx, dy, dz);
|
||||||
|
}
|
||||||
|
if (mode.equalsIgnoreCase("Highlight") || mode.equalsIgnoreCase("Both")) {
|
||||||
|
highlight(block, blockPos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void highlight(Block block, BlockPos pos) {
|
||||||
|
float red = hColor.getRed() / 255.0f;
|
||||||
|
float green = hColor.getGreen() / 255.0f;
|
||||||
|
float blue = hColor.getBlue() / 255.0f;
|
||||||
|
float alpha = hColor.getAlpha() / 255.0f;
|
||||||
|
|
||||||
|
if (isUsingChroma) {
|
||||||
|
float hue = System.currentTimeMillis() % 20000L / 20000.0f;
|
||||||
|
int chroma = Color.HSBtoRGB(hue, 1.0f, 1.0f);
|
||||||
|
alpha = (chroma >> 24 & 0xFF) / 255.0f;
|
||||||
|
red = (chroma >> 16 & 0xFF) / 255.0f;
|
||||||
|
green = (chroma >> 8 & 0xFF) / 255.0f;
|
||||||
|
blue = (chroma & 0xFF) / 255.0f;
|
||||||
|
}
|
||||||
|
float bx, by, bz;
|
||||||
|
|
||||||
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
|
WorldRenderer vertexBuffer = tessellator.getWorldRenderer();
|
||||||
|
|
||||||
|
double renderPosX = mc.getRenderManager().viewerPosX;
|
||||||
|
double renderPosY = mc.getRenderManager().viewerPosY;
|
||||||
|
double renderPosZ = mc.getRenderManager().viewerPosZ;
|
||||||
|
|
||||||
|
GlStateManager.pushMatrix();
|
||||||
|
GlStateManager.enableBlend();
|
||||||
|
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||||
|
GlStateManager.disableTexture2D();
|
||||||
|
GlStateManager.depthMask(false);
|
||||||
|
|
||||||
|
GL11.glLineWidth(lineWidth);
|
||||||
|
GL11.glColor4f(red, green, blue, 0.5F);
|
||||||
|
|
||||||
|
AxisAlignedBB bb = block.getSelectedBoundingBox(mc.theWorld, pos)
|
||||||
|
.expand(0.0020000000949949026D, 0.0020000000949949026D, 0.0020000000949949026D)
|
||||||
|
.offset(-renderPosX, -renderPosY, -renderPosZ);
|
||||||
|
|
||||||
|
drawFilledBoundingBox(bb);
|
||||||
|
GL11.glLineWidth(1F);
|
||||||
|
GlStateManager.depthMask(true);
|
||||||
|
GlStateManager.enableTexture2D();
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
GlStateManager.disableBlend();
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawLines(Block block, BlockPos b, float px, float py, float pz) {
|
||||||
|
float red = vColor.getRed() / 255.0f;
|
||||||
|
float green = vColor.getGreen() / 255.0f;
|
||||||
|
float blue = vColor.getBlue() / 255.0f;
|
||||||
|
float alpha = vColor.getAlpha() / 255.0f;
|
||||||
|
|
||||||
|
if (isUsingChroma) {
|
||||||
|
float hue = System.currentTimeMillis() % 20000L / 20000.0f;
|
||||||
|
int chroma = Color.HSBtoRGB(hue, 1.0f, 1.0f);
|
||||||
|
alpha = (chroma >> 24 & 0xFF) / 255.0f;
|
||||||
|
red = (chroma >> 16 & 0xFF) / 255.0f;
|
||||||
|
green = (chroma >> 8 & 0xFF) / 255.0f;
|
||||||
|
blue = (chroma & 0xFF) / 255.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
double renderPosX = mc.getRenderManager().viewerPosX;
|
||||||
|
double renderPosY = mc.getRenderManager().viewerPosY;
|
||||||
|
double renderPosZ = mc.getRenderManager().viewerPosZ;
|
||||||
|
|
||||||
|
GlStateManager.pushMatrix();
|
||||||
|
GlStateManager.enableBlend();
|
||||||
|
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||||
|
GlStateManager.disableTexture2D();
|
||||||
|
GlStateManager.depthMask(false);
|
||||||
|
GL11.glLineWidth(lineWidth);
|
||||||
|
GL11.glColor4f(red, green, blue, 1F);
|
||||||
|
|
||||||
|
AxisAlignedBB box = block.getSelectedBoundingBox(mc.theWorld, b)
|
||||||
|
.expand(0.0020000000949949026D, 0.0020000000949949026D, 0.0020000000949949026D)
|
||||||
|
.offset(-renderPosX, -renderPosY, -renderPosZ);
|
||||||
|
;
|
||||||
|
|
||||||
|
drawSelectionBoundingBox(box);
|
||||||
|
GL11.glLineWidth(1F);
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
GlStateManager.depthMask(true);
|
||||||
|
GlStateManager.enableTexture2D();
|
||||||
|
GlStateManager.disableBlend();
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawSelectionBoundingBox(AxisAlignedBB p_181561_0_) {
|
||||||
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
|
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||||
|
worldrenderer.begin(3, DefaultVertexFormats.POSITION);
|
||||||
|
worldrenderer.pos(p_181561_0_.minX, p_181561_0_.minY, p_181561_0_.minZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.maxX, p_181561_0_.minY, p_181561_0_.minZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.maxX, p_181561_0_.minY, p_181561_0_.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.minX, p_181561_0_.minY, p_181561_0_.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.minX, p_181561_0_.minY, p_181561_0_.minZ).endVertex();
|
||||||
|
tessellator.draw();
|
||||||
|
worldrenderer.begin(3, DefaultVertexFormats.POSITION);
|
||||||
|
worldrenderer.pos(p_181561_0_.minX, p_181561_0_.maxY, p_181561_0_.minZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.maxX, p_181561_0_.maxY, p_181561_0_.minZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.maxX, p_181561_0_.maxY, p_181561_0_.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.minX, p_181561_0_.maxY, p_181561_0_.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.minX, p_181561_0_.maxY, p_181561_0_.minZ).endVertex();
|
||||||
|
tessellator.draw();
|
||||||
|
worldrenderer.begin(1, DefaultVertexFormats.POSITION);
|
||||||
|
worldrenderer.pos(p_181561_0_.minX, p_181561_0_.minY, p_181561_0_.minZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.minX, p_181561_0_.maxY, p_181561_0_.minZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.maxX, p_181561_0_.minY, p_181561_0_.minZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.maxX, p_181561_0_.maxY, p_181561_0_.minZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.maxX, p_181561_0_.minY, p_181561_0_.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.maxX, p_181561_0_.maxY, p_181561_0_.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.minX, p_181561_0_.minY, p_181561_0_.maxZ).endVertex();
|
||||||
|
worldrenderer.pos(p_181561_0_.minX, p_181561_0_.maxY, p_181561_0_.maxZ).endVertex();
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawFilledBoundingBox(AxisAlignedBB box) {
|
||||||
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
|
WorldRenderer worldRenderer = tessellator.getWorldRenderer();
|
||||||
|
|
||||||
|
worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION);
|
||||||
|
worldRenderer.pos(box.minX, box.minY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.maxY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.minY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.maxY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.minY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.maxY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.minY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.maxY, box.maxZ).endVertex();
|
||||||
|
tessellator.draw();
|
||||||
|
|
||||||
|
worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION);
|
||||||
|
worldRenderer.pos(box.maxX, box.maxY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.minY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.maxY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.minY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.maxY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.minY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.maxY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.minY, box.maxZ).endVertex();
|
||||||
|
tessellator.draw();
|
||||||
|
|
||||||
|
worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION);
|
||||||
|
worldRenderer.pos(box.minX, box.maxY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.maxY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.maxY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.maxY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.maxY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.maxY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.maxY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.maxY, box.minZ).endVertex();
|
||||||
|
tessellator.draw();
|
||||||
|
|
||||||
|
worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION);
|
||||||
|
worldRenderer.pos(box.minX, box.minY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.minY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.minY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.minY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.minY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.minY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.minY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.minY, box.minZ).endVertex();
|
||||||
|
tessellator.draw();
|
||||||
|
|
||||||
|
worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION);
|
||||||
|
worldRenderer.pos(box.minX, box.minY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.maxY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.minY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.maxY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.minY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.maxY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.minY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.maxY, box.minZ).endVertex();
|
||||||
|
tessellator.draw();
|
||||||
|
|
||||||
|
worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION);
|
||||||
|
worldRenderer.pos(box.minX, box.maxY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.minY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.maxY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.minX, box.minY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.maxY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.minY, box.minZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.maxY, box.maxZ).endVertex();
|
||||||
|
worldRenderer.pos(box.maxX, box.minY, box.maxZ).endVertex();
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
|
import rip.athena.client.config.ConfigValue;
|
||||||
|
import rip.athena.client.modules.Category;
|
||||||
|
import rip.athena.client.modules.Module;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/3/2023
|
||||||
|
*/
|
||||||
|
public class Chat extends Module {
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Custom Font")
|
||||||
|
public static boolean customFont = false;
|
||||||
|
|
||||||
|
public Chat() {
|
||||||
|
super("Chat", Category.RENDER);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
super.onEnable();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
super.onDisable();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
|
import rip.athena.client.config.ConfigValue;
|
||||||
|
import rip.athena.client.modules.Category;
|
||||||
|
import rip.athena.client.modules.Module;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/4/2023
|
||||||
|
*/
|
||||||
|
public class CustomHitColor extends Module {
|
||||||
|
|
||||||
|
@ConfigValue.Color(name = "Hit Color", description = "Chose the color of your desires")
|
||||||
|
public Color color = Color.WHITE;
|
||||||
|
|
||||||
|
public CustomHitColor() {
|
||||||
|
super("Custom Hit Color", Category.RENDER);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,104 @@
|
||||||
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import rip.athena.client.config.ConfigValue;
|
||||||
|
import rip.athena.client.font.FontManager;
|
||||||
|
import rip.athena.client.gui.hud.HUDElement;
|
||||||
|
import rip.athena.client.modules.Category;
|
||||||
|
import rip.athena.client.modules.Module;
|
||||||
|
import rip.athena.client.utils.render.DrawUtils;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/4/2023
|
||||||
|
*/
|
||||||
|
public class CustomText extends Module {
|
||||||
|
|
||||||
|
@ConfigValue.Text(name = "Custom Text", description = "Enter choice of text to display")
|
||||||
|
private String customText = "Custom Text Here";
|
||||||
|
|
||||||
|
@ConfigValue.Color(name = "Color")
|
||||||
|
private Color color = Color.WHITE;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Custom Font")
|
||||||
|
private boolean customFont = false;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Background")
|
||||||
|
private boolean backGround = true;
|
||||||
|
|
||||||
|
@ConfigValue.Color(name = "Background Color")
|
||||||
|
private Color background = new Color(0, 0, 0, 150);
|
||||||
|
|
||||||
|
@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 CustomText() {
|
||||||
|
super("Custom Text", Category.RENDER);
|
||||||
|
|
||||||
|
hud = new HUDElement("customtext", width, height) {
|
||||||
|
@Override
|
||||||
|
public void onRender() {
|
||||||
|
render();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
hud.setX(1);
|
||||||
|
hud.setY(200);
|
||||||
|
|
||||||
|
addHUD(hud);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render() {
|
||||||
|
if (mc.gameSettings.showDebugInfo) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
|
int width = hud.getWidth();
|
||||||
|
int height = hud.getHeight();
|
||||||
|
|
||||||
|
if(backGround) {
|
||||||
|
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB());
|
||||||
|
}
|
||||||
|
|
||||||
|
float posY = hud.getY() + 2;
|
||||||
|
float posX = hud.getX() + 9;
|
||||||
|
|
||||||
|
if(customFont) {
|
||||||
|
hud.setWidth((int) FontManager.baloo17.getStringWidth(customText) + 16);
|
||||||
|
hud.setHeight((int)FontManager.baloo17.getHeight(customText) + 7);
|
||||||
|
|
||||||
|
if(isUsingStaticChroma) {
|
||||||
|
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, customText, (int) (posX), (int) posY + 1, true, true);
|
||||||
|
} else if(isUsingWaveChroma) {
|
||||||
|
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, customText, (int) (posX), (int) posY + 1, false, true);
|
||||||
|
} else {
|
||||||
|
FontManager.baloo17.drawString(customText,(int) (posX), (int)posY + 1, color.getRGB());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
hud.setWidth(mc.fontRendererObj.getStringWidth(customText) + 16);
|
||||||
|
hud.setHeight(mc.fontRendererObj.FONT_HEIGHT + 9);
|
||||||
|
|
||||||
|
if(isUsingStaticChroma) {
|
||||||
|
DrawUtils.drawChromaString(customText, posX, posY + 3, true ,true);
|
||||||
|
} else if(isUsingWaveChroma) {
|
||||||
|
DrawUtils.drawChromaString(customText, posX, posY+ 3, false ,true);
|
||||||
|
} else {
|
||||||
|
mc.fontRendererObj.drawStringWithShadow(customText, (float) (posX), (float) posY+ 3, color.getRGB());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GL11.glColor3f(1, 1, 1);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package rip.athena.client.modules.impl.mods;
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
import net.minecraft.client.resources.FallbackResourceManager;
|
import net.minecraft.client.resources.FallbackResourceManager;
|
||||||
import net.minecraft.client.resources.IResource;
|
import net.minecraft.client.resources.IResource;
|
|
@ -0,0 +1,128 @@
|
||||||
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.FoodStats;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import rip.athena.client.config.ConfigValue;
|
||||||
|
import rip.athena.client.font.FontManager;
|
||||||
|
import rip.athena.client.gui.hud.HUDElement;
|
||||||
|
import rip.athena.client.modules.Category;
|
||||||
|
import rip.athena.client.modules.Module;
|
||||||
|
import rip.athena.client.utils.render.DrawUtils;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/4/2023
|
||||||
|
*/
|
||||||
|
public class PotCounter extends Module {
|
||||||
|
|
||||||
|
@ConfigValue.Color(name = "Color")
|
||||||
|
private Color color = Color.WHITE;
|
||||||
|
|
||||||
|
@ConfigValue.Boolean(name = "Background")
|
||||||
|
private boolean background = true;
|
||||||
|
|
||||||
|
@ConfigValue.Color(name = "Background Color")
|
||||||
|
private Color backgroundColor = new Color(0,0,0,150);
|
||||||
|
|
||||||
|
@ConfigValue.List(name = "Potion Type", values = {"Instant Health", "Instant Health II", "Soup"})
|
||||||
|
private String potType = "Instant Health II";
|
||||||
|
|
||||||
|
@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;
|
||||||
|
private int counter = 0;
|
||||||
|
|
||||||
|
public PotCounter() {
|
||||||
|
super("Pot Counter", Category.RENDER);
|
||||||
|
|
||||||
|
hud = new HUDElement("potioncounter", width, height) {
|
||||||
|
@Override
|
||||||
|
public void onRender() {
|
||||||
|
render();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
hud.setX(1);
|
||||||
|
hud.setY(200);
|
||||||
|
|
||||||
|
addHUD(hud);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render() {
|
||||||
|
if(mc.gameSettings.showDebugInfo) return;
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
|
counter = 0;
|
||||||
|
|
||||||
|
if(mc.thePlayer != null && mc.theWorld != null) {
|
||||||
|
for(int i = 0; i < mc.thePlayer.inventory.getSizeInventory(); i++) {
|
||||||
|
ItemStack stack = mc.thePlayer.inventory.getStackInSlot(i);
|
||||||
|
if (stack != null) {
|
||||||
|
if(potType.contains("Instant Health II") && Item.getItemById(373) == stack.getItem() && stack.getMetadata() == 16421) {
|
||||||
|
counter += stack.stackSize;
|
||||||
|
} else if (potType.contains("Soup") && Item.getItemById(282) == stack.getItem()) {
|
||||||
|
counter += stack.stackSize;
|
||||||
|
} else if (potType.equalsIgnoreCase("Instant Health") && Item.getItemById(373) == stack.getItem() && stack.getMetadata() == 16453) {
|
||||||
|
counter += stack.stackSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String str = counter + (potType.contains("Instant") ? " Pots" : " Soup");
|
||||||
|
|
||||||
|
int width = hud.getWidth();
|
||||||
|
int height = hud.getHeight();
|
||||||
|
|
||||||
|
if(background) {
|
||||||
|
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, backgroundColor.getRGB(), backgroundColor.getRGB());
|
||||||
|
}
|
||||||
|
|
||||||
|
float posY = hud.getY() + 2;
|
||||||
|
float posX = hud.getX() + 9;
|
||||||
|
|
||||||
|
if(customFont) {
|
||||||
|
hud.setWidth((int) (FontManager.baloo17.getStringWidth(str) + 16));
|
||||||
|
hud.setHeight((int) (FontManager.baloo17.getHeight(str) + 7));
|
||||||
|
|
||||||
|
if(isUsingStaticChroma) {
|
||||||
|
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, str, (int) posX, (int) posY + 1, true, true);
|
||||||
|
} else if (isUsingWaveChroma) {
|
||||||
|
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, str, (int) posX, (int) posY + 1, false, true);
|
||||||
|
} else {
|
||||||
|
FontManager.baloo17.drawString(str, (int) posX, (int) posY + 1, color.getRGB());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
hud.setWidth(mc.fontRendererObj.getStringWidth(str) + 16);
|
||||||
|
hud.setHeight(mc.fontRendererObj.FONT_HEIGHT + 9);
|
||||||
|
|
||||||
|
if(isUsingStaticChroma) {
|
||||||
|
DrawUtils.drawChromaString(str, posX, posY + 3, true, true);
|
||||||
|
} else if (isUsingWaveChroma) {
|
||||||
|
DrawUtils.drawChromaString(str, posX, posY + 3, false, true);
|
||||||
|
} else {
|
||||||
|
mc.fontRendererObj.drawString(str, (int) posX, (int) posY + 3, color.getRGB());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glColor3f(1,1,1);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
package rip.athena.client.socket;
|
||||||
|
|
||||||
|
import co.gongzh.procbridge.Client;
|
||||||
|
|
||||||
|
import java.net.ServerSocket;
|
||||||
|
import java.net.SocketException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/4/2023
|
||||||
|
*/
|
||||||
|
public class SocketClient {
|
||||||
|
|
||||||
|
public static final Client client = new Client("141.145.209.142", 1337);
|
||||||
|
private static final Map<String, Boolean> userCache = new HashMap<>();
|
||||||
|
private static String currentUsername = "";
|
||||||
|
|
||||||
|
public static boolean isClientRunning() {
|
||||||
|
try {
|
||||||
|
ServerSocket serverSocket = new ServerSocket(1337);
|
||||||
|
serverSocket.close();
|
||||||
|
return false;
|
||||||
|
} catch (Exception e) {
|
||||||
|
if (e instanceof SocketException) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Object sendRequest(String... args) {
|
||||||
|
return client.request("echo", String.join(" ", args));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isUser(String username) {
|
||||||
|
if (userCache.containsKey(username)) {
|
||||||
|
return userCache.get(username);
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] args = client.request("isUser", username).toString().split(":");
|
||||||
|
boolean isUser = args[0].equals("true");
|
||||||
|
userCache.put(username, isUser);
|
||||||
|
return isUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCurrentUsername() {
|
||||||
|
return currentUsername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setCurrentUsername(String username) {
|
||||||
|
currentUsername = username;
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1010 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 816 B |
After Width: | Height: | Size: 892 B |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 751 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 970 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 578 B |
After Width: | Height: | Size: 987 B |
After Width: | Height: | Size: 420 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1002 B |
After Width: | Height: | Size: 881 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 941 B |
After Width: | Height: | Size: 2.5 KiB |