Can't handle BLOCK_PHYSICS and i don't use it

Discussion in 'Plugin Development' started by blackwolf12333, Jun 23, 2012.

Thread Status:
Not open for further replies.
  1. Hi, i have this error which i just can't get rid of, i know where it happens, but i have no idea why, here is the full error:
    Code:
     Could not properly handle event BLOCK_PHYSICS:
    java.lang.IllegalAccessError: Synchronized code got accessed from another thread: tk.blackwolf12333.grieflog.utils.Rollback
        at org.bukkit.event.Listener.onBlockPhysics(Listener:0)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
        at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:30)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:460)
        at net.minecraft.server.World.k(World.java:510)
        at net.minecraft.server.World.applyPhysics(World.java:493)
        at net.minecraft.server.World.update(World.java:459)
        at net.minecraft.server.World.setTypeId(World.java:434)
        at org.bukkit.craftbukkit.block.CraftBlock.setTypeId(CraftBlock.java:92)
        at org.bukkit.craftbukkit.block.CraftBlock.setType(CraftBlock.java:88)
        at tk.blackwolf12333.grieflog.utils.Rollback.rollback(Rollback.java:139)
        at tk.blackwolf12333.grieflog.utils.Rollback.rollback(Rollback.java:79)
        at tk.blackwolf12333.grieflog.utils.Rollback.run(Rollback.java:70)
    17:14:01 [INFO] This error is logged only once: it could have occurred multiple times by now.
    and here is the rollback function and some other stuff:
    Code:
    @Override
        public void run() {
            try {
            rollback(); // line 70
            } catch(Exception e) {
               
            }
        }
       
        public void rollback()    {
            while(count < allLines.size()) {
                for(String line : allLines) {
                    rollback(line); // line 79
                    count++;
                }
            }
        }
    If you need more, i'll update my github repository so you can look at the whole file.
    thanks in advance,
    greetz blackwolf12333
     
  2. Offline

    Milkywayz

    Try:
    Code:
    public synchronized void rollback()    {
            while(count < allLines.size()) {
                for(String line : allLines) {
                    rollback(line); // line 79
                    count++;
                }
            }
     
  3. Hmm, that didn't work:(
     
  4. do bukit methodes on the main thread, instead on your own thread ( dont whine about the lagg, the problemsn that can exist now are mutch worse, :p)
     
  5. i don't whine about the lag:p but it worked before... but i think since the changes in bukkit R1.4 with the synchronous and asynchronous events that might cause it, i don't know much about that part of java so i don't know for sure.
    greetz blackwolf12333
     
  6. you used your own thread for it, the chance dont affec tit
    The stack trace whould be diferend if that was the cause
     
  7. ok, than i think i will have to live with the lag, i fixed it already so....Thanks:)

    now the permissions.....:/
     
Thread Status:
Not open for further replies.

Share This Page