Solved Schematics file returning negative BlockTypeID

Discussion in 'Plugin Development' started by AmShaegar, Mar 14, 2013.

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

    AmShaegar

    I am trying to read a structure from a .schematics file previously exported from mcedit. Some work great, some do not because I get a negative BlockType... Is there a problem with my code, mcedit or did I just get something totally wrong?

    Marked lines belong together: http://pastebin.com/Z4nsnfyF
     
  2. Offline

    skipperguy12

    If it's the CORRECT block ID but negative, use math.abs to get absolute value.
     
    AmShaegar likes this.
  3. Offline

    AmShaegar

    Oh dear... that was too easy. It never came to my mind that it could actually be the correct id but negative. But I tried... Math.abs() definitely avoids the Exception and it loads the right blocks. :rolleyes:

    Still wondering why that they turned negative but thanks! This solved my problem.

    Edit: I have to revoke. The broken block was hidden and does not show the right one when loading it through my code. They look really similar. That is why I first overlooked it.

    Anyways, found out that even mcedit does not show the correct block, so this is not a problem of bukkit. Thanks anway!
     
Thread Status:
Not open for further replies.

Share This Page