本文整理汇总了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);
}
示例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);
}
示例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"));
}
}
示例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());
}
示例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");
}
示例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);
}
示例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");
}
示例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"));
}
示例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;
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例14: fromBytes
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buffer) {
super.fromBytes(buffer);
moduleSide = EnumFacing.getFront(buffer.readByte());
}
示例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);
}