Convert to maven

This commit is contained in:
aPunch 2012-03-20 20:10:32 -05:00
parent fde15d4abd
commit e5bbe641ed
9 changed files with 78 additions and 12 deletions

5
.gitignore vendored
View File

@ -1,7 +1,4 @@
/bin /bin
/build
/target /target
.classpath .classpath
.project .project
Blacksmith.jar
build.xml

View File

@ -1,12 +1,12 @@
#Thu Feb 09 16:52:58 CST 2012
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

60
pom.xml Normal file
View File

@ -0,0 +1,60 @@
<!-- Blacksmith build file -->
<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>net.apunch</groupId>
<artifactId>blacksmith</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Blacksmith</name>
<description>Blacksmith Character for the CitizensAPI</description>
<!-- Properties -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<bukkit.version>1.2.3-R0.3-SNAPSHOT</bukkit.version>
<citizensapi.version>2.0-SNAPSHOT</citizensapi.version>
<vault.version>1.2.13-SNAPSHOT</vault.version>
<build.number>Unknown</build.number>
</properties>
<!-- Repositories -->
<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
</repository>
<repository>
<id>citizens-repo</id>
<url>http://repo.citizensnpcs.net/</url>
</repository>
<repository>
<id>vault-repo</id>
<url>http://ci.milkbowl.net/plugin/repository/everything</url>
</repository>
</repositories>
<!-- Dependencies -->
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>${bukkit.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.citizensnpcs</groupId>
<artifactId>citizensapi</artifactId>
<version>${citizensapi.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId>
<version>${vault.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -125,8 +125,10 @@ public class Blacksmith extends Character {
return; return;
} }
session = new ReforgeSession(player, npc); session = new ReforgeSession(player, npc);
npc.chat(player, costMsg.replace("<price>", plugin.formatCost(player)).replace("<item>", npc.chat(
hand.getType().name().toLowerCase().replace('_', ' '))); player,
costMsg.replace("<price>", plugin.formatCost(player)).replace("<item>",
hand.getType().name().toLowerCase().replace('_', ' ')));
} }
} }
@ -160,8 +162,11 @@ public class Blacksmith extends Character {
private void reforge(NPC npc, Player player) { private void reforge(NPC npc, Player player) {
npc.chat(player, startReforgeMsg); npc.chat(player, startReforgeMsg);
plugin.withdraw(player); plugin.withdraw(player);
session.setTask(plugin.getServer().getScheduler().scheduleAsyncDelayedTask(plugin, session.setTask(plugin
new ReforgeTask(npc, player), (new Random().nextInt(maxReforgeDelay) + minReforgeDelay) * 20)); .getServer()
.getScheduler()
.scheduleAsyncDelayedTask(plugin, new ReforgeTask(npc, player),
(new Random().nextInt(maxReforgeDelay) + minReforgeDelay) * 20));
if (npc.getBukkitEntity() instanceof Player) if (npc.getBukkitEntity() instanceof Player)
((Player) npc.getBukkitEntity()).setItemInHand(player.getItemInHand()); ((Player) npc.getBukkitEntity()).setItemInHand(player.getItemInHand());
player.setItemInHand(null); player.setItemInHand(null);