From 2f65d57116a874f415fee12a3571d1cc81733c7c Mon Sep 17 00:00:00 2001 From: UnixSupremacist <100294596+unix-supremacist@users.noreply.github.com> Date: Sat, 11 Feb 2023 09:11:57 -0600 Subject: [PATCH] emulate vanilla behavior by default --- src/main/java/tconstruct/TConstruct.java | 2 ++ .../java/tconstruct/util/config/PHConstruct.java | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/tconstruct/TConstruct.java b/src/main/java/tconstruct/TConstruct.java index 3b04c81c..19d678a1 100644 --- a/src/main/java/tconstruct/TConstruct.java +++ b/src/main/java/tconstruct/TConstruct.java @@ -286,6 +286,8 @@ public class TConstruct { @SubscribeEvent public void onEntitySpawn(EntityJoinWorldEvent event) { + // return if config is zero to keep vanilla functionality + if (PHConstruct.globalDespawn == 0) return; if (event.entity instanceof EntityItem) { EntityItem ourGuy = (EntityItem) event.entity; if (ourGuy.lifespan == 6000) { diff --git a/src/main/java/tconstruct/util/config/PHConstruct.java b/src/main/java/tconstruct/util/config/PHConstruct.java index ff9fec53..a8b5fe2e 100644 --- a/src/main/java/tconstruct/util/config/PHConstruct.java +++ b/src/main/java/tconstruct/util/config/PHConstruct.java @@ -71,10 +71,14 @@ public class PHConstruct { "Difficulty Changes", "Add alternative recipe for bolt parts: arrowhead + toolrod in a crafting grid", false).getBoolean(false); - indestructible = config.get("Difficulty Changes", "Dropped tools are indestructible", false).getBoolean(false); - globalDespawn = config.get("Difficulty Changes", "Global item despawn time", 18000).getInt(18000); - dropCanisters = config.get("Difficulty Changes", "Drop heart canisters on death", true).getBoolean(true); - daggerThrowMultiplier = config.get("Difficulty Changes", "Thrown dagger output multiplier", 3).getDouble(3); + indestructible = config.get("Difficulty Changes", "Dropped tools are indestructible", true).getBoolean(true); + globalDespawn = config.get( + "Difficulty Changes", + "Global item despawn time", + 0, + "Changes the despawn time of all items, 0 is vanilla behavior").getInt(0); + dropCanisters = config.get("Difficulty Changes", "Drop heart canisters on death", false).getBoolean(false); + daggerThrowMultiplier = config.get("Difficulty Changes", "Thrown dagger output multiplier", 1).getDouble(1); naturalSlimeSpawn = config.get("Mobs", "Blue Slime spawn chance", 1, "Set to 0 to disable").getInt(1);