diff --git a/README.md b/README.md index 0b193a2..0c0da5f 100644 --- a/README.md +++ b/README.md @@ -51,22 +51,33 @@ Minepacks is a backpack plugin for minecraft server running bukkit or spigot. * [API][api] for developers ## Build from source: +The plugin can be build in 3 different configurations. ### Normal version: ``` git clone https://github.com/GeorgH93/Minepacks.git cd Minepacks mvn package ``` -The final file will be in the `target` folder +The final file will be in the `target` folder, named `Minepacks-.jar`. ### Standalone version: This version works without the PCGF-PluginLib, however some API features are not available. ``` git clone https://github.com/GeorgH93/Minepacks.git cd Minepacks -mvn package -P Standalone +mvn package -P Standalone,ExcludeBadRabbit ``` -The final file will be in the `target/munged` folder +The final file will be in the `target` folder, named `Minepacks--Standalone.jar`. + +### Release version: +This is the version of the plugin published on dev.bukkit.org and spigotmc.org. +``` +git clone https://github.com/GeorgH93/Minepacks.git +cd Minepacks +mvn clean install -P Standalone +mvn clean package -P Release +``` +The final file will be in the `target` folder, named `Minepacks--Release.jar`. ## API: Minepacks V2 comes with an API that allows you to interact with this plugin. diff --git a/pom.xml b/pom.xml index f8b9fce..78c8615 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 at.pcgamingfreaks Minepacks - 2.0-RC1 + 2.0-RC2 scm:git:git@github.com:GeorgH93/Minepacks.git @@ -80,6 +80,12 @@ PluginLib 1.0.11-SNAPSHOT + + + at.pcgamingfreaks + BadRabbit + 1.1 + @@ -137,6 +143,34 @@ + + ExcludeBadRabbit + + true + + + + + maven-jar-plugin + 3.1.2 + + + default-jar + package + + jar + + + + at/pcgamingfreaks/Minepacks/Bukkit/MinepacksBadRabbit.class + + + + + + + + Standalone @@ -148,7 +182,6 @@ ${project.groupId}.${project.artifactId}Standalone.Bukkit.${project.artifactId} - ${project.artifactId}Standalone-${project.version} @@ -162,8 +195,11 @@ shade + true + Standalone false true + ${project.build.directory} at.pcgamingfreaks:Minepacks-API @@ -210,6 +246,7 @@ org.sonatype.plugins munge-maven-plugin + 1.0 munge @@ -226,6 +263,61 @@ + + Release + + false + + + ${project.version}-Release + softdepend: [ PCGF_PluginLib ] + ${project.groupId}.${project.artifactId}.Bukkit.${project.artifactId}BadRabbit + + + + at.pcgamingfreaks + Minepacks + ${project.version} + Standalone + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.1 + + + package + + shade + + + true + Release + false + false + + + at.pcgamingfreaks:Minepacks-API + at.pcgamingfreaks:BadRabbit + at.pcgamingfreaks:Minepacks + + + + + at.pcgamingfreaks.BadRabbit + at.pcgamingfreaks.Minepacks + + + + + + + + + diff --git a/src/at/pcgamingfreaks/Minepacks/Bukkit/MinepacksBadRabbit.java b/src/at/pcgamingfreaks/Minepacks/Bukkit/MinepacksBadRabbit.java new file mode 100644 index 0000000..118a252 --- /dev/null +++ b/src/at/pcgamingfreaks/Minepacks/Bukkit/MinepacksBadRabbit.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2019 GeorgH93 + * + * 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 . + */ + +package at.pcgamingfreaks.Minepacks.Bukkit; + +import at.pcgamingfreaks.BadRabbit.Bukkit.BadRabbit; + +import org.bukkit.Bukkit; +import org.bukkit.plugin.java.JavaPlugin; +import org.jetbrains.annotations.NotNull; + +public class MinepacksBadRabbit extends BadRabbit +{ + @Override + protected @NotNull JavaPlugin createInstance() throws Exception + { + JavaPlugin newPluginInstance; + if(Bukkit.getPluginManager().getPlugin("PCGF_PluginLib") == null) + { + getLogger().info("PCGF-PluginLib not installed. Switching to standalone mode!"); + newPluginInstance = (JavaPlugin) Class.forName("at.pcgamingfreaks.MinepacksStandalone.Bukkit.Minepacks").newInstance(); + } + else + { + getLogger().info("PCGF-PluginLib installed. Switching to normal mode!"); + newPluginInstance = new Minepacks(); + } + return newPluginInstance; + } +} \ No newline at end of file