Updated main menu, IgnoreModule, MovementGraphComponent

This commit is contained in:
noil 2021-03-04 22:43:09 -05:00
parent 2083b441c1
commit db4b893e02
3 changed files with 17 additions and 2 deletions

View File

@ -36,7 +36,7 @@ public final class MovementGraphComponent extends ResizableHudComponent {
public void render(int mouseX, int mouseY, float partialTicks) {
super.render(mouseX, mouseY, partialTicks);
if (mc.player != null && mc.world != null && mc.getCurrentServerData() != null) {
if (mc.player != null && mc.world != null) {
final ScaledResolution sr = new ScaledResolution(mc);
final DecimalFormat decimalFormat = new DecimalFormat("###.##");

View File

@ -290,11 +290,14 @@ public final class GuiSeppukuMainMenu extends GuiScreen {
final Minecraft mc = Minecraft.getMinecraft();
final ScaledResolution res = new ScaledResolution(mc);
final String spash = "Welcome, " + mc.getSession().getUsername();
final String spash = ChatFormatting.GRAY + "Welcome, " + mc.getSession().getUsername();
this.drawString(this.fontRenderer, spash, 1, res.getScaledHeight() - mc.fontRenderer.FONT_HEIGHT, -1);
final String version = ChatFormatting.GRAY + "Version " + SeppukuMod.VERSION + " for " + Minecraft.getMinecraft().getVersion();
this.drawString(this.fontRenderer, version, res.getScaledWidth() - mc.fontRenderer.getStringWidth(version) - 1, res.getScaledHeight() - mc.fontRenderer.FONT_HEIGHT, -1);
final String copyright = ChatFormatting.DARK_GRAY + "" + ChatFormatting.ITALIC + "Mojang AB";
this.drawString(this.fontRenderer, copyright, res.getScaledWidth() - mc.fontRenderer.getStringWidth(copyright) - 1, res.getScaledHeight() - (mc.fontRenderer.FONT_HEIGHT * 2), -1);
}
public void unload() {

View File

@ -3,8 +3,10 @@ package me.rigamortis.seppuku.impl.module.hidden;
import me.rigamortis.seppuku.Seppuku;
import me.rigamortis.seppuku.api.event.EventStageable;
import me.rigamortis.seppuku.api.event.network.EventReceivePacket;
import me.rigamortis.seppuku.api.friend.Friend;
import me.rigamortis.seppuku.api.ignore.Ignored;
import me.rigamortis.seppuku.api.module.Module;
import me.rigamortis.seppuku.api.value.Value;
import net.minecraft.client.Minecraft;
import net.minecraft.network.play.server.SPacketChat;
import net.minecraft.util.StringUtils;
@ -21,6 +23,7 @@ import java.util.regex.Pattern;
public final class IgnoreModule extends Module {
private final String REGEX_NAME = "<(\\S+)\\s*(\\S+?)?>\\s(.*)";
public final Value<Boolean> allowFriends = new Value<Boolean>("AllowFriends", new String[]{"AllowF", "Friends", "AF", "F"}, "If enabled, any friend's message will not be auto-ignored.", true);
public IgnoreModule() {
super("Ignore", new String[]{"Ignor"}, "Allows you to ignore people client-side", "NONE", -1, ModuleType.HIDDEN);
@ -42,6 +45,15 @@ public final class IgnoreModule extends Module {
Matcher chatUsernameMatcher = chatUsernamePattern.matcher(message);
if (chatUsernameMatcher.find()) {
String username = chatUsernameMatcher.group(1).replaceAll(">", "").toLowerCase();
// Check if the user is a friend
if (this.allowFriends.getValue()) {
final Friend friend = Seppuku.INSTANCE.getFriendManager().find(username);
if (friend != null) {
return;
}
}
final Ignored ignored = Seppuku.INSTANCE.getIgnoredManager().find(username);
if (ignored != null && !username.equalsIgnoreCase(Minecraft.getMinecraft().session.getUsername())) {
event.setCanceled(true);