D45Hub
2 years ago
10 changed files with 242 additions and 0 deletions
-
32.classpath
-
1.gitignore
-
29.project
-
5.settings/org.eclipse.core.resources.prefs
-
13.settings/org.eclipse.jdt.core.prefs
-
4.settings/org.eclipse.m2e.core.prefs
-
84pom.xml
-
32src/main/java/de/denisthiessen/damagedisabler/DamageDisablerPlugin.java
-
4src/main/resources/plugin.yml
-
38src/test/java/de/denisthiessen/damagedisabler/AppTest.java
@ -0,0 +1,32 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<classpath> |
|||
<classpathentry kind="src" output="target/classes" path="src/main/java"> |
|||
<attributes> |
|||
<attribute name="optional" value="true"/> |
|||
<attribute name="maven.pomderived" value="true"/> |
|||
</attributes> |
|||
</classpathentry> |
|||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> |
|||
<attributes> |
|||
<attribute name="maven.pomderived" value="true"/> |
|||
</attributes> |
|||
</classpathentry> |
|||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> |
|||
<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="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> |
|||
<attributes> |
|||
<attribute name="module" value="true"/> |
|||
<attribute name="maven.pomderived" value="true"/> |
|||
</attributes> |
|||
</classpathentry> |
|||
<classpathentry kind="output" path="target/classes"/> |
|||
</classpath> |
@ -0,0 +1,29 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<projectDescription> |
|||
<name>damagedisabler</name> |
|||
<comment></comment> |
|||
<projects> |
|||
</projects> |
|||
<buildSpec> |
|||
<buildCommand> |
|||
<name>org.eclipse.wst.common.project.facet.core.builder</name> |
|||
<arguments> |
|||
</arguments> |
|||
</buildCommand> |
|||
<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.jdt.core.javanature</nature> |
|||
<nature>org.eclipse.m2e.core.maven2Nature</nature> |
|||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> |
|||
</natures> |
|||
</projectDescription> |
@ -0,0 +1,5 @@ |
|||
eclipse.preferences.version=1 |
|||
encoding//src/main/java=UTF-8 |
|||
encoding//src/main/resources=UTF-8 |
|||
encoding//src/test/java=UTF-8 |
|||
encoding/<project>=UTF-8 |
@ -0,0 +1,13 @@ |
|||
eclipse.preferences.version=1 |
|||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled |
|||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate |
|||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 |
|||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve |
|||
org.eclipse.jdt.core.compiler.compliance=1.8 |
|||
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.source=1.8 |
@ -0,0 +1,4 @@ |
|||
activeProfiles= |
|||
eclipse.preferences.version=1 |
|||
resolveWorkspaceProjects=true |
|||
version=1 |
@ -0,0 +1,84 @@ |
|||
<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.denisthiessen</groupId> |
|||
<artifactId>damagedisabler</artifactId> |
|||
<version>0.0.1-SNAPSHOT</version> |
|||
<packaging>jar</packaging> |
|||
|
|||
<name>damagedisabler</name> |
|||
<url>http://maven.apache.org</url> |
|||
|
|||
<properties> |
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
|||
<maven.compiler.source>1.8</maven.compiler.source> |
|||
<maven.compiler.target>1.8</maven.compiler.target> |
|||
</properties> |
|||
|
|||
<repositories> |
|||
<repository> |
|||
<id>papermc</id> |
|||
<url>https://papermc.io/repo/repository/maven-public/</url> |
|||
</repository> |
|||
<repository> |
|||
<id>spigot-repo</id> |
|||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> |
|||
</repository> |
|||
</repositories> |
|||
|
|||
<build> |
|||
<plugins> |
|||
<plugin> |
|||
<groupId>org.apache.maven.plugins</groupId> |
|||
<artifactId>maven-shade-plugin</artifactId> |
|||
<version>3.2.4</version> <!-- Make sure to always use the latest version (https://maven.apache.org/plugins/maven-shade-plugin/) --> |
|||
<configuration> |
|||
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation> |
|||
<relocations> |
|||
<relocation> |
|||
<pattern>io.papermc.lib</pattern> |
|||
<shadedPattern>de.denisthiessen.damagedisabler.paperlib</shadedPattern> <!-- Replace this --> |
|||
</relocation> |
|||
</relocations> |
|||
</configuration> |
|||
<executions> |
|||
<execution> |
|||
<phase>package</phase> |
|||
<goals> |
|||
<goal>shade</goal> |
|||
</goals> |
|||
</execution> |
|||
</executions> |
|||
</plugin> |
|||
</plugins> |
|||
</build> |
|||
|
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>junit</groupId> |
|||
<artifactId>junit</artifactId> |
|||
<version>3.8.1</version> |
|||
<scope>test</scope> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>io.papermc.paper</groupId> |
|||
<artifactId>paper-api</artifactId> |
|||
<version>1.17.1-R0.1-SNAPSHOT</version> |
|||
<scope>provided</scope> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>io.papermc</groupId> |
|||
<artifactId>paperlib</artifactId> |
|||
<version>1.0.6</version> |
|||
<scope>compile</scope> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.spigotmc</groupId> |
|||
<artifactId>spigot-api</artifactId> |
|||
<version>1.17.1-R0.1-SNAPSHOT</version> |
|||
<scope>provided</scope> |
|||
</dependency> |
|||
</dependencies> |
|||
</project> |
@ -0,0 +1,32 @@ |
|||
package de.denisthiessen.damagedisabler; |
|||
|
|||
import org.bukkit.Bukkit; |
|||
import org.bukkit.entity.Player; |
|||
import org.bukkit.event.EventHandler; |
|||
import org.bukkit.event.Listener; |
|||
import org.bukkit.event.entity.EntityDamageEvent; |
|||
import org.bukkit.plugin.java.JavaPlugin; |
|||
|
|||
import io.papermc.lib.PaperLib; |
|||
|
|||
public class DamageDisablerPlugin extends JavaPlugin implements Listener { |
|||
|
|||
@Override |
|||
public void onDisable() { |
|||
// Don't log disabling, Spigot does that for you automatically! |
|||
} |
|||
|
|||
@Override |
|||
public void onEnable() { |
|||
PaperLib.suggestPaper(this); |
|||
Bukkit.getPluginManager().registerEvents(this, this); |
|||
} |
|||
|
|||
@EventHandler |
|||
public void onEntityDamage(EntityDamageEvent e) { |
|||
if (e.getEntity() instanceof Player) { |
|||
e.setCancelled(true); |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,4 @@ |
|||
name: DamageDisabler |
|||
main: de.denisthiessen.damagedisabler.DamageDisablerPlugin |
|||
version: 1.0 |
|||
api-version: 1.13 |
@ -0,0 +1,38 @@ |
|||
package de.denisthiessen.damagedisabler; |
|||
|
|||
import junit.framework.Test; |
|||
import junit.framework.TestCase; |
|||
import junit.framework.TestSuite; |
|||
|
|||
/** |
|||
* Unit test for simple App. |
|||
*/ |
|||
public class AppTest |
|||
extends TestCase |
|||
{ |
|||
/** |
|||
* Create the test case |
|||
* |
|||
* @param testName name of the test case |
|||
*/ |
|||
public AppTest( String testName ) |
|||
{ |
|||
super( testName ); |
|||
} |
|||
|
|||
/** |
|||
* @return the suite of tests being tested |
|||
*/ |
|||
public static Test suite() |
|||
{ |
|||
return new TestSuite( AppTest.class ); |
|||
} |
|||
|
|||
/** |
|||
* Rigourous Test :-) |
|||
*/ |
|||
public void testApp() |
|||
{ |
|||
assertTrue( true ); |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue