本文整理匯總了Java中org.bukkit.block.BlockState.setTypeId方法的典型用法代碼示例。如果您正苦於以下問題:Java BlockState.setTypeId方法的具體用法?Java BlockState.setTypeId怎麽用?Java BlockState.setTypeId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.block.BlockState
的用法示例。
在下文中一共展示了BlockState.setTypeId方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: callBlockFadeEvent
import org.bukkit.block.BlockState; //導入方法依賴的package包/類
/**
* BlockFadeEvent
*/
public static BlockFadeEvent callBlockFadeEvent(Block block, net.minecraft.block.Block type) {
BlockState state = block.getState();
state.setTypeId(net.minecraft.block.Block.getIdFromBlock(type));
BlockFadeEvent event = new BlockFadeEvent(block, state);
Bukkit.getPluginManager().callEvent(event);
return event;
}
示例2: handleBlockSpreadEvent
import org.bukkit.block.BlockState; //導入方法依賴的package包/類
public static void handleBlockSpreadEvent(Block block, Block source, net.minecraft.block.Block type, int data) {
BlockState state = block.getState();
state.setTypeId(net.minecraft.block.Block.getIdFromBlock(type));
state.setRawData((byte) data);
BlockSpreadEvent event = new BlockSpreadEvent(block, source, state);
Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
state.update(true);
}
}
示例3: setRawTypeIdAndData
import org.bukkit.block.BlockState; //導入方法依賴的package包/類
public boolean setRawTypeIdAndData(int x, int y, int z, int type, int data) {
BlockState state = world.getBlockAt(x, y, z).getState();
state.setTypeId(type);
state.setData(new MaterialData(type, (byte) data));
blocks.add(state);
return true;
}
示例4: getState
import org.bukkit.block.BlockState; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
public BlockState getState(BlockVector pos) {
int offset = this.offset(pos);
BlockState state = pos.toLocation(this.world).getBlock().getState();
state.setTypeId(this.blockIds[offset]);
state.setRawData(this.blockData[offset]);
return state;
}
示例5: next
import org.bukkit.block.BlockState; //導入方法依賴的package包/類
@Override
public BlockState next() {
Block block = BlockUtils.blockAt(world, iter.key());
if(block == null) return null;
BlockState state = block.getState();
state.setTypeId(decodeTypeId(iter.value()));
state.setRawData(decodeMetadata(iter.value()));
return state;
}
示例6: setTypeAndData
import org.bukkit.block.BlockState; //導入方法依賴的package包/類
public void setTypeAndData(int x, int y, int z, net.minecraft.block.Block block, int data, int light) {
BlockState state = world.getBlockAt(x, y, z).getState();
state.setTypeId(net.minecraft.block.Block.getIdFromBlock(block));
state.setRawData((byte) data);
list.add(state);
}
示例7: setTypeId
import org.bukkit.block.BlockState; //導入方法依賴的package包/類
public void setTypeId(int x, int y, int z, int type) {
BlockState state = world.getBlockAt(x, y, z).getState();
state.setTypeId(type);
list.add(state);
}
示例8: setType
import org.bukkit.block.BlockState; //導入方法依賴的package包/類
public void setType(int x, int y, int z, net.minecraft.block.Block block) {
BlockState state = world.getBlockAt(x, y, z).getState();
state.setTypeId(net.minecraft.block.Block.getIdFromBlock(block));
list.add(state);
}