Skip to content

Commit 7908a35

Browse files
committed
Fix worldguard hook
1 parent d2d65cb commit 7908a35

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

org/wargamer2010/signshop/hooks/WorldGuardHook.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public String getName() {
2121
public Boolean canBuild(Player player, Block block) {
2222
if (HookManager.getHook("WorldGuard") == null) return true;
2323

24-
LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(player);
24+
LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(player.getPlayer());
2525
if (WorldGuard.getInstance().getPlatform().getSessionManager().hasBypass(localPlayer, localPlayer.getWorld())) return true;
2626

2727
Location loc = localPlayer.getLocation();

org/wargamer2010/signshop/listeners/sslisteners/WorldGuardChecker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import com.sk89q.worldedit.math.BlockVector3;
55
import com.sk89q.worldedit.world.World;
6-
import com.sk89q.worldguard.LocalPlayer;
76
import com.sk89q.worldguard.WorldGuard;
7+
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
88
import com.sk89q.worldguard.protection.flags.Flag;
99
import com.sk89q.worldguard.protection.flags.StateFlag;
1010
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
@@ -29,7 +29,7 @@ public void onSSBuildEvent(SSCreatedEvent event) {
2929
return;
3030

3131
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
32-
World world = ((LocalPlayer) event.getPlayer().getPlayer()).getWorld();
32+
World world = WorldGuardPlugin.inst().wrapPlayer(event.getPlayer().getPlayer()).getWorld();
3333
Location sl = event.getSign().getLocation();
3434
BlockVector3 region = BlockVector3.at(sl.getX(), sl.getY(), sl.getZ());
3535

0 commit comments

Comments
 (0)