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


Java EnumFacing.getFront方法代碼示例

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


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

示例1: readFromNBT

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
@Override
public void readFromNBT(NBTTagCompound tag){
    super.readFromNBT(tag);
    up = connectionFromInt(tag.getInteger("up"));
    down = connectionFromInt(tag.getInteger("down"));
    north = connectionFromInt(tag.getInteger("north"));
    south = connectionFromInt(tag.getInteger("south"));
    west = connectionFromInt(tag.getInteger("west"));
    east = connectionFromInt(tag.getInteger("east"));
    for (int i = 0; i < 6; i++)
    {
        EnumFacing facing = EnumFacing.getFront(i);
        String key = "target" + facing.getName();
        if(!tag.hasKey(key))
            continue;
        NBTTagCompound targetCompound = tag.getCompoundTag(key);
        BlockPos target = new BlockPos(targetCompound.getInteger("x"), targetCompound.getInteger("y"), targetCompound.getInteger("z"));
        targets[i] = target;
    }
    capability.readFromNBT(tag);
}
 
開發者ID:DaedalusGame,項目名稱:Soot,代碼行數:22,代碼來源:TileEntityEmberBurst.java

示例2: getStateFromMeta

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
public IBlockState getStateFromMeta(int meta)
{
    EnumFacing enumfacing = EnumFacing.getFront(meta);

    if (enumfacing.getAxis() == EnumFacing.Axis.Y)
    {
        enumfacing = EnumFacing.NORTH;
    }

    return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:12,代碼來源:BlockBanner.java

示例3: readEntityFromNBT

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
protected void readEntityFromNBT(NBTTagCompound compound)
{
    this.steps = compound.getInteger("Steps");
    this.targetDeltaX = compound.getDouble("TXD");
    this.targetDeltaY = compound.getDouble("TYD");
    this.targetDeltaZ = compound.getDouble("TZD");

    if (compound.hasKey("Dir", 99))
    {
        this.direction = EnumFacing.getFront(compound.getInteger("Dir"));
    }

    if (compound.hasKey("Owner", 10))
    {
        NBTTagCompound nbttagcompound = compound.getCompoundTag("Owner");
        this.ownerUniqueId = NBTUtil.getUUIDFromTag(nbttagcompound);
        this.ownerBlockPos = new BlockPos(nbttagcompound.getInteger("X"), nbttagcompound.getInteger("Y"), nbttagcompound.getInteger("Z"));
    }

    if (compound.hasKey("Target", 10))
    {
        NBTTagCompound nbttagcompound1 = compound.getCompoundTag("Target");
        this.targetUniqueId = NBTUtil.getUUIDFromTag(nbttagcompound1);
        this.targetBlockPos = new BlockPos(nbttagcompound1.getInteger("X"), nbttagcompound1.getInteger("Y"), nbttagcompound1.getInteger("Z"));
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:30,代碼來源:EntityShulkerBullet.java

示例4: readPacketData

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.status = (C07PacketPlayerDigging.Action)buf.readEnumValue(C07PacketPlayerDigging.Action.class);
    this.position = buf.readBlockPos();
    this.facing = EnumFacing.getFront(buf.readUnsignedByte());
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:10,代碼來源:C07PacketPlayerDigging.java

示例5: readFromNBT

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
public void readFromNBT(NBTTagCompound compound)
{
    super.readFromNBT(compound);
    this.pistonState = Block.getBlockById(compound.getInteger("blockId")).getStateFromMeta(compound.getInteger("blockData"));
    this.pistonFacing = EnumFacing.getFront(compound.getInteger("facing"));
    this.lastProgress = this.progress = compound.getFloat("progress");
    this.extending = compound.getBoolean("extending");
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:9,代碼來源:TileEntityPiston.java

示例6: getStateFromMeta

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
/**
 * Convert the given metadata into a BlockState for this Block
 */
public IBlockState getStateFromMeta(int meta)
{
    EnumFacing enumfacing = EnumFacing.getFront(meta);

    if (enumfacing.getAxis() == EnumFacing.Axis.Y)
    {
        enumfacing = EnumFacing.NORTH;
    }

    return this.getDefaultState().withProperty(FACING, enumfacing);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:15,代碼來源:BlockFurnace.java

示例7: readFromNBT

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
public void readFromNBT(NBTTagCompound compound)
{
    super.readFromNBT(compound);
    this.pistonState = Block.getBlockById(compound.getInteger("blockId")).getStateFromMeta(compound.getInteger("blockData"));
    this.pistonFacing = EnumFacing.getFront(compound.getInteger("facing"));
    this.progress = compound.getFloat("progress");
    this.lastProgress = this.progress;
    this.extending = compound.getBoolean("extending");
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:10,代碼來源:TileEntityPiston.java

示例8: readFromFixedNBT

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
@Override
protected void readFromFixedNBT (NBTTagCompound tag) {
    super.readFromFixedNBT(tag);

    this.facing = EnumFacing.getFront(tag.getByte("dir"));
    this.mount = BlockCandelabra.EnumMount.byMetadata(tag.getByte("mnt"));
}
 
開發者ID:jaquadro,項目名稱:GardenStuff,代碼行數:8,代碼來源:TileCandelabra.java

示例9: getDefaultCache

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
public static TileEntityCache[] getDefaultCache(World world, BlockPos pos) {
    TileEntityCache[] cache = new TileEntityCache[6];
    for (int i = 0; i < 6; i++) {
        EnumFacing d = EnumFacing.getFront(i);
        cache[i] = new TileEntityCache(world, pos.offset(d));
    }
    return cache;
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:9,代碼來源:TileEntityCache.java

示例10: readFromNBT

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
@Override
public void readFromNBT(NBTTagCompound tag) {
    super.readFromNBT(tag);
    targetRotationAngle = tag.getFloat("targetRotationAngle");
    targetHeightAngle = tag.getFloat("targetHeightAngle");
    rotationAngle = tag.getFloat("rotationAngle");
    heightAngle = tag.getFloat("heightAngle");
    gpsX = tag.getInteger("gpsX");
    gpsY = tag.getInteger("gpsY");
    gpsZ = tag.getInteger("gpsZ");
    redstoneMode = tag.getByte("redstoneMode");
    coordWithinReach = tag.getBoolean("targetWithinReach");
    inventory = new AirCannonStackHandler();
    inventory.deserializeNBT(tag.getCompoundTag("Items"));

    trackedItemIds = new HashSet<>();
    NBTTagList tagList = tag.getTagList("trackedItems", Constants.NBT.TAG_COMPOUND);
    for (int i = 0; i < tagList.tagCount(); i++) {
        NBTTagCompound t = tagList.getCompoundTagAt(i);
        trackedItemIds.add(new UUID(t.getLong("UUIDMost"), t.getLong("UUIDLeast")));
    }

    if (tag.hasKey("inventoryX")) {
        lastInsertingInventory = new BlockPos(tag.getInteger("inventoryX"), tag.getInteger("inventoryY"), tag.getInteger("inventoryZ"));
        lastInsertingInventorySide = EnumFacing.getFront(tag.getByte("inventorySide"));
    } else {
        lastInsertingInventory = null;
        lastInsertingInventorySide = null;
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:31,代碼來源:TileEntityAirCannon.java

示例11: getFacing

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
/**
 * Get the facing of a dispenser with the given metadata
 */
public static EnumFacing getFacing(int meta)
{
    return EnumFacing.getFront(meta & 7);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:8,代碼來源:BlockDispenser.java

示例12: getFacing

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
public static EnumFacing getFacing(int meta)
{
    int i = meta & 7;
    return i > 5 ? null : EnumFacing.getFront(i);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:6,代碼來源:BlockPistonExtension.java

示例13: getStateFromMeta

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
/**
 * Convert the given metadata into a BlockState for this Block
 */
public IBlockState getStateFromMeta(int meta)
{
    EnumFacing enumfacing = EnumFacing.getFront(meta);
    return this.getDefaultState().withProperty(field_190957_a, enumfacing);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:9,代碼來源:BlockShulkerBox.java

示例14: fromBytes

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
@Override
public void fromBytes(ByteBuf buffer) {
    super.fromBytes(buffer);
    moduleSide = EnumFacing.getFront(buffer.readByte());
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:6,代碼來源:PacketUpdateTubeModule.java

示例15: getFacing

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
@Nullable
public static EnumFacing getFacing(int meta)
{
    int i = meta & 7;
    return i > 5 ? null : EnumFacing.getFront(i);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:7,代碼來源:BlockPistonBase.java


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