Skip to content
Merged
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
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ body:


**Version format:** v[mod_version]+[mod_loader]-[minecraft_version]
**Version example:** v5.0+fabric-1.26
**Title example:** [v5.3.1+neoforge-1.26.2] Red "Do not click" button
**Version example:** v5.0+fabric-26
**Title example:** [v5.3.1+neoforge-26.1.2] Red "Do not click" button
crashes the game when clicked
- type: textarea
id: description
Expand Down Expand Up @@ -69,9 +69,8 @@ body:
mod-pack. This helps project maintainers reproduce the issue, as other
mods often can and do cause issues.
placeholder: >-
Name a list of mods or link a mod-pack here. Please do not expect
project maintainers to manually download and install like 300 separate
mods.
Name a list of mods or link a mod-pack here. To rule out mod conflicts, it is
advised to reproduce the issue without other mods present (except for dependencies).
validations:
required: true
- type: checkboxes
Expand Down
122 changes: 66 additions & 56 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,66 @@
# -------------------- Eclipse IDE -------------------
# ==================================================
# Gradle
# ==================================================
.gradle
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

# ==================================================
# Java
# ==================================================
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
!**/src/main/resources/**/*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/.gradle/
/build/

# ==================================================
# FabricMC
# ==================================================
run/

# ==================================================
# Eclipse IDE
# ==================================================
.metadata
bin/
tmp/
Expand Down Expand Up @@ -60,59 +122,7 @@ local.properties
# Typically, this file would be tracked if it contains build/dependency configurations:
#.project

# ----------------------- Java -----------------------
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
!**/src/main/resources/**/*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/.gradle/
/build/

# -------------------- Idea IDE -------------------
# ==================================================
# IntelliJ Idea IDE
# ==================================================
**/.idea/

# ----------------------- Gradle -----------------------
.gradle
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

# ----------------------- Fabric -----------------------
run/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ The vanilla statistics screen is a mess, harder to read and navigate, and lacks
## Dependencies

This mod depends on some other mods that first need to be installed before this mod can be installed. Those dependencies are as follows:
- 🧵 [Fabric API](https://github.com/FabricMC/fabric-api) (Fabric only) - Loads this mod's assets and resources.
- 🖥 [TCDCommons API](https://github.com/TheCSDev/tcdcommons) - Powers the GUI interface of this mod
- 🏗 [Architectury API](https://github.com/architectury/architectury-api) - Allows this mod to run on `Fabric` and `NeoForge`

## Building

Follow these steps to build the project from source.

### Prerequisites
* **Java 21**: Ensure you have the Java Development Kit (JDK) 21 installed.
* **Java 25**: Ensure you have the Java Development Kit (JDK) installed.
* **Git**: Required to clone this repository.

### Instructions
Expand Down
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'net.fabricmc.fabric-loom' version "1.15-SNAPSHOT"
id 'net.fabricmc.fabric-loom' version "1.17-SNAPSHOT"
}

repositories
Expand All @@ -14,7 +14,10 @@ dependencies
implementation "net.fabricmc:fabric-loader:${project["fabric.loader_version"]}"
runtimeOnly "net.fabricmc.fabric-api:fabric-api:${project["fabric.api_version"]}"

implementation "com.terraformersmc:modmenu:18.0.0-alpha.8"
implementation("com.terraformersmc:modmenu:${project["modmenu.version"]}") {
exclude group: "net.fabricmc", module: "fabric-loader" //causes issues, exclude it
exclude group: "net.fabricmc.fabric-api" //causes issues, exclude it
}
implementation fileTree(dir: 'src/main/resources/META-INF/jarjar', include: '*.jar')
}

Expand Down
17 changes: 10 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ maven.group = com.thecsdev

# Mod properties
mod.id = betterstats
mod.version = 5.3.0
mod.version = 5.5.5
mod.name = Better Statistics Screen
mod.description = A Minecraft mod that improves the statistics screen and makes it more useful.
mod.author = TheCSDev
Expand All @@ -26,14 +26,17 @@ mod.link.curseforge = https://thecsdev.com/fwd/betterstats-curseforge/
mod.link.modrinth = https://thecsdev.com/fwd/betterstats-modrinth/

# 'pack.mcmeta' properties
pack.format = 84.0
pack.format = 84

# Minecraft properties
minecraft.version = 26.1

# Third-party mod versions
modmenu.version = 18.0.0

# Fabric properties
fabric.loader_version = 0.18.6
fabric.api_version = 0.145.1+26.1
fabric.loader_version = 0.18.5
fabric.api_version = 0.144.0+26.1

# fabric.mod.json properties
fabric.json.entrypoints.main = com.thecsdev.betterstats.fabric.BetterStatsFabric
Expand All @@ -43,9 +46,9 @@ fabric.api_version = 0.145.1+26.1

fabric.json.depends.java = >=25
fabric.json.depends.minecraft = ~26.1
fabric.json.depends.fabricloader = >=0.18.4
fabric.json.depends.fabric-api = >=0.145.1
fabric.json.depends.tcdcommons = >=5.3.2
fabric.json.depends.fabricloader = >=0.18.5
fabric.json.depends.fabric-api = >=0.144.0
fabric.json.depends.tcdcommons = >=5.5.5

# Neo-Forge properties
neoforge.version = 26.1.0.7-beta
Expand Down
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
import com.thecsdev.commonmc.resource.TLanguage;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -93,7 +95,7 @@ public static final void initConfigGui(@NotNull TPanelElement panel) throws Null
initStringProperty(
panel,
BLanguage.config_common_apiEndpoint(),
TTooltip.of(BLanguage.config_common_apiEndpoint_tooltip()),
BLanguage.config_common_apiEndpoint_tooltip(),
bss_config.getApiEndpoint().toString(),
(_, _, n) -> {
try { bss_config.setApiEndpoint(URI.create(n));}
Expand All @@ -102,13 +104,13 @@ public static final void initConfigGui(@NotNull TPanelElement panel) throws Null
initBooleanProperty(
panel,
BLanguage.config_common_registerCommands(),
TTooltip.of(BLanguage.config_common_registerCommands_tooltip()),
BLanguage.config_common_registerCommands_tooltip(),
bss_config.canRegisterCommands(),
(_, _, n) -> bss_config.setRegisterCommands(n));
initBooleanProperty(
panel,
BLanguage.config_common_experiments(),
TTooltip.of(BLanguage.config_common_experiments_tooltip()),
BLanguage.config_common_experiments_tooltip(),
bss_config.experimentsEnabled(),
(_, _, n) -> bss_config.setExperimentsEnabled(n));

Expand All @@ -117,13 +119,13 @@ public static final void initConfigGui(@NotNull TPanelElement panel) throws Null
initBooleanProperty(
panel,
BLanguage.config_client_guiMobsFollowCursor(),
TTooltip.of(BLanguage.config_client_guiMobsFollowCursor_tooltip()),
BLanguage.config_client_guiMobsFollowCursor_tooltip(),
bss_config.getGuiMobsFollowCursor(),
(_, _, n) -> bss_config.setGuiMobsFollowCursor(n));
initBooleanProperty(
panel,
BLanguage.config_client_allowChatPsa(),
TTooltip.of(BLanguage.config_client_allowChatPsa_tooltip()),
BLanguage.config_client_allowChatPsa_tooltip(),
bss_config.allowsChatPsaMessages(),
(_, _, n) -> bss_config.setAllowChatPsaMessages(n));

Expand All @@ -144,7 +146,7 @@ public static final void initConfigGui(@NotNull TPanelElement panel) throws Null
initBooleanProperty(
panel,
TLanguage.config_client_updateItemGroupsOnJoin(),
TTooltip.of(TLanguage.config_client_updateItemGroupsOnJoin_tooltip()),
TLanguage.config_client_updateItemGroupsOnJoin_tooltip(),
tcd_config.updateItemGroupsOnJoin(),
(_, _, n) -> tcd_config.setUpdateItemGroupsOnJoin(n));

Expand Down Expand Up @@ -204,6 +206,7 @@ private static final void initTableHead(
* Initializes a blank setting slot that has no setting there.
* @param panel The target {@link TPanelElement}.
*/
@ApiStatus.Internal
private static final void initNothingSetting(@NotNull TPanelElement panel)
{
//background color element
Expand All @@ -224,15 +227,27 @@ private static final void initNothingSetting(@NotNull TPanelElement panel)
* Initializes a boolean property setting.
* @param panel The panel where the setting is to be initialized.
* @param name The display name label text.
* @param tooltip The tooltip text.
* @param tooltipText The tooltip text.
* @param value The current value of the setting.
* @param changeListener Use this to apply setting value changes.
*/
@ApiStatus.Internal
private static final void initBooleanProperty(
@NotNull TPanelElement panel,
@NotNull Component name, @Nullable TTooltip tooltip,
@NotNull Component name, @Nullable Component tooltipText,
boolean value, @NotNull IChangeListener<Boolean> changeListener)
{
//preparation
if(tooltipText != null)
tooltipText = Component.literal("")
.append(Component.literal("").append(name).withStyle(ChatFormatting.YELLOW))
.append("\n")
.append(Component.literal("").append(tooltipText).withStyle(ChatFormatting.GRAY));
else
tooltipText = Component.literal("")
.append(Component.literal("").append(name).withStyle(ChatFormatting.YELLOW));
final var tooltip = TTooltip.of(tooltipText);

//background color element
final var el_bg = new TFillColorElement.Flat((panel.size() % 2 == 0) ? 0x33000000 : 0x44000000, 0);
el_bg.hoverableProperty().set(true, BetterStatsConfigScreen.class);
Expand All @@ -258,15 +273,27 @@ private static final void initBooleanProperty(
* Initializes a string property setting.
* @param panel The panel where the setting is to be initialized.
* @param name The display name label text.
* @param tooltip The tooltip text.
* @param tooltipText The tooltip text.
* @param value The current value of the setting.
* @param changeListener Use this to apply setting value changes.
*/
@ApiStatus.Internal
private static final void initStringProperty(
@NotNull TPanelElement panel,
@NotNull Component name, @Nullable TTooltip tooltip,
@NotNull Component name, @Nullable Component tooltipText,
@NotNull String value, @NotNull IChangeListener<String> changeListener)
{
//preparation
if(tooltipText != null)
tooltipText = Component.literal("")
.append(Component.literal("").append(name).withStyle(ChatFormatting.YELLOW))
.append("\n")
.append(Component.literal("").append(tooltipText).withStyle(ChatFormatting.GRAY));
else
tooltipText = Component.literal("")
.append(Component.literal("").append(name).withStyle(ChatFormatting.YELLOW));
final var tooltip = TTooltip.of(tooltipText);

//background color element
final var el_bg = new TFillColorElement.Flat((panel.size() % 2 == 0) ? 0x33000000 : 0x44000000, 0);
el_bg.hoverableProperty().set(true, BetterStatsConfigScreen.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ public final void setCurrentView(@NotNull StatsView view) throws NullPointerExce
/**
* Puts an {@link McbsGoal} into {@link McbsFile#getGoals()}.
* @param goal The {@link McbsGoal} to add.
* @return {@code true} if the {@link McbsFile} did not already contain the goal.
* @throws NullPointerException If the argument is {@code null}.
*/
public final void putGoal(@NotNull McbsGoal goal) throws NullPointerException
Expand Down
Loading
Loading