4 Commits
Author SHA1 Message Date
Darto KLoning 3f8ea97f7c fix client file configuration respectedly 2026-09-29 05:48:40 +07:00
Darto KLoning 7c8aac69ef image compress 2026-09-28 20:38:51 +07:00
Darto KLoning 733a44396c compress 2026-09-28 19:58:55 +07:00
Darto KLoning deea759317 add icon 2026-09-28 19:53:03 +07:00
5 changed files with 17 additions and 4 deletions
+5 -3
View File
@@ -2,14 +2,16 @@
This branch is Fabric-only and intentionally separates authority:
* `config/item-despawn-timer-server.json` — server gameplay: default despawn time and per-item overrides. `-1` means infinite when enabled.
* `config/item-despawn-timer-client.json` — client presentation only: timer/name visibility, heights, threshold and colors.
* `config/item-despawn-timer-server.json` — **dedicated server only**; server gameplay: default despawn time and per-item overrides. `-1` means infinite when enabled.
* `config/item-despawn-timer-client.json` — **client only**; presentation settings: timer/name visibility, heights, threshold and colors.
Since v0.3.7, a physical client no longer creates `item-despawn-timer-server.json`. The main Fabric initializer also runs on clients, so `ServerConfig` explicitly checks the physical environment before reading/writing its persistent file. Integrated singleplayer uses the built-in server defaults in memory; dedicated servers continue to use the persistent server JSON.
Minecraft 26.2 uses the unobfuscated Mojang/official names and Java 25. This port therefore does not reuse the old Yarn-named common/client GUI classes from 0.2.2. Client rendering lives only in `src/client`, while server/gameplay code lives in `src/main`.
Run `compiler.bat` on Windows or `./compiler.sh` on Linux/macOS. The script checks whether the existing JAR contains the same `mod_version+mc<minecraft_version>` as `gradle.properties`; matching builds offer Push/Recompile/Quit. After a successful build it offers Git push and retries failed pushes in groups of three.
## Commands (v0.3.4)
## Commands (v0.3.7)
`/idt reload`
+1 -1
View File
@@ -3,6 +3,6 @@ org.gradle.configuration-cache=false
minecraft_version=26.2
loader_version=0.19.3
fabric_version=0.160.0+26.2
mod_version=0.3.4
mod_version=0.3.7
maven_group=whirlfrenzy.itemdespawntimer
archives_base_name=item-despawn-timer
@@ -2,6 +2,7 @@ package whirlfrenzy.itemdespawntimer.config;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.entity.item.ItemEntity;
@@ -18,6 +19,15 @@ public final class ServerConfig {
}
private ServerConfig() {}
public static void load() {
// The common/main initializer also runs in a physical Minecraft client.
// Never create or read the server config there: a client installation owns
// presentation settings only. Integrated singleplayer uses server defaults
// in memory; a dedicated server owns the persistent server config file.
if (FabricLoader.getInstance().getEnvironmentType() != EnvType.SERVER) {
data = new Data();
return;
}
Path p = FabricLoader.getInstance().getConfigDir().resolve("item-despawn-timer-server.json");
try {
if (Files.exists(p)) { try (Reader r=Files.newBufferedReader(p)) { Data d=GSON.fromJson(r,Data.class); if(d!=null)data=d; } }
Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

+1
View File
@@ -4,6 +4,7 @@
"version": "${version}",
"name": "Item Despawn Timer",
"description": "Server-authoritative item despawn times with client-only countdown presentation settings.",
"icon": "assets/item-despawn-timer/icon.png",
"environment": "*",
"entrypoints": {
"main": ["whirlfrenzy.itemdespawntimer.ItemDespawnTimer"],