Java Code Examples for org.bukkit.material.Door#setOpen()
The following examples show how to use
org.bukkit.material.Door#setOpen() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VersionHelper18.java From RedProtect with GNU General Public License v3.0 | 5 votes |
public void toggleDoor(Block b) { BlockState state = b.getState(); if (state instanceof Door) { Door op = (Door) state.getData(); if (!op.isOpen()) op.setOpen(true); else op.setOpen(false); state.setData(op); state.update(); } }
Example 2
Source File: VersionHelper112.java From RedProtect with GNU General Public License v3.0 | 5 votes |
public void toggleDoor(Block b) { BlockState state = b.getState(); if (state instanceof Door) { Door op = (Door) state.getData(); op.setOpen(!op.isOpen()); state.setData(op); state.update(); } }
Example 3
Source File: VersionHelper113.java From RedProtect with GNU General Public License v3.0 | 5 votes |
public void toggleDoor(Block b) { BlockState state = b.getState(); if (state instanceof Door) { Door op = (Door) state.getData(); if (!op.isOpen()) op.setOpen(true); else op.setOpen(false); state.setData(op); state.update(); } }