From d4ada83ec3e7416bbac10c7d79a9ac5a0f939de6 Mon Sep 17 00:00:00 2001 From: HacktheTime Date: Sat, 7 Oct 2023 19:17:54 +0200 Subject: bug fixes and performance improvements. --- .../bbsentials/client/BBsentialsConfigScreemFactory.java | 5 +++++ src/main/java/de/hype/bbsentials/client/Config.java | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'src/main/java/de/hype/bbsentials/client') diff --git a/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java b/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java index 17fc3f1..dc521f2 100644 --- a/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java +++ b/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java @@ -69,6 +69,11 @@ public class BBsentialsConfigScreemFactory { .setTooltip(Text.of("Override the Bingo Time and connect always to the Server. (Bingo time is 14 days cause Extreme Bingo)")) .setSaveConsumer(newValue -> config.overrideBingoTime = newValue) .build()); + server.addEntry(entryBuilder.startBooleanToggle(Text.of("Allow Server Partying"), config.allowServerPartyInvite) + .setDefaultValue(true) + .setTooltip(Text.of("Allow the Server to party players for you automatically. (Convenience Feature. Is used for example for services to automatically party the persons which joined it)")) + .setSaveConsumer(newValue -> config.allowServerPartyInvite = newValue) + .build()); //Visual ConfigCategory visual = builder.getOrCreateCategory(Text.of("Visual")); visual.addEntry(entryBuilder.startBooleanToggle(Text.of("Show Bingo Chat"), config.showBingoChat) diff --git a/src/main/java/de/hype/bbsentials/client/Config.java b/src/main/java/de/hype/bbsentials/client/Config.java index ab4440b..9c62d2e 100644 --- a/src/main/java/de/hype/bbsentials/client/Config.java +++ b/src/main/java/de/hype/bbsentials/client/Config.java @@ -2,7 +2,6 @@ package de.hype.bbsentials.client; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import de.hype.bbsentials.chat.Chat; import de.hype.bbsentials.chat.Sender; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.MinecraftClient; @@ -14,13 +13,14 @@ import java.util.ArrayList; public class Config implements Serializable { //DO NOT Change any of the following unless you know what you are doing! public int apiVersion = 1; - boolean devMode = false; + public boolean allowServerPartyInvite = true; + boolean devMode = false; boolean detailedDevMode = false; //You can change again // set automatically private transient boolean isLeader; - private transient String alreadyReported = ""; + public transient String alreadyReported = ""; public String[] bbsentialsRoles = {""}; public static ArrayList partyMembers = new ArrayList<>(); public transient ToDisplayConfig toDisplayConfig = ToDisplayConfig.loadFromFile(); @@ -143,10 +143,6 @@ public class Config implements Serializable { return partyMembers.toArray(new String[0]); } - public boolean messageFromAlreadyReported(String message) { - return alreadyReported.contains(Chat.getPlayerNameFromMessage(message)); - } - public void addReported(String playerName) { alreadyReported = alreadyReported + " , " + playerName; } @@ -197,4 +193,8 @@ public class Config implements Serializable { public int getApiVersion() { return apiVersion; } + + public String getMCUUID() { + return MinecraftClient.getInstance().player.getUuid().toString().replace("-", ""); + } } -- cgit