Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7326ed4aa0 | |||
| 711920464a | |||
| e176b3bca8 | |||
| f81f05c3d0 | |||
| 0afb6ce06a | |||
| a938abde3f | |||
| ec9b0387c5 | |||
| 03c3d49659 | |||
| 8d9a77ab67 | |||
| fc2997e011 | |||
| 8eb5f5ddf2 | |||
| fd8f942014 | |||
| eab8826583 | |||
| bc0177df43 | |||
| 1dc78b8eb8 |
@@ -834,6 +834,10 @@ SKIN_NO_REGION = §7You are not in a region with a changealbe skin
|
||||
SKIN_ALREADY_EXISTS = §cThis skin already exists like this
|
||||
SKIN_MESSAGE = §7Skin created
|
||||
SKIN_MESSAGE_HOVER = §eClick to copy for YoyoNow and send
|
||||
# Blast Resistance
|
||||
BLASTRESISTANCE_HELP = §8/§eblastresistance §8-§7 Calculate min/max and average blast resistance of current clipboard
|
||||
BLASTRESISTANCE_NO_CLIPBOARD = §cYou currently do not have a clipboard to be used.
|
||||
BLASTRESISTANCE_RESULT = §7BlastResistance §8>>§7 Min§8: §e{0}§7 Max§8: §e{1}§7 Avg§8: §e{2}
|
||||
# Panzern
|
||||
PANZERN_HELP = §8/§epanzern §8[§7Block§8] §8[§7Slab§8] §8- §7Armor your WorldEdit selection
|
||||
PANZERN_PREPARE1 = §71. Check, if barrels reach until border of armor.
|
||||
|
||||
@@ -772,6 +772,10 @@ SKIN_NO_REGION = §7Du steht in keiner Region, welche mit einem Skin versehen we
|
||||
SKIN_ALREADY_EXISTS = §cDieser Skin existiert in der Form bereits
|
||||
SKIN_MESSAGE = §7Skin erstellt
|
||||
SKIN_MESSAGE_HOVER = §eKlicken zum kopieren für YoyoNow und an diesen senden
|
||||
# Blast Resistance
|
||||
BLASTRESISTANCE_HELP = §8/§eblastresistance §8-§7 Minimal-, Maximal- und durchschnittliche Sprengfestigkeit des aktuellen Inhalts der Zwischenablage berechnen
|
||||
BLASTRESISTANCE_NO_CLIPBOARD = §cDerzeit steht Ihnen keine Zwischenablage zur Verfügung.
|
||||
BLASTRESISTANCE_RESULT = §7BlastResistance §8>>§7 Min§8: §e{0}§7 Max§8: §e{1}§7 Avg§8: §e{2}
|
||||
# Panzern
|
||||
PANZERN_HELP = §8/§epanzern §8[§7Block§8] §8[§7Slab§8] §8- §7Panzer deine WorldEdit Auswahl
|
||||
PANZERN_PREPARE1 = §71. Gucke nochmal nach, ob Läufe auch bis zur Panzergrenze führen.
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2026 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.features.experimental;
|
||||
|
||||
import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.linkage.Linked;
|
||||
|
||||
@Linked
|
||||
public class ExperimentalCommand extends SWCommand {
|
||||
|
||||
public ExperimentalCommand() {
|
||||
super("experimental", "experiment");
|
||||
}
|
||||
}
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2026 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.features.experimental.redstone_engine;
|
||||
|
||||
import de.steamwar.bausystem.features.experimental.ExperimentalCommand;
|
||||
import de.steamwar.bausystem.region.Region;
|
||||
import de.steamwar.bausystem.utils.ScoreboardElement;
|
||||
import de.steamwar.command.AbstractSWCommand;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.linkage.Linked;
|
||||
import io.papermc.paper.configuration.WorldConfiguration;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.title.TitlePart;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@AbstractSWCommand.PartOf(ExperimentalCommand.class)
|
||||
@Linked
|
||||
public class RedstoneEngine extends SWCommand implements Listener, ScoreboardElement {
|
||||
|
||||
public RedstoneEngine() {
|
||||
super("");
|
||||
}
|
||||
|
||||
private WorldConfiguration.Misc getConfig() {
|
||||
return ((CraftWorld) Bukkit.getWorlds().get(0)).getHandle().paperConfig().misc;
|
||||
}
|
||||
|
||||
@Register("redstone")
|
||||
@Register("redstoneengine")
|
||||
public void setRedstoneEngine(Player player, @StaticValue("alternate_current") String __, WorldConfiguration.Misc.AlternateCurrentUpdateOrder updateOrder) {
|
||||
WorldConfiguration.Misc misc = getConfig();
|
||||
misc.redstoneImplementation = WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT;
|
||||
misc.alternateCurrentUpdateOrder = updateOrder;
|
||||
broadcastTitle(Bukkit.getOnlinePlayers());
|
||||
}
|
||||
|
||||
@Register("redstone")
|
||||
@Register("redstoneengine")
|
||||
public void setRedstoneEngine(Player player, WorldConfiguration.Misc.RedstoneImplementation implementation) {
|
||||
getConfig().redstoneImplementation = implementation;
|
||||
broadcastTitle(Bukkit.getOnlinePlayers());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
WorldConfiguration.Misc misc = getConfig();
|
||||
if (misc.redstoneImplementation != WorldConfiguration.Misc.RedstoneImplementation.EIGENCRAFT) {
|
||||
broadcastTitle(List.of(event.getPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
private void broadcastTitle(Collection<? extends Player> players) {
|
||||
WorldConfiguration.Misc misc = getConfig();
|
||||
Component title = switch (misc.redstoneImplementation) {
|
||||
case VANILLA -> Component.text("⚠").color(NamedTextColor.RED).append(Component.text(" Redstone: Vanilla ").color(NamedTextColor.WHITE)).append(Component.text("⚠").color(NamedTextColor.RED));
|
||||
case EIGENCRAFT -> Component.text("Redstone: Eigencraft");
|
||||
case ALTERNATE_CURRENT -> Component.text("⚠").color(NamedTextColor.RED).append(Component.text(" Redstone: AC ").color(NamedTextColor.WHITE)).append(Component.text("⚠").color(NamedTextColor.RED));
|
||||
};
|
||||
Component subtitle;
|
||||
if (misc.redstoneImplementation != WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) {
|
||||
subtitle = Component.text().build();
|
||||
} else {
|
||||
subtitle = switch (misc.alternateCurrentUpdateOrder) {
|
||||
case VERTICAL_FIRST_INWARD -> Component.text("Y first inwards"); // Y before XZ
|
||||
case VERTICAL_FIRST_OUTWARD -> Component.text("Y first outwards"); // XZ before Y
|
||||
case HORIZONTAL_FIRST_INWARD -> Component.text("XZ first inwards"); // Y before XZ
|
||||
case HORIZONTAL_FIRST_OUTWARD -> Component.text("XZ first outwards"); // XZ before Y
|
||||
};
|
||||
}
|
||||
players.forEach(player -> {
|
||||
player.sendTitlePart(TitlePart.TITLE, title);
|
||||
player.sendTitlePart(TitlePart.SUBTITLE, subtitle);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScoreboardGroup getGroup() {
|
||||
return ScoreboardGroup.FOOTER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int order() {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String get(Region region, Player p) {
|
||||
WorldConfiguration.Misc misc = getConfig();
|
||||
switch (misc.redstoneImplementation) {
|
||||
case ALTERNATE_CURRENT:
|
||||
switch (misc.alternateCurrentUpdateOrder) {
|
||||
case VERTICAL_FIRST_INWARD:
|
||||
return "§eRedstone§8: §cAC §8(§7Y in§8)";
|
||||
case VERTICAL_FIRST_OUTWARD:
|
||||
return "§eRedstone§8: §cAC §8(§7Y out§8)";
|
||||
case HORIZONTAL_FIRST_INWARD:
|
||||
return "§eRedstone§8: §cAC §8(§7XZ in§8)";
|
||||
case HORIZONTAL_FIRST_OUTWARD:
|
||||
return "§eRedstone§8: §cAC §8(§7XZ out§8)";
|
||||
}
|
||||
return "§eRedstone§8: §cAC";
|
||||
case EIGENCRAFT:
|
||||
return null;
|
||||
case VANILLA:
|
||||
default:
|
||||
return "§eRedstone§8: §cVanilla";
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -172,7 +172,7 @@ public class SimulatorCursor implements Listener {
|
||||
|
||||
public static void calcCursor(Player player) {
|
||||
if (!Permission.BUILD.hasPermission(player) || !hasSimulatorItem(player)) {
|
||||
if (removeCursor(player) || SimulatorWatcher.show(null, player)) {
|
||||
if (removeCursor(player) | SimulatorWatcher.show(null, player)) {
|
||||
SWUtils.sendToActionbar(player, "");
|
||||
}
|
||||
return;
|
||||
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2026 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.features.slaves.blastresistance;
|
||||
|
||||
import com.google.common.util.concurrent.AtomicDouble;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.linkage.Linked;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@Linked
|
||||
public class BlastResistanceCommand extends SWCommand {
|
||||
|
||||
public BlastResistanceCommand() {
|
||||
super("blastresistance");
|
||||
}
|
||||
|
||||
@Register(description = "BLASTRESISTANCE_HELP")
|
||||
public void command(@Validator Player player) {
|
||||
LocalSession localSession = WorldEdit.getInstance().getSessionManager().get(BukkitAdapter.adapt(player));
|
||||
Clipboard clipboard;
|
||||
try {
|
||||
clipboard = localSession.getClipboard().getClipboards().getFirst();
|
||||
} catch (WorldEditException e) {
|
||||
BauSystem.MESSAGE.send("BLASTRESISTANCE_NO_CLIPBOARD", player);
|
||||
return;
|
||||
}
|
||||
|
||||
AtomicDouble min = new AtomicDouble(0);
|
||||
AtomicDouble max = new AtomicDouble(0);
|
||||
AtomicDouble sum = new AtomicDouble(0);
|
||||
AtomicInteger count = new AtomicInteger(0);
|
||||
clipboard.forEach(blockVector3 -> {
|
||||
BlockState blockState = clipboard.getBlock(blockVector3);
|
||||
Material material = BukkitAdapter.adapt(blockState).getMaterial();
|
||||
if (material == Material.WATER || material == Material.LAVA) return;
|
||||
double blastResistance = BukkitAdapter.adapt(blockState).getMaterial().getBlastResistance();
|
||||
min.set(Math.min(min.get(), blastResistance));
|
||||
max.set(Math.max(max.get(), blastResistance));
|
||||
sum.addAndGet(blastResistance);
|
||||
count.getAndIncrement();
|
||||
});
|
||||
|
||||
BauSystem.MESSAGE.send("BLASTRESISTANCE_RESULT", player, min.get(), max.get(), sum.get() / count.get());
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.record.GlobalRecorder;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Registry;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
|
||||
@@ -88,7 +89,7 @@ public class Fight {
|
||||
}
|
||||
|
||||
public static void playSound(Sound sound, float volume, float pitch) {
|
||||
GlobalRecorder.getInstance().soundAtPlayer(sound.name(), volume, pitch);
|
||||
GlobalRecorder.getInstance().soundAtPlayer(Registry.SOUNDS.getKey(sound).getKey(), volume, pitch);
|
||||
//volume: max. 100, pitch: max. 2
|
||||
Bukkit.getServer().getOnlinePlayers().forEach(player -> player.playSound(player, sound, volume, pitch));
|
||||
}
|
||||
|
||||
+8
-4
@@ -510,11 +510,13 @@ public class PacketProcessor implements Listener {
|
||||
float volume = source.readFloat();
|
||||
float pitch = source.readFloat();
|
||||
|
||||
Sound sound = Sound.valueOf(soundName);
|
||||
Sound sound = Registry.SOUNDS.get(NamespacedKey.minecraft(soundName));
|
||||
if (sound == null) sound = Sound.valueOf(soundName); // TODO: Remove in 26.x because of no longer needed backwards compatibility
|
||||
Sound finalSound = sound;
|
||||
|
||||
execSync(() -> {
|
||||
Location location = new Location(Config.world, x, y, z);
|
||||
location.getWorld().playSound(location, sound, SoundCategory.valueOf(soundCategory), volume, pitch);
|
||||
location.getWorld().playSound(location, finalSound, SoundCategory.valueOf(soundCategory), volume, pitch);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -524,9 +526,11 @@ public class PacketProcessor implements Listener {
|
||||
float volume = source.readFloat();
|
||||
float pitch = source.readFloat();
|
||||
|
||||
Sound sound = Sound.valueOf(soundName);
|
||||
Sound sound = Registry.SOUNDS.get(NamespacedKey.minecraft(soundName));
|
||||
if (sound == null) sound = Sound.valueOf(soundName); // TODO: Remove in 26.x because of no longer needed backwards compatibility
|
||||
Sound finalSound = sound;
|
||||
|
||||
execSync(() -> Fight.playSound(sound, volume, pitch));
|
||||
execSync(() -> Fight.playSound(finalSound, volume, pitch));
|
||||
}
|
||||
|
||||
private void pasteSchem(FightTeam team) throws IOException {
|
||||
|
||||
@@ -33,6 +33,7 @@ import de.steamwar.sql.SchematicNode;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Registry;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.craftbukkit.block.CraftBlockState;
|
||||
import org.bukkit.entity.Entity;
|
||||
@@ -238,7 +239,7 @@ public interface Recorder {
|
||||
}
|
||||
|
||||
default void sound(int x, int y, int z, SWSound soundType, String soundCategory, float volume, float pitch) {
|
||||
write(0x32, x, y, z, soundType.getSound().name(), soundCategory, volume, pitch);
|
||||
write(0x32, x, y, z, Registry.SOUNDS.getKey(soundType.getSound()).getKey(), soundCategory, volume, pitch);
|
||||
}
|
||||
|
||||
default void soundAtPlayer(String soundType, float volume, float pitch) {
|
||||
|
||||
@@ -37,8 +37,8 @@ public class AutoChecker {
|
||||
public static final AutoChecker impl = new AutoChecker();
|
||||
|
||||
public AutoCheckerResult check(Clipboard clipboard, GameModeConfig<Material, String> type) {
|
||||
return AutoCheckerResult.builder().type(type).height(clipboard.getDimensions().getBlockY()).width(clipboard.getDimensions().getBlockX())
|
||||
.depth(clipboard.getDimensions().getBlockZ()).blockScanResult(scan(clipboard, type))
|
||||
return AutoCheckerResult.builder().type(type).height(clipboard.getDimensions().x()).width(clipboard.getDimensions().x())
|
||||
.depth(clipboard.getDimensions().z()).blockScanResult(scan(clipboard, type))
|
||||
.entities(clipboard.getEntities().stream().map(Entity::getLocation)
|
||||
.map(blockVector3 -> new BlockPos(blockVector3.getBlockX(), blockVector3.getBlockY(), blockVector3.getBlockZ()))
|
||||
.collect(Collectors.toList()))
|
||||
@@ -46,19 +46,19 @@ public class AutoChecker {
|
||||
}
|
||||
|
||||
public AutoCheckerResult sizeCheck(Clipboard clipboard, GameModeConfig<Material, String> type) {
|
||||
return AutoCheckerResult.builder().type(type).height(clipboard.getDimensions().getBlockY()).width(clipboard.getDimensions().getBlockX())
|
||||
.depth(clipboard.getDimensions().getBlockZ()).build();
|
||||
return AutoCheckerResult.builder().type(type).height(clipboard.getDimensions().y()).width(clipboard.getDimensions().x())
|
||||
.depth(clipboard.getDimensions().z()).build();
|
||||
}
|
||||
|
||||
public AutoChecker.BlockScanResult scan(Clipboard clipboard, GameModeConfig<Material, String> type) {
|
||||
AutoChecker.BlockScanResult result = new AutoChecker.BlockScanResult();
|
||||
BlockVector3 min = clipboard.getMinimumPoint();
|
||||
BlockVector3 max = clipboard.getMaximumPoint();
|
||||
for (int x = min.getBlockX(); x <= max.getBlockX(); x++) {
|
||||
for (int y = min.getBlockY(); y <= max.getBlockY(); y++) {
|
||||
for (int z = min.getBlockZ(); z <= max.getBlockZ(); z++) {
|
||||
for (int x = min.x(); x <= max.x(); x++) {
|
||||
for (int y = min.y(); y <= max.y(); y++) {
|
||||
for (int z = min.z(); z <= max.z(); z++) {
|
||||
final BaseBlock block = clipboard.getFullBlock(BlockVector3.at(x, y, z));
|
||||
final Material material = Material.matchMaterial(block.getBlockType().getId());
|
||||
final Material material = Material.matchMaterial(block.getBlockType().id());
|
||||
if (material == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class AutoChecker {
|
||||
checkInventory(result, block, material, new BlockPos(x, y, z), type);
|
||||
}
|
||||
|
||||
if (x == min.getBlockX() || x == max.getBlockX() || y == max.getBlockY() || z == min.getBlockZ() || z == max.getBlockZ()) {
|
||||
if (x == min.x() || x == max.x() || y == max.y() || z == min.z() || z == max.z()) {
|
||||
result.getDesignBlocks().computeIfAbsent(material, m -> new ArrayList<>()).add(new BlockPos(x, y, z));
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -245,12 +245,12 @@ public class SchematicCommand extends SWCommand {
|
||||
BlockState replaceType = Objects.requireNonNull(toReplace.contains(Material.END_STONE) ? BlockTypes.IRON_BLOCK : BlockTypes.END_STONE).getDefaultState();
|
||||
BlockVector3 min = clipboard.getMinimumPoint();
|
||||
BlockVector3 max = clipboard.getMaximumPoint();
|
||||
for (int i = min.getBlockX(); i <= max.getBlockX(); i++) {
|
||||
for (int j = min.getBlockY(); j <= max.getBlockY(); j++) {
|
||||
for (int k = min.getBlockZ(); k <= max.getBlockZ(); k++) {
|
||||
for (int i = min.x(); i <= max.x(); i++) {
|
||||
for (int j = min.y(); j <= max.y(); j++) {
|
||||
for (int k = min.z(); k <= max.z(); k++) {
|
||||
BlockVector3 vector = BlockVector3.at(i, j, k);
|
||||
BaseBlock block = clipboard.getFullBlock(vector);
|
||||
if (toReplace.contains(Material.matchMaterial(block.getBlockType().getId()))) {
|
||||
if (toReplace.contains(Material.matchMaterial(block.getBlockType().id()))) {
|
||||
clipboard.setBlock(vector, replaceType.toBaseBlock());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,13 +42,6 @@ public class ReplayCommand extends SWCommand {
|
||||
super("replay");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericCommand(PlayerChatter sender) {
|
||||
sender.system("REPLAY_UNAVAILABLE");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
@Register
|
||||
public void genericCommand(PlayerChatter sender, int replayId, @StaticValue(value = {"", "-a"}, allowISE = true) @OptionalValue("") boolean isAdmin, @OptionalValue("") String optionalMap) {
|
||||
Fight fight = Fight.getById(replayId);
|
||||
@@ -64,6 +57,9 @@ public class ReplayCommand extends SWCommand {
|
||||
@Register
|
||||
public void genericCommand(PlayerChatter sender, @OptionalValue("") String optionalMap) {
|
||||
if (PunishmentCommand.isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer)) return;
|
||||
if (!sender.user().hasPerm(UserPerm.TEAM)) return;
|
||||
|
||||
|
||||
|
||||
new SWStreamInv<>(sender, new Message("REPLAY_TITLE"), (click, fight) -> {
|
||||
startReplay(sender, click.isShiftClick(), optionalMap, fight);
|
||||
@@ -72,6 +68,7 @@ public class ReplayCommand extends SWCommand {
|
||||
|
||||
private void startReplay(PlayerChatter sender, boolean isAdmin, String optionalMap, Fight fight) {
|
||||
if (PunishmentCommand.isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer)) return;
|
||||
if (!sender.user().hasPerm(UserPerm.TEAM)) return;
|
||||
|
||||
GameModeConfig<String, String> mode = ArenaMode.getBySchemType(fight.getSchemType());
|
||||
ServerStarter starter = new ServerStarter().replay(fight.getFightID()).blueLeader(sender.getPlayer());
|
||||
@@ -116,5 +113,5 @@ public class ReplayCommand extends SWCommand {
|
||||
private Message parseLeader(SteamwarUser leader, int players, boolean winner) {
|
||||
return new Message("REPLAY_" + (players > 1 ? "" : "SOLO_") + (winner ? "WINNER" : "LOSER"), leader.getUserName(), players - 1);
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class DevServer extends DefaultTask {
|
||||
|
||||
@Input
|
||||
@Optional
|
||||
String worldName = null
|
||||
boolean debug = false
|
||||
|
||||
@Input
|
||||
String template = null
|
||||
@@ -84,10 +84,13 @@ class DevServer extends DefaultTask {
|
||||
}
|
||||
}
|
||||
|
||||
if (worldName == null) worldName = properties.get("worldName")
|
||||
worldName = properties.get("worldName")
|
||||
host = properties.get("host")
|
||||
debugPort = new Random().nextInt(5001, 10000)
|
||||
|
||||
if (worldName == null) {
|
||||
throw new GradleException("Please supply the 'worldName' in a 'steamwar.properties' files either in this project dir or any parent project!")
|
||||
}
|
||||
if (host == null) {
|
||||
throw new GradleException("Please supply the 'host' in a 'steamwar.properties' files either in this project dir or any parent project!")
|
||||
}
|
||||
@@ -95,7 +98,7 @@ class DevServer extends DefaultTask {
|
||||
doLast {
|
||||
setupTemplate(template)
|
||||
uploadDependencies()
|
||||
startDebugPort()
|
||||
if (debug) startDebugPort()
|
||||
startDevServer()
|
||||
}
|
||||
finalizedBy(new Finalizer())
|
||||
@@ -113,6 +116,9 @@ class DevServer extends DefaultTask {
|
||||
@Internal
|
||||
Boolean running = true
|
||||
|
||||
@Internal
|
||||
String worldName = null
|
||||
|
||||
class Finalizer extends DefaultTask {
|
||||
|
||||
Finalizer() {
|
||||
@@ -241,7 +247,7 @@ class DevServer extends DefaultTask {
|
||||
devPy.append(" -D${dParam.key}=${dParam.value}")
|
||||
}
|
||||
devPy.append(" $template")
|
||||
devPy.append(" -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:$debugPort")
|
||||
if (debug) devPy.append(" -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:$debugPort")
|
||||
if (jvmArgs != null) devPy.append(" $jvmArgs")
|
||||
println("Starting $template with command ${devPy.toString()}")
|
||||
|
||||
@@ -286,7 +292,7 @@ class VelocityServer extends DevServer {
|
||||
VelocityServer() {
|
||||
super()
|
||||
doFirst {
|
||||
if(packetDecodeLogging) dParams.put("velocity.packet-decode-logging", "true")
|
||||
if (packetDecodeLogging) dParams.put("velocity.packet-decode-logging", "true")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user