Skip to content
Merged

Beta #29

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 10

- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: temurin

- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
polycheat but worse (like very worse) + bw stat checker!!!
additonal features that arent in vanilla minecraft for obvious reasons
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mod_name=Additional
# Sets the id of your mod that mod loaders use to recognize it.
mod_id=additional
# Sets the version of your mod. Make sure to update this when you make changes according to semver.
mod_version=3.0.1
mod_version=3.0.2
# Sets the name of the jar file that you put in your 'mods' folder.
mod_archives_name=Additional

Expand Down
10 changes: 6 additions & 4 deletions src/main/java/me/waffles/additional/Additional.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ public class Additional {
public static final String NAME = "@NAME@";
public static final String VERSION = "@VER@";
public static ModConfig config;
public static int maxSize = 16;
public static EldestRemovalMap<String, Duels> duelsStatsList = new EldestRemovalMap<>(maxSize);
public static EldestRemovalMap<String, Bedwars> bedwarsStatsList = new EldestRemovalMap<>(maxSize);
public static EldestRemovalMap<String, PlayerProfile> playerProfileList = new EldestRemovalMap<>(maxSize);
public static EldestRemovalMap<String, Duels> duelsStatsList;
public static EldestRemovalMap<String, Bedwars> bedwarsStatsList;
public static EldestRemovalMap<String, PlayerProfile> playerProfileList;

@Mod.EventHandler
public void onInit(FMLInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(this);
config = new ModConfig();
duelsStatsList = new EldestRemovalMap<>(ModConfig.maxCacheSize);
bedwarsStatsList = new EldestRemovalMap<>(ModConfig.maxCacheSize);
playerProfileList = new EldestRemovalMap<>(ModConfig.maxCacheSize);
CommandManager.INSTANCE.registerCommand(new BedwarsStatsCommand());
CommandManager.INSTANCE.registerCommand(new DuelsStatsCommand());
}
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/me/waffles/additional/config/ModConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import cc.polyfrost.oneconfig.config.annotations.*;
import cc.polyfrost.oneconfig.config.core.OneKeyBind;
import cc.polyfrost.oneconfig.config.data.InfoType;
import cc.polyfrost.oneconfig.libs.universal.UKeyboard;
import cc.polyfrost.oneconfig.utils.Notifications;
import me.waffles.additional.Additional;
Expand Down Expand Up @@ -78,6 +79,24 @@ public class ModConfig extends Config {
Notifications.INSTANCE.send("Additional", "Cleared player cache", 3000);
};

@Slider(
name = "Amount of players cached",
min = 1,
max = 16,
step = 1,
category = "Stat Checking"
)
public static int maxCacheSize = 4;

@Info(
text = "Restart Minecraft to apply changes",
type = InfoType.INFO,
category = "Stat Checking",
size = OptionSize.DUAL
)
public static boolean ignored2; // Useless. Java limitations with @annotation.


public ModConfig() {
super(new Mod(Additional.NAME, ModType.UTIL_QOL), Additional.MODID + ".json");
initialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class EldestRemovalMap<K, V> extends LinkedHashMap<K, V> {
private final int MAX_SIZE;

public EldestRemovalMap(int maxSize) {
super(maxSize, 0.75f, true); // true = access order (LRU behavior)
super(maxSize + 1, 1.0f, true); // true = access order (LRU behavior)
this.MAX_SIZE = maxSize;
}

Expand Down
Loading