Skip to content

Commit a50cb74

Browse files
committed
Merging in PR APDevTeam#748
1 parent eecc1f0 commit a50cb74

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Movecraft/src/main/java/net/countercraft/movecraft/features/status/StatusManager.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ private StatusUpdateTask(@NotNull Craft craft) {
9595

9696
Counter<RequiredBlockEntry> flyblocks = new Counter<>();
9797
Counter<RequiredBlockEntry> moveblocks = new Counter<>();
98+
for(RequiredBlockEntry entry : craft.getType().getRequiredBlockProperty(CraftType.MOVE_BLOCKS)) {
99+
moveblocks.add(entry, 0);
100+
}
98101
for(Material material : materials.getKeySet()) {
99102
for(RequiredBlockEntry entry : craft.getType().getRequiredBlockProperty(CraftType.FLY_BLOCKS)) {
100103
if(entry.contains(material)) {
@@ -143,9 +146,11 @@ public void onCraftStatusUpdate(@NotNull CraftStatusUpdateEvent e) {
143146
if(!entry.check(flyBlocks.get(entry), nonNegligibleBlocks, sinkPercent))
144147
sinking = true;
145148
}
146-
for (RequiredBlockEntry entry : moveBlocks.getKeySet()) {
147-
if (!entry.check(moveBlocks.get(entry), nonNegligibleBlocks, sinkPercent))
148-
disabled = true;
149+
if (craft.getType().getRequiredBlockProperty(CraftType.MOVE_BLOCKS).size() > 0) {
150+
for (RequiredBlockEntry entry : moveBlocks.getKeySet()) {
151+
if (!entry.check(moveBlocks.get(entry), nonNegligibleBlocks, sinkPercent))
152+
disabled = true;
153+
}
149154
}
150155

151156
// And check the OverallSinkPercent

0 commit comments

Comments
 (0)