Fix plugin.yml pom integration

This commit is contained in:
Ste3et_C0st 2021-06-21 00:44:32 +02:00
parent 58af285ace
commit 7c1ce3b70b
4 changed files with 92 additions and 100 deletions

54
pom.xml
View File

@ -1,4 +1,6 @@
<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"> <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> <modelVersion>4.0.0</modelVersion>
<groupId>de.Ste3et_C0st.furniture</groupId> <groupId>de.Ste3et_C0st.furniture</groupId>
<artifactId>DiceFurniture</artifactId> <artifactId>DiceFurniture</artifactId>
@ -7,7 +9,7 @@
<furniture.tag></furniture.tag> <furniture.tag></furniture.tag>
</properties> </properties>
<version>3.5${furniture.tag}</version> <version>3.5.0${furniture.tag}</version>
<build> <build>
<defaultGoal>clean package install</defaultGoal> <defaultGoal>clean package install</defaultGoal>
<sourceDirectory>src</sourceDirectory> <sourceDirectory>src</sourceDirectory>
@ -18,6 +20,7 @@
<excludes> <excludes>
<exclude>**/*.java</exclude> <exclude>**/*.java</exclude>
</excludes> </excludes>
<filtering>true</filtering>
</resource> </resource>
</resources> </resources>
<plugins> <plugins>
@ -29,46 +32,6 @@
<target>1.8</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>
de.Ste3et_C0st.ProtectionLib.main.ProtectionLib
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.1</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
@ -98,4 +61,11 @@
<version>22fb4086de</version> <version>22fb4086de</version>
</dependency> </dependency>
</dependencies> </dependencies>
<description>Add some new Objects to the Server</description>
<url>https://dicecraft.de/furniture/</url>
<issueManagement>
<url>https://github.com/Ste3et/FurnitureLib/issues</url>
<system>GitHub</system>
</issueManagement>
</project> </project>

View File

@ -1,5 +1,7 @@
package de.Ste3et_C0st.Furniture.Main; package de.Ste3et_C0st.Furniture.Main;
import java.util.Objects;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import de.Ste3et_C0st.Furniture.Main.Event.redstoneEvent; import de.Ste3et_C0st.Furniture.Main.Event.redstoneEvent;
@ -96,7 +98,9 @@ public class FurnitureHook extends FurniturePlugin{
new Project("AdventCalender", getPlugin(), getResource(modelFolder + "AdventCalender" + ending), PlaceableSide.TOP, AdventCalender::new).setSize(1, 1, 1, CenterType.RIGHT); new Project("AdventCalender", getPlugin(), getResource(modelFolder + "AdventCalender" + ending), PlaceableSide.TOP, AdventCalender::new).setSize(1, 1, 1, CenterType.RIGHT);
new Project("FireworkLauncher", getPlugin(), getResource(modelFolder + "FireworkLauncher" + ending), PlaceableSide.TOP, FireworkLauncher::new).setSize(1, 1, 1, CenterType.CENTER); new Project("FireworkLauncher", getPlugin(), getResource(modelFolder + "FireworkLauncher" + ending), PlaceableSide.TOP, FireworkLauncher::new).setSize(1, 1, 1, CenterType.CENTER);
FurnitureLib.getInstance().getFurnitureManager().getProjects().stream().filter(pro -> pro.getPlugin().equals(getPlugin())).forEach(pro -> pro.setEditorProject(editModels)); FurnitureLib.getInstance().getFurnitureManager().getProjects().stream().filter(pro -> pro.getPlugin().equals(getPlugin())).forEach(pro -> {
if(Objects.nonNull(pro)) pro.setEditorProject(editModels);
});
}catch (Exception e) { }catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -27,8 +27,19 @@ public class main extends JavaPlugin{
public static HashMap<String, Vector> catapultRange = new HashMap<String, Vector>(); public static HashMap<String, Vector> catapultRange = new HashMap<String, Vector>();
public void onEnable(){ public void onEnable(){
if(!Bukkit.getPluginManager().isPluginEnabled("FurnitureLib")){Bukkit.getPluginManager().disablePlugin(this);} if(getServer().getPluginManager().isPluginEnabled("FurnitureLib") == false){
this.disablePlugin("[DiceFurniture] FurnitureLib is missing please install it!");
System.out.println("You can find the download here: https://www.spigotmc.org/resources/furniturelibary-protectionlib.9368/");
return;
}
instance = this; instance = this;
if(FurnitureLib.getInstance().isEnabledPlugin() == false) {
this.disablePlugin("[DiceFurniture] Plugin disabled because FurnitureLib is incorectly installed!");
return;
}
util = FurnitureLib.getInstance().getLocationUtil(); util = FurnitureLib.getInstance().getLocationUtil();
if(FurnitureLib.getInstance().getDescription().getVersion().startsWith("2.")){ if(FurnitureLib.getInstance().getDescription().getVersion().startsWith("2.")){
FurnitureHook furniturePlugin = new FurnitureHook(getInstance()); FurnitureHook furniturePlugin = new FurnitureHook(getInstance());
@ -41,10 +52,17 @@ public class main extends JavaPlugin{
}else{ }else{
FurnitureLib.getInstance().send("FurnitureLib Version > 2.x not found"); FurnitureLib.getInstance().send("FurnitureLib Version > 2.x not found");
FurnitureLib.getInstance().send("DiceFurniture deos not load"); FurnitureLib.getInstance().send("DiceFurniture deos not load");
this.disablePlugin("");
return;
} }
} }
private void disablePlugin(String string) {
if(string.isEmpty() == false) System.out.println(string);
Bukkit.getPluginManager().disablePlugin(this);
}
private void setDefaults_2(){ private void setDefaults_2(){
c = new config(); c = new config();
this.file = c.getConfig("damage", "plugin/bearTrap/"); this.file = c.getConfig("damage", "plugin/bearTrap/");

View File

@ -1,8 +1,8 @@
name: DiceFurniture name: ${project.name}
version: 3.4.6 version: ${project.version}
description: Add some new Objects to the Server description: ${project.description}
author: Ste3et_C0st author: Ste3et_C0st
website: http://dicecraft.de website: ${project.url}
depend: [FurnitureLib] depend: [FurnitureLib]
main: de.Ste3et_C0st.Furniture.Main.main main: de.Ste3et_C0st.Furniture.Main.main
api-version: 1.13 api-version: 1.13