mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Fix #1355
There is the possibility this will cause issues with sponge Signed-off-by: MattBDev <mattbdev@outlook.com>
This commit is contained in:
parent
8e7e5dcb25
commit
a4363bdb27
@ -376,7 +376,7 @@ public class MainListener {
|
|||||||
}
|
}
|
||||||
Optional<Explosive> source = event.getExplosion().getSourceExplosive();
|
Optional<Explosive> source = event.getExplosion().getSourceExplosive();
|
||||||
if (!source.isPresent()) {
|
if (!source.isPresent()) {
|
||||||
event.filterAll();
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Explosive tnt = source.get();
|
Explosive tnt = source.get();
|
||||||
@ -385,21 +385,22 @@ public class MainListener {
|
|||||||
Plot currentPlot = current.getPlot();
|
Plot currentPlot = current.getPlot();
|
||||||
if (currentPlot == null) {
|
if (currentPlot == null) {
|
||||||
if (current.isPlotArea()) {
|
if (current.isPlotArea()) {
|
||||||
event.filterAll();
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (creator != null) {
|
if (creator != null) {
|
||||||
if (!currentPlot.isAdded(creator)) {
|
if (!currentPlot.isAdded(creator)) {
|
||||||
event.filterAll();
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!currentPlot.getFlag(Flags.EXPLOSION).or(false)) {
|
if (!currentPlot.getFlag(Flags.EXPLOSION).or(false)) {
|
||||||
event.filterAll();
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
event.filter(loc -> currentPlot.equals(SpongeUtil.getLocation(loc.getExtent().getName(), loc).getPlot()));
|
|
||||||
|
event.getAffectedLocations().removeIf(worldLocation -> currentPlot.equals(SpongeUtil.getLocation(worldLocation.getExtent().getName(), worldLocation).getPlot()));
|
||||||
event.filterEntities(entity -> currentPlot.equals(SpongeUtil.getLocation(entity).getPlot()));
|
event.filterEntities(entity -> currentPlot.equals(SpongeUtil.getLocation(entity).getPlot()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user