From 8eb4a70cc1474efd7097caea7981d8f2134efd61 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 11 Jul 2024 18:13:39 +0200 Subject: [PATCH] Move some things around --- .../build.gradle | 43 ++++++++++++------- .../bausystem/bauinfo}/BauInfoBauGuiItem.java | 28 ++++++------ .../bausystem/bauinfo}/InfoCommand.java | 21 ++++++++- .../itemframe}/ItemFrameListener.java | 26 +++++------ .../bausystem/material}/MaterialCommand.java | 26 +++++------ .../bausystem/material}/MaterialLazyInit.java | 26 +++++------ .../bausystem/signeditor}/SignEditFrom20.java | 4 +- .../signeditor}/SignEditUntil19.java | 26 +++++------ .../bausystem/signeditor/SignListener.java | 41 ++++++++++++++++++ .../src/de/steamwar/bausystem/Permission.java | 1 + .../de/steamwar/bausystem/region/Flag.java | 2 +- .../bausystem/region/flags/ChangedMode.java | 4 +- 12 files changed, 160 insertions(+), 88 deletions(-) rename BauSystem_Main/src/de/steamwar/bausystem/features/world/SignListener.java => BauSystem_Base/build.gradle (56%) rename {BauSystem_Main/src/de/steamwar/bausystem/features/bau => BauSystem_Base/src/de/steamwar/bausystem/bauinfo}/BauInfoBauGuiItem.java (70%) rename {BauSystem_Main/src/de/steamwar/bausystem/features/bau => BauSystem_Base/src/de/steamwar/bausystem/bauinfo}/InfoCommand.java (82%) rename {BauSystem_Main/src/de/steamwar/bausystem/features/world => BauSystem_BuilderUtilities/src/de/steamwar/bausystem/itemframe}/ItemFrameListener.java (59%) rename {BauSystem_Main/src/de/steamwar/bausystem/features/util => BauSystem_BuilderUtilities/src/de/steamwar/bausystem/material}/MaterialCommand.java (93%) rename {BauSystem_Main/src/de/steamwar/bausystem/features/util => BauSystem_BuilderUtilities/src/de/steamwar/bausystem/material}/MaterialLazyInit.java (88%) rename {BauSystem_Main/src/de/steamwar/bausystem/features/world => BauSystem_BuilderUtilities/src/de/steamwar/bausystem/signeditor}/SignEditFrom20.java (98%) rename {BauSystem_Main/src/de/steamwar/bausystem/features/world => BauSystem_BuilderUtilities/src/de/steamwar/bausystem/signeditor}/SignEditUntil19.java (83%) create mode 100644 BauSystem_BuilderUtilities/src/de/steamwar/bausystem/signeditor/SignListener.java diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignListener.java b/BauSystem_Base/build.gradle similarity index 56% rename from BauSystem_Main/src/de/steamwar/bausystem/features/world/SignListener.java rename to BauSystem_Base/build.gradle index 40ad9a66..55102a04 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignListener.java +++ b/BauSystem_Base/build.gradle @@ -17,25 +17,36 @@ * along with this program. If not, see . */ -package de.steamwar.bausystem.features.world; +plugins { + id 'base' + id 'java' +} -import de.steamwar.linkage.Linked; -import org.bukkit.ChatColor; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.SignChangeEvent; +apply from: '../module.gradle' -@Linked -public class SignListener implements Listener { +group 'steamwar' +version '1.0' - @EventHandler - public void onSignChange(SignChangeEvent event) { - for (int i = 0; i <= 3; ++i) { - String line = event.getLine(i); - if (line == null) - continue; - line = ChatColor.translateAlternateColorCodes('&', line); - event.setLine(i, line); +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 libraries.base + annotationProcessor libraries.base +} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauInfoBauGuiItem.java b/BauSystem_Base/src/de/steamwar/bausystem/bauinfo/BauInfoBauGuiItem.java similarity index 70% rename from BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauInfoBauGuiItem.java rename to BauSystem_Base/src/de/steamwar/bausystem/bauinfo/BauInfoBauGuiItem.java index d8ba9171..df0ba58c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauInfoBauGuiItem.java +++ b/BauSystem_Base/src/de/steamwar/bausystem/bauinfo/BauInfoBauGuiItem.java @@ -1,23 +1,23 @@ /* - * This file is a part of the SteamWar software. + * This file is a part of the SteamWar software. * - * Copyright (C) 2021 SteamWar.de-Serverteam + * 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 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. + * 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ -package de.steamwar.bausystem.features.bau; +package de.steamwar.bausystem.bauinfo; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; @@ -38,7 +38,7 @@ import java.util.ArrayList; import java.util.List; @Linked -public class BauInfoBauGuiItem extends BauGuiItem { +public class beBauInfoBauGuiItem extends BauGuiItem { public BauInfoBauGuiItem() { super(7); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/bau/InfoCommand.java b/BauSystem_Base/src/de/steamwar/bausystem/bauinfo/InfoCommand.java similarity index 82% rename from BauSystem_Main/src/de/steamwar/bausystem/features/bau/InfoCommand.java rename to BauSystem_Base/src/de/steamwar/bausystem/bauinfo/InfoCommand.java index 2d638888..baba1e55 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/bau/InfoCommand.java +++ b/BauSystem_Base/src/de/steamwar/bausystem/bauinfo/InfoCommand.java @@ -1,4 +1,23 @@ -package de.steamwar.bausystem.features.bau; +/* + * 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 . + */ + +package de.steamwar.bausystem.bauinfo; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/ItemFrameListener.java b/BauSystem_BuilderUtilities/src/de/steamwar/bausystem/itemframe/ItemFrameListener.java similarity index 59% rename from BauSystem_Main/src/de/steamwar/bausystem/features/world/ItemFrameListener.java rename to BauSystem_BuilderUtilities/src/de/steamwar/bausystem/itemframe/ItemFrameListener.java index 535551ab..60540657 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/ItemFrameListener.java +++ b/BauSystem_BuilderUtilities/src/de/steamwar/bausystem/itemframe/ItemFrameListener.java @@ -1,23 +1,23 @@ /* - * This file is a part of the SteamWar software. + * This file is a part of the SteamWar software. * - * Copyright (C) 2021 SteamWar.de-Serverteam + * 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 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. + * 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ -package de.steamwar.bausystem.features.world; +package de.steamwar.bausystem.itemframe; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.SWUtils; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialCommand.java b/BauSystem_BuilderUtilities/src/de/steamwar/bausystem/material/MaterialCommand.java similarity index 93% rename from BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialCommand.java rename to BauSystem_BuilderUtilities/src/de/steamwar/bausystem/material/MaterialCommand.java index 7893b8c4..79ad3192 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialCommand.java +++ b/BauSystem_BuilderUtilities/src/de/steamwar/bausystem/material/MaterialCommand.java @@ -1,23 +1,23 @@ /* - * This file is a part of the SteamWar software. + * This file is a part of the SteamWar software. * - * Copyright (C) 2021 SteamWar.de-Serverteam + * 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 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. + * 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ -package de.steamwar.bausystem.features.util; +package de.steamwar.bausystem.material; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.SWUtils; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialLazyInit.java b/BauSystem_BuilderUtilities/src/de/steamwar/bausystem/material/MaterialLazyInit.java similarity index 88% rename from BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialLazyInit.java rename to BauSystem_BuilderUtilities/src/de/steamwar/bausystem/material/MaterialLazyInit.java index 8beb38b1..c7cb1fe2 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialLazyInit.java +++ b/BauSystem_BuilderUtilities/src/de/steamwar/bausystem/material/MaterialLazyInit.java @@ -1,23 +1,23 @@ /* - * This file is a part of the SteamWar software. + * This file is a part of the SteamWar software. * - * Copyright (C) 2022 SteamWar.de-Serverteam + * 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 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. + * 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ -package de.steamwar.bausystem.features.util; +package de.steamwar.bausystem.material; import de.steamwar.bausystem.BauSystem; import de.steamwar.inventory.SWItem; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditFrom20.java b/BauSystem_BuilderUtilities/src/de/steamwar/bausystem/signeditor/SignEditFrom20.java similarity index 98% rename from BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditFrom20.java rename to BauSystem_BuilderUtilities/src/de/steamwar/bausystem/signeditor/SignEditFrom20.java index 1ccfb014..e2ca0268 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditFrom20.java +++ b/BauSystem_BuilderUtilities/src/de/steamwar/bausystem/signeditor/SignEditFrom20.java @@ -1,7 +1,7 @@ /* * This file is a part of the SteamWar software. * - * Copyright (C) 2023 SteamWar.de-Serverteam + * 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 @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package de.steamwar.bausystem.features.world; +package de.steamwar.bausystem.signeditor; import com.comphenix.tinyprotocol.Reflection; import com.comphenix.tinyprotocol.TinyProtocol; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditUntil19.java b/BauSystem_BuilderUtilities/src/de/steamwar/bausystem/signeditor/SignEditUntil19.java similarity index 83% rename from BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditUntil19.java rename to BauSystem_BuilderUtilities/src/de/steamwar/bausystem/signeditor/SignEditUntil19.java index 7aebd4e9..5bff90b8 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditUntil19.java +++ b/BauSystem_BuilderUtilities/src/de/steamwar/bausystem/signeditor/SignEditUntil19.java @@ -1,23 +1,23 @@ /* - * This file is a part of the SteamWar software. + * This file is a part of the SteamWar software. * - * Copyright (C) 2021 SteamWar.de-Serverteam + * 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 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. + * 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ -package de.steamwar.bausystem.features.world; +package de.steamwar.bausystem.signeditor; import com.comphenix.tinyprotocol.Reflection; import com.comphenix.tinyprotocol.TinyProtocol; diff --git a/BauSystem_BuilderUtilities/src/de/steamwar/bausystem/signeditor/SignListener.java b/BauSystem_BuilderUtilities/src/de/steamwar/bausystem/signeditor/SignListener.java new file mode 100644 index 00000000..8ad81e51 --- /dev/null +++ b/BauSystem_BuilderUtilities/src/de/steamwar/bausystem/signeditor/SignListener.java @@ -0,0 +1,41 @@ +/* + * 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 . + */ + +package de.steamwar.bausystem.signeditor; + +import de.steamwar.linkage.Linked; +import org.bukkit.ChatColor; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.SignChangeEvent; + +@Linked +public class SignListener implements Listener { + + @EventHandler + public void onSignChange(SignChangeEvent event) { + for (int i = 0; i <= 3; ++i) { + String line = event.getLine(i); + if (line == null) + continue; + line = ChatColor.translateAlternateColorCodes('&', line); + event.setLine(i, line); + } + } +} diff --git a/BauSystem_PluginBase/src/de/steamwar/bausystem/Permission.java b/BauSystem_PluginBase/src/de/steamwar/bausystem/Permission.java index 6fb3a82a..f0df76c2 100644 --- a/BauSystem_PluginBase/src/de/steamwar/bausystem/Permission.java +++ b/BauSystem_PluginBase/src/de/steamwar/bausystem/Permission.java @@ -25,6 +25,7 @@ import de.steamwar.sql.BauweltMember; import de.steamwar.sql.SteamwarUser; import org.bukkit.entity.Player; +@FunctionalInterface public interface Permission { Permission OWNER = PermissionSystem.impl::isOwner; diff --git a/BauSystem_PluginBase/src/de/steamwar/bausystem/region/Flag.java b/BauSystem_PluginBase/src/de/steamwar/bausystem/region/Flag.java index aaf56489..95f90549 100644 --- a/BauSystem_PluginBase/src/de/steamwar/bausystem/region/Flag.java +++ b/BauSystem_PluginBase/src/de/steamwar/bausystem/region/Flag.java @@ -36,7 +36,7 @@ public enum Flag { ITEMS(ItemMode.class, ItemMode.INACTIVE), NO_GRAVITY(NoGravityMode.class, NoGravityMode.INACTIVE), TESTBLOCK(TestblockMode.class, TestblockMode.NO_VALUE), - CHANGED(ChangedMode.class, ChangedMode.NO_CHANGE), + CHANGED(ChangedMode.class, ChangedMode.NOT_CHANGED), ; @Getter diff --git a/BauSystem_PluginBase/src/de/steamwar/bausystem/region/flags/ChangedMode.java b/BauSystem_PluginBase/src/de/steamwar/bausystem/region/flags/ChangedMode.java index 4c70b95b..a07abcc0 100644 --- a/BauSystem_PluginBase/src/de/steamwar/bausystem/region/flags/ChangedMode.java +++ b/BauSystem_PluginBase/src/de/steamwar/bausystem/region/flags/ChangedMode.java @@ -27,8 +27,8 @@ import lombok.Getter; @AllArgsConstructor public enum ChangedMode implements Flag.Value { - NO_CHANGE, - HAS_CHANGE; + NOT_CHANGED, + CHANGED; private static ChangedMode[] values;