This commit is contained in:
Lemon 2017-10-29 19:45:38 +05:00 committed by GitHub
parent a9681fb7d7
commit 212b367c3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,11 +3,14 @@ package me.totalfreedom.totalfreedommod;
import net.minecraft.server.v1_12_R1.NBTTagCompound; import net.minecraft.server.v1_12_R1.NBTTagCompound;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock;
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack; import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
public class SignPatch extends FreedomService public class SignPatch extends FreedomService
@ -51,4 +54,15 @@ public class SignPatch extends FreedomService
} }
} }
} }
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerInteractSign(PlayerInteractEvent event)
{
if(event.getAction() != Action.RIGHT_CLICK_BLOCK)
return;
if (event.getClickedBlock() != null && event.getClickedBlock().getType().equals(Material.SIGN) || event.getClickedBlock().getType().equals(Material.SIGN_POST) || event.getClickedBlock().getType().equals(Material.WALL_SIGN))
{
event.setCancelled(true);
}
}
} }