Skip to content

Commit

Permalink
move tracked locations
Browse files Browse the repository at this point in the history
  • Loading branch information
DerToaster98 committed Jan 18, 2025
1 parent 8fe3979 commit ab9322b
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.countercraft.movecraft.Movecraft;
import net.countercraft.movecraft.MovecraftChunk;
import net.countercraft.movecraft.MovecraftLocation;
import net.countercraft.movecraft.TrackedLocation;
import net.countercraft.movecraft.async.AsyncTask;
import net.countercraft.movecraft.config.Settings;
import net.countercraft.movecraft.craft.*;
Expand Down Expand Up @@ -321,6 +322,8 @@ protected void execute() throws InterruptedException, ExecutionException {
}
}

updateTrackedLocations(craft, dx, dy, dz);

if (!collisionBox.isEmpty() && craft.getType().getBoolProperty(CraftType.CRUISE_ON_PILOT)) {
CraftManager.getInstance().release(craft, CraftReleaseEvent.Reason.EMPTY, false);
for (MovecraftLocation location : oldHitBox) {
Expand All @@ -342,6 +345,16 @@ protected void execute() throws InterruptedException, ExecutionException {
captureYield(harvestedBlocks);
}

protected void updateTrackedLocations(Craft craft, int dx, int dy, int dz) {
craft.getTrackedLocations().values().forEach(trackedLocations -> {
trackedLocations.forEach(
trackedLocation -> {
trackedLocation.translate(dx, dy, dz);
}
);
});
}

private void preventsTorpedoRocketsPilots() {
if (!craft.getType().getBoolProperty(CraftType.MOVE_ENTITIES) ||
(craft instanceof SinkingCraft
Expand Down

0 comments on commit ab9322b

Please sign in to comment.