Jump to content

cookieassassin

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by cookieassassin

  1. Thank you for moving it. I made a post on bukkit forums but there staff just removed the thread and told me to put it here. I really don't know why myself, its the same as any other bukkit plugin.
  2. Hi guys, so i was making a plugin for tekkit new frontier (Minecraft 1.5.1) and i exported it, put it in the plugins folder and started up the server. When i log into the server "/antibag" works but when i do something in my inventory or try and rename the bag the plugin doesn't do anything. I can't seem to work out what the problem is, so i decided to ask u guys Here is my main class: Code:java package me.CookieAssassin.AntiBag; import java.util.logging.Logger; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.Event; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; public class AntiBag extends JavaPlugin{ public final Logger logger= Logger.getLogger("Minecraft"); public static AntiBag plugin; public final KeyPressListener kpl = new KeyPressListener(this); @Override public void onDisable() { PluginDescriptionFile pdfFile = this.getDescription(); this.logger.info(pdfFile.getName() + " Has Been Disabled!"); } @Override public void onEnable() { PluginManager pm = getServer().getPluginManager(); pm.registerEvents(this.kpl, this); PluginDescriptionFile pdfFile = this.getDescription(); this.logger.info(pdfFile.getName() + " V." + pdfFile.getVersion() + " Has Been Enabled!"); } public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String args[]) { Player harvey = (Player) sender; if(commandLabel.equalsIgnoreCase("antibag")) { sender.sendMessage("§4[§1AntiBag§4] This plugin is for tekkit new frontier Minecraft version 1.5.1. It stops users from duplicating using backpacks."); } return false; } } And here is my KeyPressListeners class: Code:java package me.CookieAssassin.AntiBag; import net.minecraft.server.v1_5_R3.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.inventory.InventoryInteractEvent; import org.bukkit.event.player.PlayerInteractEvent; import backpack.Backpack; import backpack.misc.ConfigurationBackpack; import backpack.util.*; public class KeyPressListener implements Listener { AntiBag plugin; public KeyPressListener(AntiBag instance) { plugin = instance; } @EventHandler(priority=EventPriority.LOWEST, ignoreCancelled=true) private void click(InventoryInteractEvent event) { Player player = (Player) event.getViewers(); String eventName = event.getEventName(); player.sendMessage("§4[§1AntiBag§4] The event you just called is " + eventName); } @EventHandler(priority=EventPriority.LOWEST, ignoreCancelled=true) private void bitchTryingToRename(PlayerInteractEvent event) { String eventName = event.getEventName(); Player player = event.getPlayer(); if(event.getPlayer().getItemInHand().getType().getId()==5857 && player.isSneaking() && (event.getAction().equals(Action.RIGHT_CLICK_AIR)||event.getAction().equals(Action.RIGHT_CLICK_BLOCK))) { event.setCancelled(true); player.sendMessage("§4[§1AntiBag§4] Renaming backpacks has been disabled"); } player.sendMessage("§4[§1AntiBag§4] The event you just called is " + eventName); } } Eclipse isn't coming up with any errors. I would be very grateful if someone could tell me what i'm doing wrong.
×
×
  • Create New...