Bukkit has finally ate someone's cake (Mine)

Discussion in 'Plugin Development' started by Hohahihehu, Jan 28, 2011.

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

    Hohahihehu

    I am trying to turn a block into cake via bukkit and... well.. bukkit eats 87.5% of it. The cake only spawns with 1 slice. What can I do to fix it?

    Example of the code in question: http://pastebin.com/RqbHCidV
     
  2. Offline

    paletas

    I'm having a hard time to decipher where you're turning the block into a cake, you should use the Material enum available in the API, it increases the readability of your code.
     
  3. Offline

    Snowl

    You need to set it with a different amount of damage (I think).
     
  4. Offline

    Mixcoatl

    I suspect it may have something to do with the block data. But I'm not certain what the data values are supposed to be for the a cake block. I suppose, if you were really interested, you could write some code to split out the block data for the cake block as you interact with it.
     
  5. Offline

    Hohahihehu

    The problem is that the data value for a full cake is 0, which should be what it spawns with, but it isn't a full cake.
     
  6. Offline

    darknesschaos

    look at my voidmage code, the cakewalk spawns perfect cake (a few too many though) :D
     
  7. Offline

    Hohahihehu

    That's exactly how I do it, setting the type id to 92. I guess bukkit actually is eating my cake O_O
     
  8. Offline

    darknesschaos

    lol, bukkit is low on health apparently.
     
    MrBluebear3 likes this.
  9. Offline

    Mixcoatl

    As an experiment you could try explicitly setting the block's data to a known value. Pick something you can test for, like four or six.
     
  10. Offline

    R3ality

    It's been a while since the last post in here so the OP might have solved it already. But I was testing some other stuff and happened to stumble upon a solution for this..

    The cake block's data needs to be set to Byte 0 (zero). Or anything up to 6 (0 = a complete cake, 6 = one slice left)

    So reverting to the code OP had:
    Code:
    Block block = world.getBlockAt(cx, cy, cz);
    block.setTypeId(92);
    ..changing it to:
    Code:
    Block block = world.getBlockAt(cx, cy, cz);
    block.setTypeId(92);
    b.setData(Byte.valueOf("0"));
    ..should fix the problem
     
Thread Status:
Not open for further replies.

Share This Page