Skip to content
Open
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
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.18'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.20'
}


7 changes: 6 additions & 1 deletion src/main/java/tconstruct/library/tools/HarvestTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,14 @@ public void breakExtraBlock(World world, int x, int y, int z, int sidehit, Entit
Block refBlock = world.getBlock(refX, refY, refZ);
float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ);
float strength = ForgeHooks.blockStrength(block, player, world, x, y, z);
if (strength <= 0) strength = 0.00001F; // don't div by zero or go below 0.

// only harvestable blocks that aren't impossibly slow to harvest
if (!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength / strength > 10f) return;
// don't exclude blocks that would be broken in 1-2 ticks, regardless of hardness diff
// blocks are instantly broken if the mining speed is more than 30x the block hardness/strength
if (!ForgeHooks.canHarvestBlock(block, player, meta)
|| (refStrength / strength > PHConstruct.HarvestToolAOERelativeStrength && strength * 2 < 1))
return; // the Forgehooks method returns mining speed / hardness / 30

// send the blockbreak event
BlockEvent.BreakEvent event = ForgeHooks
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/tconstruct/util/config/PHConstruct.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ public static void initProps(File location) {
miningLevelIncrease = config.get("Difficulty Changes", "Modifiers increase Mining Level", true)
.getBoolean(true);
denyMattock = config.get("Difficulty Changes", "Deny creation of non-metal mattocks", false).getBoolean(false);
HarvestToolAOERelativeStrength = config.get(
"general",
"AOE Harvest Max Relative Strength",
10,
"The maximum relative strength of the blocks in the aoe of the tool compared to the broken block to still mine them")
.getDouble(10);
craftEndstone = config.get("Difficulty Changes", "Allow creation of endstone", true).getBoolean(true);
redstoneFaucet = config.get("Difficulty Changes", "Allow Faucets to be activated by Redstone", true)
.getBoolean(true);
Expand Down Expand Up @@ -439,6 +445,7 @@ public static void initProps(File location) {
public static boolean consumeXPBerryStacks;

public static boolean disableAllRecipes;
public static double HarvestToolAOERelativeStrength;

// Mobs
public static int naturalSlimeSpawn;
Expand Down