Refactored game rule handling in ProjectStart to use a unified GameRuleSetting record, eliminating redundant methods and improving code clarity.
This commit is contained in:
1 parent
a1ab06a80d
commit
46ee734bbc
2 files changed
+21
-28
No files matched your search
@@ -31,12 +31,8 @@ public class IteratorUtil {
|
||||
rules.forEach((gameRule, value) -> IteratorUtil.worlds(world -> world.setGameRule(gameRule, value ^ inverse)));
|
||||
}
|
||||
|
||||
public static void setIntGameRules(Map<GameRule<Integer>, Integer> rules) {
|
||||
rules.forEach((gameRule, value) -> IteratorUtil.worlds(world -> world.setGameRule(gameRule, value)));
|
||||
}
|
||||
|
||||
public static void times(int times, Runnable callback) {
|
||||
IntStream.range(0, times).forEach(value -> callback.run());
|
||||
IntStream.range(0, times).forEach(_ -> callback.run());
|
||||
}
|
||||
|
||||
public static <T> void iterateListInGlobal(int sectionStart, List<T> list, BiConsumer<Integer, T> callback) {
|
||||
|
||||
Reference in new issue
Block a user