Implement PlotComponentSetEvent

This commit is contained in:
manuelgu
2016-05-25 21:49:55 +02:00
parent ef60aeb017
commit ceb8fb9fa3
8 changed files with 136 additions and 3 deletions

View File

@ -7,9 +7,9 @@ import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PseudoRandom;
import com.intellectualcrafters.plot.object.RegionWrapper;
import com.intellectualcrafters.plot.util.EventUtil;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.SetQueue;
import java.util.ArrayList;
/**
@ -22,27 +22,35 @@ public class ClassicPlotManager extends SquarePlotManager {
switch (component) {
case "floor":
setFloor(plotworld, plotid, blocks);
EventUtil.manager.callComponentSet(plotworld.getPlot(plotid), component);
return true;
case "wall":
setWallFilling(plotworld, plotid, blocks);
EventUtil.manager.callComponentSet(plotworld.getPlot(plotid), component);
return true;
case "all":
setAll(plotworld, plotid, blocks);
EventUtil.manager.callComponentSet(plotworld.getPlot(plotid), component);
return true;
case "air":
setAir(plotworld, plotid, blocks);
EventUtil.manager.callComponentSet(plotworld.getPlot(plotid), component);
return true;
case "main":
setMain(plotworld, plotid, blocks);
EventUtil.manager.callComponentSet(plotworld.getPlot(plotid), component);
return true;
case "middle":
setMiddle(plotworld, plotid, blocks);
EventUtil.manager.callComponentSet(plotworld.getPlot(plotid), component);
return true;
case "outline":
setOutline(plotworld, plotid, blocks);
EventUtil.manager.callComponentSet(plotworld.getPlot(plotid), component);
return true;
case "border":
setWall(plotworld, plotid, blocks);
EventUtil.manager.callComponentSet(plotworld.getPlot(plotid), component);
return true;
}
return false;

View File

@ -31,6 +31,8 @@ public abstract class EventUtil {
public abstract boolean callTeleport(PlotPlayer player, Location from, Plot plot);
public abstract boolean callComponentSet(Plot plot, String component);
public abstract boolean callClear(Plot plot);
public abstract void callDelete(Plot plot);