mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-28 03:34:42 +02:00
Fixes #518
This commit is contained in:
@ -14,6 +14,7 @@ import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotCluster;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
import com.intellectualcrafters.plot.object.Rating;
|
||||
import com.intellectualcrafters.plot.util.EventUtil;
|
||||
import com.plotsquared.bukkit.events.ClusterFlagRemoveEvent;
|
||||
import com.plotsquared.bukkit.events.PlayerClaimPlotEvent;
|
||||
@ -28,6 +29,7 @@ import com.plotsquared.bukkit.events.PlotDeleteEvent;
|
||||
import com.plotsquared.bukkit.events.PlotFlagAddEvent;
|
||||
import com.plotsquared.bukkit.events.PlotFlagRemoveEvent;
|
||||
import com.plotsquared.bukkit.events.PlotMergeEvent;
|
||||
import com.plotsquared.bukkit.events.PlotRateEvent;
|
||||
import com.plotsquared.bukkit.events.PlotUnlinkEvent;
|
||||
import com.plotsquared.bukkit.object.BukkitPlayer;
|
||||
|
||||
@ -117,5 +119,12 @@ public class BukkitEventUtil extends EventUtil {
|
||||
public boolean callFlagRemove(Flag flag, PlotCluster cluster) {
|
||||
return callEvent(new ClusterFlagRemoveEvent(flag, cluster));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rating callRating(PlotPlayer player, Plot plot, Rating rating) {
|
||||
PlotRateEvent event = new PlotRateEvent(player, rating, plot);
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
return event.getRating();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotCluster;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
import com.intellectualcrafters.plot.object.Rating;
|
||||
import com.intellectualcrafters.plot.util.EventUtil;
|
||||
import com.plotsquared.sponge.SpongeMain;
|
||||
import com.plotsquared.sponge.events.ClusterFlagRemoveEvent;
|
||||
@ -28,6 +29,7 @@ import com.plotsquared.sponge.events.PlotDeleteEvent;
|
||||
import com.plotsquared.sponge.events.PlotFlagAddEvent;
|
||||
import com.plotsquared.sponge.events.PlotFlagRemoveEvent;
|
||||
import com.plotsquared.sponge.events.PlotMergeEvent;
|
||||
import com.plotsquared.sponge.events.PlotRateEvent;
|
||||
import com.plotsquared.sponge.events.PlotUnlinkEvent;
|
||||
|
||||
public class SpongeEventUtil extends EventUtil {
|
||||
@ -115,5 +117,12 @@ public class SpongeEventUtil extends EventUtil {
|
||||
public boolean callFlagRemove(Flag flag, PlotCluster cluster) {
|
||||
return callEvent(new ClusterFlagRemoveEvent(flag, cluster));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rating callRating(PlotPlayer player, Plot plot, Rating rating) {
|
||||
PlotRateEvent event = new PlotRateEvent(player, rating, plot);
|
||||
events.post(event);
|
||||
return event.getRating();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user