Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerS1066 committed Aug 25, 2024
1 parent 033f151 commit cba1892
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ private StatusUpdateTask(@NotNull Craft craft) {
}

@Override
public @Nullable Effect get() {
public @NotNull Effect get() {
Counter<Material> materials = new Counter<>();
int nonNegligibleBlocks = 0;
int nonNegligibleSolidBlocks = 0;
double fuel = 0;
final CraftType crafttype = craft.getType();

for (MovecraftLocation l : craft.getHitBox()) {
Material type = craft.getMovecraftWorld().getMaterial(l);
Expand All @@ -97,17 +96,15 @@ private StatusUpdateTask(@NotNull Craft craft) {

Counter<RequiredBlockEntry> flyblocks = new Counter<>();
Counter<RequiredBlockEntry> moveblocks = new Counter<>();
final var flyblocksList = crafttype.getRequiredBlockProperty(CraftType.FLY_BLOCKS);
final var moveblocksList = crafttype.getRequiredBlockProperty(CraftType.MOVE_BLOCKS);
for(Material material : materials.getKeySet()) {
for(RequiredBlockEntry entry : flyblocksList) {
for(RequiredBlockEntry entry : craft.getType().getRequiredBlockProperty(CraftType.FLY_BLOCKS)) {
if(entry.contains(material)) {
flyblocks.add(entry, materials.get(material) );
break;
}
}

for(RequiredBlockEntry entry : moveblocksList) {
for(RequiredBlockEntry entry : craft.getType().getRequiredBlockProperty(CraftType.MOVE_BLOCKS)) {
if(entry.contains(material)) {
moveblocks.add(entry, materials.get(material) );
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,9 @@ public final void onSignTranslate(SignTranslateEvent event) {
}
}

Counter<RequiredBlockEntry> flyblocks = craft.getDataTag(Craft.FLYBLOCKS);
Counter<RequiredBlockEntry> moveblocks = craft.getDataTag(Craft.MOVEBLOCKS);
Counter<RequiredBlockEntry> displayBlocks = new Counter<>();

displayBlocks.add(flyblocks);
displayBlocks.add(moveblocks);
displayBlocks.add(craft.getDataTag(Craft.FLYBLOCKS));
displayBlocks.add(craft.getDataTag(Craft.MOVEBLOCKS));

int signLine = 1;
int signColumn = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ public void set(T item, int count) {
counter.put(item, count);
}

public void putIfAbsent(T item, int count) {
counter.putIfAbsent(item, count);
}

public void add(T item, int count) {
counter.put(item, counter.getInt(item) + count);
}
Expand Down

0 comments on commit cba1892

Please sign in to comment.