cookieassassin Posted August 12, 2013 Posted August 12, 2013 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. Quote
Neowulf Posted August 12, 2013 Posted August 12, 2013 Moved this to mod makers market since it's a help request not a mod idea. I haven't touched bukkit myself, but there are others on the forum who have. Hopefully someone can pick out the problem. Quote
cookieassassin Posted August 12, 2013 Author Posted August 12, 2013 Moved this to mod makers market since it's a help request not a mod idea. I haven't touched bukkit myself, but there are others on the forum who have. Hopefully someone can pick out the problem. 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. Quote
Neowulf Posted August 13, 2013 Posted August 13, 2013 The bukkit guys don't take kindly to mods, especially forge mods. No clue why. Completely bonkers if you ask me... Quote
Moderators Munaus Posted August 15, 2013 Moderators Posted August 15, 2013 bump Hello Have you read the rules today? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.