mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-25 02:27:42 +01:00
Use fake player build override for NPCs in SessionManager too.
This commit is contained in:
parent
d24157e693
commit
144c31645c
@ -19,6 +19,9 @@
|
||||
|
||||
package com.sk89q.worldguard.bukkit.session;
|
||||
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldguard.LocalPlayer;
|
||||
import com.sk89q.worldguard.WorldGuard;
|
||||
import com.sk89q.worldguard.bukkit.BukkitPlayer;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.sk89q.worldguard.session.AbstractSessionManager;
|
||||
@ -65,4 +68,14 @@ public void run() {
|
||||
get(new BukkitPlayer(WorldGuardPlugin.inst(), player)).tick(new BukkitPlayer(WorldGuardPlugin.inst(), player));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBypass(LocalPlayer player, World world) {
|
||||
if (player instanceof BukkitPlayer) {
|
||||
if (((BukkitPlayer) player).getPlayer().hasMetadata("NPC")
|
||||
&& WorldGuard.getInstance().getPlatform().getGlobalStateManager().get(world).fakePlayerBuildOverride)
|
||||
return true;
|
||||
}
|
||||
return super.hasBypass(player, world);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user