3
0
Fork 0

Added getPlayer to AttractionPreStatusChangeEvent

This commit is contained in:
BuildTools 2022-04-27 23:38:21 +02:00
parent b319ef5088
commit e69fd04282
135 changed files with 15 additions and 5 deletions

0
.gitignore vendored Normal file → Executable file
View file

0
pom.xml Normal file → Executable file
View file

0
src/main/java/nl/iobyte/themepark/ThemePark.java Normal file → Executable file
View file

View file

View file

View file

View file

View file

View file

@ -10,9 +10,7 @@ import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.jetbrains.annotations.NotNull;
import org.yaml.snakeyaml.error.YAMLException;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Map;
import java.util.logging.Level;

View file

View file

View file

View file

@ -3,14 +3,21 @@ package nl.iobyte.themepark.api.event.attraction;
import nl.iobyte.themepark.api.attraction.enums.Status;
import nl.iobyte.themepark.api.attraction.objects.Attraction;
import nl.iobyte.themepark.api.event.objects.AttractionEvent;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
public class AttractionPreStatusChangeEvent extends AttractionEvent<Status> implements Cancellable {
private boolean b;
private final Player player;
private boolean b = false;
public AttractionPreStatusChangeEvent(Attraction attraction, Status old, Status current) {
public AttractionPreStatusChangeEvent(Attraction attraction, Status old, Status current, Player player) {
super(attraction, old, current);
this.player = player;
}
public Player getPlayer() {
return player;
}
public boolean isCancelled() {

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

@ -9,6 +9,8 @@ import nl.iobyte.themepark.api.attraction.objects.Attraction;
import nl.iobyte.themepark.api.event.attraction.AttractionPreStatusChangeEvent;
import nl.iobyte.themepark.api.message.Text;
import nl.iobyte.themepark.commands.arguments.AttractionArgument;
import org.bukkit.entity.Player;
import java.util.List;
public class AttractionStatusCommand extends SubCommand {
@ -25,10 +27,13 @@ public class AttractionStatusCommand extends SubCommand {
Attraction attraction = (Attraction) list.get(0);
Status status = (Status) list.get(1);
Player player = sender.getOriginal() instanceof Player ? (Player) sender.getOriginal() : null;
AttractionPreStatusChangeEvent event = new AttractionPreStatusChangeEvent(
attraction,
attraction.getStatus(),
status
status,
player
);
ThemePark.getInstance().getAPI().getEventDispatcher().call(
event,

Some files were not shown because too many files have changed in this diff Show more