mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 12:35:15 +01:00
Fix #1034
This commit is contained in:
parent
e801c6d7e8
commit
ea3306d070
@ -699,7 +699,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||||||
if (this.lastRadius != 0) {
|
if (this.lastRadius != 0) {
|
||||||
List<Entity> nearby = event.getEntity().getNearbyEntities(this.lastRadius, this.lastRadius, this.lastRadius);
|
List<Entity> nearby = event.getEntity().getNearbyEntities(this.lastRadius, this.lastRadius, this.lastRadius);
|
||||||
for (Entity near : nearby) {
|
for (Entity near : nearby) {
|
||||||
if (near instanceof TNTPrimed || near.getType() == EntityType.MINECART_TNT) {
|
if (near instanceof TNTPrimed || near.getType().equals(EntityType.MINECART_TNT)) {
|
||||||
if (!near.hasMetadata("plot")) {
|
if (!near.hasMetadata("plot")) {
|
||||||
near.setMetadata("plot", new FixedMetadataValue((Plugin) PS.get().IMP, plot));
|
near.setMetadata("plot", new FixedMetadataValue((Plugin) PS.get().IMP, plot));
|
||||||
}
|
}
|
||||||
@ -952,12 +952,12 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
List<Block> blocks = event.getBlocks();
|
List<Block> blocks = event.getBlocks();
|
||||||
for (Block b : blocks) {
|
for (Block b : blocks) {
|
||||||
Location bloc = BukkitUtil.getLocation(b.getLocation().add(relative));
|
Location bloc = BukkitUtil.getLocation(b.getLocation());
|
||||||
if (!area.contains(bloc.getX(), bloc.getZ())) {
|
if (!area.contains(bloc.getX(), bloc.getZ()) || !area.contains(bloc.getX() + relative.getBlockX(), bloc.getZ() + relative.getBlockZ())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!plot.equals(area.getOwnedPlot(bloc))) {
|
if (!plot.equals(area.getOwnedPlot(bloc)) || !plot.equals(area.getOwnedPlot(bloc.add(relative.getBlockX(), relative.getBlockY(), relative.getBlockZ())))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -366,7 +366,11 @@ public class EntityWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void restoreInventory(InventoryHolder entity) {
|
private void restoreInventory(InventoryHolder entity) {
|
||||||
entity.getInventory().setContents(this.inventory);
|
try {
|
||||||
|
entity.getInventory().setContents(this.inventory);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
PS.debug("&c[WARN] Failed to restore inventory.\n Reason: " + e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void storeLiving(LivingEntity lived) {
|
public void storeLiving(LivingEntity lived) {
|
||||||
|
Loading…
Reference in New Issue
Block a user