Skip to content

Commit

Permalink
Reduced how often the random tick blocks get accelerated, and added a…
Browse files Browse the repository at this point in the history
… config option to change it
  • Loading branch information
Buuz135 committed Feb 25, 2024
1 parent 278c237 commit eda1ba3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
minecraftVersion=1.20.1
modVersion=1.0.5
modVersion=1.0.6
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit eda1ba3

Please sign in to comment.