Merge pull request #587 from DRE2N/multi-module

Multi module / 1.14
This commit is contained in:
Daniel Saukel 2019-06-13 20:29:43 +02:00 committed by GitHub
commit 16084f45f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
247 changed files with 601 additions and 608 deletions

View File

@ -6,8 +6,6 @@
[![JavaDocs](http://feuerstern.bplaced.net/ressourcen/buttons/JavaDocs.png)](http://erethon.de/javadocs/dungeonsxl/)
[![MCStats](http://feuerstern.bplaced.net/ressourcen/buttons/MCStats.png)](http://bstats.org/plugin/bukkit/DungeonsXL/)
![Doge](https://i.imgflip.com/vtpyi.jpg)
DungeonsXL is a server mod that allows you to instantiate worlds.
Its main goal is to offer a way to use a world in a set state multiple times by a player (like for a jump'n'run), a group of players (e.g. for a quest dungeon, an adventure map or a PvE arena) or even by groups of groups of players (e.g. for PvP arenas).
@ -47,7 +45,7 @@ If you want to learn how to use DungeonsXL step by step, please have a look at t
## Compatibility
### Server
DungeonsXL works with 1.8.8 and higher. However, support for 1.13.x / 1.12.x / 1.11.x / 1.10.x / 1.9.x has a higher priority than support for 1.8.8. Old builds that support older versions are unusable for production environments. See [here](../../wiki/legacy-support) for detailed information. Some cosmetic features require the Spigot API and will therefore not work with CraftBukkit.
DungeonsXL works with Spigot 1.8 and higher. However, support for 1.14 / 1.13 has a higher priority than support for 1.8-1.12. Old builds that support older versions are unusable for production environments. See [here](../../wiki/legacy-support) for detailed information. DungeonsXL only works with Spigot and does not support CraftBukkit builds.
### Building information and dependencies
Building DungeonsXL from source requires [Apache Maven](https://maven.apache.org/).
@ -59,6 +57,9 @@ Maven automatically fetches all dependencies and builds DungeonsXL; just run _bu
#### Caliburn API
[Caliburn](https://github.com/DRE2N/CaliburnAPI) is an API to read custom items and mobs from config files.
#### Vignette
[Vignette](https://github.com/DRE2N/Vignette) is a Bukkit GUI Framework.
### Java
Make sure that your server uses Java 8 or higher.

20
api/pom.xml Normal file
View File

@ -0,0 +1,20 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.erethon.dungeonsxl</groupId>
<artifactId>dungeonsxl-api</artifactId>
<version>0.18-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>de.erethon.dungeonsxl</groupId>
<artifactId>dungeonsxl-parent</artifactId>
<version>0.18-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,40 @@
/*
* Copyright (C) 2012-2019 Frank Baumann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.adapter.block;
import de.erethon.dungeonsxl.util.DColor;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
/**
* @author Daniel Saukel
*/
public interface BlockAdapter {
boolean isBedHead(Block block);
void openDoor(Block block);
void setBlockWoolColor(Block block, DColor color);
BlockFace getFacing(Block block);
void setFacing(Block block, BlockFace facing);
void setAxis(Block block, boolean z);
}

View File

@ -77,15 +77,6 @@ public enum DColor {
return dye.getColor().asRGB();
}
/**
* @deprecated Use getDyeColor() or getMaterial() instead
* @return the wool DV
*/
@Deprecated
public byte getWoolData() {
return dye.getWoolData();
}
/**
* @return the wool material
*/

26
bukkit_blockdata/pom.xml Normal file
View File

@ -0,0 +1,26 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.erethon.dungeonsxl</groupId>
<artifactId>dungeonsxl-bukkit_blockdata</artifactId>
<version>0.18-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>de.erethon.dungeonsxl</groupId>
<artifactId>dungeonsxl-parent</artifactId>
<version>0.18-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.erethon.dungeonsxl</groupId>
<artifactId>dungeonsxl-api</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,83 @@
/*
* Copyright (C) 2012-2019 Frank Baumann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.adapter.block;
import de.erethon.dungeonsxl.util.DColor;
import org.bukkit.Axis;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.Directional;
import org.bukkit.block.data.Openable;
import org.bukkit.block.data.Orientable;
import org.bukkit.block.data.type.Bed;
/**
* @author Daniel Saukel
*/
public class BlockAdapterBlockData implements BlockAdapter {
@Override
public boolean isBedHead(Block block) {
if (!(block.getBlockData() instanceof Bed)) {
throw new IllegalArgumentException("Block is not Bed");
}
return ((Bed) block.getBlockData()).getPart() == Bed.Part.HEAD;
}
@Override
public void openDoor(Block block) {
if (!(block.getBlockData() instanceof Openable)) {
throw new IllegalArgumentException("Block is not Openable");
}
Openable data = ((Openable) block.getBlockData());
data.setOpen(true);
block.setBlockData(data);
}
@Override
public void setBlockWoolColor(Block block, DColor color) {
block.setType(color.getWoolMaterial().getMaterial());
}
@Override
public BlockFace getFacing(Block block) {
if (!(block.getBlockData() instanceof Directional)) {
throw new IllegalArgumentException("Block is not Directional");
}
return ((Directional) block.getBlockData()).getFacing();
}
@Override
public void setFacing(Block block, BlockFace facing) {
if (!(block.getBlockData() instanceof Directional)) {
throw new IllegalArgumentException("Block is not Directional");
}
Directional data = (Directional) block.getBlockData();
data.setFacing(facing);
block.setBlockData(data, false);
}
@Override
public void setAxis(Block block, boolean z) {
if (!(block.getBlockData() instanceof Orientable)) {
throw new IllegalArgumentException("Block is not Orientable");
}
Orientable data = (Orientable) block.getBlockData();
data.setAxis(z ? Axis.Z : Axis.X);
}
}

View File

@ -0,0 +1,26 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.erethon.dungeonsxl</groupId>
<artifactId>dungeonsxl-bukkit_magicvalues</artifactId>
<version>0.18-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>de.erethon.dungeonsxl</groupId>
<artifactId>dungeonsxl-parent</artifactId>
<version>0.18-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.erethon.dungeonsxl</groupId>
<artifactId>dungeonsxl-api</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,78 @@
/*
* Copyright (C) 2012-2019 Frank Baumann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.adapter.block;
import de.erethon.dungeonsxl.util.DColor;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.material.Bed;
import org.bukkit.material.Directional;
import org.bukkit.material.MaterialData;
/**
* @author Daniel Saukel
*/
public class BlockAdapterMagicValues implements BlockAdapter {
@Override
public boolean isBedHead(Block block) {
MaterialData data = block.getState().getData();
if (!(data instanceof Bed)) {
throw new IllegalArgumentException("Block is not Bed");
}
return ((Bed) data).isHeadOfBed();
}
@Override
public void openDoor(Block block) {
block.setData((byte) (block.getData() + 4));
}
@Override
public void setBlockWoolColor(Block block, DColor color) {
block.setTypeIdAndData(Material.WOOL.getId(), color.getDyeColor().getWoolData(), false);
}
@Override
public BlockFace getFacing(Block block) {
MaterialData data = block.getState().getData();
if (!(data instanceof Directional)) {
throw new IllegalArgumentException("Block is not Directional");
}
return ((Directional) data).getFacing();
}
@Override
public void setFacing(Block block, BlockFace facing) {
BlockState state = block.getState();
MaterialData data = state.getData();
if (!(data instanceof Directional)) {
throw new IllegalArgumentException("Block is not Directional");
}
((Directional) data).setFacingDirection(facing);
state.setData(data);
state.update();
}
@Override
public void setAxis(Block block, boolean z) {
block.setData(z ? (byte) 2 : 1);
}
}

110
core/pom.xml Normal file
View File

@ -0,0 +1,110 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.erethon.dungeonsxl</groupId>
<artifactId>dungeonsxl-core</artifactId>
<version>0.18-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>de.erethon.dungeonsxl</groupId>
<artifactId>dungeonsxl-parent</artifactId>
<version>0.18-SNAPSHOT</version>
</parent>
<build>
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>src/main/resources/</directory>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>de.erethon.dungeonsxl</groupId>
<artifactId>dungeonsxl-api</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.erethon.dungeonsxl</groupId>
<artifactId>dungeonsxl-bukkit_blockdata</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.erethon.dungeonsxl</groupId>
<artifactId>dungeonsxl-bukkit_magicvalues</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.github.dre2n</groupId>
<artifactId>commandsxl</artifactId>
<version>2.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.citizensnpcs</groupId>
<artifactId>citizens</artifactId>
<version>2.0.25-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.gmail.filoghost.holographicdisplays</groupId>
<artifactId>holographicdisplays-api</artifactId>
<version>2.3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.black_ixx</groupId>
<artifactId>BossShop</artifactId>
<version>2.7.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.griefcraft</groupId>
<artifactId>Modern-LWC</artifactId>
<version>2.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.10.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
</repository>
<repository>
<id>citizens-repo</id>
<url>http://repo.citizensnpcs.co/</url>
</repository>
<repository>
<id>filoghost-repo</id>
<url>https://ci.filoghost.me/plugin/repository/everything/</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
</project>

View File

@ -19,10 +19,15 @@ package de.erethon.dungeonsxl;
import de.erethon.caliburn.CaliburnAPI;
import de.erethon.caliburn.loottable.LootTable;
import de.erethon.commons.compatibility.Internals;
import de.erethon.commons.compatibility.Version;
import de.erethon.commons.config.MessageConfig;
import de.erethon.commons.javaplugin.DREPlugin;
import de.erethon.commons.javaplugin.DREPluginSettings;
import de.erethon.commons.misc.FileUtil;
import de.erethon.commons.spiget.comparator.VersionComparator;
import de.erethon.dungeonsxl.adapter.block.BlockAdapter;
import de.erethon.dungeonsxl.adapter.block.BlockAdapterBlockData;
import de.erethon.dungeonsxl.adapter.block.BlockAdapterMagicValues;
import de.erethon.dungeonsxl.announcer.AnnouncerCache;
import de.erethon.dungeonsxl.command.DCommandCache;
import de.erethon.dungeonsxl.config.DMessage;
@ -68,6 +73,8 @@ public class DungeonsXL extends DREPlugin {
private static DungeonsXL instance;
private CaliburnAPI caliburn;
public static final BlockAdapter BLOCK_ADAPTER = Version.isAtLeast(Version.MC1_13) ? new BlockAdapterBlockData() : new BlockAdapterMagicValues();
public static final String[] EXCLUDED_FILES = {"config.yml", "uid.dat", "DXLData.data", "data"};
public static File BACKUPS;
public static File LANGUAGES;
@ -109,6 +116,7 @@ public class DungeonsXL extends DREPlugin {
.permissions(true)
.metrics(true)
.spigotMCResourceId(9488)
.versionComparator(VersionComparator.EQUAL)
.build();
}

View File

@ -16,11 +16,8 @@
*/
package de.erethon.dungeonsxl.announcer;
import de.erethon.commons.chat.BaseComponent;
import de.erethon.commons.chat.ClickEvent;
import de.erethon.commons.chat.DefaultFontInfo;
import de.erethon.commons.chat.MessageUtil;
import de.erethon.commons.chat.TextComponent;
import de.erethon.dungeonsxl.DungeonsXL;
import de.erethon.dungeonsxl.config.DMessage;
import de.erethon.dungeonsxl.dungeon.Dungeon;
@ -33,6 +30,9 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;

View File

@ -22,7 +22,7 @@ import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
/**
* Announcer instance manager.
@ -70,7 +70,7 @@ public class AnnouncerCache {
* @param gui the gui
* @return the announcer that has the GUI
*/
public Announcer getByGUI(Inventory gui) {
public Announcer getByGUI(InventoryView gui) {
for (Announcer announcer : announcers) {
if ((ChatColor.DARK_RED + announcer.getName()).equals(gui.getTitle())) {
return announcer;

View File

@ -22,7 +22,6 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
/**
@ -43,9 +42,8 @@ public class AnnouncerListener implements Listener {
}
Player player = (Player) event.getWhoClicked();
Inventory gui = event.getInventory();
ItemStack button = event.getCurrentItem();
Announcer announcer = announcers.getByGUI(gui);
Announcer announcer = announcers.getByGUI(event.getView());
if (announcer != null && button != null && Category.WOOL.containsMaterial(button.getType())) {
announcer.clickGroupButton(player, button);
}

View File

@ -16,9 +16,7 @@
*/
package de.erethon.dungeonsxl.command;
import de.erethon.commons.chat.ClickEvent;
import de.erethon.commons.chat.MessageUtil;
import de.erethon.commons.chat.TextComponent;
import de.erethon.commons.misc.FileUtil;
import de.erethon.dungeonsxl.DungeonsXL;
import de.erethon.dungeonsxl.config.DMessage;
@ -26,6 +24,8 @@ import de.erethon.dungeonsxl.player.DPermission;
import de.erethon.dungeonsxl.world.DEditWorld;
import de.erethon.dungeonsxl.world.DResourceWorld;
import java.io.File;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

View File

@ -16,10 +16,8 @@
*/
package de.erethon.dungeonsxl.command;
import de.erethon.commons.chat.ClickEvent;
import de.erethon.commons.chat.DefaultFontInfo;
import de.erethon.commons.chat.MessageUtil;
import de.erethon.commons.chat.TextComponent;
import de.erethon.commons.compatibility.CompatibilityHandler;
import de.erethon.commons.compatibility.Internals;
import de.erethon.dungeonsxl.DungeonsXL;
@ -28,6 +26,8 @@ import de.erethon.dungeonsxl.event.DataReloadEvent;
import de.erethon.dungeonsxl.player.DInstancePlayer;
import de.erethon.dungeonsxl.player.DPermission;
import java.util.List;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

Some files were not shown because too many files have changed in this diff Show More