package me.barslan_.com;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class NoReds extends JavaPlugin implements Listener {
@EventHandler
public void onPlaceBlock(BlockPlaceEvent event) {
Block targetBlock = event.getBlockAgainst();
Block placedBlock = event.getBlockPlaced();
if (targetBlock.getType().equals(Material.ACACIA_TRAPDOOR) && placedBlock.getType().equals(Material.REDSTONE)) {
event.setCancelled(true);
event.getPlayer().sendMessage(ChatColor.RED + "Ваще действие может вызвать лаги на сервере.");
}
}
}
name: com.bars
version: '${project.version}'
main: me.barslan_.com.NoReds
api-version: 1.14
author: BarsLan