Bad coords

Discussion in 'Plugin Development' started by BeeT, Mar 3, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    BeeT

    Hello I have plugin and in plugin there is "block place" event.
    I don't know why, but I place block at: -31;62;91, plugin shows x = -30, for example placed on x= -28 plugin shows x = -27. Only X. I don't know why...


    main plugin:
    Code:
     
    package mc.pavel.signcommand;
     
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.java.JavaPlugin;
     
    public class SignCommand extends JavaPlugin
    {
      @Override
      public void onDisable()
      {
            System.out.println("SignCommands disabled...");
      }
     
      @Override
      public void onEnable()
      {
        SignManager = new SignManager(this);
        PluginManager pm = getServer().getPluginManager();
        pm.registerEvents(new SignCommandBlockListener(), this);
        System.out.println("SignComands Loaded!");
      }
      
      public String preferred;
      public PluginDescriptionFile info;
      public SignManager SignManager;
    }
    
    SignCommandBlockListener.java
    Code:
     
    package mc.pavel.signcommand;
     
    import org.bukkit.Location;
    import org.bukkit.Material;
    import org.bukkit.block.Block;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.BlockBreakEvent;
    import org.bukkit.event.block.BlockPlaceEvent;
    import org.bukkit.event.block.SignChangeEvent;
     
    public class SignCommandBlockListener implements Listener
    {
      @EventHandler
      public void onBlockPlace(BlockPlaceEvent e) {
          Block b = e.getBlockPlaced();
          Location block = b.getLocation();
          System.out.println("BLOCK: " + block);
          System.out.println("BLOCK PLACED: " + e.getBlockPlaced().getLocation());
      }
      
      @EventHandler
      public void onBlockBreak(BlockBreakEvent e) {
        if (SignManager.isCustomSign(e.getBlock().getLocation())) {
          Location block = e.getBlock().getLocation();
          if (e.getPlayer().isOp()) {
                SignManager.removeSign(block);
          }
        }
      }
    }
     
    
    BUMP COORDS BUG IS IN ALL PLUGINS.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
Thread Status:
Not open for further replies.

Share This Page