Code cleanup
This commit is contained in:
parent
1b02722dce
commit
d68cf25ccb
|
@ -288,9 +288,13 @@ public class DraggableHudComponent extends HudComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isRclicked() { return rclicked; }
|
public boolean isRclicked() {
|
||||||
|
return rclicked;
|
||||||
|
}
|
||||||
|
|
||||||
public void setRclicked(boolean rclicked) { this.rclicked = rclicked; }
|
public void setRclicked(boolean rclicked) {
|
||||||
|
this.rclicked = rclicked;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isSnappable() {
|
public boolean isSnappable() {
|
||||||
return snappable;
|
return snappable;
|
||||||
|
|
|
@ -183,23 +183,23 @@ public class GuiPasswordField extends Gui {
|
||||||
boolean flag = n < 0;
|
boolean flag = n < 0;
|
||||||
int j = Math.abs(n);
|
int j = Math.abs(n);
|
||||||
|
|
||||||
for(int k = 0; k < j; ++k) {
|
for (int k = 0; k < j; ++k) {
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
int l = this.text.length();
|
int l = this.text.length();
|
||||||
i = this.text.indexOf(32, i);
|
i = this.text.indexOf(32, i);
|
||||||
if (i == -1) {
|
if (i == -1) {
|
||||||
i = l;
|
i = l;
|
||||||
} else {
|
} else {
|
||||||
while(skipWs && i < l && this.text.charAt(i) == ' ') {
|
while (skipWs && i < l && this.text.charAt(i) == ' ') {
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while(skipWs && i > 0 && this.text.charAt(i - 1) == ' ') {
|
while (skipWs && i > 0 && this.text.charAt(i - 1) == ' ') {
|
||||||
--i;
|
--i;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(i > 0 && this.text.charAt(i - 1) != ' ') {
|
while (i > 0 && this.text.charAt(i - 1) != ' ') {
|
||||||
--i;
|
--i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ public class GuiPasswordField extends Gui {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
switch(keyCode) {
|
switch (keyCode) {
|
||||||
case 14:
|
case 14:
|
||||||
if (GuiScreen.isCtrlKeyDown()) {
|
if (GuiScreen.isCtrlKeyDown()) {
|
||||||
if (this.isEnabled) {
|
if (this.isEnabled) {
|
||||||
|
@ -372,7 +372,7 @@ public class GuiPasswordField extends Gui {
|
||||||
|
|
||||||
if (!s.isEmpty()) {
|
if (!s.isEmpty()) {
|
||||||
String s1 = flag ? s.substring(0, j) : s;
|
String s1 = flag ? s.substring(0, j) : s;
|
||||||
j1 = this.fontRenderer.drawStringWithShadow(s1.replaceAll("(?s).", "*"), (float)l, (float)i1, i);
|
j1 = this.fontRenderer.drawStringWithShadow(s1.replaceAll("(?s).", "*"), (float) l, (float) i1, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean flag2 = this.cursorPosition < this.text.length() || this.text.length() >= this.getMaxStringLength();
|
boolean flag2 = this.cursorPosition < this.text.length() || this.text.length() >= this.getMaxStringLength();
|
||||||
|
@ -385,14 +385,14 @@ public class GuiPasswordField extends Gui {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!s.isEmpty() && flag && j < s.length()) {
|
if (!s.isEmpty() && flag && j < s.length()) {
|
||||||
j1 = this.fontRenderer.drawStringWithShadow(s.substring(j), (float)j1, (float)i1, i);
|
j1 = this.fontRenderer.drawStringWithShadow(s.substring(j), (float) j1, (float) i1, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag1) {
|
if (flag1) {
|
||||||
if (flag2) {
|
if (flag2) {
|
||||||
Gui.drawRect(k1, i1 - 1, k1 + 1, i1 + 1 + this.fontRenderer.FONT_HEIGHT, -3092272);
|
Gui.drawRect(k1, i1 - 1, k1 + 1, i1 + 1 + this.fontRenderer.FONT_HEIGHT, -3092272);
|
||||||
} else {
|
} else {
|
||||||
this.fontRenderer.drawStringWithShadow("_", (float)k1, (float)i1, i);
|
this.fontRenderer.drawStringWithShadow("_", (float) k1, (float) i1, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,10 +433,10 @@ public class GuiPasswordField extends Gui {
|
||||||
GlStateManager.enableColorLogic();
|
GlStateManager.enableColorLogic();
|
||||||
GlStateManager.colorLogicOp(LogicOp.OR_REVERSE);
|
GlStateManager.colorLogicOp(LogicOp.OR_REVERSE);
|
||||||
bufferbuilder.begin(7, DefaultVertexFormats.POSITION);
|
bufferbuilder.begin(7, DefaultVertexFormats.POSITION);
|
||||||
bufferbuilder.pos((double)startX, (double)endY, 0.0D).endVertex();
|
bufferbuilder.pos((double) startX, (double) endY, 0.0D).endVertex();
|
||||||
bufferbuilder.pos((double)endX, (double)endY, 0.0D).endVertex();
|
bufferbuilder.pos((double) endX, (double) endY, 0.0D).endVertex();
|
||||||
bufferbuilder.pos((double)endX, (double)startY, 0.0D).endVertex();
|
bufferbuilder.pos((double) endX, (double) startY, 0.0D).endVertex();
|
||||||
bufferbuilder.pos((double)startX, (double)startY, 0.0D).endVertex();
|
bufferbuilder.pos((double) startX, (double) startY, 0.0D).endVertex();
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
GlStateManager.disableColorLogic();
|
GlStateManager.disableColorLogic();
|
||||||
GlStateManager.enableTexture2D();
|
GlStateManager.enableTexture2D();
|
||||||
|
|
|
@ -38,7 +38,7 @@ public final class AuthUtil {
|
||||||
if (username == null || username.length() <= 0 || password == null || password.length() <= 0)
|
if (username == null || username.length() <= 0 || password == null || password.length() <= 0)
|
||||||
return "Error";
|
return "Error";
|
||||||
YggdrasilAuthenticationService a = new YggdrasilAuthenticationService(Proxy.NO_PROXY, "");
|
YggdrasilAuthenticationService a = new YggdrasilAuthenticationService(Proxy.NO_PROXY, "");
|
||||||
YggdrasilUserAuthentication b = (YggdrasilUserAuthentication)a.createUserAuthentication(Agent.MINECRAFT);
|
YggdrasilUserAuthentication b = (YggdrasilUserAuthentication) a.createUserAuthentication(Agent.MINECRAFT);
|
||||||
b.setUsername(username);
|
b.setUsername(username);
|
||||||
b.setPassword(password);
|
b.setPassword(password);
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -7,11 +7,9 @@ import me.rigamortis.seppuku.Seppuku;
|
||||||
import me.rigamortis.seppuku.api.config.Configurable;
|
import me.rigamortis.seppuku.api.config.Configurable;
|
||||||
import me.rigamortis.seppuku.api.util.FileUtil;
|
import me.rigamortis.seppuku.api.util.FileUtil;
|
||||||
import me.rigamortis.seppuku.impl.module.render.SearchModule;
|
import me.rigamortis.seppuku.impl.module.render.SearchModule;
|
||||||
import me.rigamortis.seppuku.impl.module.render.XrayModule;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author noil
|
* @author noil
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
package me.rigamortis.seppuku.impl.gui.hud.component;
|
package me.rigamortis.seppuku.impl.gui.hud.component;
|
||||||
|
|
||||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||||
import me.rigamortis.seppuku.Seppuku;
|
|
||||||
import me.rigamortis.seppuku.api.gui.hud.component.DraggableHudComponent;
|
import me.rigamortis.seppuku.api.gui.hud.component.DraggableHudComponent;
|
||||||
import me.rigamortis.seppuku.impl.gui.hud.GuiHudEditor;
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
|
|
@ -19,7 +19,8 @@ import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static me.rigamortis.seppuku.impl.module.hidden.ArrayListModule.Mode.*;
|
import static me.rigamortis.seppuku.impl.module.hidden.ArrayListModule.Mode.ALPHABET;
|
||||||
|
import static me.rigamortis.seppuku.impl.module.hidden.ArrayListModule.Mode.LENGTH;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author seth * 7/25/2019 @ 7:24 AM
|
* @author seth * 7/25/2019 @ 7:24 AM
|
||||||
|
|
|
@ -649,14 +649,14 @@ public final class ModuleListComponent extends ResizableHudComponent {
|
||||||
if (otherComponent == component || otherComponent.getName().equals(component.getName()))
|
if (otherComponent == component || otherComponent.getName().equals(component.getName()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
boolean isChildComponent = component.getName().toLowerCase().startsWith(otherComponent.getName().toLowerCase());
|
boolean isChildComponent = component.getName().toLowerCase().startsWith(otherComponent.getName().toLowerCase());
|
||||||
if (isChildComponent) {
|
if (isChildComponent) {
|
||||||
if (!otherComponent.rightClickEnabled) {
|
if (!otherComponent.rightClickEnabled) {
|
||||||
skipRendering = true;
|
skipRendering = true;
|
||||||
}
|
|
||||||
|
|
||||||
offsetX += 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
offsetX += 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skipRendering)
|
if (skipRendering)
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
package me.rigamortis.seppuku.impl.module.misc;
|
package me.rigamortis.seppuku.impl.module.misc;
|
||||||
|
|
||||||
import me.rigamortis.seppuku.Seppuku;
|
import me.rigamortis.seppuku.Seppuku;
|
||||||
import me.rigamortis.seppuku.api.event.EventStageable;
|
|
||||||
import me.rigamortis.seppuku.api.event.gui.EventGetGuiTabName;
|
import me.rigamortis.seppuku.api.event.gui.EventGetGuiTabName;
|
||||||
import me.rigamortis.seppuku.api.event.network.EventReceivePacket;
|
|
||||||
import me.rigamortis.seppuku.api.friend.Friend;
|
import me.rigamortis.seppuku.api.friend.Friend;
|
||||||
import me.rigamortis.seppuku.api.module.Module;
|
import me.rigamortis.seppuku.api.module.Module;
|
||||||
import net.minecraft.network.play.server.SPacketPlayerListHeaderFooter;
|
|
||||||
import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
|
import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package me.rigamortis.seppuku.impl.module.movement;
|
package me.rigamortis.seppuku.impl.module.movement;
|
||||||
|
|
||||||
import me.rigamortis.seppuku.api.event.EventStageable;
|
import me.rigamortis.seppuku.api.event.EventStageable;
|
||||||
import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate;
|
|
||||||
import me.rigamortis.seppuku.api.event.player.EventUpdateWalkingPlayer;
|
import me.rigamortis.seppuku.api.event.player.EventUpdateWalkingPlayer;
|
||||||
import me.rigamortis.seppuku.api.module.Module;
|
import me.rigamortis.seppuku.api.module.Module;
|
||||||
import me.rigamortis.seppuku.api.value.Value;
|
import me.rigamortis.seppuku.api.value.Value;
|
||||||
|
|
|
@ -190,6 +190,7 @@ public final class FreeCamModule extends Module {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deprecated
|
* Deprecated
|
||||||
|
*
|
||||||
* @param event
|
* @param event
|
||||||
*/
|
*/
|
||||||
@Listener
|
@Listener
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class AmbianceModule extends Module {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Value<SkyMode> skyMode = new Value<SkyMode>("SkyMode", new String[]{"Sky", "Sm", "SkieMode", "Skie", "Skies"}, "Edit the skybox.", SkyMode.SEPPUKU);
|
public final Value<SkyMode> skyMode = new Value<SkyMode>("SkyMode", new String[]{"Sky", "Sm", "SkieMode", "Skie", "Skies"}, "Edit the skybox.", SkyMode.SEPPUKU);
|
||||||
public final Value<Color> skyColor = new Value<Color>("SkyColor", new String[]{"SkyCol", "Sc", "SkieColor", "SkieCol", "Color", "C"}, "Edit the skybox color (COLOR mode only).", new Color(0, 127, 255));
|
public final Value<Color> skyColor = new Value<Color>("SkyColor", new String[]{"SkyCol", "Sc", "SkieColor", "SkieCol", "Color", "C"}, "Edit the skybox color (COLOR mode only).", new Color(0, 127, 255));
|
||||||
public final Value<Integer> skyGamma = new Value<Integer>("SkyGamma", new String[]{"SkyGam", "SkyG", "Sg", "Gamma", "G"}, "Edit the skybox gamma.", 128, 1, 255, 1);
|
public final Value<Integer> skyGamma = new Value<Integer>("SkyGamma", new String[]{"SkyGam", "SkyG", "Sg", "Gamma", "G"}, "Edit the skybox gamma.", 128, 1, 255, 1);
|
||||||
public final Value<Integer> skyGammaEnd = new Value<Integer>("SkyGammaEnd", new String[]{"SkyGamEnd", "SkyGe", "Sge", "GammaEnd", "GamEnd", "Ge"}, "Edit the skybox gamma (END mode only).", 40, 1, 255, 1);
|
public final Value<Integer> skyGammaEnd = new Value<Integer>("SkyGammaEnd", new String[]{"SkyGamEnd", "SkyGe", "Sge", "GammaEnd", "GamEnd", "Ge"}, "Edit the skybox gamma (END mode only).", 40, 1, 255, 1);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import me.rigamortis.seppuku.Seppuku;
|
||||||
import me.rigamortis.seppuku.api.event.EventStageable;
|
import me.rigamortis.seppuku.api.event.EventStageable;
|
||||||
import me.rigamortis.seppuku.api.event.network.EventReceivePacket;
|
import me.rigamortis.seppuku.api.event.network.EventReceivePacket;
|
||||||
import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate;
|
import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate;
|
||||||
import me.rigamortis.seppuku.api.event.player.EventUpdateWalkingPlayer;
|
|
||||||
import me.rigamortis.seppuku.api.event.render.EventRender3D;
|
import me.rigamortis.seppuku.api.event.render.EventRender3D;
|
||||||
import me.rigamortis.seppuku.api.event.world.EventLoadWorld;
|
import me.rigamortis.seppuku.api.event.world.EventLoadWorld;
|
||||||
import me.rigamortis.seppuku.api.module.Module;
|
import me.rigamortis.seppuku.api.module.Module;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package me.rigamortis.seppuku.impl.patch;
|
package me.rigamortis.seppuku.impl.patch;
|
||||||
|
|
||||||
import me.rigamortis.seppuku.Seppuku;
|
import me.rigamortis.seppuku.Seppuku;
|
||||||
import me.rigamortis.seppuku.api.event.render.EventRenderBlockSide;
|
|
||||||
import me.rigamortis.seppuku.api.event.world.EventCanCollide;
|
import me.rigamortis.seppuku.api.event.world.EventCanCollide;
|
||||||
import me.rigamortis.seppuku.api.event.world.EventLiquidCollisionBB;
|
import me.rigamortis.seppuku.api.event.world.EventLiquidCollisionBB;
|
||||||
import me.rigamortis.seppuku.api.patch.ClassPatch;
|
import me.rigamortis.seppuku.api.patch.ClassPatch;
|
||||||
|
|
|
@ -5,9 +5,7 @@ import me.rigamortis.seppuku.api.event.gui.EventGetGuiTabName;
|
||||||
import me.rigamortis.seppuku.api.patch.ClassPatch;
|
import me.rigamortis.seppuku.api.patch.ClassPatch;
|
||||||
import me.rigamortis.seppuku.api.patch.MethodPatch;
|
import me.rigamortis.seppuku.api.patch.MethodPatch;
|
||||||
import me.rigamortis.seppuku.impl.management.PatchManager;
|
import me.rigamortis.seppuku.impl.management.PatchManager;
|
||||||
import net.minecraft.client.gui.GuiPlayerTabOverlay;
|
|
||||||
import net.minecraft.client.network.NetworkPlayerInfo;
|
import net.minecraft.client.network.NetworkPlayerInfo;
|
||||||
import net.minecraft.scoreboard.ScorePlayerTeam;
|
|
||||||
import org.objectweb.asm.Type;
|
import org.objectweb.asm.Type;
|
||||||
import org.objectweb.asm.tree.*;
|
import org.objectweb.asm.tree.*;
|
||||||
|
|
||||||
|
@ -31,7 +29,7 @@ public final class GuiPlayerTabOverlayPatch extends ClassPatch {
|
||||||
public void getPlayerName(MethodNode methodNode, PatchManager.Environment env) {
|
public void getPlayerName(MethodNode methodNode, PatchManager.Environment env) {
|
||||||
final InsnList insnList = new InsnList();
|
final InsnList insnList = new InsnList();
|
||||||
insnList.add(new VarInsnNode(ALOAD, 1));
|
insnList.add(new VarInsnNode(ALOAD, 1));
|
||||||
insnList.add(new MethodInsnNode(INVOKESTATIC, Type.getInternalName(this.getClass()), "getPlayerNameHook", env == PatchManager.Environment.IDE ? "(Lnet/minecraft/client/network/NetworkPlayerInfo;)Ljava/lang/String;" : "(Lbsc;)Ljava/lang/String;", false));
|
insnList.add(new MethodInsnNode(INVOKESTATIC, Type.getInternalName(this.getClass()), "getPlayerNameHook", env == PatchManager.Environment.IDE ? "(Lnet/minecraft/client/network/NetworkPlayerInfo;)Ljava/lang/String;" : "(Lbsc;)Ljava/lang/String;", false));
|
||||||
insnList.add(new InsnNode(ARETURN));
|
insnList.add(new InsnNode(ARETURN));
|
||||||
methodNode.instructions.insert(insnList);
|
methodNode.instructions.insert(insnList);
|
||||||
}
|
}
|
||||||
|
@ -44,5 +42,4 @@ public final class GuiPlayerTabOverlayPatch extends ClassPatch {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,10 @@ package me.rigamortis.seppuku.impl.patch;
|
||||||
|
|
||||||
import me.rigamortis.seppuku.Seppuku;
|
import me.rigamortis.seppuku.Seppuku;
|
||||||
import me.rigamortis.seppuku.api.event.render.EventAddEffect;
|
import me.rigamortis.seppuku.api.event.render.EventAddEffect;
|
||||||
import me.rigamortis.seppuku.api.event.render.EventRenderBossHealth;
|
|
||||||
import me.rigamortis.seppuku.api.event.render.EventSpawnEffect;
|
|
||||||
import me.rigamortis.seppuku.api.patch.ClassPatch;
|
import me.rigamortis.seppuku.api.patch.ClassPatch;
|
||||||
import me.rigamortis.seppuku.api.patch.MethodPatch;
|
import me.rigamortis.seppuku.api.patch.MethodPatch;
|
||||||
import me.rigamortis.seppuku.impl.management.PatchManager;
|
import me.rigamortis.seppuku.impl.management.PatchManager;
|
||||||
import net.minecraft.client.particle.Particle;
|
import net.minecraft.client.particle.Particle;
|
||||||
import net.minecraft.util.EnumParticleTypes;
|
|
||||||
import org.objectweb.asm.Type;
|
import org.objectweb.asm.Type;
|
||||||
import org.objectweb.asm.tree.*;
|
import org.objectweb.asm.tree.*;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue