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


Java BlockState.setRawData方法代碼示例

本文整理匯總了Java中org.bukkit.block.BlockState.setRawData方法的典型用法代碼示例。如果您正苦於以下問題:Java BlockState.setRawData方法的具體用法?Java BlockState.setRawData怎麽用?Java BlockState.setRawData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bukkit.block.BlockState的用法示例。


在下文中一共展示了BlockState.setRawData方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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

示例2: 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

示例3: onBlockFromTo

import org.bukkit.block.BlockState; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
@EventWrapper
public void onBlockFromTo(BlockFromToEvent event) {
    if(event.getToBlock().getType() != event.getBlock().getType()) {
        BlockState oldState = event.getToBlock().getState();
        BlockState newState = event.getToBlock().getState();
        newState.setType(event.getBlock().getType());
        newState.setRawData(event.getBlock().getData());

        // Check for lava ownership
        this.callEvent(event, oldState, newState, blockResolver.getOwner(event.getBlock()));
    }
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:14,代碼來源:BlockTransformListener.java

示例4: cloneWithMaterial

import org.bukkit.block.BlockState; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
public static BlockState cloneWithMaterial(Block block, Material material, byte data) {
    BlockState state = block.getState();
    state.setType(material);
    state.setRawData(data);
    return state;
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:8,代碼來源:BlockStateUtils.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: toAir

import org.bukkit.block.BlockState; //導入方法依賴的package包/類
public static BlockState toAir(Block block) {
    BlockState newState = block.getState(); // this creates a new copy of the state
    newState.setType(Material.AIR);
    newState.setRawData((byte) 0);
    return newState;
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:7,代碼來源:BlockStateUtils.java


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