本文整理汇总了Java中net.minecraftforge.common.ForgeDirection.values方法的典型用法代码示例。如果您正苦于以下问题:Java ForgeDirection.values方法的具体用法?Java ForgeDirection.values怎么用?Java ForgeDirection.values使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.ForgeDirection
的用法示例。
在下文中一共展示了ForgeDirection.values方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readData
import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
@Override
public void readData(DataInputStream data) throws IOException {
posX = data.readInt();
posY = data.readInt();
posZ = data.readInt();
orientation = ForgeDirection.values()[data.readInt()];
errorState = EnumErrorCode.values()[data.readInt()];
int ordinal = data.readInt();
isOwnable = ordinal >= 0;
if (isOwnable) {
access = EnumAccess.values()[ordinal];
owner = data.readUTF();
}
super.readData(data);
}
示例2: readFromNBT
import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
@Override
public void readFromNBT(NBTTagCompound nbttagcompound) {
super.readFromNBT(nbttagcompound);
if (nbttagcompound.hasKey("Access")) {
access = EnumAccess.values()[nbttagcompound.getInteger("Access")];
} else {
access = EnumAccess.SHARED;
}
if (nbttagcompound.hasKey("Owner")) {
owner = nbttagcompound.getString("Owner");
}
if (nbttagcompound.hasKey("Orientation")) {
orientation = ForgeDirection.values()[nbttagcompound.getInteger("Orientation")];
} else {
orientation = ForgeDirection.WEST;
}
}
示例3: rotateEngine
import net.minecraftforge.common.ForgeDirection; //导入方法依赖的package包/类
public void rotateEngine() {
for (int i = getOrientation().ordinal() + 1; i <= getOrientation().ordinal() + 6; ++i) {
ForgeDirection orient = ForgeDirection.values()[i % 6];
Position pos = new Position(xCoord, yCoord, zCoord, orient);
pos.moveForwards(1.0F);
TileEntity tile = worldObj.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z);
if (BlockUtil.isPoweredTile(tile)) {
setOrientation(orient);
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
break;
}
}
}