Skip to content

Commit

Permalink
Add option to disable the copper oxidation proximity penalty
Browse files Browse the repository at this point in the history
  • Loading branch information
MelnCat committed Oct 9, 2023
1 parent 69d6fae commit ea200c9
Showing 1 changed file with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Meln Cat <[email protected]>
Date: Mon, 9 Oct 2023 12:21:49 -0700
Subject: [PATCH] Add option to disable the copper oxidation proximity penalty


diff --git a/src/main/java/net/minecraft/world/level/block/ChangeOverTimeBlock.java b/src/main/java/net/minecraft/world/level/block/ChangeOverTimeBlock.java
index 8512b977b44a0a4d3a2521e27a60d65f7ac967be..dd270f67388c8663e0418875c88cb1e2a55d0635 100644
--- a/src/main/java/net/minecraft/world/level/block/ChangeOverTimeBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ChangeOverTimeBlock.java
@@ -65,7 +65,7 @@ public interface ChangeOverTimeBlock<T extends Enum<T>> {
}

float f = (float) (k + 1) / (float) (k + j + 1);
- float f1 = f * f * this.getChanceModifier();
+ float f1 = world.purpurConfig.disableOxidationProximityPenalty ? this.getChanceModifier() : f * f * this.getChanceModifier(); // Purpur

if (random.nextFloat() < f1) {
this.getNext(state).ifPresent((iblockdata2) -> {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index d4d9f748d259df8b6f4566efa21c15c470de5ba2..64e172e6cbfb8134c2b36bce8279e1ef44085257 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -145,6 +145,7 @@ public class PurpurWorldConfig {
public boolean rainStopsAfterSleep = true;
public boolean thunderStopsAfterSleep = true;
public int mobLastHurtByPlayerTime = 100;
+ public boolean disableOxidationProximityPenalty = false;
private void miscGameplayMechanicsSettings() {
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
mendingMultiplier = getDouble("gameplay-mechanics.mending-multiplier", mendingMultiplier);
@@ -173,6 +174,7 @@ public class PurpurWorldConfig {
rainStopsAfterSleep = getBoolean("gameplay-mechanics.rain-stops-after-sleep", rainStopsAfterSleep);
thunderStopsAfterSleep = getBoolean("gameplay-mechanics.thunder-stops-after-sleep", thunderStopsAfterSleep);
mobLastHurtByPlayerTime = getInt("gameplay-mechanics.mob-last-hurt-by-player-time", mobLastHurtByPlayerTime);
+ disableOxidationProximityPenalty = getBoolean("gameplay-mechanics.disable-oxidation-proximity-penalty", disableOxidationProximityPenalty);
}

public int daytimeTicks = 12000;

0 comments on commit ea200c9

Please sign in to comment.