Added money given on delete.

This commit is contained in:
Sauilitired 2014-10-08 19:31:59 +02:00
parent 1ddb6b3bdc
commit ef443cade3
5 changed files with 23 additions and 12 deletions

View File

@ -25,7 +25,7 @@ public enum C {
/*
* Economy Stuff
*/
CANNOT_AFFORD_PLOT("&cYou cannot afford to buy this plot. It costs &6%s"), CANNOT_AFFORD_MERGE("&cYou cannot afford to merge the plots. It costs &6%s"), REMOVED_BALANCE("&6%s &chas been taken from your balance"),
CANNOT_AFFORD_PLOT("&cYou cannot afford to buy this plot. It costs &6%s"), CANNOT_AFFORD_MERGE("&cYou cannot afford to merge the plots. It costs &6%s"), ADDED_BALANCE("&6%s &chas been added to your balance"), REMOVED_BALANCE("&6%s &chas been taken from your balance"),
/*
* Setup Stuff
*/

View File

@ -464,8 +464,8 @@ public class PlotMain extends JavaPlugin {
}
/**
* TODO: Implement better system The whole point of this system is to
* recycle old plots So why not just allow users to claim old plots, and try
* TODO: Implement better system
* The whole point of this system is to recycle old plots So why not just allow users to claim old plots, and try
* to hide the fact that the are owned. Reduce amount of expired plots: - On
* /plot auto - allow claiming of old plot, clear it so the user doesn't
* know - On /plot info, - show that the plot is expired and allowed to be

View File

@ -1,10 +1,10 @@
package com.intellectualcrafters.plot;
import org.bukkit.Material;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Material;
/**
* This is the PlotWorld class (obviously) <br>
* - All existing PlotWorld instances should be kept in PlotMain (worlds
@ -225,4 +225,5 @@ public class PlotWorld {
public boolean USE_ECONOMY = false;
public double PLOT_PRICE = 100;
public double MERGE_PRICE = 100;
public double SELL_PRICE = 75;
}

View File

@ -9,14 +9,10 @@
package com.intellectualcrafters.plot.commands;
import org.bukkit.entity.Player;
import com.intellectualcrafters.plot.C;
import com.intellectualcrafters.plot.PlayerFunctions;
import com.intellectualcrafters.plot.Plot;
import com.intellectualcrafters.plot.PlotHelper;
import com.intellectualcrafters.plot.PlotMain;
import com.intellectualcrafters.plot.*;
import com.intellectualcrafters.plot.database.DBFunc;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.entity.Player;
/**
* Created by Citymonstret on 2014-08-01.
@ -42,6 +38,15 @@ public class Delete extends SubCommand {
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
return false;
}
PlotWorld pWorld = PlotMain.getWorldSettings(plot.getWorld());
if(PlotMain.useEconomy && pWorld.USE_ECONOMY) {
double c = pWorld.SELL_PRICE;
if(c > 0d) {
Economy economy = PlotMain.economy;
economy.depositPlayer(plr, c);
sendMessage(plr, C.ADDED_BALANCE, c + "");
}
}
boolean result = PlotMain.removePlot(plr.getWorld().getName(), plot.id, true);
if (result) {
PlotHelper.removeSign(plr, plot);

View File

@ -184,6 +184,9 @@ public class DefaultPlotWorld extends PlotWorld {
public double PLOT_PRICE;
public static double PLOT_PRICE_DEFAULT = 100;
public double SELL_PRICE;
public static double SELL_PRICE_DEFAULT = 75;
public double MERGE_PRICE;
public static double MERGE_PRICE_DEFAULT = 100;
@ -230,6 +233,7 @@ public class DefaultPlotWorld extends PlotWorld {
new ConfigurationNode("economy.use", USE_ECONOMY, "Enable economy features", Configuration.BOOLEAN, false),
new ConfigurationNode("economy.prices.claim", PLOT_PRICE, "Plot claim price", Configuration.DOUBLE, false),
new ConfigurationNode("economy.prices.merge", MERGE_PRICE, "Plot merge price", Configuration.DOUBLE, false),
new ConfigurationNode("economy.prices.sell", SELL_PRICE, "Plot Sell Price", Configuration.DOUBLE, false),
new ConfigurationNode("chat.enabled", PLOT_CHAT, "Enable plot chat", Configuration.BOOLEAN, false)
};
}
@ -262,6 +266,7 @@ public class DefaultPlotWorld extends PlotWorld {
this.USE_ECONOMY = config.getBoolean("economy.use");
this.PLOT_PRICE = config.getDouble("economy.prices.claim");
this.MERGE_PRICE = config.getDouble("economy.prices.merge");
this.SELL_PRICE = config.getDouble("economy.prices.sell");
this.PLOT_CHAT = config.getBoolean("chat.enabled");
}
}