本文整理匯總了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();
}