Update for Spigot and mavenize.

This commit is contained in:
garbagemule 2015-07-17 03:38:41 +02:00
parent 91d426a74b
commit aafeb93d38
175 changed files with 97 additions and 152 deletions

3
.gitignore vendored
View File

@ -18,7 +18,8 @@ build/
misc/
lib/
test/
target/
# Misc files
MobArena.jar
build.properties
build.properties

144
build.xml
View File

@ -1,144 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
###########################################################################
### ###
### MobArena Build File ###
### ###
###########################################################################
To build MobArena, you need the following dependencies, which can all be
found on their respective websites/Bukkit pages/whatever:
- Bukkit by the Bukkit team http://dl.bukkit.org/downloads/bukkit/
- Vault by Sleaker http://dev.bukkit.org/bukkit-plugins/vault/
- MagicSpells by nisovin http://dev.bukkit.org/bukkit-plugins/magicspells/
The dependencies (jar-files) should be placed in a lib-folder at the root
of the project file structure, i.e. in the same folder as 'src'.
-->
<project name="MobArena" default="build-package-distribute" basedir=".">
<!--
###########################################################################
### ###
### Properties File ###
### ###
###########################################################################
The properties file (build.properties) is optional. It can contain the
following properties, which can provide compilation convenience:
- server.dir A path to a location that the MobArena.jar file will be
copied to, upon packaging. This is useful for paths to
a server's plugins-folder for easy testing.
-->
<property file="build.properties"/>
<!-- Folders -->
<property name="src" location="src"/>
<property name="bin" location="build"/>
<property name="lib" location="lib"/>
<property name="res" location="resources"/>
<!-- Classpath -->
<path id="classpath">
<fileset dir="${lib}" includes="*.jar"/>
<pathelement location="${bin}" />
</path>
<!--
###########################################################################
### ###
### Distribution targets ###
### ###
###########################################################################
-->
<!-- Copy MobArena.jar to the server.dir folder from the properties file -->
<target name="copy-to-server" if="server.dir">
<copy file="${ant.project.name}.jar" tofile="${server.dir}/${ant.project.name}.jar" />
</target>
<!-- Copy MobArena.jar to the dropbox.dir folder from the properties file -->
<target name="copy-to-dropbox" if="dropbox.dir">
<copy file="${ant.project.name}.jar" tofile="${dropbox.dir}/${ant.project.name}.jar" />
</target>
<!-- Copy MobArena.jar to the remote.dir folder from the properties file -->
<target name="copy-to-remote" if="remote.dir">
<scp file="${ant.project.name}.jar" todir="${remote.usr}:${remote.pwd}@${remote.host}:${remote.dir}" />
</target>
<!--
###########################################################################
### ###
### Build targets ###
### ###
###########################################################################
-->
<!-- Build the project files -->
<target name="build">
<antcall target="clean-bin"/>
<mkdir dir="${bin}"/>
<javac target="1.6" source="1.6"
srcdir="${src}" destdir="${bin}"
debug="on" debuglevel="lines,vars,source"
includeantruntime="no" classpathref="classpath">
<compilerarg value="-Xlint:deprecation"/>
</javac>
</target>
<!-- Build and package the project -->
<target name="build-package">
<antcall target="build"/>
<delete file="${ant.project.name}.jar" />
<jar jarfile="${ant.project.name}.jar">
<!-- Include the class-files (bin) and the resources (res) -->
<fileset dir="${bin}" />
<fileset dir="${res}" />
</jar>
<antcall target="clean-bin"/>
</target>
<!-- Build, package and distribute the project -->
<target name="build-package-distribute">
<antcall target="build-package"/>
<antcall target="copy-to-server"/>
<antcall target="copy-to-dropbox"/>
</target>
<!-- Build, package and distribute the project (includes remote) -->
<target name="build-package-distribute-remote">
<antcall target="build-package"/>
<antcall target="copy-to-server"/>
<antcall target="copy-to-dropbox"/>
<antcall target="copy-to-remote"/>
</target>
<!--
###########################################################################
### ###
### Clean targets ###
### ###
###########################################################################
-->
<!-- Delete the bin folder -->
<target name="clean-bin">
<delete dir="${bin}"/>
</target>
<!-- Delete the bin folder and the jar-file -->
<target name="clean">
<antcall target="clean-bin"/>
<delete file="${ant.project.name}.jar"/>
</target>
</project>

79
pom.xml Normal file
View File

@ -0,0 +1,79 @@
<?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.garbagemule</groupId>
<artifactId>mobarena</artifactId>
<name>MobArena</name>
<version>0.96.10-SNAPSHOT</version>
<build>
<plugins>
<!-- Use Java 7 for compilation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- Rename the final jar-file to MobArena.jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<finalName>MobArena</finalName>
</configuration>
</plugin>
</plugins>
<resources>
<!-- Resource filtering; use Maven version in plugin.yml -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
<!-- Spigot repo -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<!-- Vault repo -->
<repository>
<id>vault-repo</id>
<url>http://nexus.theyeticave.net/content/repositories/pub_releases/</url>
</repository>
</repositories>
<dependencies>
<!-- Spigot API -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.7-R0.1-SNAPSHOT</version>
</dependency>
<!-- Vault -->
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.5</version>
</dependency>
<!-- Magic Spells (tentative) -->
<dependency>
<groupId>com.nisovin</groupId>
<artifactId>magicspells</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/MagicSpells.jar</systemPath>
</dependency>
</dependencies>
</project>

View File

@ -56,6 +56,7 @@ import com.garbagemule.MobArena.region.RegionPoint;
import com.garbagemule.MobArena.repairable.*;
import com.garbagemule.MobArena.util.TextUtils;
import com.garbagemule.MobArena.waves.MABoss;
import org.bukkit.projectiles.ProjectileSource;
public class ArenaListener
{
@ -540,7 +541,10 @@ public class ArenaListener
// Make sure to grab the owner of a projectile/pet
if (damager instanceof Projectile) {
damager = ((Projectile) damager).getShooter();
ProjectileSource shooter = ((Projectile) damager).getShooter();
if (shooter instanceof Entity) {
damager = (Entity) shooter;
}
}
else if (damager instanceof Wolf && arena.hasPet(damager)) {
damager = (Player) ((Wolf) damager).getOwner();
@ -626,7 +630,10 @@ public class ArenaListener
damager = edbe.getDamager();
if (damager instanceof Projectile) {
damager = ((Projectile) damager).getShooter();
ProjectileSource shooter = ((Projectile) damager).getShooter();
if (shooter instanceof Entity) {
damager = (Entity) shooter;
}
}
// Repair weapons if necessary

View File

@ -8,10 +8,13 @@ import com.garbagemule.MobArena.commands.CommandInfo;
import com.garbagemule.MobArena.commands.Commands;
import com.garbagemule.MobArena.framework.ArenaMaster;
import com.garbagemule.MobArena.util.config.ConfigUtils;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.HashSet;
import static com.garbagemule.MobArena.util.config.ConfigUtils.setLocation;
@CommandInfo(
@ -39,11 +42,10 @@ public class ClassChestCommand implements Command {
}
Player p = (Player) sender;
Block b = p.getTargetBlock(null, 10);
Block b = p.getTargetBlock(new HashSet<Material>(), 10);
switch (b.getType()) {
case CHEST:
case LOCKED_CHEST:
case ENDER_CHEST:
case TRAPPED_CHEST:
break;

View File

@ -354,7 +354,7 @@ public class Metrics {
boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
String pluginVersion = description.getVersion();
String serverVersion = Bukkit.getVersion();
int playersOnline = Bukkit.getServer().getOnlinePlayers().length;
int playersOnline = Bukkit.getServer().getOnlinePlayers().size();
// END server software specific section -- all code below does not use any code outside of this class / Java

Some files were not shown because too many files have changed in this diff Show More