mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Don't include eggs with spawn*_eggs*
This commit is contained in:
parent
2fb76e6636
commit
afb72aa102
@ -1514,8 +1514,9 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
for (Block block1 : event.getBlocks()) {
|
for (Block block1 : event.getBlocks()) {
|
||||||
Location bloc = BukkitUtil.getLocation(block1.getLocation());
|
Location bloc = BukkitUtil.getLocation(block1.getLocation());
|
||||||
if (bloc.isPlotArea() || bloc.add(relative.getBlockX(),
|
if (bloc.isPlotArea() || bloc
|
||||||
relative.getBlockY(), relative.getBlockZ()).isPlotArea()) {
|
.add(relative.getBlockX(), relative.getBlockY(), relative.getBlockZ())
|
||||||
|
.isPlotArea()) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1546,8 +1547,8 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!plot.equals(area.getOwnedPlot(location.add(
|
if (!plot.equals(area.getOwnedPlot(
|
||||||
relative.getBlockX(), relative.getBlockY(), relative.getBlockZ())))) {
|
location.add(relative.getBlockX(), relative.getBlockY(), relative.getBlockZ())))) {
|
||||||
// This branch is only necessary to prevent pistons from extending
|
// This branch is only necessary to prevent pistons from extending
|
||||||
// if they are: on a plot edge, facing outside the plot, and not
|
// if they are: on a plot edge, facing outside the plot, and not
|
||||||
// pushing any blocks
|
// pushing any blocks
|
||||||
@ -1568,8 +1569,9 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
for (Block block1 : event.getBlocks()) {
|
for (Block block1 : event.getBlocks()) {
|
||||||
Location bloc = BukkitUtil.getLocation(block1.getLocation());
|
Location bloc = BukkitUtil.getLocation(block1.getLocation());
|
||||||
if (bloc.isPlotArea() || bloc.add(relative.getBlockX(),
|
if (bloc.isPlotArea() || bloc
|
||||||
relative.getBlockY(), relative.getBlockZ()).isPlotArea()) {
|
.add(relative.getBlockX(), relative.getBlockY(), relative.getBlockZ())
|
||||||
|
.isPlotArea()) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1955,7 +1957,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
if (event.getAction() == Action.RIGHT_CLICK_AIR) {
|
if (event.getAction() == Action.RIGHT_CLICK_AIR) {
|
||||||
Material item = event.getMaterial();
|
Material item = event.getMaterial();
|
||||||
if (item.toString().toLowerCase().endsWith("egg")) {
|
if (item.toString().toLowerCase().endsWith("_egg")) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
event.setUseItemInHand(Event.Result.DENY);
|
event.setUseItemInHand(Event.Result.DENY);
|
||||||
}
|
}
|
||||||
@ -1967,7 +1969,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||||||
if (type == Material.AIR) {
|
if (type == Material.AIR) {
|
||||||
type = offType;
|
type = offType;
|
||||||
}
|
}
|
||||||
if (type.toString().toLowerCase().endsWith("egg")) {
|
if (type.toString().toLowerCase().endsWith("_egg")) {
|
||||||
Block block = player.getTargetBlockExact(5, FluidCollisionMode.SOURCE_ONLY);
|
Block block = player.getTargetBlockExact(5, FluidCollisionMode.SOURCE_ONLY);
|
||||||
if (block != null && block.getType() != Material.AIR) {
|
if (block != null && block.getType() != Material.AIR) {
|
||||||
Location location = BukkitUtil.getLocation(block.getLocation());
|
Location location = BukkitUtil.getLocation(block.getLocation());
|
||||||
|
Loading…
Reference in New Issue
Block a user