IllegalAccessError When accesing a block

Discussion in 'Plugin Development' started by TechGuard, Jul 3, 2011.

Thread Status:
Not open for further replies.
  1. Hey,

    Somehow I get a IllegalAccessError with this code:
    Code:
    Block ladder = world.getBlockAt(location.getBlockX(), y, location.getBlockZ());
    blocks.add(mcBlock.fromBlock(ladder));//Error at this line
    ladder.setTypeIdAndData(Material.LADDER.getId(), (byte)2, false);
    mcBlock.java:

    Code:
    public static mcBlock fromBlock(Block block){
               return new mcBlock(block.getWorld(), block.getTypeId(), block.getData(), block.getX(), block.getY(), block.getZ());
    }
    Tried this using the bukkit scheduler, but it makes no difference.

    bump?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  2. Offline

    ItsHarry

    Use try/catch and print the stack trace?
     
  3. There you go:

     
  4. Offline

    ItsHarry

    Ugh.. Lemme think

    Try putting the fromBlock thingy in the same class. Then it should work for some reason
     
Thread Status:
Not open for further replies.

Share This Page