Skip to content

Commit

Permalink
Update sinking implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerS1066 committed Aug 26, 2024
1 parent e19371b commit f133511
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import net.countercraft.movecraft.MovecraftLocation;
import net.countercraft.movecraft.craft.controller.PilotController;
import net.countercraft.movecraft.craft.controller.PlayerController;
import net.countercraft.movecraft.craft.controller.SinkingController;
import net.countercraft.movecraft.craft.controller.SinkingControllerImpl;
import net.countercraft.movecraft.craft.type.CraftType;
import net.countercraft.movecraft.events.CraftReleaseEvent;
import net.countercraft.movecraft.events.CraftSinkEvent;
Expand Down Expand Up @@ -200,11 +202,10 @@ public void sink(@NotNull Craft craft) {
if (event.isCancelled())
return;

crafts.remove(craft);
if (craft.getDataTag(Craft.CONTROLLER) instanceof PlayerController playerController)
playerCrafts.remove(playerController.getPilot());

crafts.add(new SinkingCraftImpl(craft));
craft.setDataTag(Craft.CONTROLLER, new SinkingControllerImpl());
}

public void release(@NotNull Craft craft, @NotNull CraftReleaseEvent.Reason reason, boolean force) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package net.countercraft.movecraft.craft.controller;

public class SinkingControllerImpl implements SinkingController {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.countercraft.movecraft.craft.controller;

public interface SinkingController {
public interface SinkingController extends Controller {
}

0 comments on commit f133511

Please sign in to comment.