2015-10-07 08:33:33 +02:00
|
|
|
package com.plotsquared.sponge.util;
|
|
|
|
|
2015-12-19 20:30:06 +01:00
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
import org.apache.commons.lang.NotImplementedException;
|
|
|
|
|
|
|
|
import com.intellectualcrafters.plot.PS;
|
2015-10-07 08:33:33 +02:00
|
|
|
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
|
|
|
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
|
|
|
import com.intellectualcrafters.plot.util.EconHandler;
|
|
|
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
2015-12-19 20:30:06 +01:00
|
|
|
import com.plotsquared.sponge.SpongeMain;
|
2015-10-07 08:33:33 +02:00
|
|
|
import com.plotsquared.sponge.object.SpongePlayer;
|
|
|
|
|
|
|
|
public class SpongeEconHandler extends EconHandler {
|
|
|
|
|
2015-12-19 20:30:06 +01:00
|
|
|
private Object TE_SERVICE;
|
|
|
|
private Object EL_SERVICE;
|
|
|
|
|
|
|
|
public SpongeEconHandler() {
|
|
|
|
try {
|
|
|
|
Class<?> clazz = Class.forName("com.erigitic.service.TEService");
|
|
|
|
this.TE_SERVICE = SpongeMain.THIS.getGame().getServiceManager().provide(clazz).get();
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
try {
|
|
|
|
Class<?> clazz = Class.forName("me.Flibio.EconomyLite.API.EconomyLiteAPI");
|
|
|
|
this.EL_SERVICE = SpongeMain.THIS.getGame().getServiceManager().provide(clazz).get();
|
|
|
|
} catch (Exception e2) {
|
|
|
|
PS.log("No economy service found! (EconomyLite, TotalEconomy)");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-10-07 08:33:33 +02:00
|
|
|
@Override
|
|
|
|
public void withdrawMoney(PlotPlayer player, double amount) {
|
2015-12-19 20:30:06 +01:00
|
|
|
UUID uuid = ((SpongePlayer) player).player.getUniqueId();
|
2015-10-07 08:33:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void depositMoney(PlotPlayer player, double amount) {
|
2015-12-19 20:30:06 +01:00
|
|
|
UUID uuid = ((SpongePlayer) player).player.getUniqueId();
|
2015-10-07 08:33:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void depositMoney(OfflinePlotPlayer player, double amount) {
|
2015-12-19 20:30:06 +01:00
|
|
|
UUID uuid = player.getUUID();
|
2015-10-07 08:33:33 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setPermission(String world, String player, String perm, boolean value) {
|
|
|
|
// TODO Auto-generated method stub
|
2015-12-19 20:30:06 +01:00
|
|
|
throw new NotImplementedException("TODO/WIP/NOT IMPLEMENTED!");
|
2015-10-07 08:33:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean hasPermission(String world, String player, String perm) {
|
|
|
|
SpongePlayer obj = (SpongePlayer) UUIDHandler.getPlayer(player);
|
|
|
|
if (obj != null) {
|
|
|
|
return obj.player.hasPermission(perm);
|
|
|
|
}
|
|
|
|
// TODO offline
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|