Solved Getting ALL levels of a Cauldron?

Discussion in 'Spigot Help' started by Mobkinz78, Apr 21, 2017.

  1. Hey there! I'm having a bit of difficulty trying to get the level of a cauldron. Here's some code
    Code (Java):

    // cauldState is the block, I have verified it prints properly as being full
    if (cauldState.getData().equals((byte) 3)) {
        // It appears this statement does not work. Any sysout/message here is not reached.
        cauldState.getData().setData((byte) 2);
        cauldState.update();
        // More stuff
    }
     
    A few things-
    1. Yes, I know these methods are deprecated. I have no other choice, however, and they still remain to not work. If anyone knows any alternatives that would be fantastic. I am unable to find any :(
    2. I can use #isFull() or #isEmpty(), but I also need to get levels in between. I assume that's possible based on the #getData() and #setData() methods...
    3. Again, I have been able to verify the block exists and I have been able to verify it is a cauldron. I have also been able to print the data (clickedBlock.getState().getData(). It just appears that I can not change the data and/or the plugin is not reading it properly... I fear deprecation has something to do with this and I hope there is an alternative.

    Thanks in advance,
    Mark[/CODE]
     
  2. Oh, I got it... Apparently, you can't use #.equals() when comparing MaterialData :| Use == Some basic java I have to brush up on!