-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Refactor Warp Api. * Fix merge things * Update eternalcore-api/src/main/java/com/eternalcode/core/feature/warp/event/PreWarpTeleportEvent.java Co-authored-by: Michał Wojtas <[email protected]> * Update eternalcore-api/src/main/java/com/eternalcode/core/feature/warp/event/WarpTeleportEvent.java Co-authored-by: Michał Wojtas <[email protected]> * Update eternalcore-api/src/main/java/com/eternalcode/core/feature/warp/event/PreWarpTeleportEvent.java Co-authored-by: Michał Wojtas <[email protected]> * Follow @imDMK Feedback. * Follow mr. Norbert feedback. Signed-off-by: Martin <[email protected]> * Use WarpService interface to communicate in command. --------- Signed-off-by: Martin <[email protected]> Co-authored-by: Michał Wojtas <[email protected]>
- Loading branch information
Showing
18 changed files
with
389 additions
and
213 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
...lcore-api/src/main/java/com/eternalcode/core/feature/warp/event/PreWarpTeleportEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.eternalcode.core.feature.warp.event; | ||
|
||
import com.eternalcode.core.feature.warp.Warp; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
|
||
/** | ||
* Called before teleportation to warp. | ||
*/ | ||
public class PreWarpTeleportEvent extends Event implements Cancellable { | ||
|
||
private static final HandlerList HANDLER_LIST = new HandlerList(); | ||
|
||
private final Player player; | ||
private Warp warp; | ||
private boolean cancelled; | ||
|
||
public PreWarpTeleportEvent(Player player, Warp warp) { | ||
super(false); | ||
|
||
this.player = player; | ||
this.warp = warp; | ||
} | ||
|
||
public Player getPlayer() { | ||
return this.player; | ||
} | ||
|
||
public Warp getWarp() { | ||
return this.warp; | ||
} | ||
|
||
public void setWarp(Warp warp) { | ||
this.warp = warp; | ||
} | ||
|
||
@Override | ||
public boolean isCancelled() { | ||
return this.cancelled; | ||
} | ||
|
||
@Override | ||
public void setCancelled(boolean cancel) { | ||
this.cancelled = cancel; | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() { | ||
return HANDLER_LIST; | ||
} | ||
|
||
public static HandlerList getHandlerList() { | ||
return HANDLER_LIST; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 0 additions & 109 deletions
109
eternalcore-core/src/main/java/com/eternalcode/core/feature/warp/WarpCommand.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,4 @@ public String getName() { | |
public Location getLocation() { | ||
return PositionAdapter.convert(this.position); | ||
} | ||
|
||
} |
Oops, something went wrong.