Skip to content

Commit

Permalink
Merge pull request #271 from jb-aero/vault
Browse files Browse the repository at this point in the history
Remove dependency on Vault. The functions can now be found in CHVault.
  • Loading branch information
LadyCailin committed Feb 23, 2015
2 parents ff56330 + d1a35e8 commit 4b485fd
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 905 deletions.
32 changes: 0 additions & 32 deletions pom.xml
Expand Up @@ -163,12 +163,6 @@
<id>Java.Net</id>
<url>http://download.java.net/maven/2/</url>
</repository>

<!-- Vault Repo -->
<repository>
<id>vault-repo</id>
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
</repository>
</repositories>
<dependencies>
<!-- Please update the Compatibility docs page whenever
Expand Down Expand Up @@ -196,21 +190,6 @@
<version>1.8-R0.1-SNAPSHOT</version>
</dependency>

<!-- CraftBukkit Dependency for experimental features
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.4.5-R0.3-SNAPSHOT</version>
</dependency>-->

<!-- Used for economy stuff -->
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.4</version>
<scope>provided</scope>
</dependency>

<!-- Used for storing and retreiving Constructs in a storage transparent medium: JSONs -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
Expand Down Expand Up @@ -570,14 +549,9 @@
<include>javax.mail:mail:jar:*</include>
<include>javax.activation:activation:jar:*</include>
<include>postgresql:postgresql:jar:*</include>
<include>net.milkbowl.vault:VaultAPI:jar:*</include>
</includes>
</artifactSet>
<relocations>
<!-- <relocation>
<pattern>net.milkbowl.vault</pattern>
<shadedPattern>com.laytonsmith.libs.net.milkbowl.vault</shadedPattern>
</relocation>-->
<relocation>
<pattern>org.perf4j</pattern>
<shadedPattern>com.laytonsmith.libs.org.perf4j</shadedPattern>
Expand Down Expand Up @@ -676,12 +650,6 @@
</relocation>
</relocations>
<filters>
<filter>
<artifact>net.milkbowl.vault:VaultAPI:jar:*</artifact>
<includes>
<include>net/milkbowl/vault/**</include>
</includes>
</filter>
<filter>
<artifact>org.xerial:sqlite-jdbc:jar:*</artifact>
<includes>
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/com/laytonsmith/abstraction/MCServer.java
Expand Up @@ -7,8 +7,6 @@
import java.util.Set;
import java.util.UUID;

import net.milkbowl.vault.economy.Economy;


/**
*
Expand Down Expand Up @@ -76,8 +74,6 @@ public interface MCServer extends AbstractionObject{
public MCScoreboard getMainScoreboard();
public MCScoreboard getNewScoreboard();

public Economy getEconomy();

public void runasConsole(String cmd);
public MCMessenger getMessenger();

Expand Down
Expand Up @@ -28,6 +28,8 @@
import java.net.InetSocketAddress;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Note;
Expand Down Expand Up @@ -562,6 +564,11 @@ public MCLocation getBedSpawnLocation() {
return loc == null ? null : new BukkitMCLocation(loc);
}

@Override
public UUID getUniqueID() {
return p.getUniqueId();
}

@Override
public void setBedSpawnLocation(MCLocation l) {
p.setBedSpawnLocation((Location)l.getHandle(), true);
Expand Down
Expand Up @@ -32,7 +32,6 @@
import java.util.Set;
import java.util.UUID;

import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.Server;
Expand All @@ -43,7 +42,6 @@
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.Recipe;
import org.bukkit.plugin.RegisteredServiceProvider;

/**
*
Expand Down Expand Up @@ -360,21 +358,6 @@ public List<MCOfflinePlayer> getOperators() {
return list;
}

@Override
public Economy getEconomy() {
try{
@SuppressWarnings("unchecked")
RegisteredServiceProvider<Economy> economyProvider = (RegisteredServiceProvider<Economy>)
s.getServicesManager().getRegistration(Class.forName("net.milkbowl.vault.economy.Economy"));
if (economyProvider != null) {
return economyProvider.getProvider();
}
} catch(ClassNotFoundException e){
//Ignored, it means they don't have Vault installed.
}
return null;
}

@Override
public void runasConsole(String cmd) {
CommandSender sender = (CommandSender)Static.GetCommandSender("~console", Target.UNKNOWN).getHandle();
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/com/laytonsmith/core/AliasCore.java
Expand Up @@ -20,7 +20,6 @@
import com.laytonsmith.core.exceptions.ConfigRuntimeException;
import com.laytonsmith.core.exceptions.ProgramFlowManipulationException;
import com.laytonsmith.core.extensions.ExtensionManager;
import com.laytonsmith.core.functions.Economy;
import com.laytonsmith.core.functions.IncludeCache;
import com.laytonsmith.core.functions.Scheduling;
import com.laytonsmith.core.packetjumper.PacketJumper;
Expand Down Expand Up @@ -534,13 +533,6 @@ public final void reload(MCPlayer player, String[] settings) {
t.printStackTrace();
}

if (!Economy.setupEconomy()) {
if (Prefs.DebugMode()) {
logger.log(Level.WARNING, "[CommandHelper]: Economy could not be initialized. No further"
+ " errors will occur, unless you try to use an Economy function.");
}
}

ProfilePoint postReloadAliases = parent.profiler.start("Extension manager post reload aliases", LogLevel.VERBOSE);
try {
ExtensionManager.PostReloadAliases();
Expand Down

0 comments on commit 4b485fd

Please sign in to comment.