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

20
ChorusLimiter/.classpath Normal file
View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-10">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

2
ChorusLimiter/.gitignore vendored Normal file
View File

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

23
ChorusLimiter/.project Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ChorusLimiter</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</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

34
ChorusLimiter/pom.xml Normal file
View File

@ -0,0 +1,34 @@
<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>ChorusLimiter</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>
<dependency>
<groupId>com.connorlinfoot</groupId>
<artifactId>BountifulAPI</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,31 @@
package cz.marwland.mc.features;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerItemConsumeEvent;
import com.connorlinfoot.bountifulapi.BountifulAPI;
import cz.marwland.mc.core.features.Feature;
import cz.marwland.mc.core.util.Cooldown;
import net.md_5.bungee.api.ChatColor;
public class ChorusLimiter extends Feature {
private Cooldown chorusCooldown = new Cooldown(this);
@EventHandler
public void onPlayerItemConsume(PlayerItemConsumeEvent e) {
if (e.getItem().getType() != Material.CHORUS_FRUIT)
return;
long left = chorusCooldown.timeLeftSeconds(e.getPlayer());
if (left > 0) {
BountifulAPI.sendActionBar(e.getPlayer(), ChatColor.RED + "Musis pockat jeste " + left + " sekund pro pouziti Chorus Fruitu!");
e.setCancelled(true);
return;
}
chorusCooldown.resetPlayer(e.getPlayer());
}
}