mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Check for the root cause instead of the source when handling the InteractBlockEvent
This commit is contained in:
parent
96798bbb90
commit
2fd5c2f887
@ -149,12 +149,12 @@ public class SpongeWorldEdit {
|
||||
if (!platform.isHookingEvents()) return; // We have to be told to catch these events
|
||||
|
||||
WorldEdit we = WorldEdit.getInstance();
|
||||
Optional<Player> optPlayer = event.getCause().get(NamedCause.SOURCE, Player.class);
|
||||
if (!optPlayer.isPresent()) {
|
||||
Object rootObj = event.getCause().root();
|
||||
if (!(rootObj instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
SpongePlayer player = wrapPlayer(optPlayer.get());
|
||||
SpongePlayer player = wrapPlayer((Player) rootObj);
|
||||
com.sk89q.worldedit.world.World world = player.getWorld();
|
||||
|
||||
BlockSnapshot targetBlock = event.getTargetBlock();
|
||||
|
Loading…
Reference in New Issue
Block a user