-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue #1009 and made it more configurable.
It now uses the output from `/is info` to count items. Might be memory intensive, so perhaps it should be disabled per default.
- Loading branch information
Showing
43 changed files
with
919 additions
and
105 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
...brek/ultimateskyblock/async/Callback.java → .../ultimateskyblock/api/async/Callback.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
34 changes: 34 additions & 0 deletions
34
...API/src/main/java/us/talabrek/ultimateskyblock/api/event/CancellableAsyncPlayerEvent.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,34 @@ | ||
package us.talabrek.ultimateskyblock.api.event; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.player.PlayerEvent; | ||
|
||
/** | ||
* Common event for PlayerEvents that can be cancelled (async). | ||
* @since 2.7.3 | ||
*/ | ||
public abstract class CancellableAsyncPlayerEvent extends Event implements Cancellable { | ||
private boolean cancelled = false; | ||
private Player player; | ||
|
||
public CancellableAsyncPlayerEvent(Player player) { | ||
super(true); | ||
this.player = player; | ||
} | ||
|
||
public Player getPlayer() { | ||
return player; | ||
} | ||
|
||
@Override | ||
public boolean isCancelled() { | ||
return cancelled; | ||
} | ||
|
||
@Override | ||
public void setCancelled(boolean cancel) { | ||
this.cancelled = cancel; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
uSkyBlock-API/src/main/java/us/talabrek/ultimateskyblock/api/event/IslandInfoEvent.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,38 @@ | ||
package us.talabrek.ultimateskyblock.api.event; | ||
|
||
import org.bukkit.Location; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.HandlerList; | ||
import us.talabrek.ultimateskyblock.api.async.Callback; | ||
import us.talabrek.ultimateskyblock.api.model.IslandScore; | ||
|
||
/** | ||
* @since v2.7.3 | ||
*/ | ||
public class IslandInfoEvent extends CancellableAsyncPlayerEvent { | ||
private static final HandlerList handlers = new HandlerList(); | ||
private final Location islandLocation; | ||
private final Callback<IslandScore> callback; | ||
|
||
public IslandInfoEvent(Player who, Location islandLocation, Callback<IslandScore> callback) { | ||
super(who); | ||
this.islandLocation = islandLocation; | ||
this.callback = callback; | ||
} | ||
|
||
public Location getIslandLocation() { | ||
return islandLocation; | ||
} | ||
|
||
public Callback<IslandScore> getCallback() { | ||
return callback; | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() { | ||
return handlers; | ||
} | ||
public static HandlerList getHandlerList() { | ||
return handlers; | ||
} | ||
} |
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
2 changes: 0 additions & 2 deletions
2
uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/admin/PurgeCommand.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
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
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
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
Oops, something went wrong.