mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Merge pull request #1134 from manuelgu/feature/componentevent
[WIP] Implement PlotComponentSetEvent
This commit is contained in:
@ -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() {
|
||||
|
@ -9,7 +9,6 @@ import com.intellectualcrafters.plot.object.PseudoRandom;
|
||||
import com.intellectualcrafters.plot.object.RegionWrapper;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.SetQueue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
|
@ -18,11 +18,11 @@ 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.geom.Area;
|
||||
import java.awt.geom.PathIterator;
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user