Skip to content

Commit

Permalink
emulate vanilla behavior by default
Browse files Browse the repository at this point in the history
  • Loading branch information
unix-supremacist committed Feb 11, 2023
1 parent 96dd538 commit 2f65d57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/main/java/tconstruct/TConstruct.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ public static class Spawntercepter {

@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) {
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/tconstruct/util/config/PHConstruct.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ public static void initProps(File location) {
"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);

Expand Down

0 comments on commit 2f65d57

Please sign in to comment.