From eda1ba376f6baa84cd643bfe6c610eee2341d658 Mon Sep 17 00:00:00 2001 From: Buuz135 Date: Sun, 25 Feb 2024 21:14:27 +0100 Subject: [PATCH] Reduced how often the random tick blocks get accelerated, and added a config option to change it --- CHANGELOG.md | 6 +++++- gradle.properties | 2 +- .../block/tile/SoulSurgeBlockEntity.java | 6 ++++-- .../industrialforegoingsouls/config/ConfigSoulSurge.java | 3 +++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22de073..e2d09a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -# Version 1.0.4 +# Version 1.0.6 + +* Reduced how often the random tick blocks get accelerated, and added a config option to change it + +# Version 1.0.5 * Acceleration config for tile entities can now be 0 ticks * Added support for accelerating entities, entities can be added to the `industrialforegoingsouls:cant_accelerate` tag diff --git a/gradle.properties b/gradle.properties index 6bfc586..2718f28 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false minecraftVersion=1.20.1 -modVersion=1.0.5 \ No newline at end of file +modVersion=1.0.6 \ No newline at end of file diff --git a/src/main/java/com/buuz135/industrialforegoingsouls/block/tile/SoulSurgeBlockEntity.java b/src/main/java/com/buuz135/industrialforegoingsouls/block/tile/SoulSurgeBlockEntity.java index 3d8ad1f..1e0918d 100644 --- a/src/main/java/com/buuz135/industrialforegoingsouls/block/tile/SoulSurgeBlockEntity.java +++ b/src/main/java/com/buuz135/industrialforegoingsouls/block/tile/SoulSurgeBlockEntity.java @@ -62,8 +62,10 @@ public void serverTick(Level level, BlockPos pos, BlockState state, SoulSurgeBlo --tickingTime; } } else if (level instanceof ServerLevel serverLevel) { - for (int i = 0; i < ConfigSoulSurge.BLOCK_ACCELERATION_TICK; i++) { - targetingState.randomTick(serverLevel, pos.relative(state.getValue(RotatableBlock.FACING_ALL).getOpposite()), serverLevel.random); + if (serverLevel.random.nextDouble() < ConfigSoulSurge.RANDOM_TICK_ACCELERATION_CHANCE) { + for (int i = 0; i < ConfigSoulSurge.BLOCK_ACCELERATION_TICK; i++) { + targetingState.randomTick(serverLevel, pos.relative(state.getValue(RotatableBlock.FACING_ALL).getOpposite()), serverLevel.random); + } } --tickingTime; } diff --git a/src/main/java/com/buuz135/industrialforegoingsouls/config/ConfigSoulSurge.java b/src/main/java/com/buuz135/industrialforegoingsouls/config/ConfigSoulSurge.java index 59a01e5..8627b4a 100644 --- a/src/main/java/com/buuz135/industrialforegoingsouls/config/ConfigSoulSurge.java +++ b/src/main/java/com/buuz135/industrialforegoingsouls/config/ConfigSoulSurge.java @@ -22,4 +22,7 @@ public class ConfigSoulSurge { @ConfigVal.InRangeInt(min = 0) public static int BLOCK_ACCELERATION_TICK = 4; + @ConfigVal(comment = "How often a random tick block will be accelerated, by default 3% of the ticks (random)") + @ConfigVal.InRangeInt(min = 0, max = 1) + public static double RANDOM_TICK_ACCELERATION_CHANCE = 0.03; }