Skip to content

Commit 1ec4813

Browse files
authored
Add files via upload
0 parents  commit 1ec4813

File tree

7 files changed

+313
-0
lines changed

7 files changed

+313
-0
lines changed

addon.iml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
4+
<output url="file://$MODULE_DIR$/target/classes" />
5+
<output-test url="file://$MODULE_DIR$/target/test-classes" />
6+
<content url="file://$MODULE_DIR$">
7+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9+
<excludeFolder url="file://$MODULE_DIR$/target" />
10+
</content>
11+
<orderEntry type="inheritedJdk" />
12+
<orderEntry type="sourceFolder" forTests="false" />
13+
<orderEntry type="library" name="Maven: com.github.drupijs.Drupi-JS:drupi:0.0.7" level="project" />
14+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT" level="project" />
15+
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
16+
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
17+
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
18+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
19+
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:17.0" level="project" />
20+
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.2.4" level="project" />
21+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.avaje:ebean:2.8.1" level="project" />
22+
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
23+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.15" level="project" />
24+
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.8-SNAPSHOT" level="project" />
25+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.8.8-R0.1-SNAPSHOT" level="project" />
26+
<orderEntry type="library" name="Maven: org.json:json:20090211" level="project" />
27+
</component>
28+
</module>

dependency-reduced-pom.xml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>pehost.xyz</groupId>
5+
<artifactId>addon</artifactId>
6+
<version>1.0-SNAPSHOT</version>
7+
<build>
8+
<plugins>
9+
<plugin>
10+
<artifactId>maven-shade-plugin</artifactId>
11+
<version>3.1.0</version>
12+
<executions>
13+
<execution>
14+
<phase>package</phase>
15+
<goals>
16+
<goal>shade</goal>
17+
</goals>
18+
</execution>
19+
</executions>
20+
</plugin>
21+
</plugins>
22+
</build>
23+
<repositories>
24+
<repository>
25+
<id>spigot-repo</id>
26+
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
27+
</repository>
28+
<repository>
29+
<id>jitpack.io</id>
30+
<url>https://jitpack.io</url>
31+
</repository>
32+
</repositories>
33+
<dependencies>
34+
<dependency>
35+
<groupId>org.spigotmc</groupId>
36+
<artifactId>spigot-api</artifactId>
37+
<version>1.8.8-R0.1-SNAPSHOT</version>
38+
<scope>provided</scope>
39+
<exclusions>
40+
<exclusion>
41+
<artifactId>commons-lang</artifactId>
42+
<groupId>commons-lang</groupId>
43+
</exclusion>
44+
<exclusion>
45+
<artifactId>json-simple</artifactId>
46+
<groupId>com.googlecode.json-simple</groupId>
47+
</exclusion>
48+
<exclusion>
49+
<artifactId>guava</artifactId>
50+
<groupId>com.google.guava</groupId>
51+
</exclusion>
52+
<exclusion>
53+
<artifactId>gson</artifactId>
54+
<groupId>com.google.code.gson</groupId>
55+
</exclusion>
56+
<exclusion>
57+
<artifactId>ebean</artifactId>
58+
<groupId>org.avaje</groupId>
59+
</exclusion>
60+
<exclusion>
61+
<artifactId>snakeyaml</artifactId>
62+
<groupId>org.yaml</groupId>
63+
</exclusion>
64+
<exclusion>
65+
<artifactId>bungeecord-chat</artifactId>
66+
<groupId>net.md-5</groupId>
67+
</exclusion>
68+
</exclusions>
69+
</dependency>
70+
<dependency>
71+
<groupId>org.bukkit</groupId>
72+
<artifactId>bukkit</artifactId>
73+
<version>1.8.8-R0.1-SNAPSHOT</version>
74+
<scope>provided</scope>
75+
<exclusions>
76+
<exclusion>
77+
<artifactId>commons-lang</artifactId>
78+
<groupId>commons-lang</groupId>
79+
</exclusion>
80+
<exclusion>
81+
<artifactId>json-simple</artifactId>
82+
<groupId>com.googlecode.json-simple</groupId>
83+
</exclusion>
84+
<exclusion>
85+
<artifactId>guava</artifactId>
86+
<groupId>com.google.guava</groupId>
87+
</exclusion>
88+
<exclusion>
89+
<artifactId>gson</artifactId>
90+
<groupId>com.google.code.gson</groupId>
91+
</exclusion>
92+
<exclusion>
93+
<artifactId>ebean</artifactId>
94+
<groupId>org.avaje</groupId>
95+
</exclusion>
96+
<exclusion>
97+
<artifactId>snakeyaml</artifactId>
98+
<groupId>org.yaml</groupId>
99+
</exclusion>
100+
</exclusions>
101+
</dependency>
102+
</dependencies>
103+
<properties>
104+
<maven.compiler.target>1.8</maven.compiler.target>
105+
<maven.compiler.source>1.8</maven.compiler.source>
106+
</properties>
107+
</project>
108+

pom.xml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>pehost.xyz</groupId>
8+
<artifactId>addon</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<properties>
11+
<maven.compiler.source>1.8</maven.compiler.source>
12+
<maven.compiler.target>1.8</maven.compiler.target>
13+
</properties>
14+
15+
<repositories>
16+
<repository>
17+
<id>spigot-repo</id>
18+
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
19+
</repository>
20+
<repository>
21+
<id>jitpack.io</id>
22+
<url>https://jitpack.io</url>
23+
</repository>
24+
</repositories>
25+
<dependencies>
26+
<!-- Drupi API Start -->
27+
<dependency>
28+
<groupId>com.github.drupijs.Drupi-JS</groupId>
29+
<artifactId>drupi</artifactId>
30+
<version>LATEST</version>
31+
</dependency>
32+
<!-- Drupi API End -->
33+
<dependency>
34+
<groupId>org.spigotmc</groupId>
35+
<artifactId>spigot-api</artifactId>
36+
<version>1.8.8-R0.1-SNAPSHOT</version>
37+
<type>jar</type>
38+
<scope>provided</scope>
39+
</dependency>
40+
<dependency>
41+
<groupId>org.bukkit</groupId>
42+
<artifactId>bukkit</artifactId>
43+
<version>1.8.8-R0.1-SNAPSHOT</version>
44+
<scope>provided</scope>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.json</groupId>
48+
<artifactId>json</artifactId>
49+
<version>20090211</version>
50+
<type>jar</type>
51+
<scope>compile</scope>
52+
</dependency>
53+
</dependencies>
54+
<build>
55+
<plugins>
56+
<plugin>
57+
<groupId>org.apache.maven.plugins</groupId>
58+
<artifactId>maven-shade-plugin</artifactId>
59+
<version>3.1.0</version>
60+
<executions>
61+
<execution>
62+
<phase>package</phase>
63+
<goals>
64+
<goal>shade</goal>
65+
</goals>
66+
</execution>
67+
</executions>
68+
</plugin>
69+
</plugins>
70+
</build>
71+
</project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package hundeklemmen.addon;
2+
3+
import hundeklemmen.api.DrupiAPI;
4+
import org.bukkit.event.EventHandler;
5+
import org.bukkit.event.Listener;
6+
import org.bukkit.event.player.PlayerGameModeChangeEvent;
7+
8+
public class eventHandler implements Listener {
9+
10+
//Registering an event as normal
11+
@EventHandler
12+
public void PlayerGameModeChange(PlayerGameModeChangeEvent event){
13+
//Loading our DrupiAPI from our main
14+
DrupiAPI Drupi = main.getDrupi();
15+
//registering our Drupi event, this will be accessible by addonName_PlayerGameModeChangeEvent and in this example it would then be: function TestAddon_PlayerGameModeChangeEvent(event)
16+
//We could use event.getClass().getName() instead of "PlayerGameModeChangeEvent" but this is simpler to show
17+
Drupi.registerEvent(event, "PlayerGameModeChangeEvent");
18+
}
19+
20+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package hundeklemmen.addon;
2+
3+
import hundeklemmen.api.DrupiAPI;
4+
import hundeklemmen.api.DrupiLoadEvent;
5+
import org.bukkit.event.EventHandler;
6+
import org.bukkit.event.Listener;
7+
import org.bukkit.plugin.java.JavaPlugin;
8+
9+
public class main extends JavaPlugin implements Listener {
10+
11+
private static main instance;
12+
private static DrupiAPI Drupi;
13+
14+
public static boolean update = false;
15+
16+
@Override
17+
public void onEnable() {
18+
instance = this;
19+
instance.getLogger().info("Drupi Addon has been enabled");
20+
21+
instance.getServer().getPluginManager().registerEvents(this, this);
22+
instance.getServer().getPluginManager().registerEvents(new eventHandler(), this);
23+
24+
//register our addon
25+
instance.getLogger().info("Registering TestAddon");
26+
Drupi = new DrupiAPI("TestAddon");
27+
instance.getLogger().info("TestAddon has been registered");
28+
29+
}
30+
31+
@Override
32+
public void onDisable(){
33+
instance.getLogger().info("Drupi Addon has been disabled");
34+
}
35+
36+
@EventHandler
37+
public void DrupiLoad(DrupiLoadEvent event){
38+
//registering a class
39+
Drupi.register(new testClass(instance));
40+
}
41+
42+
43+
public static main getInstance(){
44+
return instance;
45+
}
46+
47+
public static DrupiAPI getDrupi(){
48+
return Drupi;
49+
}
50+
51+
52+
53+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package hundeklemmen.addon;
2+
3+
import org.bukkit.World;
4+
import org.bukkit.entity.Player;
5+
6+
public class testClass {
7+
8+
9+
main plugin;
10+
11+
public testClass(main plugin){
12+
this.plugin = plugin;
13+
}
14+
15+
//This will be accessible by our addonName.getWorld so in this test it would be TestAddon.getWorld
16+
public World getWorld(String worldName){
17+
World ourWorld = plugin.getServer().getWorld(worldName);
18+
return ourWorld;
19+
}
20+
21+
//This will be accessible by our addonName.kickPlayer so in this test it would be TestAddon.kickPlayer
22+
public void kickPlayer(Player player, String Reason){
23+
player.kickPlayer(Reason);
24+
}
25+
26+
}

src/main/resources/plugin.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: DrupiTestAddon
2+
api: "1.0.0"
3+
main: hundeklemmen.addon.main
4+
author: Hundeklemmen
5+
version: "1.0"
6+
description: Drupi Addon
7+
depend: [Drupi]

0 commit comments

Comments
 (0)