mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 11:55:38 +01:00
fix: adjust nullability checks for shulkers in the kill road mobs task (#3842)
- Fixes #3789
This commit is contained in:
parent
76c6be9ba7
commit
9f3850000c
@ -866,10 +866,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
com.plotsquared.core.location.Location pLoc = BukkitUtil.adapt(entity.getLocation());
|
||||
PlotArea area = pLoc.getPlotArea();
|
||||
if (area != null) {
|
||||
PlotId currentPlotId = area.getPlotAbs(pLoc).getId();
|
||||
if (!originalPlotId.equals(currentPlotId) && (currentPlotId == null || !area.getPlot(
|
||||
originalPlotId)
|
||||
.equals(area.getPlot(currentPlotId)))) {
|
||||
Plot currentPlot = area.getPlotAbs(pLoc);
|
||||
if (currentPlot == null || !originalPlotId.equals(currentPlot.getId())) {
|
||||
if (entity.hasMetadata("ps-tmp-teleport")) {
|
||||
continue;
|
||||
}
|
||||
@ -883,11 +881,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
com.plotsquared.core.location.Location pLoc = BukkitUtil.adapt(entity.getLocation());
|
||||
PlotArea area = pLoc.getPlotArea();
|
||||
if (area != null) {
|
||||
PlotId currentPlotId = area.getPlotAbs(pLoc).getId();
|
||||
if (currentPlotId != null) {
|
||||
Plot currentPlot = area.getPlotAbs(pLoc);
|
||||
if (currentPlot != null) {
|
||||
entity.setMetadata(
|
||||
"shulkerPlot",
|
||||
new FixedMetadataValue((Plugin) PlotSquared.platform(), currentPlotId)
|
||||
new FixedMetadataValue((Plugin) PlotSquared.platform(), currentPlot.getId())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user