aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java
index bab7def6..2c807065 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java
@@ -168,19 +168,21 @@ public class ItemCooldowns {
}
public static void checkForBlockChange(BlockPos pos, IBlockState blockState) {
- BlockData oldBlockData = null;
+ Minecraft.getMinecraft().addScheduledTask(() -> {
+ BlockData oldBlockData = null;
- for (BlockData value : blocksClicked.values()) {
- if (value.blockPos.equals(pos)) oldBlockData = value;
- }
+ for (BlockData value : blocksClicked.values()) {
+ if (value.blockPos.equals(pos)) oldBlockData = value;
+ }
- if (oldBlockData != null) {
- IBlockState oldState = oldBlockData.blockState;
- if ((oldState.getBlock() == Blocks.log || oldState.getBlock() == Blocks.log2) &&
- blockState.getBlock() == Blocks.air) {
- onBlockMined();
+ if (oldBlockData != null) {
+ IBlockState oldState = oldBlockData.blockState;
+ if ((oldState.getBlock() == Blocks.log || oldState.getBlock() == Blocks.log2) &&
+ blockState.getBlock() == Blocks.air) {
+ onBlockMined();
+ }
}
- }
+ });
}
public static void onBlockMined() {