mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-21 23:51:27 +01:00
Paper only: Protect sign modifications as building
This commit is contained in:
parent
5fa6f2a858
commit
c2b95f59a8
@ -47,6 +47,7 @@
|
||||
import com.sk89q.worldguard.config.WorldConfiguration;
|
||||
import com.sk89q.worldguard.protection.flags.Flags;
|
||||
import io.papermc.lib.PaperLib;
|
||||
import io.papermc.paper.event.player.PlayerOpenSignEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
@ -1266,5 +1267,13 @@ private class PaperListener implements Listener {
|
||||
public void onEntityTransform(EntityZapEvent event) {
|
||||
Events.fireToCancel(event, new DamageEntityEvent(event, create(event.getBolt()), event.getEntity()));
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onSignOpen(PlayerOpenSignEvent event) {
|
||||
if (event.getCause() == PlayerOpenSignEvent.Cause.INTERACT) {
|
||||
// other cases are handled by other events
|
||||
Events.fireToCancel(event, new UseBlockEvent(event, create(event.getPlayer()), event.getSign().getBlock()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1343,7 +1343,8 @@ public static boolean isConsideredBuildingIfUsed(Material type) {
|
||||
|| type == Material.DRAGON_EGG
|
||||
|| Tag.FLOWER_POTS.isTagged(type)
|
||||
|| Tag.CANDLES.isTagged(type)
|
||||
|| Tag.CANDLE_CAKES.isTagged(type);
|
||||
|| Tag.CANDLE_CAKES.isTagged(type)
|
||||
|| Tag.ALL_SIGNS.isTagged(type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user