本文整理汇总了Java中net.minecraft.util.EnumFacing.getName方法的典型用法代码示例。如果您正苦于以下问题:Java EnumFacing.getName方法的具体用法?Java EnumFacing.getName怎么用?Java EnumFacing.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.EnumFacing
的用法示例。
在下文中一共展示了EnumFacing.getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeToNBT
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tag){
super.writeToNBT(tag);
tag.setInteger("up", up.ordinal());
tag.setInteger("down", down.ordinal());
tag.setInteger("north", north.ordinal());
tag.setInteger("south", south.ordinal());
tag.setInteger("west", west.ordinal());
tag.setInteger("east", east.ordinal());
for (int i = 0; i < 6; i++)
{
EnumFacing facing = EnumFacing.getFront(i);
String key = "target" + facing.getName();
BlockPos target = targets[i];
if(target == null)
continue;
NBTTagCompound targetCompound = new NBTTagCompound();
targetCompound.setInteger("x",target.getX());
targetCompound.setInteger("y",target.getY());
targetCompound.setInteger("z",target.getZ());
tag.setTag(key,targetCompound);
}
capability.writeToNBT(tag);
return tag;
}
示例2: 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);
}
示例3: makeBakedQuad
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private static BakedQuad makeBakedQuad(EnumFacing p_makeBakedQuad_0_, TextureAtlasSprite p_makeBakedQuad_1_, int p_makeBakedQuad_2_)
{
Vector3f vector3f = new Vector3f(0.0F, 0.0F, 0.0F);
Vector3f vector3f1 = new Vector3f(16.0F, 16.0F, 16.0F);
BlockFaceUV blockfaceuv = new BlockFaceUV(new float[] {0.0F, 0.0F, 16.0F, 16.0F}, 0);
BlockPartFace blockpartface = new BlockPartFace(p_makeBakedQuad_0_, p_makeBakedQuad_2_, "#" + p_makeBakedQuad_0_.getName(), blockfaceuv);
ModelRotation modelrotation = ModelRotation.X0_Y0;
BlockPartRotation blockpartrotation = null;
boolean flag = false;
boolean flag1 = true;
FaceBakery facebakery = new FaceBakery();
BakedQuad bakedquad = facebakery.makeBakedQuad(vector3f, vector3f1, blockpartface, p_makeBakedQuad_1_, p_makeBakedQuad_0_, modelrotation, blockpartrotation, flag, flag1);
return bakedquad;
}
示例4: makeBakedQuad
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static BakedQuad makeBakedQuad(EnumFacing p_makeBakedQuad_0_, TextureAtlasSprite p_makeBakedQuad_1_, int p_makeBakedQuad_2_)
{
Vector3f vector3f = new Vector3f(0.0F, 0.0F, 0.0F);
Vector3f vector3f1 = new Vector3f(16.0F, 16.0F, 16.0F);
BlockFaceUV blockfaceuv = new BlockFaceUV(new float[] {0.0F, 0.0F, 16.0F, 16.0F}, 0);
BlockPartFace blockpartface = new BlockPartFace(p_makeBakedQuad_0_, p_makeBakedQuad_2_, "#" + p_makeBakedQuad_0_.getName(), blockfaceuv);
ModelRotation modelrotation = ModelRotation.X0_Y0;
BlockPartRotation blockpartrotation = null;
boolean flag = false;
boolean flag1 = true;
FaceBakery facebakery = new FaceBakery();
BakedQuad bakedquad = facebakery.makeBakedQuad(vector3f, vector3f1, blockpartface, p_makeBakedQuad_1_, p_makeBakedQuad_0_, modelrotation, blockpartrotation, flag, flag1);
return bakedquad;
}
示例5: getName
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public static String getName(EnumFacing facing) {
return facing.getName();
}