Moved features to separate projects

This commit is contained in:
2018-09-24 12:51:02 +02:00
commit 8383a77730
35 changed files with 1009 additions and 0 deletions

18
AntiVoid/.classpath Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src" including="**/*.java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="/MarwCore"/>
<classpathentry kind="lib" path="/home/erik/Dokumenty/Java/marwland/res/MassiveCore.jar"/>
<classpathentry kind="lib" path="/home/erik/Dokumenty/Java/marwland/res/Factions.jar"/>
<classpathentry kind="var" path="M2_REPO/org/spigotmc/spigot-api/1.12-R0.1-SNAPSHOT/spigot-api-1.12-R0.1-SNAPSHOT.jar" sourcepath="M2_REPO/org/spigotmc/spigot-api/1.12-R0.1-SNAPSHOT/spigot-api-1.12-R0.1-SNAPSHOT-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.6/commons-lang-2.6.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.6/commons-lang-2.6-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar" sourcepath="M2_REPO/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.10/junit-4.10.jar" sourcepath="M2_REPO/junit/junit/4.10/junit-4.10-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar" sourcepath="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/guava/guava/21.0/guava-21.0.jar" sourcepath="M2_REPO/com/google/guava/guava/21.0/guava-21.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar" sourcepath="M2_REPO/com/google/code/gson/gson/2.8.0/gson-2.8.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/yaml/snakeyaml/1.18/snakeyaml-1.18.jar" sourcepath="M2_REPO/org/yaml/snakeyaml/1.18/snakeyaml-1.18-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-SNAPSHOT.jar" sourcepath="M2_REPO/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-SNAPSHOT-sources.jar"/>
</classpath>

2
AntiVoid/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/bin/
/target/

20
AntiVoid/.project Normal file
View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>AntiVoid</name>
<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
<projects>
<project>MarwCore</project>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,13 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=10
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=10
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=10

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

30
AntiVoid/pom.xml Normal file
View File

@ -0,0 +1,30 @@
<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>cz.marwland.mc.features</groupId>
<artifactId>AntiVoid</artifactId>
<parent>
<groupId>cz.marwland.mc</groupId>
<artifactId>MarwStuff</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>MarwStuff</relativePath>
</parent>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<release>10</release>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>cz.marwland.mc</groupId>
<artifactId>MarwCore</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,56 @@
package cz.marwland.mc.features;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerMoveEvent;
import cz.marwland.mc.core.features.Feature;
import cz.marwland.mc.core.util.Cooldown;
public class AntiVoid extends Feature {
private FileConfiguration cfg;
private ArrayList<World> allowedWorlds = new ArrayList<>();
private double triggery = 0d;
public AntiVoid() {
super();
this.registerConfig("antivoid.yml");
Cooldown xd = new Cooldown(this);
}
@EventHandler
public void onPlayerMove(PlayerMoveEvent e) {
Player p = e.getPlayer();
if (p.getLocation().getY() > triggery)
return;
World w = p.getWorld();
if (!allowedWorlds.contains(w))
return;
p.teleport(w.getSpawnLocation());
}
@Override
public void onEnable() {
super.onEnable();
cfg = getConfig("antivoid.yml");
triggery = cfg.getDouble("triggery", 0d);
allowedWorlds = new ArrayList<>();
for (String wname : cfg.getStringList("worlds")) {
World w = Bukkit.getWorld(wname);
if (w == null)
continue;
allowedWorlds.add(w);
}
}
}