當前位置: 首頁>>代碼示例>>Java>>正文


Java BlockState.setTypeId方法代碼示例

本文整理匯總了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;
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:12,代碼來源:CraftEventFactory.java

示例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);
    }
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:13,代碼來源:CraftEventFactory.java

示例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;
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:8,代碼來源:StructureGrowDelegate.java

示例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;
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:9,代碼來源:BlockImage.java

示例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;
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:10,代碼來源:BlockMaterialMap.java

示例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);
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:7,代碼來源:BlockStateListPopulator.java

示例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);
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:6,代碼來源:BlockStateListPopulator.java

示例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);
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:6,代碼來源:BlockStateListPopulator.java


注:本文中的org.bukkit.block.BlockState.setTypeId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。