Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
crashdemons committed Oct 16, 2020
0 parents commit 35ff2c5
Show file tree
Hide file tree
Showing 5 changed files with 156 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 @@
# Eclipse stuff
/.classpath
/.project
/.settings

# netbeans
/nbproject
*.versionsBackup

# maven
/build.xml
/target
/pom.xml.versionsBackup

# vim
.*.sw[a-p]

# various other potential build files
/build
/bin
/dist
/manifest.mf

/world

# Mac filesystem dust
/.DS_Store

# intellij
*.iml
*.ipr
*.iws
.idea/

#personal
/test-in-spigot.bat
/private

18 changes: 18 additions & 0 deletions nb-configuration.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<netbeans.hint.jdkPlatform>JDK_1.8_u181_x64</netbeans.hint.jdkPlatform>
</properties>
</project-shared-configuration>
55 changes: 55 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?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>com.github.crashdemons</groupId>
<artifactId>AprilFools</artifactId>
<version>0.0.9-SNAPSHOT</version>
<packaging>jar</packaging>
<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>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>[1.15.2-R0.1-SNAPSHOT]</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>15.0</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<finalName>${project.name}-${project.version}</finalName>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>

</project>
37 changes: 37 additions & 0 deletions src/main/java/com/github/crashdemons/aprilfools/Plugin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.github.crashdemons.aprilfools;

import org.bukkit.Material;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.ThrowableProjectile;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.ProjectileLaunchEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

/**
*
* @author crashdemons (crashenator at gmail.com)
*/
public class Plugin extends JavaPlugin implements Listener {

@Override
public void onEnable(){
this.getServer().getPluginManager().registerEvents(this, this);
}


@EventHandler(ignoreCancelled=true)
public void onProjectile(ProjectileLaunchEvent event){
Projectile proj = event.getEntity();
if(proj instanceof ThrowableProjectile){
ThrowableProjectile tproj = (ThrowableProjectile) proj;
tproj.setItem(new ItemStack(Material.DIAMOND));
}
}
}
8 changes: 8 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: AprilFools
version: ${project.version}
description: nah
authors: [crashdemons]

api-version: 1.13

main: com.github.crashdemons.aprilfools.Plugin

0 comments on commit 35ff2c5

Please sign in to comment.