Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-07 20:10:06 +01:00
A BlockSnapot does not always have a location in the InteractBlockEvent
Dieser Commit ist enthalten in:
Ursprung
a50e337224
Commit
330523bac4
@ -154,7 +154,13 @@ public class SpongeWorldEdit {
|
|||||||
com.sk89q.worldedit.world.World world = player.getWorld();
|
com.sk89q.worldedit.world.World world = player.getWorld();
|
||||||
|
|
||||||
BlockSnapshot targetBlock = event.getTargetBlock();
|
BlockSnapshot targetBlock = event.getTargetBlock();
|
||||||
Location<World> loc = targetBlock.getLocation().get();
|
Optional<Location<World>> optLoc = targetBlock.getLocation();
|
||||||
|
|
||||||
|
if (!optLoc.isPresent()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Location<World> loc = optLoc.get();
|
||||||
BlockType interactedType = targetBlock.getState().getType();
|
BlockType interactedType = targetBlock.getState().getType();
|
||||||
|
|
||||||
if (event instanceof InteractBlockEvent.Primary) {
|
if (event instanceof InteractBlockEvent.Primary) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren