当前位置: 首页>>代码示例>>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;未经允许,请勿转载。