mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Move event calling to Plot class
This commit is contained in:
parent
ceb8fb9fa3
commit
ec4839ec3f
@ -111,7 +111,7 @@ public class Set extends SubCommand {
|
||||
}
|
||||
plot.addRunning();
|
||||
for (Plot current : plot.getConnectedPlots()) {
|
||||
manager.setComponent(plotworld, current.getId(), component, blocks);
|
||||
current.setComponent(component, blocks);
|
||||
}
|
||||
MainUtil.sendMessage(plr, C.GENERATING_COMPONENT);
|
||||
SetQueue.IMP.addTask(new Runnable() {
|
||||
|
@ -7,7 +7,6 @@ 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,35 +21,27 @@ 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;
|
||||
|
@ -18,12 +18,12 @@ import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.Permissions;
|
||||
import com.intellectualcrafters.plot.util.SchematicHandler;
|
||||
import com.intellectualcrafters.plot.util.SetQueue;
|
||||
import com.intellectualcrafters.plot.util.StringMan;
|
||||
import com.intellectualcrafters.plot.util.TaskManager;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
import com.intellectualcrafters.plot.util.WorldUtil;
|
||||
import com.plotsquared.listener.PlotListener;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.*;
|
||||
import java.awt.geom.Area;
|
||||
import java.awt.geom.PathIterator;
|
||||
import java.io.File;
|
||||
@ -2600,6 +2600,9 @@ public class Plot {
|
||||
* @return
|
||||
*/
|
||||
public boolean setComponent(String component, PlotBlock[] blocks) {
|
||||
if (StringMan.isEqualToAny(component, getManager().getPlotComponents(this.area, this.getId()))) {
|
||||
EventUtil.manager.callComponentSet(this, component);
|
||||
}
|
||||
return this.getManager().setComponent(this.area, this.getId(), component, blocks);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user