forked from SteamWar/SteamWar
Compare commits
48
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de4f32feb2 | ||
|
|
a3d2d2be1e | ||
|
|
7a000efb93 | ||
|
|
42c9d6d612 | ||
|
|
67c679a20f | ||
|
|
a071d8a1f2 | ||
|
|
7b25bd31fc | ||
|
|
139a2c275c | ||
|
|
aa787b5a25 | ||
|
|
54adc12045 | ||
|
|
32c85b9bd5 | ||
|
|
15bb92fbba | ||
|
|
d6a5caf95d | ||
|
|
66d18e316b | ||
|
|
5cdad8c2f4 | ||
|
|
87a7120a6a | ||
|
|
b5a9564808 | ||
|
|
f93362a023 | ||
|
|
b1bef4ced5 | ||
|
|
e7e1e2d968 | ||
|
|
713275ba11 | ||
|
|
e72ae3cf94 | ||
|
|
d36753dec1 | ||
|
|
84cc292df4 | ||
|
|
f89c4e88f9 | ||
|
|
a38f9222dd | ||
|
|
5ee9d3e167 | ||
|
|
98321de46c | ||
|
|
239ba3f213 | ||
|
|
3d7dedd3ad | ||
|
|
ef66b8c1f1 | ||
|
|
1201b16ee4 | ||
|
|
4ddd88f540 | ||
|
|
ca35ab9234 | ||
|
|
3df84a7dad | ||
|
|
83c20729fa | ||
|
|
925901e40e | ||
|
|
059dd314d1 | ||
|
|
86ff619548 | ||
|
|
76e00b07db | ||
|
|
4edfd32ff5 | ||
|
|
5669725f9b | ||
|
|
335649fa87 | ||
|
|
9001e83321 | ||
|
|
32703c6659 | ||
|
|
e393aad25f | ||
|
|
50543ddd4e | ||
|
|
ae7d394ae2 |
+37
@@ -0,0 +1,37 @@
|
|||||||
|
package de.steamwar.bausystem.features.printerTool;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.utils.ItemUtils;
|
||||||
|
import de.steamwar.inventory.SWItem;
|
||||||
|
import de.steamwar.linkage.Linked;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
|
@Linked
|
||||||
|
public class PrinterToolItem implements Listener {
|
||||||
|
public static ItemStack getItem(Player p) {
|
||||||
|
ItemStack itemStack = new SWItem(Material.WOODEN_PICKAXE, "Printer Tool").getItemStack();
|
||||||
|
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||||
|
itemMeta.setCustomModelData(1);
|
||||||
|
itemStack.setItemMeta(itemMeta);
|
||||||
|
ItemUtils.setItem(itemStack, "printer_tool");
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isItem(ItemStack itemStack) {
|
||||||
|
return itemStack != null && ItemUtils.isItem(itemStack, "printer_tool");
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||||
|
ItemStack item = event.getItem();
|
||||||
|
|
||||||
|
if(PrinterToolItem.isItem(item)) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -226,7 +226,7 @@ public class FreezeListener implements Listener, ScoreboardElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onBlockBreak(BlockBreakEvent e) {
|
public void onBlockBreak(BlockBreakEvent e) {
|
||||||
if (Core.getVersion() < 19) return;
|
if (Core.getVersion() < 19) return;
|
||||||
if (e.getPlayer().getInventory().getItemInMainHand().getType() == Material.DEBUG_STICK) return;
|
if (e.getPlayer().getInventory().getItemInMainHand().getType() == Material.DEBUG_STICK) return;
|
||||||
|
|||||||
+2
-1
@@ -25,6 +25,7 @@ import com.sk89q.worldedit.world.block.BaseBlock;
|
|||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
import de.steamwar.bausystem.utils.WorldEditUtils;
|
import de.steamwar.bausystem.utils.WorldEditUtils;
|
||||||
|
import de.steamwar.core.Core;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@@ -56,7 +57,7 @@ public class Panzern {
|
|||||||
|
|
||||||
private BaseBlock blockType;
|
private BaseBlock blockType;
|
||||||
private BaseBlock slabType;
|
private BaseBlock slabType;
|
||||||
private static final BaseBlock jukeboxType = BlockTypes.JUKEBOX.getDefaultState().toBaseBlock();
|
private static final BaseBlock jukeboxType = (Core.getVersion() > 19 ? BlockTypes.get("lodestone"): BlockTypes.get("jukebox")).getDefaultState().toBaseBlock();
|
||||||
private static final BaseBlock cobwebType = BlockTypes.COBWEB.getDefaultState().toBaseBlock();
|
private static final BaseBlock cobwebType = BlockTypes.COBWEB.getDefaultState().toBaseBlock();
|
||||||
private static final BaseBlock airType = BlockTypes.AIR.getDefaultState().toBaseBlock();
|
private static final BaseBlock airType = BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -179,7 +179,12 @@ public class SpectatorListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
||||||
if (event.getMessage().startsWith("/schem save") || event.getMessage().startsWith("//schem save") || event.getMessage().startsWith("/schematic save") || event.getMessage().startsWith("//schematic save")) {
|
if (event.getMessage().startsWith("/schem save") ||
|
||||||
|
event.getMessage().startsWith("//schem save") ||
|
||||||
|
event.getMessage().startsWith("/schematic save") ||
|
||||||
|
event.getMessage().startsWith("//schematic save") ||
|
||||||
|
event.getMessage().startsWith("/download") ||
|
||||||
|
event.getMessage().startsWith("//download")) {
|
||||||
if (!Permission.SUPERVISOR.hasPermission(event.getPlayer())) {
|
if (!Permission.SUPERVISOR.hasPermission(event.getPlayer())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
event.setMessage("/");
|
event.setMessage("/");
|
||||||
|
|||||||
@@ -0,0 +1,204 @@
|
|||||||
|
package de.steamwar.bausystem.utils.cursor;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.utils.RayTraceUtils;
|
||||||
|
import de.steamwar.entity.REntity;
|
||||||
|
import de.steamwar.entity.REntityServer;
|
||||||
|
import de.steamwar.entity.RFallingBlockEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.block.BlockFace;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
import yapion.hierarchy.types.YAPIONType;
|
||||||
|
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
|
import java.util.function.BiFunction;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public class RCursor {
|
||||||
|
private final World WORLD = Bukkit.getWorlds().get(0);
|
||||||
|
|
||||||
|
private final REntityServer targetServer;
|
||||||
|
private final REntityServer cursorServer;
|
||||||
|
|
||||||
|
private final Player owner;
|
||||||
|
private final Material highlightMaterial;
|
||||||
|
private final ClickHandler onClickHandler;
|
||||||
|
|
||||||
|
private RFallingBlockEntity cursorEntity;
|
||||||
|
|
||||||
|
private Location cursorLocation;
|
||||||
|
private boolean isHittingEntity = false;
|
||||||
|
|
||||||
|
@Setter
|
||||||
|
private Material cursorMaterial;
|
||||||
|
@Setter
|
||||||
|
private CursorMode cursorMode;
|
||||||
|
private boolean visible = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public RCursor(REntityServer targetServer, Player owner, Material highlightMaterial, Material cursorMaterial, CursorMode cursorMode, ClickHandler onClickHandler) {
|
||||||
|
this.targetServer = targetServer;
|
||||||
|
this.owner = owner;
|
||||||
|
this.highlightMaterial = highlightMaterial;
|
||||||
|
this.cursorMaterial = cursorMaterial;
|
||||||
|
this.cursorMode = cursorMode;
|
||||||
|
this.onClickHandler = onClickHandler;
|
||||||
|
|
||||||
|
cursorServer = new REntityServer();
|
||||||
|
cursorServer.addPlayer(owner);
|
||||||
|
|
||||||
|
RCursorManager.getInstance().registerCursor(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render() {
|
||||||
|
if (!visible) return;
|
||||||
|
|
||||||
|
RayTraceUtils.RRayTraceResult rayTraceResult = RayTraceUtils.traceREntity(owner, owner.getLocation(), targetServer.getEntities());
|
||||||
|
if (rayTraceResult == null) {
|
||||||
|
if(cursorEntity != null) cursorEntity.die();
|
||||||
|
cursorEntity = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
REntity hitEntity = rayTraceResult.getHitEntity() == cursorEntity ? null : rayTraceResult.getHitEntity();
|
||||||
|
|
||||||
|
|
||||||
|
Material activeCursorMaterial = hitEntity == null ? cursorMaterial : highlightMaterial;
|
||||||
|
Location activeCursorLocation = hitEntity == null ? cursorMode.positionTransform.apply(owner, rayTraceResult).toLocation(WORLD)
|
||||||
|
: new Vector(hitEntity.getX(), hitEntity.getY(), hitEntity.getZ()).toLocation(WORLD);
|
||||||
|
|
||||||
|
cursorLocation = activeCursorLocation;
|
||||||
|
isHittingEntity = hitEntity != null;
|
||||||
|
|
||||||
|
if (cursorEntity == null) {
|
||||||
|
cursorEntity = new RFallingBlockEntity(cursorServer, activeCursorLocation, activeCursorMaterial);
|
||||||
|
cursorEntity.setNoGravity(true);
|
||||||
|
} if (cursorEntity.getMaterial() == activeCursorMaterial) {
|
||||||
|
cursorEntity.move(activeCursorLocation);
|
||||||
|
} else {
|
||||||
|
cursorEntity.die();
|
||||||
|
cursorEntity = new RFallingBlockEntity(cursorServer, activeCursorLocation, activeCursorMaterial);
|
||||||
|
cursorEntity.setNoGravity(true);
|
||||||
|
if(activeCursorMaterial == highlightMaterial) {
|
||||||
|
cursorEntity.setGlowing(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void hide() {
|
||||||
|
visible = false;
|
||||||
|
if (cursorEntity != null) {
|
||||||
|
cursorEntity.die();
|
||||||
|
cursorEntity = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void handleClick(Action action) {
|
||||||
|
if(!visible || cursorLocation == null) return;
|
||||||
|
|
||||||
|
onClickHandler.handle(cursorLocation, isHittingEntity, action);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void close() {
|
||||||
|
cursorServer.close();
|
||||||
|
RCursorManager.getInstance().unregisterCursor(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum CursorMode {
|
||||||
|
FREE((player, rayTraceResult) -> {
|
||||||
|
Vector pos = rayTraceResult.getHitPosition();
|
||||||
|
|
||||||
|
BlockFace face = rayTraceResult.getHitBlockFace();
|
||||||
|
if (face != null) {
|
||||||
|
switch (face) {
|
||||||
|
case DOWN:
|
||||||
|
pos.setY(pos.getY() - 0.98);
|
||||||
|
break;
|
||||||
|
case EAST:
|
||||||
|
pos.setX(pos.getX() + 0.49);
|
||||||
|
break;
|
||||||
|
case WEST:
|
||||||
|
pos.setX(pos.getX() - 0.49);
|
||||||
|
break;
|
||||||
|
case NORTH:
|
||||||
|
pos.setZ(pos.getZ() - 0.49);
|
||||||
|
break;
|
||||||
|
case SOUTH:
|
||||||
|
pos.setZ(pos.getZ() + 0.49);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (face.getModY() == 0 && player.isSneaking()) {
|
||||||
|
pos.setY(pos.getY() - 0.49);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.isSneaking()) {
|
||||||
|
pos.setX(pos.getBlockX() + 0.5);
|
||||||
|
if (face == null || face.getModY() == 0)
|
||||||
|
pos.setY(pos.getBlockY() + 0.0);
|
||||||
|
pos.setZ(pos.getBlockZ() + 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
return pos;
|
||||||
|
}),
|
||||||
|
BLOCK_ALIGNED((player, rayTraceResult) -> {
|
||||||
|
Vector pos = rayTraceResult.getHitPosition();
|
||||||
|
|
||||||
|
BlockFace face = rayTraceResult.getHitBlockFace();
|
||||||
|
if (face != null) {
|
||||||
|
switch (face) {
|
||||||
|
case DOWN:
|
||||||
|
pos.setY(pos.getY() - 0.98);
|
||||||
|
break;
|
||||||
|
case EAST:
|
||||||
|
pos.setX(pos.getX() + 0.49);
|
||||||
|
break;
|
||||||
|
case WEST:
|
||||||
|
pos.setX(pos.getX() - 0.49);
|
||||||
|
break;
|
||||||
|
case NORTH:
|
||||||
|
pos.setZ(pos.getZ() - 0.49);
|
||||||
|
break;
|
||||||
|
case SOUTH:
|
||||||
|
pos.setZ(pos.getZ() + 0.49);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pos.setX(pos.getBlockX() + 0.5);
|
||||||
|
if (pos.getY() - pos.getBlockY() != 0 && face == BlockFace.UP) {
|
||||||
|
pos.setY(pos.getBlockY() + 1.0);
|
||||||
|
} else {
|
||||||
|
pos.setY(pos.getBlockY());
|
||||||
|
}
|
||||||
|
pos.setZ(pos.getBlockZ() + 0.5);
|
||||||
|
return pos;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
private final BiFunction<Player, RayTraceUtils.RRayTraceResult, Vector> positionTransform;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ClickHandler{
|
||||||
|
public void handle(Location cursorLocation, boolean didHitEntity, Action action);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package de.steamwar.bausystem.utils.cursor;
|
||||||
|
|
||||||
|
import com.comphenix.tinyprotocol.TinyProtocol;
|
||||||
|
import de.steamwar.Reflection;
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
|
import de.steamwar.linkage.Linked;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
|
import java.lang.ref.SoftReference;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.function.BiFunction;
|
||||||
|
|
||||||
|
@Linked
|
||||||
|
public class RCursorManager implements Listener {
|
||||||
|
@Getter
|
||||||
|
private static RCursorManager instance;
|
||||||
|
|
||||||
|
private final Set<Player> calculationActive = new HashSet<>();
|
||||||
|
private final Map<Player, RCursor> activeCursors = new HashMap<>();
|
||||||
|
|
||||||
|
public RCursorManager() {
|
||||||
|
if (instance == null) {
|
||||||
|
instance = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
BiFunction<Player, Object, Object> function = (player, object) -> {
|
||||||
|
updateCursor(player);
|
||||||
|
return object;
|
||||||
|
};
|
||||||
|
|
||||||
|
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
||||||
|
Set<Player> playersWithActiveCursor = activeCursors.keySet();
|
||||||
|
|
||||||
|
playersWithActiveCursor.forEach(this::updateCursor);
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
Class<?> positionPacketClass = Reflection.getClass("net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Pos");
|
||||||
|
Class<?> lookPacketClass = Reflection.getClass("net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Rot");
|
||||||
|
Class<?> positionLookPacketClass = Reflection.getClass("net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$PosRot");
|
||||||
|
|
||||||
|
TinyProtocol.instance.addFilter(positionPacketClass, function);
|
||||||
|
TinyProtocol.instance.addFilter(lookPacketClass, function);
|
||||||
|
TinyProtocol.instance.addFilter(positionLookPacketClass, function);
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerCursor(RCursor cursor) {
|
||||||
|
closeCursorOf(cursor.getOwner());
|
||||||
|
|
||||||
|
activeCursors.put(cursor.getOwner(), cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
void unregisterCursor(RCursor cursor) {
|
||||||
|
activeCursors.remove(cursor.getOwner());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeCursorOf(Player player) {
|
||||||
|
RCursor currentPlayerCursor = activeCursors.get(player);
|
||||||
|
|
||||||
|
if(currentPlayerCursor != null) {
|
||||||
|
currentPlayerCursor.close();
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void updateCursor(Player player) {
|
||||||
|
if (!activeCursors.containsKey(player)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
synchronized (calculationActive) {
|
||||||
|
if (calculationActive.contains(player)) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
calculationActive.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RCursor cursor = activeCursors.get(player);
|
||||||
|
|
||||||
|
if (cursor != null) {
|
||||||
|
cursor.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
synchronized (calculationActive) {
|
||||||
|
calculationActive.remove(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
private void handlePlayerInteract(PlayerInteractEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
RCursor cursorOfPlayer = activeCursors.get(player);
|
||||||
|
|
||||||
|
cursorOfPlayer.handleClick(event.getAction());
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
private void handlePlayerQuit(PlayerQuitEvent event) {
|
||||||
|
closeCursorOf(event.getPlayer());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,3 +34,19 @@ dependencies {
|
|||||||
implementation(project(":BauSystem:BauSystem_20"))
|
implementation(project(":BauSystem:BauSystem_20"))
|
||||||
implementation(project(":BauSystem:BauSystem_21"))
|
implementation(project(":BauSystem:BauSystem_21"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register<DevServer>("DevBau20") {
|
||||||
|
group = "run"
|
||||||
|
description = "Run a 1.20 Dev Bau"
|
||||||
|
dependsOn(":SpigotCore:shadowJar")
|
||||||
|
dependsOn(":BauSystem:shadowJar")
|
||||||
|
template = "Bau20"
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register<DevServer>("DevBau21") {
|
||||||
|
group = "run"
|
||||||
|
description = "Run a 1.21 Dev Bau"
|
||||||
|
dependsOn(":SpigotCore:shadowJar")
|
||||||
|
dependsOn(":BauSystem:shadowJar")
|
||||||
|
template = "Bau21"
|
||||||
|
}
|
||||||
|
|||||||
+24
-15
@@ -34,6 +34,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
|
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public class TechhiderbugCommand implements CommandExecutor {
|
public class TechhiderbugCommand implements CommandExecutor {
|
||||||
|
|
||||||
@@ -45,25 +46,33 @@ public class TechhiderbugCommand implements CommandExecutor {
|
|||||||
public boolean onCommand(CommandSender sender, Command cmd, String alias, String[] args) {
|
public boolean onCommand(CommandSender sender, Command cmd, String alias, String[] args) {
|
||||||
StringWriter writer = new StringWriter();
|
StringWriter writer = new StringWriter();
|
||||||
|
|
||||||
writer.append("ArenaMode: ").append(Config.mode.name()).append('\n');
|
try {
|
||||||
writer.append("FightState: ").append(FightState.getFightState().name()).append('\n');
|
writer.append("ArenaMode: ").append(Config.mode.name()).append('\n');
|
||||||
writer.append("TechHider enabled: ").append(FightState.getStateDependentFeatures().get(FightSystem.getTechHider()).toString()).append('\n');
|
writer.append("FightState: ").append(FightState.getFightState().name()).append('\n');
|
||||||
|
writer.append("TechHider enabled: ").append(FightState.getStateDependentFeatures().get(FightSystem.getTechHider()).toString()).append('\n');
|
||||||
|
|
||||||
writer.append("Arena region: ").append(Config.ArenaRegion.toString()).append('\n');
|
writer.append("Arena region: ").append(Config.ArenaRegion.toString()).append('\n');
|
||||||
writer.append("Team regions: ");
|
writer.append("Team regions: ");
|
||||||
Fight.teams().forEach(t -> writer.append(t.getName()).append(':').append(t.getExtendRegion().toString()).append(' '));
|
Fight.teams().forEach(t -> writer.append(t.getName()).append(':').append(t.getExtendRegion().toString()).append(' '));
|
||||||
writer.append('\n');
|
writer.append('\n');
|
||||||
|
|
||||||
writer.append("HullHider regions: ");
|
writer.append("HullHider regions: ");
|
||||||
FightSystem.getHullHider().getHullMap().forEach((t, h) -> writer.append(t.getName()).append(':').append(h.getRegion().toString()).append(' '));
|
FightSystem.getHullHider().getHullMap().forEach((t, h) -> writer.append(t.getName()).append(':').append(h.getRegion().toString()).append(' '));
|
||||||
writer.append('\n');
|
writer.append('\n');
|
||||||
|
|
||||||
writer.append("Hidden regions: ");
|
writer.append("Hidden regions: ");
|
||||||
FightSystem.getTechHider().getHiddenRegion().forEach((p, r) -> writer.append(p.getName()).append(':').append(r.toString()).append(' '));
|
FightSystem.getTechHider().getHiddenRegion().forEach((p, r) -> writer.append(p.getName()).append(':').append(r.toString()).append(' '));
|
||||||
writer.append('\n');
|
writer.append('\n');
|
||||||
|
|
||||||
writer.append('\n').append("Netty pipelines:\n");
|
writer.append("TinyProtocol: ");
|
||||||
Bukkit.getOnlinePlayers().forEach(p -> writer.append(p.getName()).append(": ").append(String.join(" ", TinyProtocol.instance.getPlayerInterceptors().get(p).getChannel().pipeline().names())).append('\n'));
|
writer.append(TinyProtocol.instance.toString()).append('\n');
|
||||||
|
|
||||||
|
writer.append('\n').append("Netty pipelines:\n");
|
||||||
|
Bukkit.getOnlinePlayers().forEach(p -> writer.append(p.getName()).append(": ").append(String.join(" ", TinyProtocol.instance.getPlayerInterceptors().get(p).getChannel().pipeline().names())).append('\n'));
|
||||||
|
} catch (Exception e) {
|
||||||
|
writer.append("Error while generating bug report: ").append(e.getMessage()).append('\n');
|
||||||
|
Bukkit.getLogger().log(Level.SEVERE, "Error while generating bug report", e);
|
||||||
|
}
|
||||||
|
|
||||||
SWException.log("Techhider-Bug reported by " + sender.getName() + ": " + Arrays.toString(args), writer.toString());
|
SWException.log("Techhider-Bug reported by " + sender.getName() + ": " + Arrays.toString(args), writer.toString());
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -29,11 +29,15 @@ import de.steamwar.fightsystem.states.FightState;
|
|||||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||||
import de.steamwar.fightsystem.states.StateDependentTask;
|
import de.steamwar.fightsystem.states.StateDependentTask;
|
||||||
import de.steamwar.fightsystem.utils.ItemBuilder;
|
import de.steamwar.fightsystem.utils.ItemBuilder;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.inventory.EquipmentSlot;
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@@ -107,6 +111,19 @@ public class HotbarKit extends Kit {
|
|||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
int slot = player.getInventory().getHeldItemSlot();
|
int slot = player.getInventory().getHeldItemSlot();
|
||||||
|
click(player, slot, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onInventoryClick(InventoryClickEvent event) {
|
||||||
|
int slot = event.getSlot();
|
||||||
|
if (slot < 0 || slot >= HOTBAR_SIZE) return;
|
||||||
|
|
||||||
|
Player player = (Player) event.getWhoClicked();
|
||||||
|
click(player, slot, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void click(Player player, int slot, Cancellable event) {
|
||||||
Kit activeKit = activeKits.get(player);
|
Kit activeKit = activeKits.get(player);
|
||||||
if(!(activeKit instanceof HotbarKit) || PersonalKitCreator.inKitCreator(player) || activeKit.getInventory()[slot] == null)
|
if(!(activeKit instanceof HotbarKit) || PersonalKitCreator.inKitCreator(player) || activeKit.getInventory()[slot] == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -39,3 +39,13 @@ dependencies {
|
|||||||
implementation(project(":FightSystem:FightSystem_20"))
|
implementation(project(":FightSystem:FightSystem_20"))
|
||||||
implementation(project(":FightSystem:FightSystem_21"))
|
implementation(project(":FightSystem:FightSystem_21"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register<FightServer>("WarGear20") {
|
||||||
|
group = "run"
|
||||||
|
description = "Run a WarGear 1.20 Fight Server"
|
||||||
|
dependsOn(":SpigotCore:shadowJar")
|
||||||
|
dependsOn(":FightSystem:shadowJar")
|
||||||
|
template = "WarGear20"
|
||||||
|
worldName = "arenas/Pentraki"
|
||||||
|
config = "WarGear20.yml"
|
||||||
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class JumpAndRun extends BasicListener {
|
|||||||
|
|
||||||
int count = CLICKED_COUNT.getOrDefault(player, -1);
|
int count = CLICKED_COUNT.getOrDefault(player, -1);
|
||||||
if (count >= 0) {
|
if (count >= 0) {
|
||||||
if (count > 60) {
|
if (count > 20) {
|
||||||
toReset.add(player);
|
toReset.add(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -104,12 +104,18 @@ public class JumpAndRun extends BasicListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Vector point = points.get(index);
|
Vector point = points.get(index);
|
||||||
if (location.getY() < point.getY()) {
|
if (location.getY() < point.getY()) index = -2;
|
||||||
return;
|
if (location.toVector().distanceSquared(point) >= 17) index = -2;
|
||||||
}
|
if (index > 0 && index < points.size() - 1) {
|
||||||
if (location.toVector().distanceSquared(point) >= 12.25) {
|
Vector nextPoint = points.get(index + 1);
|
||||||
|
if (location.getY() >= nextPoint.getY() && location.toVector().distanceSquared(nextPoint) < 17) {
|
||||||
|
index = index + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (index == -2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURRENT_POS.put(event.getPlayer(), index);
|
CURRENT_POS.put(event.getPlayer(), index);
|
||||||
event.getPlayer().playSound(event.getPlayer().getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 0.4F, 1);
|
event.getPlayer().playSound(event.getPlayer().getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 0.4F, 1);
|
||||||
if (index < points.size() - 1) {
|
if (index < points.size() - 1) {
|
||||||
|
|||||||
@@ -71,6 +71,17 @@ public class TinyProtocol implements Listener {
|
|||||||
@Getter
|
@Getter
|
||||||
private final Map<Player, PacketInterceptor> playerInterceptors = new HashMap<>();
|
private final Map<Player, PacketInterceptor> playerInterceptors = new HashMap<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "TinyProtocol{" +
|
||||||
|
"plugin=" + plugin +
|
||||||
|
", connections=" + connections +
|
||||||
|
", closed=" + closed +
|
||||||
|
", packetFilters=" + packetFilters +
|
||||||
|
", playerInterceptors=" + playerInterceptors +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
private TinyProtocol(final Plugin plugin) {
|
private TinyProtocol(final Plugin plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.connections = networkManagers.get(getServerConnection(plugin));
|
this.connections = networkManagers.get(getServerConnection(plugin));
|
||||||
@@ -84,6 +95,7 @@ public class TinyProtocol implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onPlayerLogin(PlayerLoginEvent e) {
|
public void onPlayerLogin(PlayerLoginEvent e) {
|
||||||
|
plugin.getLogger().info("Creating PacketInterceptor for: " + e.getPlayer().getName() + " (" + closed + ")");
|
||||||
if(closed)
|
if(closed)
|
||||||
return;
|
return;
|
||||||
new PacketInterceptor(e.getPlayer());
|
new PacketInterceptor(e.getPlayer());
|
||||||
@@ -118,6 +130,8 @@ public class TinyProtocol implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final void close() {
|
public final void close() {
|
||||||
|
plugin.getLogger().log(Level.INFO, "Closing PacketInterceptor", new Exception("Stacktrace"));
|
||||||
|
|
||||||
if(closed)
|
if(closed)
|
||||||
return;
|
return;
|
||||||
closed = true;
|
closed = true;
|
||||||
@@ -157,6 +171,7 @@ public class TinyProtocol implements Listener {
|
|||||||
synchronized (playerInterceptors) {
|
synchronized (playerInterceptors) {
|
||||||
playerInterceptors.put(player, this);
|
playerInterceptors.put(player, this);
|
||||||
}
|
}
|
||||||
|
plugin.getLogger().info("Adding Techhider for: " + player.getName());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
channel.pipeline().addBefore("packet_handler", HANDLER_NAME, this);
|
channel.pipeline().addBefore("packet_handler", HANDLER_NAME, this);
|
||||||
|
|||||||
@@ -66,4 +66,12 @@ dependencies {
|
|||||||
implementation(libs.apolloprotos)
|
implementation(libs.apolloprotos)
|
||||||
|
|
||||||
implementation(libs.nbt)
|
implementation(libs.nbt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register<DevServer>("DevVelocity") {
|
||||||
|
group = "run"
|
||||||
|
description = "Run a Dev Velocity"
|
||||||
|
dependsOn(":VelocityCore:shadowJar")
|
||||||
|
dependsOn(":VelocityCore:Persistent:jar")
|
||||||
|
template = "DevVelocity"
|
||||||
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ public enum ServerVersion {
|
|||||||
PAPER_18("paper-1.18.2.jar", 15, ProtocolVersion.MINECRAFT_1_18_2),
|
PAPER_18("paper-1.18.2.jar", 15, ProtocolVersion.MINECRAFT_1_18_2),
|
||||||
PAPER_19("paper-1.19.3.jar", 19, ProtocolVersion.MINECRAFT_1_19_3),
|
PAPER_19("paper-1.19.3.jar", 19, ProtocolVersion.MINECRAFT_1_19_3),
|
||||||
PAPER_20("paper-1.20.1.jar", 20, ProtocolVersion.MINECRAFT_1_20),
|
PAPER_20("paper-1.20.1.jar", 20, ProtocolVersion.MINECRAFT_1_20),
|
||||||
|
DEVEL_21("paper-1.21.5.jar", 21, ProtocolVersion.MINECRAFT_1_21_5),
|
||||||
PAPER_21("paper-1.21.3.jar", 21, ProtocolVersion.MINECRAFT_1_21_2);
|
PAPER_21("paper-1.21.3.jar", 21, ProtocolVersion.MINECRAFT_1_21_2);
|
||||||
|
|
||||||
private static final Map<String, ServerVersion> chatMap = new HashMap<>();
|
private static final Map<String, ServerVersion> chatMap = new HashMap<>();
|
||||||
@@ -94,6 +95,10 @@ public enum ServerVersion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static ServerVersion get(int version) {
|
public static ServerVersion get(int version) {
|
||||||
|
if (version == 21) {
|
||||||
|
return DEVEL_21;
|
||||||
|
}
|
||||||
|
|
||||||
return versionMap.get(version);
|
return versionMap.get(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -149,6 +149,23 @@ fun Route.configureSchematic() {
|
|||||||
return@let SchematicFormat.SPONGE_V2
|
return@let SchematicFormat.SPONGE_V2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (version == SchematicFormat.SPONGE_V3) {
|
||||||
|
try {
|
||||||
|
val fawe = schem.getCompound("Metadata")
|
||||||
|
.getCompound("WorldEdit")
|
||||||
|
.getString("Version")
|
||||||
|
.value
|
||||||
|
|
||||||
|
if (fawe.equals("2.12.3-SNAPSHOT")) {
|
||||||
|
SWException.log("Schematic with Bugged Version Uploaded", """
|
||||||
|
Schematic=$schemName
|
||||||
|
User=${user.userName}
|
||||||
|
Id=${user.id}
|
||||||
|
""".trimIndent())
|
||||||
|
}
|
||||||
|
} catch (_: Exception) {}
|
||||||
|
}
|
||||||
|
|
||||||
val data = NodeData(node.id, version)
|
val data = NodeData(node.id, version)
|
||||||
data.saveFromStream(content.inputStream(), version)
|
data.saveFromStream(content.inputStream(), version)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,214 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2020 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/>.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
}
|
||||||
|
|
||||||
|
class DevServer extends DefaultTask {
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
String worldName = null
|
||||||
|
|
||||||
|
@Input
|
||||||
|
String template = null
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
String plugins = null
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
Integer port = null
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
String jar = null
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
Map<String, String> dParams = new HashMap<>()
|
||||||
|
|
||||||
|
DevServer() {
|
||||||
|
super()
|
||||||
|
doFirst {
|
||||||
|
List<Project> projects = []
|
||||||
|
projects.add(project)
|
||||||
|
while (projects.first.parent != null) {
|
||||||
|
projects.add(0, projects.first.parent)
|
||||||
|
}
|
||||||
|
|
||||||
|
def properties = new Properties()
|
||||||
|
projects.forEach {
|
||||||
|
def file = new File(it.projectDir, "steamwar.properties")
|
||||||
|
if (file.exists()) {
|
||||||
|
properties.load(new FileInputStream(file))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (worldName == null) worldName = properties.get("worldName")
|
||||||
|
host = properties.get("host")
|
||||||
|
|
||||||
|
if (host == null) {
|
||||||
|
throw new GradleException("Please supply the 'host' in a 'steamwar.properties' files either in this project dir or any parent project!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
doLast {
|
||||||
|
checkHasTemplate()
|
||||||
|
uploadDependencies()
|
||||||
|
startDevServer()
|
||||||
|
}
|
||||||
|
finalizedBy(new Finalizer())
|
||||||
|
}
|
||||||
|
|
||||||
|
@Internal
|
||||||
|
BufferedWriter processInput
|
||||||
|
|
||||||
|
@Internal
|
||||||
|
String host
|
||||||
|
|
||||||
|
@Internal
|
||||||
|
Boolean running = true
|
||||||
|
|
||||||
|
class Finalizer extends DefaultTask {
|
||||||
|
|
||||||
|
Finalizer() {
|
||||||
|
super()
|
||||||
|
doLast {
|
||||||
|
running = false
|
||||||
|
if (processInput != null) {
|
||||||
|
processInput.write(template.endsWith("Velocity") ? "end\n" : "stop\n")
|
||||||
|
processInput.flush()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void checkHasTemplate() {
|
||||||
|
def process = new ProcessBuilder("ssh", host, "-T", "ls $template").start()
|
||||||
|
process.waitFor()
|
||||||
|
if (new BufferedReader(new InputStreamReader(process.inputStream)).lines().count() < 4) {
|
||||||
|
throw new GradleException("Used template is not in your user.home directory of the given host $host")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void uploadDependencies() {
|
||||||
|
def base = plugins == null ? "$template/plugins" : plugins
|
||||||
|
println("Uploading to ~/$base")
|
||||||
|
this.dependsOn.forEach {
|
||||||
|
Project resolved
|
||||||
|
AbstractArchiveTask archiveTask
|
||||||
|
if (it instanceof String) {
|
||||||
|
resolved = project.findProject(it.substring(0, it.lastIndexOf(':')))
|
||||||
|
archiveTask = (AbstractArchiveTask) resolved.tasks.findByName(it.substring(it.lastIndexOf(':') + 1))
|
||||||
|
} else {
|
||||||
|
throw new GradleException("Illegal argument for uploading dependencies")
|
||||||
|
}
|
||||||
|
|
||||||
|
def archive = archiveTask.archiveFile.get().asFile
|
||||||
|
println("Uploading $archive")
|
||||||
|
new ProcessBuilder("ssh", host, "-T", "rm $base/${archive.name.replace("-all", "")}").start().waitFor()
|
||||||
|
new ProcessBuilder("scp", archive.absolutePath, "$host:~/$base/${archive.name.replace("-all", "")}").start().waitFor()
|
||||||
|
println("Uploaded $archive")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void startDevServer() {
|
||||||
|
def devPy = new StringBuilder().append("dev.py")
|
||||||
|
if (port != null) devPy.append(" --port $port")
|
||||||
|
if (worldName != null) devPy.append(" -w $template/$worldName")
|
||||||
|
if (plugins != null) devPy.append(" -p $plugins")
|
||||||
|
if (jar != null) devPy.append(" --jar $jar")
|
||||||
|
for (Map.Entry<String, String> dParam : dParams.entrySet()) {
|
||||||
|
devPy.append(" -D${dParam.key}=${dParam.value}")
|
||||||
|
}
|
||||||
|
devPy.append(" $template")
|
||||||
|
println("Starting $template with command ${devPy.toString()}")
|
||||||
|
|
||||||
|
def process = new ProcessBuilder("ssh", host, "-T", devPy.toString()).start()
|
||||||
|
def processOutput = new BufferedReader(new InputStreamReader(process.inputStream))
|
||||||
|
new Thread({
|
||||||
|
while (running) {
|
||||||
|
if (processOutput.ready()) {
|
||||||
|
println(processOutput.readLine())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start()
|
||||||
|
|
||||||
|
processInput = new BufferedWriter(new OutputStreamWriter(process.outputStream))
|
||||||
|
def input = new BufferedReader(new InputStreamReader(System.in))
|
||||||
|
new Thread({
|
||||||
|
while (running) {
|
||||||
|
def text = input.readLine()
|
||||||
|
if (text == null) break
|
||||||
|
processInput.write(text)
|
||||||
|
processInput.newLine()
|
||||||
|
processInput.flush()
|
||||||
|
}
|
||||||
|
}).start()
|
||||||
|
|
||||||
|
process.waitFor()
|
||||||
|
processInput = null
|
||||||
|
running = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class FightServer extends DevServer {
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
Integer checkSchemID = 0
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
Integer prepareSchemID = 0
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
Integer replay = 0
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
String config = null
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
// Property: fightID
|
||||||
|
Integer eventKampfID = 0
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
UUID blueLeader = null
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
UUID redLeader = null
|
||||||
|
|
||||||
|
FightServer() {
|
||||||
|
super()
|
||||||
|
doFirst {
|
||||||
|
if (checkSchemID != 0) dParams.put("checkSchemID", "$checkSchemID")
|
||||||
|
if (prepareSchemID != 0) dParams.put("prepareSchemID", "$prepareSchemID")
|
||||||
|
if (replay != 0) dParams.put("replay", "$replay")
|
||||||
|
if (eventKampfID != 0) dParams.put("fightID", "$eventKampfID")
|
||||||
|
if (blueLeader != null) dParams.put("blueLeader", blueLeader.toString())
|
||||||
|
if (redLeader != null) dParams.put("redLeader", redLeader.toString())
|
||||||
|
if (config != null) dParams.put("config", config)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user