mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Added money given on delete.
This commit is contained in:
parent
1ddb6b3bdc
commit
ef443cade3
@ -25,7 +25,7 @@ public enum C {
|
|||||||
/*
|
/*
|
||||||
* Economy Stuff
|
* 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
|
* Setup Stuff
|
||||||
*/
|
*/
|
||||||
|
@ -464,8 +464,8 @@ public class PlotMain extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Implement better system The whole point of this system is to
|
* TODO: Implement better system
|
||||||
* recycle old plots So why not just allow users to claim old plots, and try
|
* 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
|
* 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
|
* /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
|
* know - On /plot info, - show that the plot is expired and allowed to be
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package com.intellectualcrafters.plot;
|
package com.intellectualcrafters.plot;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the PlotWorld class (obviously) <br>
|
* This is the PlotWorld class (obviously) <br>
|
||||||
* - All existing PlotWorld instances should be kept in PlotMain (worlds
|
* - All existing PlotWorld instances should be kept in PlotMain (worlds
|
||||||
@ -225,4 +225,5 @@ public class PlotWorld {
|
|||||||
public boolean USE_ECONOMY = false;
|
public boolean USE_ECONOMY = false;
|
||||||
public double PLOT_PRICE = 100;
|
public double PLOT_PRICE = 100;
|
||||||
public double MERGE_PRICE = 100;
|
public double MERGE_PRICE = 100;
|
||||||
|
public double SELL_PRICE = 75;
|
||||||
}
|
}
|
||||||
|
@ -9,14 +9,10 @@
|
|||||||
|
|
||||||
package com.intellectualcrafters.plot.commands;
|
package com.intellectualcrafters.plot.commands;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import com.intellectualcrafters.plot.*;
|
||||||
|
|
||||||
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.database.DBFunc;
|
import com.intellectualcrafters.plot.database.DBFunc;
|
||||||
|
import net.milkbowl.vault.economy.Economy;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Citymonstret on 2014-08-01.
|
* Created by Citymonstret on 2014-08-01.
|
||||||
@ -42,6 +38,15 @@ public class Delete extends SubCommand {
|
|||||||
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
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);
|
boolean result = PlotMain.removePlot(plr.getWorld().getName(), plot.id, true);
|
||||||
if (result) {
|
if (result) {
|
||||||
PlotHelper.removeSign(plr, plot);
|
PlotHelper.removeSign(plr, plot);
|
||||||
|
@ -184,6 +184,9 @@ public class DefaultPlotWorld extends PlotWorld {
|
|||||||
|
|
||||||
public double PLOT_PRICE;
|
public double PLOT_PRICE;
|
||||||
public static double PLOT_PRICE_DEFAULT = 100;
|
public static double PLOT_PRICE_DEFAULT = 100;
|
||||||
|
|
||||||
|
public double SELL_PRICE;
|
||||||
|
public static double SELL_PRICE_DEFAULT = 75;
|
||||||
|
|
||||||
public double MERGE_PRICE;
|
public double MERGE_PRICE;
|
||||||
public static double MERGE_PRICE_DEFAULT = 100;
|
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.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.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.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)
|
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.USE_ECONOMY = config.getBoolean("economy.use");
|
||||||
this.PLOT_PRICE = config.getDouble("economy.prices.claim");
|
this.PLOT_PRICE = config.getDouble("economy.prices.claim");
|
||||||
this.MERGE_PRICE = config.getDouble("economy.prices.merge");
|
this.MERGE_PRICE = config.getDouble("economy.prices.merge");
|
||||||
|
this.SELL_PRICE = config.getDouble("economy.prices.sell");
|
||||||
this.PLOT_CHAT = config.getBoolean("chat.enabled");
|
this.PLOT_CHAT = config.getBoolean("chat.enabled");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user