BlockType Variable?

Discussion in 'Plugin Development' started by Beeperdp, Aug 1, 2014.

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

    Beeperdp

    Hi guys, I am making a blockworth type of api for my server, but I was wondering if there is any MaterialType variable? I have looked around but could not find any answers. It would be loads easier then typing block.getType() a ton.. Thanks!

    EDIT: Is it possible without using block IDs?
     
  2. Offline

    Dragonphase

    Beeperdp

    Not entirely sure what you're asking here. Block#getType() returns the Material enum value that represents the Block's type. Can you elaborate?
     
  3. Offline

    BaranCODE

    I think what you're searching for is the Material enum values, like Dragonphase said. They are used as Material.STONE, for example.
     
  4. Offline

    Beeperdp

    Dragonphase
    BaranCODE
    Sorry, I need a way to store the type of a block, for instance Material.STONE in a variables that is comparable to another material, maybe Material.DIRT easily.
     
  5. Offline

    Dragonphase

    Beeperdp

    To compare Materials?

    Code:java
    1. Material material1 = Material.STONE;
    2. Material material2 = Material.DIRT;
    3.  
    4. if (material1 == material2){ //False
    5.  
    6. }
     
  6. Offline

    Beeperdp

    Dragonphase Wow - I didn't think of that lol. Thanks that works :)
     
Thread Status:
Not open for further replies.

Share This Page