Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict modifying signs #2080

Merged
merged 3 commits into from
Jun 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.bukkit.World.Environment;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.Sign;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Levelled;
import org.bukkit.block.data.Waterlogged;
Expand Down Expand Up @@ -1811,7 +1812,10 @@ else if (clickedBlock != null &&
clickedBlockType == Material.COMPARATOR ||
clickedBlockType == Material.REDSTONE_WIRE ||
Tag.FLOWER_POTS.isTagged(clickedBlockType) ||
Tag.CANDLES.isTagged(clickedBlockType)
Tag.CANDLES.isTagged(clickedBlockType) ||
// Only block interaction with un-editable signs to allow command signs to function.
// TODO: When we are required to update Spigot API to 1.20 to support a change, swap to Sign#isWaxed
Tag.SIGNS.isTagged(clickedBlockType) && clickedBlock.getState() instanceof Sign sign && sign.isEditable()
))
{
if (playerData == null) playerData = this.dataStore.getPlayerData(player.getUniqueId());
Expand Down Expand Up @@ -1851,15 +1855,15 @@ else if (material.name().endsWith("_DYE"))
dyes.add(material);
}

//if it's bonemeal, armor stand, spawn egg, etc - check for build permission //RoboMWM: also check flint and steel to stop TNT ignition
//add glowing ink sac and ink sac, due to their usage on signs
// Require build permission for items that may have an effect on the world when used.
if (clickedBlock != null && (materialInHand == Material.BONE_MEAL
|| materialInHand == Material.ARMOR_STAND
|| (spawn_eggs.contains(materialInHand) && GriefPrevention.instance.config_claims_preventGlobalMonsterEggs)
|| materialInHand == Material.END_CRYSTAL
|| materialInHand == Material.FLINT_AND_STEEL
|| materialInHand == Material.INK_SAC
|| materialInHand == Material.GLOW_INK_SAC
|| materialInHand == Material.HONEYCOMB
|| dyes.contains(materialInHand)))
{
String noBuildReason = instance
Expand Down