2016-05-25 21:49:55 +02:00
|
|
|
package com.plotsquared.sponge.events;
|
|
|
|
|
|
|
|
import com.intellectualcrafters.plot.object.Plot;
|
|
|
|
import org.spongepowered.api.event.cause.Cause;
|
|
|
|
import org.spongepowered.api.event.impl.AbstractEvent;
|
|
|
|
|
|
|
|
import com.intellectualcrafters.plot.object.PlotId;
|
|
|
|
|
|
|
|
public class PlotComponentSetEvent extends AbstractEvent {
|
|
|
|
private final Plot plot;
|
|
|
|
private final String component;
|
|
|
|
|
|
|
|
/**
|
2016-05-28 00:29:27 +02:00
|
|
|
* PlotDeleteEvent: Called when a plot component is set
|
2016-05-25 21:49:55 +02:00
|
|
|
*
|
2016-05-28 00:29:27 +02:00
|
|
|
* @param plot The plot
|
|
|
|
* @param component The component which was set
|
2016-05-25 21:49:55 +02:00
|
|
|
*/
|
|
|
|
public PlotComponentSetEvent(Plot plot, String component) {
|
|
|
|
this.plot = plot;
|
|
|
|
this.component = component;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the PlotId
|
|
|
|
*
|
|
|
|
* @return PlotId
|
|
|
|
*/
|
|
|
|
public PlotId getPlotId() {
|
|
|
|
return this.plot.getId();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the world name
|
|
|
|
*
|
|
|
|
* @return String
|
|
|
|
*/
|
|
|
|
public String getWorld() {
|
|
|
|
return this.plot.getArea().worldname;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the component which was set
|
|
|
|
*
|
|
|
|
* @return Component name
|
|
|
|
*/
|
|
|
|
public String getComponent() {
|
|
|
|
return this.component;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Cause getCause() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|