Merge pull request #2533 from mindw0rm/PlaceFlagBugfix

Place flag bugfix (fixxes issue #2524)
This commit is contained in:
Matt 2019-10-21 21:27:48 -04:00 committed by GitHub
commit 5741d5f6a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2042,13 +2042,14 @@ import java.util.regex.Pattern;
if (type == Material.AIR) { if (type == Material.AIR) {
type = offType; type = offType;
} }
// in the following, lb needs to have the material of the item in hand i.e. type
lb = new BukkitLazyBlock(PlotBlock.get(type.toString()));
if (type.isBlock()) { if (type.isBlock()) {
location = BukkitUtil location = BukkitUtil
.getLocation(block.getRelative(event.getBlockFace()).getLocation()); .getLocation(block.getRelative(event.getBlockFace()).getLocation());
eventType = PlayerBlockEventType.PLACE_BLOCK; eventType = PlayerBlockEventType.PLACE_BLOCK;
break; break;
} }
lb = new BukkitLazyBlock(PlotBlock.get(type.toString()));
if (type.toString().toLowerCase().endsWith("egg")) { if (type.toString().toLowerCase().endsWith("egg")) {
eventType = PlayerBlockEventType.SPAWN_MOB; eventType = PlayerBlockEventType.SPAWN_MOB;
} else { } else {