Know blockside?

Discussion in 'Plugin Development' started by thomas15v, Nov 7, 2013.

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

    thomas15v

    Oke its a bit hard to explain my problem so i just so i just show it with a picture.
    problem.png
    Here you see a import bus from the tekkit mod. I really would like to block it from placing it next to that specific side of the furnace. Because they can cheat like infinite exp with that. Ik you probably will say that i am on the wrong forum so let we just say i want to block the torch for being placed their .

    This is what i have in blockplaceevent. The problem idk how i get that side independent from how the block is placed.
    Code:java
    1. @EventHandler(priority = EventPriority.MONITOR)
    2. public void BlockPlaceEvent(BlockPlaceEvent event){
    3.  
    4.  
    5. event.getBlockAgainst().getRelative(??)
    6.  
    7.  
    8. }


    I would be really happy if someone could help me out.
     
  2. if your blockside is west, north, south or east, it must be to the side of the furnace, you can get the blockface using event.getBlockAgainst().getFace(event.getBlockPlaced())

    Notice: I am not sure if I am correct abbout the order of getBlockPlaced() and getBlockAgainst(), you should need to test by your own, or wait until someone can confirm this
     
  3. Offline

    thomas15v

    Ty, i test this out tomorow :D. I maded something that disables exp award from the furnace completely. But if i could limit it this way. It would be awsome :D.

    I am programming for this plugin: http://dev.bukkit.org/bukkit-plugins/tekkit-little-permittor/ .
    But it will prob be canceled :(.
     
Thread Status:
Not open for further replies.

Share This Page