diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 6beeab6b8c..a88ef56b71 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -17,7 +17,6 @@ import net.wurstclient.addons.AddonManager; import net.wurstclient.altmanager.AltManager; import net.wurstclient.altmanager.Encryption; -import net.wurstclient.analytics.PlausibleAnalytics; import net.wurstclient.clickgui.ClickGui; import net.wurstclient.command.CmdList; import net.wurstclient.command.CmdProcessor; @@ -65,7 +64,6 @@ public enum WurstClient public static final String VERSION = "7.54"; public static final String MC_VERSION = "26.2"; - private PlausibleAnalytics plausible; private EventManager eventManager; private AltManager altManager; private HackList hax; @@ -132,10 +130,6 @@ public void initialize() e.printStackTrace(); } - Path analyticsFile = wurstFolder.resolve("analytics.json"); - plausible = new PlausibleAnalytics(analyticsFile); - plausible.pageview("/"); - eventManager = new EventManager(this); playerRangeAlertManager = new PlayerRangeAlertManager(eventManager); serverObserver = new ServerObserver(MC); @@ -237,11 +231,6 @@ public String translate(String key, Object... args) return translator.translate(key, args); } - public PlausibleAnalytics getPlausible() - { - return plausible; - } - public EventManager getEventManager() { return eventManager; diff --git a/src/main/java/net/wurstclient/analytics/AnalyticsConfigFile.java b/src/main/java/net/wurstclient/analytics/AnalyticsConfigFile.java deleted file mode 100644 index 5cebb9eac0..0000000000 --- a/src/main/java/net/wurstclient/analytics/AnalyticsConfigFile.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2014-2026 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.analytics; - -import java.io.IOException; -import java.nio.file.NoSuchFileException; -import java.nio.file.Path; - -import com.google.gson.JsonObject; - -import net.wurstclient.util.json.JsonException; -import net.wurstclient.util.json.JsonUtils; -import net.wurstclient.util.json.WsonObject; - -public final class AnalyticsConfigFile -{ - private final Path path; - private boolean disableSaving; - - public AnalyticsConfigFile(Path path) - { - this.path = path; - } - - public void load(PlausibleAnalytics plausible) - { - try - { - WsonObject wson = JsonUtils.parseFileToObject(path); - loadJson(wson, plausible); - - }catch(NoSuchFileException e) - { - // The file doesn't exist yet. No problem, we'll create it later. - - }catch(IOException | JsonException e) - { - System.out.println("Couldn't load " + path.getFileName()); - e.printStackTrace(); - } - - save(plausible); - } - - private void loadJson(WsonObject wson, PlausibleAnalytics plausible) - throws JsonException - { - try - { - disableSaving = true; - - // v1 was bugged, don't load it - if(!wson.has("version")) - return; - - plausible.setEnabled(wson.getBoolean("enabled")); - - }finally - { - disableSaving = false; - } - } - - public void save(PlausibleAnalytics plausible) - { - if(disableSaving) - return; - - JsonObject json = createJson(plausible); - - try - { - JsonUtils.toJson(json, path); - - }catch(IOException | JsonException e) - { - System.out.println("Couldn't save " + path.getFileName()); - e.printStackTrace(); - } - } - - private JsonObject createJson(PlausibleAnalytics plausible) - { - JsonObject json = new JsonObject(); - json.addProperty("version", 2); - json.addProperty("enabled", plausible.isEnabled()); - return json; - } -} diff --git a/src/main/java/net/wurstclient/analytics/PlausibleAnalytics.java b/src/main/java/net/wurstclient/analytics/PlausibleAnalytics.java deleted file mode 100644 index 0c69924720..0000000000 --- a/src/main/java/net/wurstclient/analytics/PlausibleAnalytics.java +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Copyright (c) 2014-2026 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.analytics; - -import java.net.URI; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.nio.file.Path; -import java.time.Duration; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.LinkedBlockingQueue; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; - -import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLevelEvents; -import net.fabricmc.loader.api.FabricLoader; -import net.fabricmc.loader.api.ModContainer; -import net.fabricmc.loader.api.Version; -import net.fabricmc.loader.api.metadata.ModMetadata; -import net.minecraft.client.Minecraft; -import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.client.multiplayer.ServerData; -import net.minecraft.client.resources.language.LanguageManager; - -/** - * An implementation of the Plausible Events API for privacy-friendly - * analytics in Minecraft mods, without collecting any personal information. - * - *
- * See {@link https://plausible.io/docs/events-api} for technical details and
- * {@link https://plausible.io/privacy-focused-web-analytics} for a
- * non-technical overview of how Plausible works.
- */
-public final class PlausibleAnalytics
-{
- private static final Gson GSON = new Gson();
- private static final Logger LOGGER = LoggerFactory.getLogger("Plausible");
-
- private static final String MOD_ID = "wurst";
- private static final URI API_ENDPOINT =
- URI.create("https://plausible.wurstclient.net/api/event");
-
- private final HttpClient httpClient =
- HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(5)).build();
- private final LinkedBlockingQueue
- * Any session properties set with {@link #sessionProp(String, String)}
- * will also be included.
- *
- *
- * If Plausible is disabled at the time of this method call, no event will
- * be sent.
- */
- public void pageview(String path)
- {
- event("pageview", path, null);
- }
-
- /**
- * Sends a pageview event with the given path and properties.
- *
- *
- * Any session properties set with {@link #sessionProp(String, String)}
- * will also be included.
- *
- *
- * The total number of properties is limited to 30. Any additional
- * properties will be ignored. The length of each property name is limited
- * to 300 characters and the length of each property value is limited to
- * 2000 characters. Longer names and values will be truncated.
- *
- *
- * Properties MUST NOT contain any personal information. This includes
- * usernames, emails, IP addresses and any persistent user IDs, even if
- * they are randomly generated and/or hashed.
- *
- *
- * If Plausible is disabled at the time of this method call, no event will
- * be sent.
- */
- public void pageview(String path, Map
- * Any session properties set with {@link #sessionProp(String, String)}
- * will also be included.
- *
- *
- * If Plausible is disabled at the time of this method call, no event will
- * be sent.
- */
- public void event(String name, String path)
- {
- event(name, path, null);
- }
-
- /**
- * Sends an event with the given name, path and properties.
- *
- *
- * Any session properties set with {@link #sessionProp(String, String)}
- * will also be included.
- *
- *
- * The total number of properties is limited to 30. Any additional
- * properties will be ignored. The length of each property name is limited
- * to 300 characters and the length of each property value is limited to
- * 2000 characters. Longer names and values will be truncated.
- *
- *
- * Properties MUST NOT contain any personal information. This includes
- * usernames, emails, IP addresses and any persistent user IDs, even if
- * they are randomly generated and/or hashed.
- *
- *
- * If Plausible is disabled at the time of this method call, no event will
- * be sent.
- */
- public void event(String name, String path, Map
- * The total number of properties is limited to 30. Any additional
- * properties will be ignored. The length of each property name is limited
- * to 300 characters and the length of each property value is limited to
- * 2000 characters. Longer names and values will be truncated.
- *
- *
- * Properties MUST NOT contain any personal information. This includes
- * usernames, emails, IP addresses and any persistent user IDs, even if
- * they are randomly generated and/or hashed.
- */
- public void sessionProp(String name, String value)
- {
- if(name != null && value != null)
- sessionProps.addProperty(name, value);
- }
-
- /**
- * Removes a session property.
- */
- public void removeSessionProp(String name)
- {
- if(name != null)
- sessionProps.remove(name);
- }
-
- private record PlausibleEvent(String name, String url, JsonObject props)
- {}
-}
diff --git a/src/main/java/net/wurstclient/options/WurstOptionsScreen.java b/src/main/java/net/wurstclient/options/WurstOptionsScreen.java
index fe46eb04c6..7ba46a56c5 100644
--- a/src/main/java/net/wurstclient/options/WurstOptionsScreen.java
+++ b/src/main/java/net/wurstclient/options/WurstOptionsScreen.java
@@ -29,7 +29,6 @@
import net.wurstclient.altgui.TooManyHaxEditorScreen;
import net.wurstclient.altmanager.LoginException;
import net.wurstclient.altmanager.screens.AltManagerScreen;
-import net.wurstclient.analytics.PlausibleAnalytics;
import net.wurstclient.commands.FriendsCmd;
import net.wurstclient.navigator.NavigatorMainScreen;
import net.wurstclient.nicewurst.NiceWurstModule;
@@ -153,7 +152,6 @@ private void addCoreSection()
WurstClient wurst = WurstClient.INSTANCE;
FriendsCmd friendsCmd = wurst.getCmds().friendsCmd;
CheckboxSetting middleClickFriends = friendsCmd.getMiddleClickFriends();
- PlausibleAnalytics plausible = wurst.getPlausible();
WurstOptionsOtf options = wurst.getOtfs().wurstOptionsOtf;
VanillaSpoofOtf vanillaSpoof = wurst.getOtfs().vanillaSpoofOtf;
CheckboxSetting forceEnglish =
@@ -184,10 +182,6 @@ private void addCoreSection()
b -> middleClickFriends
.setChecked(!middleClickFriends.isChecked()));
- addButton(column, () -> "Count Users: " + onOff(plausible.isEnabled()),
- "Anonymous usage analytics to help prioritize support and version compatibility.",
- b -> plausible.setEnabled(!plausible.isEnabled()));
-
addButton(column,
() -> "Hack Toggle Chat: " + onOff(hackToggleFeedback.isChecked()),
"Show chat feedback when hacks are enabled or disabled.",