Archiviert
13
0

Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-09-15 21:06:15 +02:00
Commit 1b099d85e7
6 geänderte Dateien mit 104 neuen und 58 gelöschten Zeilen

Datei anzeigen

@ -3,37 +3,12 @@ plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '5.0.0'
}
ext.swdep = { s ->
if (file("${rootDir}/lib/${s}.jar").exists()) {
return files("${rootDir}/lib/${s}.jar")
} else {
if (s.contains("-")) {
return "de.steamwar:${s.toLowerCase().replace('-', ':')}"
} else {
return "de.steamwar:${s.toLowerCase()}:RELEASE"
}
}
id 'de.steamwar.gradle' version 'RELEASE'
}
group = 'de.steamwar'
version = ''
Properties steamwarProperties = new Properties()
if (file("steamwar.properties").exists()) {
steamwarProperties.load(file("steamwar.properties").newDataInputStream())
}
ext {
buildName = 'Builder'
artifactName = 'Builder'
uberJarName = "${buildName}-all.jar"
jarName = "${artifactName}.jar"
libs = "${buildDir}/libs"
}
compileJava.options.encoding = 'UTF-8'
sourceCompatibility = '1.8'
@ -57,40 +32,14 @@ repositories {
maven {
url = uri('https://hub.spigotmc.org/nexus/content/repositories/snapshots/')
}
maven {
url = uri('https://steamwar.de/maven')
credentials {
username = steamwarProperties.getProperty("maven.username", "")
password = steamwarProperties.getProperty("maven.password", "")
}
}
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
compileOnly swdep("SpigotCore")
compileOnly swdep("WorldEdit-1.15")
}
task buildProject {
description 'Build this project'
group "Steamwar"
dependsOn build
steamwar {
finalize = false
}
task finalizeProject {
description 'Finalize this project'
group "Steamwar"
doLast {
if ("${buildDir}" == null) {
return
}
delete fileTree("${libs}").matching {
exclude("${uberJarName}")
}
file(libs + "/" + uberJarName).renameTo(file(libs + "/" + jarName))
}
}
// build.finalizedBy(finalizeProject)

Datei anzeigen

@ -1 +1,10 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven {
url = uri('https://steamwar.de/maven/')
}
}
}
rootProject.name = 'Builder'

Datei anzeigen

@ -44,6 +44,7 @@ public final class Builder extends JavaPlugin {
new GamemodeCommand();
new SpeedCommand();
new FreezeCommand();
new ArenaconfigCommand();
Bukkit.getPluginManager().registerEvents(new PlayerChange(), this);
Bukkit.getPluginManager().registerEvents(new FreezeListener(), this);

Datei anzeigen

@ -2,7 +2,7 @@
#
# This file is a part of the SteamWar software.
#
# Copyright (C) 2021 SteamWar.de-Serverteam
# 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
@ -55,4 +55,7 @@ MATERIAL_OCCLUDING=
MATERIAL_INTERACT-ABLE=§8- §eInterargierbarer Block
MATERIAL_FLAMMABLE=§8- §eFlammbarer Block
MATERIAL_BURNABLE=§8- §eBrennbarer Block
MATERIAL_WATERLOGGABLE=§8- §eWasserspeicherbarer Block
MATERIAL_WATERLOGGABLE=§8- §eWasserspeicherbarer Block
ARENACONFIG_HELP=§8/§7arenaconfig §8[§eUntere Spielergrenze§8] (WE-Pos1: Kleinste blaue Schemkoordinate, WE-Pos2: Kleinste Rote Schemkoordinate)
ARENACONFIG_SELECTION=§cKeine WE-SAuswahl,

Datei anzeigen

@ -0,0 +1,84 @@
/*
* 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.teamserver.command;
import com.sk89q.worldedit.IncompleteRegionException;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.RegionSelector;
import de.steamwar.command.SWCommand;
import de.steamwar.teamserver.Builder;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import java.io.File;
import java.io.IOException;
public class ArenaconfigCommand extends SWCommand {
public ArenaconfigCommand() {
super("arenaconfig");
}
@Register
public void genericHelp(Player p, String... args) {
Builder.MESSAGE.send("ARENACONFIG_HELP", p);
}
@Register
public void config(Player p, int lowerPlayerBorder) throws IOException {
CuboidRegion region = getSelection(p);
if(region == null)
return;
BlockVector3 pos1 = region.getPos1();
BlockVector3 pos2 = region.getPos2();
File file = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "config.yml");
YamlConfiguration config = YamlConfiguration.loadConfiguration(file);
config.set("UnderBorder", lowerPlayerBorder);
config.set("BlueCorner.x", pos1.getX());
config.set("BlueCorner.y", pos1.getY());
config.set("BlueCorner.z", pos1.getZ());
config.set("BlueToRed.x", pos2.getX() - pos1.getX());
config.set("BlueToRed.y", pos2.getY() - pos1.getY());
config.set("BlueToRed.z", pos2.getZ() - pos1.getZ());
config.save(file);
}
private CuboidRegion getSelection(Player player) {
RegionSelector regionSelector = WorldEdit.getInstance()
.getSessionManager()
.get(BukkitAdapter.adapt(player))
.getRegionSelector(BukkitAdapter.adapt(player.getWorld()));
try {
return (CuboidRegion)regionSelector.getRegion();
} catch (IncompleteRegionException e) {
Builder.MESSAGE.send("ARENACONFIG_SELECTION", player);
return null;
}
}
}

Datei anzeigen

@ -3,6 +3,6 @@ version: 1.0
main: de.steamwar.teamserver.Builder
api-version: 1.15
prefix: Teamserver
depend: [ SpigotCore ]
depend: [SpigotCore, WorldEdit]
authors: [ YoyoNow ]
description: Teamserver