Update SimulatorExecutor and fix many bugs
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed

Dieser Commit ist enthalten in:
yoyosource 2023-10-27 16:34:54 +02:00
Ursprung c050046820
Commit c05724efda
24 geänderte Dateien mit 316 neuen und 94 gelöschten Zeilen

Datei anzeigen

@ -0,0 +1,23 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2023 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.utils;
public class TickListener15 implements TickListener {
}

Datei anzeigen

@ -51,6 +51,7 @@ dependencies {
implementation project(":BauSystem_Main")
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
compileOnly 'io.papermc.paper:paper-api:1.19.2-R0.1-SNAPSHOT'
compileOnly 'it.unimi.dsi:fastutil:8.5.6'
compileOnly 'com.mojang:datafixerupper:4.0.26'
compileOnly 'io.netty:netty-all:4.1.68.Final'

Datei anzeigen

@ -0,0 +1,51 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2023 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.utils;
import com.destroystokyo.paper.event.server.ServerTickEndEvent;
import com.destroystokyo.paper.event.server.ServerTickStartEvent;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.features.tpslimit.TPSFreezeUtils;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public class TickListener19 implements TickListener, Listener {
private boolean tickStartRan = false;
public TickListener19() {
Bukkit.getPluginManager().registerEvents(this, BauSystem.getInstance());
}
@EventHandler
public void onServerTickStart(ServerTickStartEvent event) {
if (TPSFreezeUtils.isFrozen()) return;
Bukkit.getPluginManager().callEvent(new TickStartEvent());
tickStartRan = true;
}
@EventHandler
public void onServerTickEnd(ServerTickEndEvent event) {
if (!tickStartRan) return;
Bukkit.getPluginManager().callEvent(new TickEndEvent());
tickStartRan = false;
}
}

Datei anzeigen

@ -27,6 +27,7 @@ import de.steamwar.bausystem.linkage.LinkageUtils;
import de.steamwar.bausystem.region.loader.PrototypeLoader;
import de.steamwar.bausystem.region.loader.RegionLoader;
import de.steamwar.bausystem.region.loader.Updater;
import de.steamwar.bausystem.utils.TickListener;
import de.steamwar.bausystem.worlddata.WorldData;
import de.steamwar.message.Message;
import lombok.Getter;
@ -76,6 +77,7 @@ public class BauSystem extends JavaPlugin implements Listener {
LinkageUtils.link();
RamUsage.init();
TickListener.impl.init();
// This could disable any watchdog stuff. We need to investigate if this is a problem.
/*

Datei anzeigen

@ -30,12 +30,14 @@ import de.steamwar.command.TypeMapper;
import de.steamwar.command.TypeValidator;
import de.steamwar.linkage.Linked;
import de.steamwar.linkage.LinkedInstance;
import de.steamwar.linkage.MinVersion;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.Collection;
@Linked
@MinVersion(19)
public class SimulatorCommand extends SWCommand {
@LinkedInstance

Datei anzeigen

@ -41,6 +41,7 @@ import de.steamwar.entity.REntityServer;
import de.steamwar.entity.RFallingBlockEntity;
import de.steamwar.inventory.SWAnvilInv;
import de.steamwar.linkage.Linked;
import de.steamwar.linkage.MinVersion;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.bukkit.Bukkit;
@ -66,6 +67,7 @@ import java.util.function.Function;
import java.util.stream.Collectors;
@Linked
@MinVersion(19)
public class SimulatorCursor implements Listener {
private final World WORLD = Bukkit.getWorlds().get(0);
@ -366,7 +368,7 @@ public class SimulatorCursor implements Listener {
if (rayTraceResult.getHitEntity() != null) {
REntity hitEntity = rayTraceResult.getHitEntity();
Vector vector = new Vector(hitEntity.getX(), hitEntity.getY(), hitEntity.getZ());
List<SimulatorElement<?>> elements = simulator.getElements().stream().map(SimulatorGroup::getElements).flatMap(List::stream).filter(element -> {
List<SimulatorElement<?>> elements = simulator.getGroups().stream().map(SimulatorGroup::getElements).flatMap(List::stream).filter(element -> {
return element.getWorldPos().distanceSquared(vector) < (1 / 16.0) * (1 / 16.0);
}).collect(Collectors.toList());
@ -414,7 +416,7 @@ public class SimulatorCursor implements Listener {
}
SimulatorElement<?> element = type.elementFunction.apply(vector);
SimulatorGroup group = new SimulatorGroup().add(element);
simulator.getElements().add(group);
simulator.getGroups().add(group);
SimulatorGui simulatorGui = new SimulatorGui(player, simulator);
element.open(player, simulator, group, simulatorGui);
SimulatorWatcher.update(simulator);

Datei anzeigen

@ -31,6 +31,7 @@ import de.steamwar.bausystem.features.simulator.storage.YAPIONFormatSimulatorLoa
import de.steamwar.bausystem.utils.ItemUtils;
import de.steamwar.inventory.SWItem;
import de.steamwar.linkage.Linked;
import de.steamwar.linkage.MinVersion;
import de.steamwar.linkage.api.Enable;
import org.bukkit.Bukkit;
import org.bukkit.Material;
@ -44,6 +45,7 @@ import java.io.IOException;
import java.util.*;
@Linked
@MinVersion(19)
public class SimulatorStorage implements Enable {
public static final File simulatorsDir = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "simulators");

Datei anzeigen

@ -28,6 +28,7 @@ import de.steamwar.entity.REntity;
import de.steamwar.entity.REntityServer;
import de.steamwar.entity.RFallingBlockEntity;
import de.steamwar.linkage.Linked;
import de.steamwar.linkage.MinVersion;
import lombok.experimental.UtilityClass;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@ -73,6 +74,7 @@ public class SimulatorWatcher {
}
@Linked
@MinVersion(19)
public static class QuitListener implements Listener {
@EventHandler
@ -87,7 +89,7 @@ public class SimulatorWatcher {
return null;
}
Map<Vector, Set<Class<?>>> positionCache = new HashMap<>();
simulator.getElements().stream().map(group -> group.getElements().stream().map(element -> new Pair<>(group, element)).collect(Collectors.toList())).flatMap(List::stream).forEach(pair -> {
simulator.getGroups().stream().map(group -> group.getElements().stream().map(element -> new Pair<>(group, element)).collect(Collectors.toList())).flatMap(List::stream).forEach(pair -> {
SimulatorGroup group = pair.getKey();
SimulatorElement<?> element = pair.getValue();

Datei anzeigen

@ -31,6 +31,7 @@ import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
@Getter
@Setter
@ -39,10 +40,10 @@ public final class Simulator {
private Material material = Material.BARREL;
private final String name;
private boolean autoTrace = false;
private final List<SimulatorGroup> elements = new ArrayList<>();
private final List<SimulatorGroup> groups = new ArrayList<>();
public void move(int x, int y, int z) {
elements.forEach(simulatorGroup -> {
groups.forEach(simulatorGroup -> {
simulatorGroup.move(x, y, z);
});
}
@ -51,14 +52,14 @@ public final class Simulator {
return new SWItem(material, "§e" + name, invCallback);
}
public void toSimulatorActions(Map<Integer, List<SimulatorAction>> actions) {
elements.forEach(simulatorGroup -> {
simulatorGroup.toSimulatorActions(actions);
public void toSimulatorActions(BiConsumer<Integer, SimulatorAction> tickStart, BiConsumer<Integer, SimulatorAction> tickEnd) {
groups.forEach(simulatorGroup -> {
simulatorGroup.toSimulatorActions(tickStart, tickEnd);
});
}
public Simulator add(SimulatorGroup group) {
elements.add(group);
groups.add(group);
return this;
}
}

Datei anzeigen

@ -34,6 +34,7 @@ import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
@Getter
@Setter
@ -101,17 +102,17 @@ public abstract class SimulatorElement<T extends SimulatorPhase> {
return new SWItem(material, "§e" + getName(player), lore, disabled, invCallback);
}
public void toSimulatorActions(Map<Integer, List<SimulatorAction>> actions) {
public void toSimulatorActions(BiConsumer<Integer, SimulatorAction> tickStart, BiConsumer<Integer, SimulatorAction> tickEnd) {
if (disabled) return;
phases.forEach(phase -> {
phase.toSimulatorActions(actions, position.clone());
phase.toSimulatorActions(position.clone(), tickStart, tickEnd);
});
}
public abstract void open(Player player, Simulator simulator, SimulatorGroup group, SimulatorBaseGui back);
public SimulatorGroup getGroup(Simulator simulator) {
return simulator.getElements().stream()
return simulator.getGroups().stream()
.filter(simulatorGroup -> simulatorGroup.getElements().contains(this))
.findFirst()
.orElse(null);

Datei anzeigen

@ -31,6 +31,7 @@ import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
@Getter
@Setter
@ -40,7 +41,9 @@ public final class SimulatorGroup {
private final List<SimulatorElement<?>> elements = new ArrayList<>();
public SimulatorGroup add(SimulatorElement<?> element) {
elements.add(element);
if (!elements.contains(element)) {
elements.add(element);
}
return this;
}
@ -82,10 +85,10 @@ public final class SimulatorGroup {
}
}
public void toSimulatorActions(Map<Integer, List<SimulatorAction>> actions) {
public void toSimulatorActions(BiConsumer<Integer, SimulatorAction> tickStart, BiConsumer<Integer, SimulatorAction> tickEnd) {
if (disabled) return;
elements.forEach(simulatorElement -> {
simulatorElement.toSimulatorActions(actions);
simulatorElement.toSimulatorActions(tickStart, tickEnd);
});
}
}

Datei anzeigen

@ -27,6 +27,7 @@ import yapion.hierarchy.types.YAPIONObject;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
@Getter
@Setter
@ -37,7 +38,7 @@ public abstract class SimulatorPhase {
protected int lifetime = 80;
protected int order = 0;
public abstract void toSimulatorActions(Map<Integer, List<SimulatorAction>> actions, Vector position);
public abstract void toSimulatorActions(Vector position, BiConsumer<Integer, SimulatorAction> tickStart, BiConsumer<Integer, SimulatorAction> tickEnd);
public void saveExtra(YAPIONObject phaseObject) {}
public void loadExtra(YAPIONObject phaseObject) {}
}

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bausystem.features.simulator.data.redstone;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.features.simulator.data.SimulatorPhase;
import de.steamwar.bausystem.features.simulator.execute.SimulatorAction;
import lombok.NoArgsConstructor;
@ -33,6 +34,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.BiConsumer;
@NoArgsConstructor
public final class RedstonePhase extends SimulatorPhase {
@ -46,31 +48,27 @@ public final class RedstonePhase extends SimulatorPhase {
}
@Override
public void toSimulatorActions(Map<Integer, List<SimulatorAction>> actions, Vector position) {
AtomicReference<BlockState> previousBlockState = new AtomicReference<>();
actions.computeIfAbsent(tickOffset, __ -> new ArrayList<>())
.add(new SimulatorAction(0, 1) {
@Override
public void accept(World world) {
// TODO: 0 Tick Pistons not working
Block block = world.getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
previousBlockState.set(block.getState());
block.setType(Material.REDSTONE_BLOCK);
if (lifetime == 0) {
previousBlockState.get().update(true, true);
}
}
});
if (lifetime == 0) {
return;
}
actions.computeIfAbsent(tickOffset + lifetime, __ -> new ArrayList<>())
.add(new SimulatorAction(0, 1) {
@Override
public void accept(World world) {
previousBlockState.get().update(true, true);
}
});
public void toSimulatorActions(Vector position, BiConsumer<Integer, SimulatorAction> tickStart, BiConsumer<Integer, SimulatorAction> tickEnd) {
AtomicReference<BlockState> blockState = new AtomicReference<>();
tickStart.accept(tickOffset, new SimulatorAction(order, 1) {
@Override
public void accept(World world) {
Block block = world.getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
blockState.set(block.getState());
block.setType(Material.REDSTONE_BLOCK);
}
});
tickEnd.accept(tickOffset + lifetime, new SimulatorAction(0, 1) {
@Override
public void accept(World world) {
BlockState state = blockState.get();
if (state != null) {
state.update(true, true);
} else {
Block block = world.getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
block.setType(Material.AIR);
}
}
});
}
}

Datei anzeigen

@ -32,6 +32,7 @@ import yapion.hierarchy.types.YAPIONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
@Getter
@Setter
@ -57,8 +58,8 @@ public final class TNTPhase extends SimulatorPhase {
}
@Override
public void toSimulatorActions(Map<Integer, List<SimulatorAction>> actions, Vector position) {
actions.computeIfAbsent(tickOffset, __ -> new ArrayList<>()).add(new SimulatorAction(order, count) {
public void toSimulatorActions(Vector position, BiConsumer<Integer, SimulatorAction> tickStart, BiConsumer<Integer, SimulatorAction> tickEnd) {
tickStart.accept(tickOffset, new SimulatorAction(order, count) {
@Override
public void accept(World world) {
TNTPrimed tnt = world.spawn(position.toLocation(world), TNTPrimed.class);

Datei anzeigen

@ -19,63 +19,88 @@
package de.steamwar.bausystem.features.simulator.execute;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.features.simulator.data.Simulator;
import lombok.experimental.UtilityClass;
import de.steamwar.bausystem.features.tpslimit.TPSUtils;
import de.steamwar.bausystem.utils.TickEndEvent;
import de.steamwar.bausystem.utils.TickStartEvent;
import de.steamwar.linkage.Linked;
import de.steamwar.linkage.MinVersion;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
@UtilityClass
public class SimulatorExecutor {
@Linked
@MinVersion(19)
public class SimulatorExecutor implements Listener {
private static final World WORLD = Bukkit.getWorlds().get(0);
private static Set<Simulator> currentlyRunning = new HashSet<>();
private static Map<Long, Map<Integer, List<SimulatorAction>>> tickStartActions = new HashMap<>();
private static Map<Long, List<SimulatorAction>> tickEndActions = new HashMap<>();
public boolean run(Simulator simulator) {
public static boolean run(Simulator simulator) {
if (currentlyRunning.contains(simulator)) return false;
currentlyRunning.add(simulator);
Map<Integer, List<SimulatorAction>> map = new HashMap<>();
simulator.toSimulatorActions(map);
Map<Integer, Map<Integer, List<SimulatorAction>>> actions = new HashMap<>();
map.forEach((integer, simulatorActions) -> {
simulatorActions.forEach(simulatorAction -> {
actions.computeIfAbsent(integer, __ -> new HashMap<>()).computeIfAbsent(simulatorAction.getOrder(), __ -> new ArrayList<>()).add(simulatorAction);
});
long currentTick = TPSUtils.currentRealTick.get();
AtomicLong lastTick = new AtomicLong();
simulator.toSimulatorActions((tickOffset, simulatorAction) -> {
lastTick.set(Math.max(lastTick.get(), tickOffset));
tickStartActions.computeIfAbsent(currentTick + tickOffset, __ -> new HashMap<>())
.computeIfAbsent(simulatorAction.getOrder(), __ -> new ArrayList<>())
.add(simulatorAction);
}, (tickOffset, simulatorAction) -> {
lastTick.set(Math.max(lastTick.get(), tickOffset));
tickEndActions.computeIfAbsent(currentTick + tickOffset, __ -> new ArrayList<>())
.add(simulatorAction);
});
AtomicInteger tick = new AtomicInteger();
BauSystem.runTaskTimer(BauSystem.getInstance(), bukkitTask -> {
if (actions.isEmpty()) {
bukkitTask.cancel();
currentlyRunning.remove(simulator);
return;
}
int currentTick = tick.getAndIncrement();
Map<Integer, List<SimulatorAction>> actionsToRun = actions.remove(currentTick);
if (actionsToRun == null) return;
List<Integer> keys = new ArrayList<>(actionsToRun.keySet());
keys.sort(null);
for (int actionKey : keys) {
List<SimulatorAction> keyedActions = actionsToRun.get(actionKey);
while (!keyedActions.isEmpty()) {
Collections.shuffle(keyedActions);
for (int i = keyedActions.size() - 1 ; i >= 0; i--) {
SimulatorAction action = keyedActions.get(i);
action.accept(WORLD);
action.setCount(action.getCount() - 1);
if (action.getCount() == 0) {
keyedActions.remove(i);
}
tickEndActions.computeIfAbsent(currentTick + lastTick.get() + 4, __ -> new ArrayList<>())
.add(new SimulatorAction(0, 1) {
@Override
public void accept(World world) {
currentlyRunning.remove(simulator);
}
}
}
}, 0, 1);
});
return true;
}
@EventHandler
public void onTickStart(TickStartEvent event) {
long currentTick = TPSUtils.currentRealTick.get();
Map<Integer, List<SimulatorAction>> actionsToRun = tickStartActions.remove(currentTick);
if (actionsToRun == null) return;
List<Integer> keys = new ArrayList<>(actionsToRun.keySet());
keys.sort(null);
for (int actionKey : keys) {
runActions(actionsToRun.get(actionKey));
}
}
@EventHandler
public void onTickEnd(TickEndEvent event) {
long currentTick = TPSUtils.currentRealTick.get() - 1;
List<SimulatorAction> actionsToRun = tickEndActions.remove(currentTick);
if (actionsToRun == null) return;
runActions(actionsToRun);
}
private void runActions(List<SimulatorAction> actionsToRun) {
while (!actionsToRun.isEmpty()) {
Collections.shuffle(actionsToRun);
for (int i = actionsToRun.size() - 1 ; i >= 0; i--) {
SimulatorAction action = actionsToRun.get(i);
action.accept(WORLD);
action.setCount(action.getCount() - 1);
if (action.getCount() == 0) {
actionsToRun.remove(i);
}
}
}
}
}

Datei anzeigen

@ -39,7 +39,7 @@ public class SimulatorGroupChooserGui extends SimulatorPageGui<SimulatorGroup> {
private final SimulatorBaseGui back;
public SimulatorGroupChooserGui(Player player, Simulator simulator, SimulatorElement<?> subject, SimulatorGroup parent, SimulatorBaseGui back) {
super(player, simulator, 6 * 9, simulator.getElements().stream().filter(e -> e != parent).collect(Collectors.toList()));
super(player, simulator, 6 * 9, simulator.getGroups().stream().filter(e -> e != parent).collect(Collectors.toList()));
this.subject = subject;
this.parent = parent;
this.back = back;
@ -53,7 +53,7 @@ public class SimulatorGroupChooserGui extends SimulatorPageGui<SimulatorGroup> {
inventory.setItem(49, new SWItem(Material.BARRIER, "§cRemove from Group", clickType -> {
SimulatorGroup newParent = new SimulatorGroup();
newParent.add(subject);
simulator.getElements().add(newParent);
simulator.getGroups().add(newParent);
parent.getElements().remove(subject);
back.open();
SimulatorWatcher.update(simulator);

Datei anzeigen

@ -31,7 +31,7 @@ import org.bukkit.entity.Player;
public class SimulatorGui extends SimulatorPageGui<SimulatorGroup> {
public SimulatorGui(Player player, Simulator simulator) {
super(player, simulator, 6 * 9, simulator.getElements());
super(player, simulator, 6 * 9, simulator.getGroups());
}
@Override
@ -41,7 +41,7 @@ public class SimulatorGui extends SimulatorPageGui<SimulatorGroup> {
@Override
public void headerAndFooter() {
if (simulator.getElements().removeIf(element -> element.getElements().isEmpty() || element.getElements().stream().allMatch(simulatorElement -> simulatorElement.getPhases().isEmpty()))) {
if (simulator.getGroups().removeIf(element -> element.getElements().isEmpty() || element.getElements().stream().allMatch(simulatorElement -> simulatorElement.getPhases().isEmpty()))) {
SimulatorWatcher.update(simulator);
}

Datei anzeigen

@ -32,7 +32,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class SimulatorTNTSettingsGui extends SimulatorBaseGui {
public class SimulatorTNTSettingsGui extends SimulatorBaseGui { // TODO: Anvil GUI's!
private final TNTElement tnt;
private final SimulatorBaseGui back;

Datei anzeigen

@ -83,8 +83,8 @@ public class SimFormatSimulatorLoader implements SimulatorLoader {
elements.streamObject().forEach(elementObject -> {
SimulatorElement<?> element;
Supplier<SimulatorPhase> phaseConstructor;
Vector position = new Vector(groupObject.getDouble("x"), groupObject.getDouble("y"), groupObject.getDouble("z"));
String type = groupObject.getPlainValue("type");
Vector position = new Vector(elementObject.getDouble("x"), elementObject.getDouble("y"), elementObject.getDouble("z"));
String type = elementObject.getPlainValue("type");
switch (type) {
case "TNT":
element = new TNTElement(position);

Datei anzeigen

@ -37,7 +37,7 @@ public class SimulatorSaver {
simulatorObject.add("autoTrace", simulator.isAutoTrace());
YAPIONArray groups = new YAPIONArray();
simulator.getElements().forEach(group -> {
simulator.getGroups().forEach(group -> {
YAPIONObject groupObject = new YAPIONObject();
groupObject.add("material", group.getMaterial().name());
groupObject.add("disabled", group.isDisabled());

Datei anzeigen

@ -0,0 +1,36 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2023 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.utils;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class TickEndEvent extends Event {
private static final HandlerList handlers = new HandlerList();
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}

Datei anzeigen

@ -0,0 +1,31 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2023 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.utils;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.core.VersionDependent;
public interface TickListener {
TickListener impl = VersionDependent.getVersionImpl(BauSystem.getInstance());
default void init() {
}
}

Datei anzeigen

@ -0,0 +1,36 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2023 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.utils;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class TickStartEvent extends Event {
private static final HandlerList handlers = new HandlerList();
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}

Datei anzeigen

@ -61,6 +61,10 @@ allprojects {
maven {
url = uri('https://libraries.minecraft.net')
}
maven {
url = uri("https://repo.papermc.io/repository/maven-public/")
}
}
}