Skip to content

Commit

Permalink
main commit v1
Browse files Browse the repository at this point in the history
  • Loading branch information
poyrazinan committed Sep 13, 2022
0 parents commit 424ffce
Show file tree
Hide file tree
Showing 14 changed files with 606 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions .idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 104 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>xyz.geik.autosystem</groupId>
<artifactId>AutoSystem</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<shaded.package>org.cas.osd.platform.ciam.shaded</shaded.package>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<!-- Spigot 1.18.1 -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
<scope>provided</scope>
</dependency>
<!-- GLib Dependency -->
<dependency>
<groupId>com.github.poyrazinan</groupId>
<artifactId>GLib</artifactId>
<version>a148ed022d</version>
</dependency>
<!-- WildStacker Dependency -->
<dependency>
<groupId>com.bgsoftware</groupId>
<artifactId>WildStackerAPI</artifactId>
<version>3.8.0</version>
</dependency>
</dependencies>

<repositories>
<!-- Spigot Repo -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<!-- Jitpack Repo -->
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<!-- WildStacker Repo -->
<repository>
<id>bg-repo</id>
<url>https://repo.bg-software.com/repository/api/</url>
</repository>
</repositories>

<build>
<plugins>
<!-- Shade plugin for store dependency on jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<configuration>
<artifactSet>
<includes>
<include>com.github.poyrazinan:*:*:*</include>
</includes>
</artifactSet>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source />
<target />
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
</plugin>
</plugins>
</build>

</project>
37 changes: 37 additions & 0 deletions src/main/java/xyz/geik/autosystem/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package xyz.geik.autosystem;

import de.leonhard.storage.Config;
import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import xyz.geik.autosystem.handlers.AutoKillListener;
import xyz.geik.autosystem.handlers.KillEvent;
import xyz.geik.glib.GLibAPI;
import xyz.geik.glib.file.StorageAPI;

public class Main extends JavaPlugin {

private static Main instance;
private static Config config;

public void onEnable() {
instance = this;
new GLibAPI(this);
config = new StorageAPI().initConfig("config");
registerEvents();
}

private void registerEvents() {
PluginManager pm = Bukkit.getPluginManager();
pm.registerEvents(new AutoKillListener(), this);
pm.registerEvents(new KillEvent(), this);
}

public static Main getInstance() {
return instance;
}

public static Config getConfigFile() {
return config;
}
}
42 changes: 42 additions & 0 deletions src/main/java/xyz/geik/autosystem/api/SpawnerKillEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package xyz.geik.autosystem.api;

import lombok.Getter;
import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

@Getter
public class SpawnerKillEvent extends Event {

private boolean isCancelled;
private Entity entity;
private int entityAmount;

public SpawnerKillEvent(Entity entity, int entityAmount) {
this.entity = entity;
this.entityAmount = entityAmount;
}

private static final HandlerList HANDLERS = new HandlerList();

@Override
public HandlerList getHandlers()
{
return HANDLERS;
}

public static HandlerList getHandlerList()
{
return HANDLERS;
}

public boolean isCancelled()
{
return this.isCancelled;
}

public void setCancelled(boolean arg0)
{
this.isCancelled = arg0;
}
}
Loading

0 comments on commit 424ffce

Please sign in to comment.