mirror of
https://github.com/refactorinqq/SLC-1.8.9.git
synced 2024-11-10 07:01:32 +01:00
commit
b9f4951d38
@ -42,7 +42,6 @@ import net.silentclient.client.mods.util.Utils;
|
|||||||
import net.silentclient.client.nanovg.UI;
|
import net.silentclient.client.nanovg.UI;
|
||||||
import net.silentclient.client.premium.PremiumCosmeticsGui;
|
import net.silentclient.client.premium.PremiumCosmeticsGui;
|
||||||
import net.silentclient.client.premium.PremiumUtils;
|
import net.silentclient.client.premium.PremiumUtils;
|
||||||
import net.silentclient.client.skillissue.SkillIssue;
|
|
||||||
import net.silentclient.client.utils.*;
|
import net.silentclient.client.utils.*;
|
||||||
import net.silentclient.client.utils.animations.AnimationHandler;
|
import net.silentclient.client.utils.animations.AnimationHandler;
|
||||||
import net.silentclient.client.utils.animations.SneakHandler;
|
import net.silentclient.client.utils.animations.SneakHandler;
|
||||||
@ -65,7 +64,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class Client {
|
public class Client {
|
||||||
public static final Logger logger = LogManager.getLogger("SC");
|
public static final Logger logger = LogManager.getLogger("SC");
|
||||||
private final String version = "2.2.0";
|
private final String version = "2.2.1";
|
||||||
|
|
||||||
private static final Client INSTANCE = new Client();
|
private static final Client INSTANCE = new Client();
|
||||||
public static final Client getInstance() {
|
public static final Client getInstance() {
|
||||||
@ -104,7 +103,6 @@ public class Client {
|
|||||||
private AccountManager accountManager;
|
private AccountManager accountManager;
|
||||||
public ServerData lastServerData;
|
public ServerData lastServerData;
|
||||||
public TextUtils textUtils;
|
public TextUtils textUtils;
|
||||||
private SkillIssue skillIssue;
|
|
||||||
private PlayerResponse.BanInfo banInfo;
|
private PlayerResponse.BanInfo banInfo;
|
||||||
|
|
||||||
public static void memoryDebug(String paramString) {
|
public static void memoryDebug(String paramString) {
|
||||||
@ -397,7 +395,6 @@ public class Client {
|
|||||||
this.textUtils = new TextUtils(Minecraft.getMinecraft().fontRendererObj);
|
this.textUtils = new TextUtils(Minecraft.getMinecraft().fontRendererObj);
|
||||||
|
|
||||||
logger.info("STARTING > skillissue");
|
logger.info("STARTING > skillissue");
|
||||||
this.skillIssue = new SkillIssue();
|
|
||||||
logger.info("-------------------------------------------------");
|
logger.info("-------------------------------------------------");
|
||||||
memoryDebug("CLIENT_POST_INIT");
|
memoryDebug("CLIENT_POST_INIT");
|
||||||
}
|
}
|
||||||
@ -405,7 +402,6 @@ public class Client {
|
|||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
logger.info("---------[ Silent Client Stopping ]--------------");
|
logger.info("---------[ Silent Client Stopping ]--------------");
|
||||||
logger.info("STOPPING > silent-socket");
|
logger.info("STOPPING > silent-socket");
|
||||||
skillIssue.sendDetections();
|
|
||||||
Players.unregister();
|
Players.unregister();
|
||||||
logger.info("-------------------------------------------------");
|
logger.info("-------------------------------------------------");
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import net.silentclient.client.event.Event;
|
|||||||
public class ConnectToServerEvent extends Event {
|
public class ConnectToServerEvent extends Event {
|
||||||
private final ServerData serverData;
|
private final ServerData serverData;
|
||||||
|
|
||||||
|
|
||||||
public ConnectToServerEvent(ServerData serverData) {
|
public ConnectToServerEvent(ServerData serverData) {
|
||||||
this.serverData = serverData;
|
this.serverData = serverData;
|
||||||
}
|
}
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
package net.silentclient.client.gui;
|
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
import net.minecraft.client.gui.GuiScreenServerList;
|
|
||||||
import net.minecraft.client.multiplayer.ServerData;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class GuiScreenServerListInGame extends GuiScreenServerList {
|
|
||||||
public GuiScreenServerListInGame(GuiScreen p_i1031_1_, ServerData p_i1031_2_) {
|
|
||||||
super(p_i1031_1_, p_i1031_2_);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void actionPerformed(GuiButton button) throws IOException {
|
|
||||||
if(button.id == 0) {
|
|
||||||
if(this.mc.theWorld != null) {
|
|
||||||
this.mc.theWorld.sendQuittingDisconnectingPacket();
|
|
||||||
this.mc.loadWorld(null);
|
|
||||||
this.mc.displayGuiScreen(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
super.actionPerformed(button);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,63 +0,0 @@
|
|||||||
package net.silentclient.client.gui;
|
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
import net.minecraft.client.gui.ScaledResolution;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
|
||||||
import net.minecraft.client.renderer.texture.TextureManager;
|
|
||||||
import net.minecraft.client.shader.Framebuffer;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
|
|
||||||
public class SplashScreen {
|
|
||||||
private static ResourceLocation SPLASH;
|
|
||||||
public static void update() {
|
|
||||||
if(Minecraft.getMinecraft() == null || Minecraft.getMinecraft().getLanguageManager() == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
drawSplash(Minecraft.getMinecraft().getTextureManager());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setProgress(int givenProgress, String givenText) {
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void drawSplash(TextureManager tm) {
|
|
||||||
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
|
|
||||||
int scaleFactor = scaledResolution.getScaleFactor();
|
|
||||||
|
|
||||||
Framebuffer framebuffer = new Framebuffer(scaledResolution.getScaledWidth() * scaleFactor, scaledResolution.getScaledHeight() * scaleFactor, true);
|
|
||||||
framebuffer.bindFramebuffer(false);
|
|
||||||
|
|
||||||
GlStateManager.matrixMode(GL11.GL_PROJECTION);
|
|
||||||
GlStateManager.loadIdentity();
|
|
||||||
GlStateManager.ortho(0.0D, (double) scaledResolution.getScaledWidth(), (double) scaledResolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
|
|
||||||
GlStateManager.matrixMode(GL11.GL_MODELVIEW);
|
|
||||||
GlStateManager.loadIdentity();
|
|
||||||
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
|
|
||||||
GlStateManager.disableLighting();
|
|
||||||
GlStateManager.disableFog();
|
|
||||||
GlStateManager.disableDepth();
|
|
||||||
GlStateManager.enableTexture2D();
|
|
||||||
|
|
||||||
if(SPLASH == null) {
|
|
||||||
SPLASH = new ResourceLocation("silentclient/splash.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
tm.bindTexture(SPLASH);
|
|
||||||
|
|
||||||
GlStateManager.resetColor();
|
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
|
|
||||||
Gui.drawScaledCustomSizeModalRect(0, 0, 0, 0, 1920, 1080, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), 1920, 1080);
|
|
||||||
framebuffer.unbindFramebuffer();
|
|
||||||
framebuffer.framebufferRender(scaledResolution.getScaledWidth() * scaleFactor, scaledResolution.getScaledHeight() * scaleFactor);
|
|
||||||
|
|
||||||
GlStateManager.enableAlpha();
|
|
||||||
GlStateManager.alphaFunc(516, 0.1F);
|
|
||||||
|
|
||||||
Minecraft.getMinecraft().updateDisplay();
|
|
||||||
}
|
|
||||||
}
|
|
@ -83,7 +83,7 @@ public class LiteMainMenu extends SilentScreen
|
|||||||
} else {
|
} else {
|
||||||
this.bannerAnimation.setAnimation(0, 30);
|
this.bannerAnimation.setAnimation(0, 30);
|
||||||
}
|
}
|
||||||
RenderUtil.drawImage(PromoController.getResponse().getCurrentPanel().getImageLocation(), this.width - 74 + (-this.bannerAnimation.getValue()), this.height - 42 + (-this.bannerAnimation.getValue()), 71, 40, false);
|
RenderUtil.drawRoundTextured(this.width - 74 + (-this.bannerAnimation.getValue()), this.height - 42 + (-this.bannerAnimation.getValue()), 71, 40, 4, 1, PromoController.getResponse().getCurrentPanel().getImageLocation(), false);
|
||||||
} else {
|
} else {
|
||||||
PromoController.getResponse().getCurrentPanel().loadImage();
|
PromoController.getResponse().getCurrentPanel().loadImage();
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package net.silentclient.client.gui.util;
|
|||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
import net.minecraft.client.gui.Gui;
|
import net.minecraft.client.gui.Gui;
|
||||||
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.OpenGlHelper;
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
@ -13,14 +14,59 @@ import net.silentclient.client.Client;
|
|||||||
import net.silentclient.client.cosmetics.StaticResourceLocation;
|
import net.silentclient.client.cosmetics.StaticResourceLocation;
|
||||||
import net.silentclient.client.mixin.ducks.TextureManagerExt;
|
import net.silentclient.client.mixin.ducks.TextureManagerExt;
|
||||||
import net.silentclient.client.utils.ColorUtils;
|
import net.silentclient.client.utils.ColorUtils;
|
||||||
|
import net.silentclient.client.utils.ShaderUtils;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
import static org.lwjgl.opengl.GL11.*;
|
import static org.lwjgl.opengl.GL11.*;
|
||||||
|
|
||||||
public class RenderUtil {
|
public class RenderUtil {
|
||||||
final static Minecraft mc = Minecraft.getMinecraft();
|
final static Minecraft mc = Minecraft.getMinecraft();
|
||||||
final static FontRenderer fr = mc.fontRendererObj;
|
final static FontRenderer fr = mc.fontRendererObj;
|
||||||
|
|
||||||
|
public static ShaderUtils roundedShader = new ShaderUtils("silentclient/shaders/roundedRect.frag");
|
||||||
|
public static ShaderUtils roundedOutlineShader = new ShaderUtils("silentclient/shaders/roundRectOutline.frag");
|
||||||
|
private static ShaderUtils roundedTexturedShader = new ShaderUtils("silentclient/shaders/roundRectTextured.frag");
|
||||||
|
|
||||||
|
public static void drawRound(float x, float y, float width, float height, float radius, Color color) {
|
||||||
|
ColorUtils.resetColor();
|
||||||
|
GlStateManager.enableBlend();
|
||||||
|
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
roundedShader.init();
|
||||||
|
|
||||||
|
setupRoundedRectUniforms(x, y, width, height, radius, roundedShader);
|
||||||
|
roundedShader.setUniformf("color", color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, color.getAlpha() / 255f);
|
||||||
|
|
||||||
|
ShaderUtils.drawQuads(x - 1, y - 1, width + 2, height + 2);
|
||||||
|
roundedShader.unload();
|
||||||
|
GlStateManager.disableBlend();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void drawRoundTextured(float x, float y, float width, float height, float radius, float alpha, ResourceLocation image, boolean mipmapped) {
|
||||||
|
if(mipmapped) {
|
||||||
|
Client.getInstance().getTextureManager().bindTextureMipmapped(image);
|
||||||
|
} else {
|
||||||
|
Minecraft.getMinecraft().getTextureManager().bindTexture(image);
|
||||||
|
}
|
||||||
|
ColorUtils.resetColor();
|
||||||
|
roundedTexturedShader.init();
|
||||||
|
roundedTexturedShader.setUniformi("textureIn", 0);
|
||||||
|
setupRoundedRectUniforms(x, y, width, height, radius, roundedTexturedShader);
|
||||||
|
roundedTexturedShader.setUniformf("alpha", alpha);
|
||||||
|
ShaderUtils.drawQuads(x - 1, y - 1, width + 2, height + 2);
|
||||||
|
roundedTexturedShader.unload();
|
||||||
|
GlStateManager.disableBlend();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setupRoundedRectUniforms(float x, float y, float width, float height, float radius, ShaderUtils roundedTexturedShader) {
|
||||||
|
ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
|
||||||
|
roundedTexturedShader.setUniformf("location", x * sr.getScaleFactor(),
|
||||||
|
(Minecraft.getMinecraft().displayHeight - (height * sr.getScaleFactor())) - (y * sr.getScaleFactor()));
|
||||||
|
roundedTexturedShader.setUniformf("rectSize", width * sr.getScaleFactor(), height * sr.getScaleFactor());
|
||||||
|
roundedTexturedShader.setUniformf("radius", radius * sr.getScaleFactor());
|
||||||
|
}
|
||||||
|
|
||||||
public static void drawRoundedRect(float x, float y, float x1, float y1, float radius, int color) {
|
public static void drawRoundedRect(float x, float y, float x1, float y1, float radius, int color) {
|
||||||
x1 = x + x1;
|
x1 = x + x1;
|
||||||
y1 = y + y1;
|
y1 = y + y1;
|
||||||
@ -65,7 +111,7 @@ public class RenderUtil {
|
|||||||
glPopAttrib();
|
glPopAttrib();
|
||||||
glLineWidth(1);
|
glLineWidth(1);
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
public static void drawRoundedOutline(float x, float y, float x1, float y1, float radius,float lineWidth, int color) {
|
public static void drawRoundedOutline(float x, float y, float x1, float y1, float radius,float lineWidth, int color) {
|
||||||
x1 = x + x1;
|
x1 = x + x1;
|
||||||
y1 = y + y1;
|
y1 = y + y1;
|
||||||
@ -83,13 +129,13 @@ public class RenderUtil {
|
|||||||
glBegin(GL_LINE_LOOP);
|
glBegin(GL_LINE_LOOP);
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i <= 90; i += 3)
|
for (i = 0; i <= 90; i += 3)
|
||||||
glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
|
glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
|
||||||
for (i = 90; i <= 180; i += 3)
|
for (i = 90; i <= 180; i += 3)
|
||||||
glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
|
glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
|
||||||
for (i = 0; i <= 90; i += 3)
|
for (i = 0; i <= 90; i += 3)
|
||||||
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius);
|
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius);
|
||||||
for (i = 90; i <= 180; i += 3)
|
for (i = 90; i <= 180; i += 3)
|
||||||
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius);
|
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius);
|
||||||
glEnd();
|
glEnd();
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
@ -100,7 +146,7 @@ public class RenderUtil {
|
|||||||
glPopAttrib();
|
glPopAttrib();
|
||||||
glLineWidth(1);
|
glLineWidth(1);
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
@ -35,6 +35,7 @@ public class HudMod extends ModDraggable {
|
|||||||
this.addBooleanSetting("Brackets", this, false);
|
this.addBooleanSetting("Brackets", this, false);
|
||||||
this.addBooleanSetting("Fancy Font", this, false);
|
this.addBooleanSetting("Fancy Font", this, false);
|
||||||
this.addBooleanSetting("Rounded Corners", this, false);
|
this.addBooleanSetting("Rounded Corners", this, false);
|
||||||
|
this.addSliderSetting("Rounding Strength", this, 3, 1, 6, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getText() {
|
public String getText() {
|
||||||
@ -110,7 +111,7 @@ public class HudMod extends ModDraggable {
|
|||||||
preRender();
|
preRender();
|
||||||
if(background) {
|
if(background) {
|
||||||
if(roundedCorners) {
|
if(roundedCorners) {
|
||||||
RenderUtil.drawRoundedRect(getX(), getY(), this.getRealWidth(), this.getHeight(), 6, backgroundColor.getRGB());
|
RenderUtil.drawRound(getX(), getY(), this.getRealWidth(), this.getHeight(), Client.getInstance().getSettingsManager().getSettingByName(this, "Rounding Strength").getValInt(), backgroundColor);
|
||||||
} else {
|
} else {
|
||||||
RenderUtils.drawRect(getX(), getY(), this.getRealWidth(), this.getHeight(), backgroundColor.getRGB());
|
RenderUtils.drawRect(getX(), getY(), this.getRealWidth(), this.getHeight(), backgroundColor.getRGB());
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package net.silentclient.client.mods.hud;
|
package net.silentclient.client.mods.hud;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
@ -15,13 +13,16 @@ import net.minecraft.potion.Potion;
|
|||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||||
import net.silentclient.client.Client;
|
import net.silentclient.client.Client;
|
||||||
|
import net.silentclient.client.gui.hud.ScreenPosition;
|
||||||
import net.silentclient.client.gui.lite.clickgui.utils.GlUtils;
|
import net.silentclient.client.gui.lite.clickgui.utils.GlUtils;
|
||||||
import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils;
|
import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils;
|
||||||
import net.silentclient.client.gui.hud.ScreenPosition;
|
import net.silentclient.client.gui.util.RenderUtil;
|
||||||
import net.silentclient.client.mods.CustomFontRenderer;
|
import net.silentclient.client.mods.CustomFontRenderer;
|
||||||
import net.silentclient.client.mods.ModCategory;
|
import net.silentclient.client.mods.ModCategory;
|
||||||
import net.silentclient.client.mods.ModDraggable;
|
import net.silentclient.client.mods.ModDraggable;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
public class BlockInfoMod extends ModDraggable {
|
public class BlockInfoMod extends ModDraggable {
|
||||||
private BlockPos pos;
|
private BlockPos pos;
|
||||||
private IBlockState state;
|
private IBlockState state;
|
||||||
@ -43,6 +44,8 @@ public class BlockInfoMod extends ModDraggable {
|
|||||||
this.addColorSetting("Color", this, new Color(255, 255, 255));
|
this.addColorSetting("Color", this, new Color(255, 255, 255));
|
||||||
this.addBooleanSetting("Font Shadow", this, true);
|
this.addBooleanSetting("Font Shadow", this, true);
|
||||||
this.addBooleanSetting("Fancy Font", this, false);
|
this.addBooleanSetting("Fancy Font", this, false);
|
||||||
|
this.addBooleanSetting("Rounded Corners", this, false);
|
||||||
|
this.addSliderSetting("Rounding Strength", this, 3, 1, 6, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -70,6 +73,8 @@ public class BlockInfoMod extends ModDraggable {
|
|||||||
if(block != null && !block.equals(Blocks.portal) && !block.equals(Blocks.end_portal)) {
|
if(block != null && !block.equals(Blocks.portal) && !block.equals(Blocks.end_portal)) {
|
||||||
String harvest = "";
|
String harvest = "";
|
||||||
boolean background = Client.getInstance().getSettingsManager().getSettingByName(this, "Background").getValBoolean();
|
boolean background = Client.getInstance().getSettingsManager().getSettingByName(this, "Background").getValBoolean();
|
||||||
|
boolean roundedCorners = Client.getInstance().getSettingsManager().getSettingByName(this, "Rounded Corners").getValBoolean();
|
||||||
|
|
||||||
Color backgroundColor = Client.getInstance().getSettingsManager().getSettingByName(this, "Background Color").getValColor();
|
Color backgroundColor = Client.getInstance().getSettingsManager().getSettingByName(this, "Background Color").getValColor();
|
||||||
boolean fontShadow = Client.getInstance().getSettingsManager().getSettingByName(this, "Font Shadow").getValBoolean();
|
boolean fontShadow = Client.getInstance().getSettingsManager().getSettingByName(this, "Font Shadow").getValBoolean();
|
||||||
Color color = Client.getInstance().getSettingsManager().getSettingByName(this, "Color").getValColor();
|
Color color = Client.getInstance().getSettingsManager().getSettingByName(this, "Color").getValColor();
|
||||||
@ -84,7 +89,11 @@ public class BlockInfoMod extends ModDraggable {
|
|||||||
font.setRenderMode(fancyFont ? CustomFontRenderer.RenderMode.CUSTOM : CustomFontRenderer.RenderMode.DEFAULT);
|
font.setRenderMode(fancyFont ? CustomFontRenderer.RenderMode.CUSTOM : CustomFontRenderer.RenderMode.DEFAULT);
|
||||||
|
|
||||||
if(background) {
|
if(background) {
|
||||||
RenderUtils.drawRect(0, 0, getWidth(), getHeight(), backgroundColor.getRGB());
|
if(roundedCorners) {
|
||||||
|
RenderUtil.drawRound(0, 0, getWidth(), getHeight(), Client.getInstance().getSettingsManager().getSettingByName(this, "Rounding Strength").getValInt(), backgroundColor);
|
||||||
|
} else {
|
||||||
|
RenderUtils.drawRect(0, 0, getWidth(), getHeight(), backgroundColor.getRGB());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GlUtils.startScale(0, 0, 5, 50, 1.8F);
|
GlUtils.startScale(0, 0, 5, 50, 1.8F);
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
package net.silentclient.client.mods.hud;
|
package net.silentclient.client.mods.hud;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
|
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
import net.silentclient.client.Client;
|
import net.silentclient.client.Client;
|
||||||
import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils;
|
|
||||||
import net.silentclient.client.gui.hud.ScreenPosition;
|
import net.silentclient.client.gui.hud.ScreenPosition;
|
||||||
|
import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils;
|
||||||
|
import net.silentclient.client.gui.util.RenderUtil;
|
||||||
import net.silentclient.client.mods.CustomFontRenderer;
|
import net.silentclient.client.mods.CustomFontRenderer;
|
||||||
import net.silentclient.client.mods.ModCategory;
|
import net.silentclient.client.mods.ModCategory;
|
||||||
import net.silentclient.client.mods.ModDraggable;
|
import net.silentclient.client.mods.ModDraggable;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
public class CoordinatesMod extends ModDraggable {
|
public class CoordinatesMod extends ModDraggable {
|
||||||
int maxWidth = 0;
|
int maxWidth = 0;
|
||||||
|
|
||||||
@ -27,6 +28,8 @@ public class CoordinatesMod extends ModDraggable {
|
|||||||
this.addBooleanSetting("Font Shadow", this, true);
|
this.addBooleanSetting("Font Shadow", this, true);
|
||||||
this.addBooleanSetting("Brackets", this, false);
|
this.addBooleanSetting("Brackets", this, false);
|
||||||
this.addBooleanSetting("Fancy Font", this, false);
|
this.addBooleanSetting("Fancy Font", this, false);
|
||||||
|
this.addBooleanSetting("Rounded Corners", this, false);
|
||||||
|
this.addSliderSetting("Rounding Strength", this, 3, 1, 6, true);
|
||||||
this.addBooleanSetting("Show Biome", this, true);
|
this.addBooleanSetting("Show Biome", this, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,6 +51,7 @@ public class CoordinatesMod extends ModDraggable {
|
|||||||
CustomFontRenderer font = new CustomFontRenderer();
|
CustomFontRenderer font = new CustomFontRenderer();
|
||||||
|
|
||||||
font.setRenderMode(fancyFont ? CustomFontRenderer.RenderMode.CUSTOM : CustomFontRenderer.RenderMode.DEFAULT);
|
font.setRenderMode(fancyFont ? CustomFontRenderer.RenderMode.CUSTOM : CustomFontRenderer.RenderMode.DEFAULT);
|
||||||
|
boolean roundedCorners = Client.getInstance().getSettingsManager().getSettingByName(this, "Rounded Corners").getValBoolean();
|
||||||
boolean background = Client.getInstance().getSettingsManager().getSettingByName(this, "Background").getValBoolean();
|
boolean background = Client.getInstance().getSettingsManager().getSettingByName(this, "Background").getValBoolean();
|
||||||
Color backgroundColor = Client.getInstance().getSettingsManager().getSettingByName(this, "Background Color").getValColor();
|
Color backgroundColor = Client.getInstance().getSettingsManager().getSettingByName(this, "Background Color").getValColor();
|
||||||
boolean fontShadow = Client.getInstance().getSettingsManager().getSettingByName(this, "Font Shadow").getValBoolean();
|
boolean fontShadow = Client.getInstance().getSettingsManager().getSettingByName(this, "Font Shadow").getValBoolean();
|
||||||
@ -67,7 +71,11 @@ public class CoordinatesMod extends ModDraggable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(background) {
|
if(background) {
|
||||||
RenderUtils.drawRect(0, 0, maxWidth, getHeight(), backgroundColor.getRGB());
|
if(roundedCorners) {
|
||||||
|
RenderUtil.drawRound(0, 0, maxWidth, getHeight(), Client.getInstance().getSettingsManager().getSettingByName(this, "Rounding Strength").getValInt(), backgroundColor);
|
||||||
|
} else {
|
||||||
|
RenderUtils.drawRect(0, 0, maxWidth, getHeight(), backgroundColor.getRGB());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
font.drawString((!brackets ? "" : "[") + "X: " + (int) (mc.thePlayer.posX) + (!brackets ? "" : "]"), (int) (0 + 4.5F), (int) (0 + 4.5F), color.getRGB(), fontShadow);
|
font.drawString((!brackets ? "" : "[") + "X: " + (int) (mc.thePlayer.posX) + (!brackets ? "" : "]"), (int) (0 + 4.5F), (int) (0 + 4.5F), color.getRGB(), fontShadow);
|
||||||
|
@ -38,6 +38,7 @@ public class KeystrokesMod extends ModDraggable {
|
|||||||
this.addBooleanSetting("Fancy Font", this, false);
|
this.addBooleanSetting("Fancy Font", this, false);
|
||||||
this.addBooleanSetting("Background", this, true);
|
this.addBooleanSetting("Background", this, true);
|
||||||
this.addBooleanSetting("Rounded Corners", this, false);
|
this.addBooleanSetting("Rounded Corners", this, false);
|
||||||
|
this.addSliderSetting("Rounding Strength", this, 3, 1, 6, true);
|
||||||
this.addModeSetting("CPS Mode", this, "Small", cpsModes);
|
this.addModeSetting("CPS Mode", this, "Small", cpsModes);
|
||||||
this.addColorSetting("Color", this, new Color(255, 255, 255));
|
this.addColorSetting("Color", this, new Color(255, 255, 255));
|
||||||
this.addColorSetting("Background Color", this, new Color(0, 0, 0), 127);
|
this.addColorSetting("Background Color", this, new Color(0, 0, 0), 127);
|
||||||
@ -205,13 +206,13 @@ public class KeystrokesMod extends ModDraggable {
|
|||||||
setAnimation(key.blue, key.isDown() ? clickedBackgroundColor.getBlue() : backgroundColor.getBlue(), fadeDelay);
|
setAnimation(key.blue, key.isDown() ? clickedBackgroundColor.getBlue() : backgroundColor.getBlue(), fadeDelay);
|
||||||
setAnimation(key.alpha, key.isDown() ? clickedBackgroundColor.getAlpha() : backgroundColor.getAlpha(), fadeDelay);
|
setAnimation(key.alpha, key.isDown() ? clickedBackgroundColor.getAlpha() : backgroundColor.getAlpha(), fadeDelay);
|
||||||
if(roundedCorners) {
|
if(roundedCorners) {
|
||||||
RenderUtil.drawRoundedRect(
|
RenderUtil.drawRound(
|
||||||
key.getX(),
|
key.getX(),
|
||||||
key.getY(),
|
key.getY(),
|
||||||
key.getWidth(),
|
key.getWidth(),
|
||||||
key.getHeight(),
|
key.getHeight(),
|
||||||
6,
|
Client.getInstance().getSettingsManager().getSettingByName(this, "Rounding Strength").getValInt(),
|
||||||
new Color((int) key.red.getValue(), (int) key.green.getValue(), (int) key.blue.getValue(), (int) key.alpha.getValue()).getRGB()
|
new Color((int) key.red.getValue(), (int) key.green.getValue(), (int) key.blue.getValue(), (int) key.alpha.getValue())
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
RenderUtils.drawRect(
|
RenderUtils.drawRect(
|
||||||
@ -308,13 +309,13 @@ public class KeystrokesMod extends ModDraggable {
|
|||||||
setAnimation(Space.blue, Space.isDown() ? clickedBackgroundColor.getBlue() : backgroundColor.getBlue(), fadeDelay);
|
setAnimation(Space.blue, Space.isDown() ? clickedBackgroundColor.getBlue() : backgroundColor.getBlue(), fadeDelay);
|
||||||
setAnimation(Space.alpha, Space.isDown() ? clickedBackgroundColor.getAlpha() : backgroundColor.getAlpha(), fadeDelay);
|
setAnimation(Space.alpha, Space.isDown() ? clickedBackgroundColor.getAlpha() : backgroundColor.getAlpha(), fadeDelay);
|
||||||
if(roundedCorners) {
|
if(roundedCorners) {
|
||||||
RenderUtil.drawRoundedRect(
|
RenderUtil.drawRound(
|
||||||
0,
|
0,
|
||||||
0 + mode.getHeight() + 2,
|
0 + mode.getHeight() + 2,
|
||||||
mode.getWidth(),
|
mode.getWidth(),
|
||||||
10,
|
10,
|
||||||
6,
|
Client.getInstance().getSettingsManager().getSettingByName(this, "Rounding Strength").getValInt(),
|
||||||
new Color((int) Space.red.getValue(), (int) Space.green.getValue(), (int) Space.blue.getValue(), (int) Space.alpha.getValue()).getRGB()
|
new Color((int) Space.red.getValue(), (int) Space.green.getValue(), (int) Space.blue.getValue(), (int) Space.alpha.getValue())
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
RenderUtils.drawRect(
|
RenderUtils.drawRect(
|
||||||
|
@ -4,6 +4,7 @@ import com.google.common.reflect.TypeToken;
|
|||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.silentclient.client.Client;
|
import net.silentclient.client.Client;
|
||||||
import net.silentclient.client.event.EventTarget;
|
import net.silentclient.client.event.EventTarget;
|
||||||
|
import net.silentclient.client.event.impl.ConnectToServerEvent;
|
||||||
import net.silentclient.client.event.impl.KeyEvent;
|
import net.silentclient.client.event.impl.KeyEvent;
|
||||||
import net.silentclient.client.gui.quickplay.QuickplayGui;
|
import net.silentclient.client.gui.quickplay.QuickplayGui;
|
||||||
import net.silentclient.client.mods.Mod;
|
import net.silentclient.client.mods.Mod;
|
||||||
@ -68,7 +69,12 @@ public class QuickPlayMod extends Mod {
|
|||||||
public void updateHashMap() {
|
public void updateHashMap() {
|
||||||
HashMap<Integer, Setting> map = new HashMap<>();
|
HashMap<Integer, Setting> map = new HashMap<>();
|
||||||
for(Setting setting : Client.getInstance().getSettingsManager().getSettingByMod(this)) {
|
for(Setting setting : Client.getInstance().getSettingsManager().getSettingByMod(this)) {
|
||||||
if (setting.isKeybind()) {
|
if(setting.getName().equals("Open Menu")) {
|
||||||
|
map.put(setting.getKeybind(), setting);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String[] args = setting.getName().split("&");
|
||||||
|
if (((args[1].equals("Hypixel") && Server.isHypixel()) || (args[1].equals("RuHypixel") && Server.isRuHypixel())) && setting.isKeybind()) {
|
||||||
map.put(setting.getKeybind(), setting);
|
map.put(setting.getKeybind(), setting);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,6 +82,11 @@ public class QuickPlayMod extends Mod {
|
|||||||
hashMap = map;
|
hashMap = map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventTarget
|
||||||
|
public void onServerJoin(ConnectToServerEvent event) {
|
||||||
|
updateHashMap();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChangeSettingValue(Setting setting) {
|
public void onChangeSettingValue(Setting setting) {
|
||||||
super.onChangeSettingValue(setting);
|
super.onChangeSettingValue(setting);
|
||||||
@ -133,7 +144,7 @@ public class QuickPlayMod extends Mod {
|
|||||||
if(setting != null) {
|
if(setting != null) {
|
||||||
if(setting.getName().equals("Open Menu")) {
|
if(setting.getName().equals("Open Menu")) {
|
||||||
// Open Menu
|
// Open Menu
|
||||||
if(setting.isKeyDown() && (Server.isHypixel() || Server.isRuHypixel())) {
|
if(Server.isHypixel() || Server.isRuHypixel()) {
|
||||||
mc.displayGuiScreen(new QuickplayGui());
|
mc.displayGuiScreen(new QuickplayGui());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -141,9 +152,7 @@ public class QuickPlayMod extends Mod {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String[] args = setting.getName().split("&");
|
String[] args = setting.getName().split("&");
|
||||||
if(((args[1].equals("Hypixel") && Server.isHypixel()) || (args[1].equals("RuHypixel") && Server.isRuHypixel())) && setting.isKeyDown()) {
|
runCommand(args[2]);
|
||||||
runCommand(args[2]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
package net.silentclient.client.mods.render;
|
package net.silentclient.client.mods.render;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiNewChat;
|
import net.minecraft.client.gui.GuiNewChat;
|
||||||
|
import net.minecraft.event.ClickEvent;
|
||||||
|
import net.minecraft.event.HoverEvent;
|
||||||
import net.minecraft.network.play.server.S02PacketChat;
|
import net.minecraft.network.play.server.S02PacketChat;
|
||||||
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
import net.minecraft.util.ChatStyle;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.util.StringUtils;
|
||||||
import net.silentclient.client.Client;
|
import net.silentclient.client.Client;
|
||||||
import net.silentclient.client.event.EventTarget;
|
import net.silentclient.client.event.EventTarget;
|
||||||
import net.silentclient.client.event.impl.EventReceivePacket;
|
import net.silentclient.client.event.impl.EventReceivePacket;
|
||||||
@ -24,6 +29,7 @@ public class ChatMod extends Mod {
|
|||||||
this.addBooleanSetting("Smooth", this, false);
|
this.addBooleanSetting("Smooth", this, false);
|
||||||
this.addSliderSetting("Smooth Speed", this, 4, 1, 10, false);
|
this.addSliderSetting("Smooth Speed", this, 4, 1, 10, false);
|
||||||
this.addBooleanSetting("Disable Background", this, true);
|
this.addBooleanSetting("Disable Background", this, true);
|
||||||
|
this.addBooleanSetting("Copy Message Button", this, false);
|
||||||
this.addBooleanSetting("Anti-Spam", this, false);
|
this.addBooleanSetting("Anti-Spam", this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,7 +37,23 @@ public class ChatMod extends Mod {
|
|||||||
public void chat(EventReceivePacket event) {
|
public void chat(EventReceivePacket event) {
|
||||||
if(event.getPacket() instanceof S02PacketChat && !event.isCancelable()) {
|
if(event.getPacket() instanceof S02PacketChat && !event.isCancelable()) {
|
||||||
final S02PacketChat chatPacket = (S02PacketChat)event.getPacket();
|
final S02PacketChat chatPacket = (S02PacketChat)event.getPacket();
|
||||||
if (Client.getInstance().getSettingsManager().getSettingByName(this, "Anti-Spam").getValBoolean() && chatPacket.getType() == 0) {
|
if(chatPacket.getType() == 2) return;
|
||||||
|
|
||||||
|
if (Client.getInstance().getSettingsManager().getSettingByName(this, "Copy Message Button").getValBoolean()) {
|
||||||
|
String unformattedText = StringUtils.stripControlCodes(chatPacket.getChatComponent().getUnformattedText());
|
||||||
|
if (!unformattedText.replace(" ", "").isEmpty()) {
|
||||||
|
ChatComponentText copyText = new ChatComponentText(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "[COPY]");
|
||||||
|
ChatStyle style = new ChatStyle()
|
||||||
|
.setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(EnumChatFormatting.GRAY + "Copy message")))
|
||||||
|
.setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/slc$copy " + unformattedText));
|
||||||
|
copyText.setChatStyle(style);
|
||||||
|
|
||||||
|
chatPacket.getChatComponent().appendSibling(new ChatComponentText(EnumChatFormatting.RESET + " "));
|
||||||
|
chatPacket.getChatComponent().appendSibling(copyText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Client.getInstance().getSettingsManager().getSettingByName(this, "Anti-Spam").getValBoolean()) {
|
||||||
GuiNewChat guiNewChat = mc.ingameGUI.getChatGUI();
|
GuiNewChat guiNewChat = mc.ingameGUI.getChatGUI();
|
||||||
if (lastMessage.equals(chatPacket.getChatComponent().getUnformattedText())) {
|
if (lastMessage.equals(chatPacket.getChatComponent().getUnformattedText())) {
|
||||||
guiNewChat.deleteChatLine(line);
|
guiNewChat.deleteChatLine(line);
|
||||||
|
@ -8,7 +8,7 @@ public enum Direction {
|
|||||||
DOWN(new Vec3i(0, -1, 0)), UP(new Vec3i(0, 1, 0)), NORTH(new Vec3i(0, 0, -1)), SOUTH(new Vec3i(0, 0, 1)),
|
DOWN(new Vec3i(0, -1, 0)), UP(new Vec3i(0, 1, 0)), NORTH(new Vec3i(0, 0, -1)), SOUTH(new Vec3i(0, 0, 1)),
|
||||||
WEST(new Vec3i(-1, 0, 0)), EAST(new Vec3i(1, 0, 0));
|
WEST(new Vec3i(-1, 0, 0)), EAST(new Vec3i(1, 0, 0));
|
||||||
|
|
||||||
private Direction(Vec3i normal) {
|
Direction(Vec3i normal) {
|
||||||
this.normal = normal;
|
this.normal = normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
package net.silentclient.client.mods.render.skins;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.silentclient.client.mixin.accessors.skins.SkullSettings;
|
|
||||||
import net.silentclient.client.mods.render.skins.render.CustomizableModelPart;
|
|
||||||
|
|
||||||
import java.util.WeakHashMap;
|
|
||||||
|
|
||||||
public class SkullRendererCache {
|
|
||||||
|
|
||||||
public static boolean renderNext = false;
|
|
||||||
public static SkullSettings lastSkull = null;
|
|
||||||
public static WeakHashMap<ItemStack, SkullSettings> itemCache = new WeakHashMap<>();
|
|
||||||
|
|
||||||
public static class ItemSettings implements SkullSettings {
|
|
||||||
|
|
||||||
private CustomizableModelPart hatModel = null;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CustomizableModelPart getHeadLayers() {
|
|
||||||
return hatModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setupHeadLayers(CustomizableModelPart box) {
|
|
||||||
this.hatModel = box;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -21,13 +21,11 @@ import java.util.function.Supplier;
|
|||||||
public class BodyLayerFeatureRenderer
|
public class BodyLayerFeatureRenderer
|
||||||
implements LayerRenderer<AbstractClientPlayer> {
|
implements LayerRenderer<AbstractClientPlayer> {
|
||||||
|
|
||||||
private RenderPlayer playerRenderer;
|
|
||||||
private final boolean thinArms;
|
private final boolean thinArms;
|
||||||
private static final Minecraft mc = Minecraft.getMinecraft();
|
private static final Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
|
||||||
public BodyLayerFeatureRenderer(
|
public BodyLayerFeatureRenderer(
|
||||||
RenderPlayer playerRenderer) {
|
RenderPlayer playerRenderer) {
|
||||||
this.playerRenderer = playerRenderer;
|
|
||||||
thinArms = ((PlayerEntityModelAccessor)playerRenderer).client$hasThinArms();
|
thinArms = ((PlayerEntityModelAccessor)playerRenderer).client$hasThinArms();
|
||||||
bodyLayers.add(new Layer(0, false, EnumPlayerModelParts.LEFT_PANTS_LEG, Shape.LEGS, () -> playerRenderer.getMainModel().bipedLeftLeg, () -> Client.getInstance().getSettingsManager().getSettingByClass(SkinsMod.class, "Left Leg").getValBoolean()));
|
bodyLayers.add(new Layer(0, false, EnumPlayerModelParts.LEFT_PANTS_LEG, Shape.LEGS, () -> playerRenderer.getMainModel().bipedLeftLeg, () -> Client.getInstance().getSettingsManager().getSettingByClass(SkinsMod.class, "Left Leg").getValBoolean()));
|
||||||
bodyLayers.add(new Layer(1, false, EnumPlayerModelParts.RIGHT_PANTS_LEG, Shape.LEGS, () -> playerRenderer.getMainModel().bipedRightLeg, () -> Client.getInstance().getSettingsManager().getSettingByClass(SkinsMod.class, "Right Leg").getValBoolean()));
|
bodyLayers.add(new Layer(1, false, EnumPlayerModelParts.RIGHT_PANTS_LEG, Shape.LEGS, () -> playerRenderer.getMainModel().bipedRightLeg, () -> Client.getInstance().getSettingsManager().getSettingByClass(SkinsMod.class, "Right Leg").getValBoolean()));
|
||||||
|
@ -37,7 +37,7 @@ public class HeadLayerFeatureRenderer implements LayerRenderer<AbstractClientPla
|
|||||||
}
|
}
|
||||||
if(mc.thePlayer.getPositionVector().squareDistanceTo(player.getPositionVector()) > Client.getInstance().getSettingsManager().getSettingByClass(SkinsMod.class, "Level Of Detail Distance").getValInt()*Client.getInstance().getSettingsManager().getSettingByClass(SkinsMod.class, "Level Of Detail Distance").getValInt())return;
|
if(mc.thePlayer.getPositionVector().squareDistanceTo(player.getPositionVector()) > Client.getInstance().getSettingsManager().getSettingByClass(SkinsMod.class, "Level Of Detail Distance").getValInt()*Client.getInstance().getSettingsManager().getSettingByClass(SkinsMod.class, "Level Of Detail Distance").getValInt())return;
|
||||||
|
|
||||||
ItemStack itemStack = player.getEquipmentInSlot(1); //TODO
|
ItemStack itemStack = player.getEquipmentInSlot(1);
|
||||||
if (itemStack != null && hideHeadLayers.contains(itemStack.getItem())) {
|
if (itemStack != null && hideHeadLayers.contains(itemStack.getItem())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,6 @@ public class GeneralMod extends Mod {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean lastFullscreen = false;
|
|
||||||
|
|
||||||
public GeneralMod() {
|
public GeneralMod() {
|
||||||
super("General", ModCategory.SETTINGS, "silentclient/icons/settings/general.png");
|
super("General", ModCategory.SETTINGS, "silentclient/icons/settings/general.png");
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ public class RenderMod extends Mod {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public RenderMod() {
|
public RenderMod() {
|
||||||
super("Render", ModCategory.SETTINGS, "silentclient/icons/settings/render.png");
|
super("Render", ModCategory.SETTINGS, "silentclient/icons/settings/render.png");
|
||||||
}
|
}
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
package net.silentclient.client.mods.staff;
|
|
||||||
|
|
||||||
import net.silentclient.client.event.EventTarget;
|
|
||||||
import net.silentclient.client.event.impl.EventText;
|
|
||||||
import net.silentclient.client.mods.Mod;
|
|
||||||
import net.silentclient.client.mods.ModCategory;
|
|
||||||
|
|
||||||
public class RadmirMod extends Mod {
|
|
||||||
public RadmirMod() {
|
|
||||||
super("Radmir Mod", ModCategory.MODS, "silentclient/mods/radmir/radmir.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventTarget
|
|
||||||
public void onText(EventText event) {
|
|
||||||
event.setOutputText(this.replaceWords(event.getText(), "Radmir (курица)"));
|
|
||||||
}
|
|
||||||
|
|
||||||
private String replaceWords(String input, String replacement) {
|
|
||||||
String[] words = input.split("\\s+");
|
|
||||||
|
|
||||||
for (int i = 0; i < words.length; i++) {
|
|
||||||
words[i] = replacement;
|
|
||||||
}
|
|
||||||
|
|
||||||
return String.join(" ", words);
|
|
||||||
}
|
|
||||||
}
|
|
@ -11,7 +11,6 @@ public class Server {
|
|||||||
public static boolean isHypixel() {
|
public static boolean isHypixel() {
|
||||||
return hypixel;
|
return hypixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setHypixel(boolean hypixel) {
|
public static void setHypixel(boolean hypixel) {
|
||||||
Server.hypixel = hypixel;
|
Server.hypixel = hypixel;
|
||||||
}
|
}
|
||||||
@ -19,7 +18,6 @@ public class Server {
|
|||||||
public static boolean isRuHypixel() {
|
public static boolean isRuHypixel() {
|
||||||
return ruHypixel;
|
return ruHypixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setRuHypixel(boolean ruHypixel) {
|
public static void setRuHypixel(boolean ruHypixel) {
|
||||||
Server.ruHypixel = ruHypixel;
|
Server.ruHypixel = ruHypixel;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package net.silentclient.client.mods.world;
|
package net.silentclient.client.mods.world;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import net.minecraft.network.play.server.S2BPacketChangeGameState;
|
import net.minecraft.network.play.server.S2BPacketChangeGameState;
|
||||||
import net.silentclient.client.Client;
|
import net.silentclient.client.Client;
|
||||||
import net.silentclient.client.event.EventTarget;
|
import net.silentclient.client.event.EventTarget;
|
||||||
@ -11,6 +9,8 @@ import net.silentclient.client.event.impl.EventReceivePacket;
|
|||||||
import net.silentclient.client.mods.Mod;
|
import net.silentclient.client.mods.Mod;
|
||||||
import net.silentclient.client.mods.ModCategory;
|
import net.silentclient.client.mods.ModCategory;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class WeatherChangerMod extends Mod {
|
public class WeatherChangerMod extends Mod {
|
||||||
public WeatherChangerMod() {
|
public WeatherChangerMod() {
|
||||||
super("Weather", ModCategory.MODS, "silentclient/icons/mods/weatherchanger.png");
|
super("Weather", ModCategory.MODS, "silentclient/icons/mods/weatherchanger.png");
|
||||||
@ -68,6 +68,4 @@ public class WeatherChangerMod extends Mod {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ public class PremiumCosmeticsGui extends SilentScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Client.getInstance().getSilentFontRenderer().drawString((scaledResolution.getScaledWidth() / 2) - (Client.getInstance().getSilentFontRenderer().getStringWidth(month, 18, FontType.HEADER) / 2), 10, month, 18, FontType.HEADER);
|
Client.getInstance().getSilentFontRenderer().drawString((scaledResolution.getScaledWidth() / 2) - (Client.getInstance().getSilentFontRenderer().getStringWidth(month, 18, FontType.HEADER) / 2), 10, month, 18, FontType.HEADER);
|
||||||
RenderUtil.drawImage(new ResourceLocation(Client.getInstance().getAccount().isPremiumPlus() ? "silentclient/premium/premium_plus.png" : "silentclient/premium/premium.png"), (scaledResolution.getScaledWidth() / 2) - 44.5F, 30, 89, Client.getInstance().getAccount().isPremiumPlus() ? 19 : 21);
|
RenderUtil.drawImage(new ResourceLocation(Client.getInstance().getAccount().isPremiumPlus() ? "silentclient/premium/premium_plus.png" : "silentclient/premium/premium.png"), (scaledResolution.getScaledWidth() / 2) - 44.5F, 30, 89, Client.getInstance().getAccount().isPremiumPlus() ? 19.3F : 21.34F);
|
||||||
Client.getInstance().getSilentFontRenderer().drawCenteredString("Hey " + Minecraft.getMinecraft().getSession().getUsername() + "! Thanks for being awesome and continuing", (scaledResolution.getScaledWidth() / 2), 50, 8, FontType.HEADER);
|
Client.getInstance().getSilentFontRenderer().drawCenteredString("Hey " + Minecraft.getMinecraft().getSession().getUsername() + "! Thanks for being awesome and continuing", (scaledResolution.getScaledWidth() / 2), 50, 8, FontType.HEADER);
|
||||||
Client.getInstance().getSilentFontRenderer().drawCenteredString("your Premium" + (Client.getInstance().getAccount().isPremiumPlus() ? "+" : "") + " subscription. New Exclusive cosmetic items", (scaledResolution.getScaledWidth() / 2), 60, 8, FontType.HEADER);
|
Client.getInstance().getSilentFontRenderer().drawCenteredString("your Premium" + (Client.getInstance().getAccount().isPremiumPlus() ? "+" : "") + " subscription. New Exclusive cosmetic items", (scaledResolution.getScaledWidth() / 2), 60, 8, FontType.HEADER);
|
||||||
Client.getInstance().getSilentFontRenderer().drawCenteredString("are available to you. You can access using the cosmetics menu", (scaledResolution.getScaledWidth() / 2), 70, 8, FontType.HEADER);
|
Client.getInstance().getSilentFontRenderer().drawCenteredString("are available to you. You can access using the cosmetics menu", (scaledResolution.getScaledWidth() / 2), 70, 8, FontType.HEADER);
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
package net.silentclient.client.skillissue;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.silentclient.client.Client;
|
|
||||||
import net.silentclient.client.event.EventManager;
|
|
||||||
import net.silentclient.client.event.EventTarget;
|
|
||||||
import net.silentclient.client.event.impl.ClientTickEvent;
|
|
||||||
import net.silentclient.client.skillissue.detections.Detection;
|
|
||||||
import net.silentclient.client.utils.Requests;
|
|
||||||
import net.silentclient.client.utils.TimerUtils;
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class SkillIssue {
|
|
||||||
public static final String VERSION = "1.0.0-beta.1";
|
|
||||||
private final ArrayList<Detection> detections = new ArrayList<>();
|
|
||||||
private TimerUtils timer;
|
|
||||||
|
|
||||||
public SkillIssue() {
|
|
||||||
EventManager.register(this);
|
|
||||||
Client.logger.info(String.format("[SkillIssue]: Initialising (v%s)", VERSION));
|
|
||||||
// detections.add(new Reach(this));
|
|
||||||
// detections.add(new AutoClicker(this));
|
|
||||||
timer = new TimerUtils();
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventTarget
|
|
||||||
public void tickEvent(ClientTickEvent event) {
|
|
||||||
if(timer.delay(30000)) {
|
|
||||||
timer.reset();
|
|
||||||
(new Thread(this::sendDetections)).start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void sendDetections() {
|
|
||||||
JSONArray jsonArray = new JSONArray();
|
|
||||||
for(Detection detection : detections) {
|
|
||||||
for(String detectReason : detection.getDetections()) {
|
|
||||||
jsonArray.put(new JSONObject().put("type", detection.getName().toLowerCase()).put("message", detectReason));
|
|
||||||
}
|
|
||||||
detection.getDetections().clear();
|
|
||||||
}
|
|
||||||
if(jsonArray.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
JSONObject jsonObject = new JSONObject().put("detects", jsonArray);
|
|
||||||
|
|
||||||
Requests.post("https://api.silentclient.net/anticheat/detect", jsonObject.toString());
|
|
||||||
|
|
||||||
if(Minecraft.getMinecraft().theWorld != null) {
|
|
||||||
Client.getInstance().updateUserInformation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<Detection> getDetections() {
|
|
||||||
return detections;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
package net.silentclient.client.skillissue.detections;
|
|
||||||
|
|
||||||
import net.silentclient.client.Client;
|
|
||||||
import net.silentclient.client.event.EventTarget;
|
|
||||||
import net.silentclient.client.event.impl.EntityAttackEvent;
|
|
||||||
import net.silentclient.client.skillissue.SkillIssue;
|
|
||||||
import net.silentclient.client.utils.PlayerUtils;
|
|
||||||
import org.lwjgl.input.Mouse;
|
|
||||||
|
|
||||||
public class AutoClicker extends Detection {
|
|
||||||
private long lastHit = 0;
|
|
||||||
|
|
||||||
public AutoClicker(SkillIssue skillIssue) {
|
|
||||||
super(skillIssue, "AutoClicker");
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventTarget
|
|
||||||
public void onHit(EntityAttackEvent event) {
|
|
||||||
if(System.currentTimeMillis() - lastHit < 500 || !PlayerUtils.isSurvival()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.lastHit = System.currentTimeMillis();
|
|
||||||
if(!Mouse.isButtonDown(0) && Client.getInstance().getCPSTracker().getLCPS() > 10) {
|
|
||||||
this.detect(String.format("lmb is not pressed when hitting, %s cps", Client.getInstance().getCPSTracker().getLCPS()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
package net.silentclient.client.skillissue.detections;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.silentclient.client.Client;
|
|
||||||
import net.silentclient.client.event.EventManager;
|
|
||||||
import net.silentclient.client.skillissue.SkillIssue;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class Detection {
|
|
||||||
protected Minecraft mc = Minecraft.getMinecraft();
|
|
||||||
protected SkillIssue skillIssue;
|
|
||||||
private final String name;
|
|
||||||
protected ArrayList<String> detections = new ArrayList<>();
|
|
||||||
|
|
||||||
public Detection(SkillIssue skillIssue, String name) {
|
|
||||||
this.skillIssue = skillIssue;
|
|
||||||
this.name = name;
|
|
||||||
EventManager.register(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void detect(String data) {
|
|
||||||
this.detections.add(data);
|
|
||||||
Client.logger.warn(String.format("[SkillIssue]: %s Detection: %s (vl: %s)", name, data, detections.size()));
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<String> getDetections() {
|
|
||||||
return detections;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
package net.silentclient.client.skillissue.detections;
|
|
||||||
|
|
||||||
import net.silentclient.client.event.EventTarget;
|
|
||||||
import net.silentclient.client.event.impl.EntityAttackEvent;
|
|
||||||
import net.silentclient.client.mods.hud.ReachDisplayMod;
|
|
||||||
import net.silentclient.client.skillissue.SkillIssue;
|
|
||||||
import net.silentclient.client.utils.PlayerUtils;
|
|
||||||
|
|
||||||
public class Reach extends Detection {
|
|
||||||
private long lastHit = 0;
|
|
||||||
|
|
||||||
public Reach(SkillIssue skillIssue) {
|
|
||||||
super(skillIssue, "Reach");
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventTarget
|
|
||||||
public void totallyNoReachHax(EntityAttackEvent event) {
|
|
||||||
if(System.currentTimeMillis() - lastHit < 500 || !PlayerUtils.isSurvival() || mc.isSingleplayer()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(mc.objectMouseOver != null && mc.objectMouseOver.hitVec != null) {
|
|
||||||
this.lastHit = System.currentTimeMillis();
|
|
||||||
double distance = mc.objectMouseOver.hitVec.distanceTo(mc.thePlayer.getPositionEyes(1.0F));
|
|
||||||
if(distance > 3) {
|
|
||||||
this.detect("distance: " + ReachDisplayMod.FORMAT.format(distance));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +1,20 @@
|
|||||||
package net.silentclient.client.utils;
|
package net.silentclient.client.utils;
|
||||||
|
|
||||||
import java.awt.HeadlessException;
|
import net.minecraft.client.Minecraft;
|
||||||
import java.awt.Toolkit;
|
import net.minecraft.util.Util;
|
||||||
|
import net.silentclient.client.Client;
|
||||||
|
import net.silentclient.client.event.EventTarget;
|
||||||
|
import net.silentclient.client.event.impl.RunCommandEvent;
|
||||||
|
import net.silentclient.client.utils.AsyncScreenshots.ImageSelection;
|
||||||
|
import org.lwjgl.Sys;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.datatransfer.StringSelection;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import net.silentclient.client.event.EventTarget;
|
|
||||||
import net.silentclient.client.event.impl.RunCommandEvent;
|
|
||||||
import org.lwjgl.Sys;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.util.ChatComponentText;
|
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
|
||||||
import net.minecraft.util.Util;
|
|
||||||
import net.silentclient.client.Client;
|
|
||||||
import net.silentclient.client.utils.AsyncScreenshots.ImageSelection;
|
|
||||||
|
|
||||||
public class ScreenshotManager {
|
public class ScreenshotManager {
|
||||||
private File screenshot;
|
private File screenshot;
|
||||||
private BufferedImage image;
|
private BufferedImage image;
|
||||||
@ -46,6 +43,12 @@ public class ScreenshotManager {
|
|||||||
|
|
||||||
@EventTarget()
|
@EventTarget()
|
||||||
public void command(RunCommandEvent event) {
|
public void command(RunCommandEvent event) {
|
||||||
|
if(event.getCommand().startsWith("/slc$copy ")) {
|
||||||
|
String message = event.getCommand().replace("/slc$copy ", "");
|
||||||
|
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(message), null);
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch(event.getCommand()) {
|
switch(event.getCommand()) {
|
||||||
case "/$openfolder":
|
case "/$openfolder":
|
||||||
File file1 = new File(mc.mcDataDir, "screenshots");
|
File file1 = new File(mc.mcDataDir, "screenshots");
|
||||||
|
123
src/main/java/net/silentclient/client/utils/ShaderUtils.java
Normal file
123
src/main/java/net/silentclient/client/utils/ShaderUtils.java
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
package net.silentclient.client.utils;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import static org.lwjgl.opengl.GL11.*;
|
||||||
|
import static org.lwjgl.opengl.GL20.*;
|
||||||
|
|
||||||
|
public class ShaderUtils {
|
||||||
|
|
||||||
|
private static Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
private final int programID;
|
||||||
|
|
||||||
|
public ShaderUtils(String fragmentShaderLoc, String vertexShaderLoc) {
|
||||||
|
int program = glCreateProgram();
|
||||||
|
try {
|
||||||
|
int fragmentShaderID = createShader(mc.getResourceManager().getResource(new ResourceLocation(fragmentShaderLoc)).getInputStream(), GL_FRAGMENT_SHADER);;
|
||||||
|
glAttachShader(program, fragmentShaderID);
|
||||||
|
|
||||||
|
int vertexShaderID = createShader(mc.getResourceManager().getResource(new ResourceLocation(vertexShaderLoc)).getInputStream(), GL_VERTEX_SHADER);
|
||||||
|
glAttachShader(program, vertexShaderID);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
glLinkProgram(program);
|
||||||
|
int status = glGetProgrami(program, GL_LINK_STATUS);
|
||||||
|
|
||||||
|
if (status == 0) {
|
||||||
|
throw new IllegalStateException("Shader failed to link!");
|
||||||
|
}
|
||||||
|
this.programID = program;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShaderUtils(String fragmentShaderLoc) {
|
||||||
|
this(fragmentShaderLoc, "silentclient/shaders/vertex.vsh");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
glUseProgram(programID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unload() {
|
||||||
|
glUseProgram(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUniform(String name) {
|
||||||
|
return glGetUniformLocation(programID, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setUniformf(String name, float... args) {
|
||||||
|
int loc = glGetUniformLocation(programID, name);
|
||||||
|
switch (args.length) {
|
||||||
|
case 1:
|
||||||
|
glUniform1f(loc, args[0]);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
glUniform2f(loc, args[0], args[1]);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
glUniform3f(loc, args[0], args[1], args[2]);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
glUniform4f(loc, args[0], args[1], args[2], args[3]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUniformi(String name, int... args) {
|
||||||
|
int loc = glGetUniformLocation(programID, name);
|
||||||
|
if (args.length > 1) glUniform2i(loc, args[0], args[1]);
|
||||||
|
else glUniform1i(loc, args[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void drawQuads(float x, float y, float width, float height) {
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
glTexCoord2f(0, 0);
|
||||||
|
glVertex2f(x, y);
|
||||||
|
glTexCoord2f(0, 1);
|
||||||
|
glVertex2f(x, y + height);
|
||||||
|
glTexCoord2f(1, 1);
|
||||||
|
glVertex2f(x + width, y + height);
|
||||||
|
glTexCoord2f(1, 0);
|
||||||
|
glVertex2f(x + width, y);
|
||||||
|
glEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void drawQuads() {
|
||||||
|
ScaledResolution sr = new ScaledResolution(mc);
|
||||||
|
float width = (float) sr.getScaledWidth_double();
|
||||||
|
float height = (float) sr.getScaledHeight_double();
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
glTexCoord2f(0, 1);
|
||||||
|
glVertex2f(0, 0);
|
||||||
|
glTexCoord2f(0, 0);
|
||||||
|
glVertex2f(0, height);
|
||||||
|
glTexCoord2f(1, 0);
|
||||||
|
glVertex2f(width, height);
|
||||||
|
glTexCoord2f(1, 1);
|
||||||
|
glVertex2f(width, 0);
|
||||||
|
glEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
private int createShader(InputStream inputStream, int shaderType) {
|
||||||
|
int shader = glCreateShader(shaderType);
|
||||||
|
glShaderSource(shader, FileUtils.readInputStream(inputStream));
|
||||||
|
glCompileShader(shader);
|
||||||
|
|
||||||
|
|
||||||
|
if (glGetShaderi(shader, GL_COMPILE_STATUS) == 0) {
|
||||||
|
System.out.println(glGetShaderInfoLog(shader, 4096));
|
||||||
|
throw new IllegalStateException(String.format("Shader failed to compile!", shaderType));
|
||||||
|
}
|
||||||
|
|
||||||
|
return shader;
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 73 KiB |
Binary file not shown.
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 82 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.8 MiB |
@ -0,0 +1,19 @@
|
|||||||
|
#version 120
|
||||||
|
|
||||||
|
uniform vec2 location, rectSize;
|
||||||
|
uniform vec4 color, outlineColor;
|
||||||
|
uniform float radius, outlineThickness;
|
||||||
|
|
||||||
|
float roundedSDF(vec2 centerPos, vec2 size, float radius) {
|
||||||
|
return length(max(abs(centerPos) - size + radius, 0.0)) - radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
float distance = roundedSDF(gl_FragCoord.xy - location - (rectSize * .5), (rectSize * .5) + (outlineThickness *.5) - 1.0, radius);
|
||||||
|
|
||||||
|
float blendAmount = smoothstep(0., 2., abs(distance) - (outlineThickness * .5));
|
||||||
|
|
||||||
|
vec4 insideColor = (distance < 0.) ? color : vec4(outlineColor.rgb, 0.0);
|
||||||
|
gl_FragColor = mix(outlineColor, insideColor, blendAmount);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
#version 120
|
||||||
|
|
||||||
|
uniform vec2 location, rectSize;
|
||||||
|
uniform sampler2D textureIn;
|
||||||
|
uniform float radius, alpha;
|
||||||
|
|
||||||
|
float roundedBoxSDF(vec2 centerPos, vec2 size, float radius) {
|
||||||
|
return length(max(abs(centerPos) -size, 0.)) - radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
float distance = roundedBoxSDF((rectSize * .5) - (gl_TexCoord[0].st * rectSize), (rectSize * .5) - radius - 1., radius);
|
||||||
|
float smoothedAlpha = (1.0-smoothstep(0.0, 2.0, distance)) * alpha;
|
||||||
|
gl_FragColor = vec4(texture2D(textureIn, gl_TexCoord[0].st).rgb, smoothedAlpha);
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
#version 120
|
||||||
|
|
||||||
|
uniform vec2 rectSize;
|
||||||
|
uniform sampler2D textureIn;
|
||||||
|
uniform float radius, alpha;
|
||||||
|
|
||||||
|
float roundedBoxSDF(vec2 centerPos, vec2 size, float radius) {
|
||||||
|
return length(max(abs(centerPos) -size, 0.)) - radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
float distance = roundedBoxSDF((rectSize * .5) - (gl_TexCoord[0].st * rectSize), (rectSize * .5) - radius - 1., radius);
|
||||||
|
float smoothedAlpha = (1.0-smoothstep(0.0, 2.0, distance)) * alpha;
|
||||||
|
gl_FragColor = vec4(texture2D(textureIn, gl_TexCoord[0].st).rgb, smoothedAlpha);
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
#version 120
|
||||||
|
|
||||||
|
uniform vec2 location, rectSize;
|
||||||
|
uniform vec4 color;
|
||||||
|
uniform float radius;
|
||||||
|
uniform bool blur;
|
||||||
|
|
||||||
|
float roundSDF(vec2 p, vec2 b, float r) {
|
||||||
|
return length(max(abs(p) - b, 0.0)) - r;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec2 rectHalf = rectSize * .5;
|
||||||
|
float smoothedAlpha = (1.0-smoothstep(0.0, 1.0, roundSDF(rectHalf - (gl_TexCoord[0].st * rectSize), rectHalf - radius - 1., radius))) * color.a;
|
||||||
|
|
||||||
|
gl_FragColor = vec4(color.rgb, smoothedAlpha);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user