mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-29 04:04:43 +02:00
Scripting stuff + remove PlotSquared-Null
This commit is contained in:
@ -17,4 +17,6 @@ public abstract class EconHandler {
|
||||
public abstract void depositMoney(PlotPlayer player, double amount);
|
||||
public abstract void depositMoney(OfflinePlotPlayer player, double amount);
|
||||
public abstract void setPermission(PlotPlayer player, String perm, boolean value);
|
||||
// public abstract void setPermission(OfflinePlotPlayer player, String perm, boolean value);
|
||||
// public abstract void getPermission(OfflinePlotPlayer player, String perm);
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ public class ExpireManager {
|
||||
if (plot.isMerged()) {
|
||||
MainUtil.unlinkPlot(plot);
|
||||
}
|
||||
plot.delete();
|
||||
plot.deletePlot(null);
|
||||
expiredPlots.get(world).remove(plot);
|
||||
int complexity = changed == null ? 0 : changed.getComplexity();
|
||||
int modified = changed == null ? 0 : changed.changes;
|
||||
|
@ -29,6 +29,7 @@ import java.util.UUID;
|
||||
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.config.Configuration;
|
||||
import com.intellectualcrafters.plot.config.Settings;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.object.BlockLoc;
|
||||
@ -765,6 +766,15 @@ public class MainUtil {
|
||||
}
|
||||
|
||||
public static void removeSign(final Plot p) {
|
||||
if (!PS.get().isMainThread(Thread.currentThread())) {
|
||||
TaskManager.runTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
removeSign(p);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
final String world = p.world;
|
||||
final PlotManager manager = PS.get().getPlotManager(world);
|
||||
final PlotWorld plotworld = PS.get().getPlotWorld(world);
|
||||
@ -783,16 +793,23 @@ public class MainUtil {
|
||||
setSign(UUIDHandler.getName(p.owner), p);
|
||||
}
|
||||
|
||||
public static void setSign(String name, final Plot p) {
|
||||
if (name == null) {
|
||||
name = "unknown";
|
||||
public static void setSign(final String name, final Plot p) {
|
||||
if (!PS.get().isMainThread(Thread.currentThread())) {
|
||||
TaskManager.runTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setSign(name, p);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
String rename = name == null ? "unknown" : name;
|
||||
final PlotManager manager = PS.get().getPlotManager(p.world);
|
||||
final PlotWorld plotworld = PS.get().getPlotWorld(p.world);
|
||||
if (plotworld.ALLOW_SIGNS) {
|
||||
final Location loc = manager.getSignLoc(plotworld, p);
|
||||
final String id = p.id.x + ";" + p.id.y;
|
||||
final String[] lines = new String[] { C.OWNER_SIGN_LINE_1.formatted().replaceAll("%id%", id), C.OWNER_SIGN_LINE_2.formatted().replaceAll("%id%", id).replaceAll("%plr%", name), C.OWNER_SIGN_LINE_3.formatted().replaceAll("%id%", id).replaceAll("%plr%", name), C.OWNER_SIGN_LINE_4.formatted().replaceAll("%id%", id).replaceAll("%plr%", name) };
|
||||
final String[] lines = new String[] { C.OWNER_SIGN_LINE_1.formatted().replaceAll("%id%", id), C.OWNER_SIGN_LINE_2.formatted().replaceAll("%id%", id).replaceAll("%plr%", rename), C.OWNER_SIGN_LINE_3.formatted().replaceAll("%id%", id).replaceAll("%plr%", rename), C.OWNER_SIGN_LINE_4.formatted().replaceAll("%id%", id).replaceAll("%plr%", rename) };
|
||||
BlockManager.setSign(p.world, loc.getX(), loc.getY(), loc.getZ(), lines);
|
||||
}
|
||||
}
|
||||
@ -1762,4 +1779,8 @@ public class MainUtil {
|
||||
}
|
||||
return ratings;
|
||||
}
|
||||
|
||||
public static void setComponent(Plot plot, String component, PlotBlock[] blocks) {
|
||||
PS.get().getPlotManager(plot.world).setComponent(PS.get().getPlotWorld(plot.world), plot.id, component, blocks);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user