SteamWar/BauSystem2.0
Archiviert
12
0

Initial split and trying stuff
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed

Dieser Commit ist enthalten in:
yoyosource 2024-05-18 13:53:27 +02:00
Ursprung 30ddf671ae
Commit cbdcaa7e69
7 geänderte Dateien mit 297 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -0,0 +1,63 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2021 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 {
id 'base'
id 'java'
}
group 'steamwar'
version '1.0'
compileJava.options.encoding = 'UTF-8'
sourceCompatibility = 17
targetCompatibility = 17
sourceSets {
main {
java {
srcDirs = ['src/', 'build/generated/sources/annotationProcessor/java/main/']
}
resources {
srcDirs = ['src/']
exclude '**/*.java', '**/*.kt'
}
}
}
dependencies {
implementation project(":BauSystem_PluginBase")
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
compileOnly 'org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT'
// compileOnly 'com.mojang:authlib:1.5.25'
// compileOnly 'io.netty:netty-all:4.1.68.Final'
compileOnly swdep('Spigot-1.20')
compileOnly swdep('SpigotCore')
annotationProcessor swdep('SpigotCore')
compileOnly swdep('FastAsyncWorldEdit-1.18')
// compileOnly swdep('AxiomPaper')
// implementation 'org.luaj:luaj-jse:3.0.1'
}

Datei anzeigen

@ -0,0 +1,34 @@
#
# This file is a part of the SteamWar software.
#
# Copyright (C) 2021 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/>.
#
# General (always needed!)
PREFIX = §eBau§8System§8»
TIME = HH:mm:ss
COMMAND_HELP_HEAD = §7---=== (§e{0}§7) ===---
# Permissions (always needed!)
NO_PERMISSION = You are not allowed to use that here
# BIND
BIND_COMMAND_HELP = §8/§ebind §8[§7Command§8] §8-§e Bind a command to item interaction
BIND_COMMAND_ERROR = §cInvalid or unknown command
BIND_MESSAGE_UNBINDABLE = §cCould not bind command to item
BIND_MESSAGE_BIND = §7Bound command §e{0} §7to item
BIND_MESSAGE_UNBIND = §7Unbound command
BIND_ITEM_LORE = §eCommand§8:§7 {0}

Datei anzeigen

@ -0,0 +1,33 @@
#
# This file is a part of the SteamWar software.
#
# Copyright (C) 2021 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/>.
#
# General (always needed!)
PREFIX = §eBau§8System§8»
TIME = HH:mm:ss
COMMAND_HELP_HEAD = §7---=== (§e{0}§7) ===---
# Permissions (always needed!)
NO_PERMISSION = Du darfst dies hier nicht nutzen
# BIND
BIND_COMMAND_HELP = §8/§ebind §8[§7Command§8] §8-§e Binde ein Befehl auf die Item Interaktion
BIND_COMMAND_ERROR = §cFalscher oder unbekannter Befehl
BIND_MESSAGE_UNBINDABLE = §cBefehl konnte nicht ans Item gebunden werden
BIND_MESSAGE_BIND = §7Befehl §e{0} §7ans Item gebunden
BIND_MESSAGE_UNBIND = §7Befehl vom Item entfernt

Datei anzeigen

@ -1,14 +1,32 @@
package de.steamwar.bausystem.features.util; /*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 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.itemutilities;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.event.platform.CommandEvent; import com.sk89q.worldedit.event.platform.CommandEvent;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.BauSystemPlugin;
import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.SWUtils; import de.steamwar.bausystem.SWUtils;
import de.steamwar.bausystem.features.script.ScriptCommand;
import de.steamwar.bausystem.features.script.ScriptRunner; import de.steamwar.bausystem.features.script.ScriptRunner;
import de.steamwar.bausystem.features.world.WorldEditListener; import de.steamwar.bausystem.features.world.WorldEditListener;
import de.steamwar.bausystem.utils.WorldEditUtils; import de.steamwar.bausystem.utils.WorldEditUtils;
@ -28,10 +46,12 @@ import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType; import org.bukkit.persistence.PersistentDataType;
import org.luaj.vm2.LuaValue;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.*; import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -73,8 +93,8 @@ public class BindCommand extends SWCommand implements Listener {
super("bind"); super("bind");
} }
@Register(description = "OTHER_BIND_HELP") @Register(description = "BIND_COMMAND_HELP")
public void bind(@Validator Player player, @Mapper("command") @ErrorMessage("OTHER_BIND_ERROR") String... command) { public void bind(@Validator Player player, @Mapper("command") @ErrorMessage("BIND_COMMAND_ERROR") String... command) {
bindInternal(player, command); bindInternal(player, command);
} }
@ -82,19 +102,19 @@ public class BindCommand extends SWCommand implements Listener {
ItemStack item = player.getInventory().getItemInMainHand(); ItemStack item = player.getInventory().getItemInMainHand();
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
if (meta == null) { if (meta == null) {
BauSystem.MESSAGE.send("OTHER_BIND_UNBINDABLE", player); BauSystemPlugin.MESSAGE.send("BIND_MESSAGE_UNBINDABLE", player);
return; return;
} }
if (command.length != 0) { if (command.length != 0) {
String commandText = String.join(" ", command); String commandText = String.join(" ", command);
meta.getPersistentDataContainer().set(KEY, PersistentDataType.STRING, commandText); meta.getPersistentDataContainer().set(KEY, PersistentDataType.STRING, commandText);
meta.setDisplayName(BauSystem.MESSAGE.parse("OTHER_BIND_LORE", player, commandText)); meta.setDisplayName(BauSystemPlugin.MESSAGE.parse("BIND_ITEM_LORE", player, commandText));
BauSystem.MESSAGE.send("OTHER_BIND_MESSAGE_BIND", player, commandText); BauSystemPlugin.MESSAGE.send("BIND_MESSAGE_BIND", player, commandText);
} else { } else {
meta.getPersistentDataContainer().remove(KEY); meta.getPersistentDataContainer().remove(KEY);
meta.setDisplayName(null); meta.setDisplayName(null);
BauSystem.MESSAGE.send("OTHER_BIND_MESSAGE_UNBIND", player); BauSystemPlugin.MESSAGE.send("BIND_MESSAGE_UNBIND", player);
} }
item.setItemMeta(meta); item.setItemMeta(meta);
player.getInventory().setItemInMainHand(item); player.getInventory().setItemInMainHand(item);
@ -116,7 +136,7 @@ public class BindCommand extends SWCommand implements Listener {
} }
event.setCancelled(true); event.setCancelled(true);
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> { Bukkit.getScheduler().runTaskLater(BauSystemPlugin.getInstance(), () -> {
PlayerCommandPreprocessEvent preprocessEvent = new PlayerCommandPreprocessEvent(event.getPlayer(), "/" + command); PlayerCommandPreprocessEvent preprocessEvent = new PlayerCommandPreprocessEvent(event.getPlayer(), "/" + command);
Bukkit.getPluginManager().callEvent(preprocessEvent); Bukkit.getPluginManager().callEvent(preprocessEvent);
if (preprocessEvent.isCancelled()) return; if (preprocessEvent.isCancelled()) return;

Datei anzeigen

@ -0,0 +1,12 @@
name: BauSystem_ItemUtilities
authors: [ Lixfel, YoyoNow, Chaoscaot, Zeanon, D4rkr34lm ]
version: "2.0"
depend: [ WorldEdit, SpigotCore ]
softdepend: [ ]
load: POSTWORLD
main: de.steamwar.bausystem.BauSystemPlugin
api-version: "1.13"
website: "https://steamwar.de"
description: "So unseriös wie wir sind: BauSystem nur besser."
commands:

Datei anzeigen

@ -0,0 +1,60 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2021 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 {
id 'base'
id 'java'
}
group 'steamwar'
version '1.0'
compileJava.options.encoding = 'UTF-8'
sourceCompatibility = 17
targetCompatibility = 17
sourceSets {
main {
java {
srcDirs = ['src/', 'build/generated/sources/annotationProcessor/java/main/']
}
resources {
srcDirs = ['src/']
exclude '**/*.java', '**/*.kt'
}
}
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
compileOnly 'org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT'
// compileOnly 'com.mojang:authlib:1.5.25'
// compileOnly 'io.netty:netty-all:4.1.68.Final'
// compileOnly swdep('Spigot-1.20')
compileOnly swdep('SpigotCore')
// compileOnly swdep('FastAsyncWorldEdit-1.18')
// compileOnly swdep('AxiomPaper')
// implementation 'org.luaj:luaj-jse:3.0.1'
}

Datei anzeigen

@ -0,0 +1,63 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 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;
import de.steamwar.message.Message;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import java.lang.reflect.Method;
import java.util.logging.Level;
public class BauSystemPlugin extends JavaPlugin {
public static Message MESSAGE;
@Getter
public static BauSystemPlugin instance;
@Override
public void onEnable() {
MESSAGE = new Message("BauSystem", getClassLoader());
instance = this;
try {
Class<?> clazz = Class.forName("de.steamwar.bausystem.LinkageUtils");
Method method = clazz.getMethod("link");
method.invoke(null);
} catch (Exception e) {
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
Bukkit.shutdown();
System.exit(1);
}
}
@Override
public void onDisable() {
try {
Class<?> clazz = Class.forName("de.steamwar.bausystem.LinkageUtils");
Method method = clazz.getMethod("unlink");
method.invoke(null);
} catch (Exception e) {
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
}
}
}