本文整理汇总了Java中net.minecraft.util.EnumFacing.rotateY方法的典型用法代码示例。如果您正苦于以下问题:Java EnumFacing.rotateY方法的具体用法?Java EnumFacing.rotateY怎么用?Java EnumFacing.rotateY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.EnumFacing
的用法示例。
在下文中一共展示了EnumFacing.rotateY方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getActualState
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
TileEntity te = PneumaticCraftUtils.getTileEntitySafely(worldIn, pos);
if (te instanceof TileEntityPneumaticDoor) {
TileEntityPneumaticDoor teDoor = (TileEntityPneumaticDoor) te;
if (teDoor.rotationAngle == 90) {
EnumFacing originalRotation = state.getValue(ROTATION);
if(originalRotation != EnumFacing.UP && originalRotation != EnumFacing.DOWN){
EnumFacing facing = teDoor.rightGoing ? originalRotation.rotateY() : originalRotation.rotateYCCW();
state = state.withProperty(ROTATION, facing);
}
state = state.withProperty(DOOR_STATE, DoorState.OPEN);
} else if (teDoor.rotationAngle == 0) {
state = state.withProperty(DOOR_STATE, DoorState.CLOSED);
} else if (teDoor.rotationAngle > 0) {
// currently rotating - hide the static model; TESR will show the rotating door
state = state.withProperty(DOOR_STATE, DoorState.MOVING);
}
}
return state;
}
示例2: doesSideBlockRendering
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
{
if (net.minecraftforge.common.ForgeModContainer.disableStairSlabCulling)
return super.doesSideBlockRendering(state, world, pos, face);
if ( state.isOpaqueCube() )
return true;
state = this.getActualState(state, world, pos);
EnumHalf half = state.getValue(HALF);
EnumFacing side = state.getValue(FACING);
EnumShape shape = state.getValue(SHAPE);
if (face == EnumFacing.UP) return half == EnumHalf.TOP;
if (face == EnumFacing.DOWN) return half == EnumHalf.BOTTOM;
if (shape == EnumShape.OUTER_LEFT || shape == EnumShape.OUTER_RIGHT) return false;
if (face == side) return true;
if (shape == EnumShape.INNER_LEFT && face.rotateY() == side) return true;
if (shape == EnumShape.INNER_RIGHT && face.rotateYCCW() == side) return true;
return false;
}
示例3: rotateFacing
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private static EnumFacing rotateFacing(EnumFacing facing, int rotation) {
if (rotation >= 0) {
for (int i = 0; i < rotation; i++) {
facing = facing.rotateY();
}
} else {
rotation = -rotation;
for (int i = 0; i < rotation; i++) {
facing = facing.rotateYCCW();
}
}
return facing;
}
示例4: getPowerOnSides
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
protected int getPowerOnSides(IBlockAccess worldIn, BlockPos pos, IBlockState state)
{
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
EnumFacing enumfacing1 = enumfacing.rotateY();
EnumFacing enumfacing2 = enumfacing.rotateYCCW();
return Math.max(this.getPowerOnSide(worldIn, pos.offset(enumfacing1), enumfacing1), this.getPowerOnSide(worldIn, pos.offset(enumfacing2), enumfacing2));
}
示例5: func_191110_a
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private void func_191110_a(WoodlandMansionPieces.SimpleGrid p_191110_1_, int p_191110_2_, int p_191110_3_, EnumFacing p_191110_4_, int p_191110_5_)
{
if (p_191110_5_ > 0)
{
p_191110_1_.func_191144_a(p_191110_2_, p_191110_3_, 1);
p_191110_1_.func_191141_a(p_191110_2_ + p_191110_4_.getFrontOffsetX(), p_191110_3_ + p_191110_4_.getFrontOffsetZ(), 0, 1);
for (int i = 0; i < 8; ++i)
{
EnumFacing enumfacing = EnumFacing.getHorizontal(this.field_191117_a.nextInt(4));
if (enumfacing != p_191110_4_.getOpposite() && (enumfacing != EnumFacing.EAST || !this.field_191117_a.nextBoolean()))
{
int j = p_191110_2_ + p_191110_4_.getFrontOffsetX();
int k = p_191110_3_ + p_191110_4_.getFrontOffsetZ();
if (p_191110_1_.func_191145_a(j + enumfacing.getFrontOffsetX(), k + enumfacing.getFrontOffsetZ()) == 0 && p_191110_1_.func_191145_a(j + enumfacing.getFrontOffsetX() * 2, k + enumfacing.getFrontOffsetZ() * 2) == 0)
{
this.func_191110_a(p_191110_1_, p_191110_2_ + p_191110_4_.getFrontOffsetX() + enumfacing.getFrontOffsetX(), p_191110_3_ + p_191110_4_.getFrontOffsetZ() + enumfacing.getFrontOffsetZ(), enumfacing, p_191110_5_ - 1);
break;
}
}
}
EnumFacing enumfacing1 = p_191110_4_.rotateY();
EnumFacing enumfacing2 = p_191110_4_.rotateYCCW();
p_191110_1_.func_191141_a(p_191110_2_ + enumfacing1.getFrontOffsetX(), p_191110_3_ + enumfacing1.getFrontOffsetZ(), 0, 2);
p_191110_1_.func_191141_a(p_191110_2_ + enumfacing2.getFrontOffsetX(), p_191110_3_ + enumfacing2.getFrontOffsetZ(), 0, 2);
p_191110_1_.func_191141_a(p_191110_2_ + p_191110_4_.getFrontOffsetX() + enumfacing1.getFrontOffsetX(), p_191110_3_ + p_191110_4_.getFrontOffsetZ() + enumfacing1.getFrontOffsetZ(), 0, 2);
p_191110_1_.func_191141_a(p_191110_2_ + p_191110_4_.getFrontOffsetX() + enumfacing2.getFrontOffsetX(), p_191110_3_ + p_191110_4_.getFrontOffsetZ() + enumfacing2.getFrontOffsetZ(), 0, 2);
p_191110_1_.func_191141_a(p_191110_2_ + p_191110_4_.getFrontOffsetX() * 2, p_191110_3_ + p_191110_4_.getFrontOffsetZ() * 2, 0, 2);
p_191110_1_.func_191141_a(p_191110_2_ + enumfacing1.getFrontOffsetX() * 2, p_191110_3_ + enumfacing1.getFrontOffsetZ() * 2, 0, 2);
p_191110_1_.func_191141_a(p_191110_2_ + enumfacing2.getFrontOffsetX() * 2, p_191110_3_ + enumfacing2.getFrontOffsetZ() * 2, 0, 2);
}
}
示例6: getCollEighthBlock
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
/**
* Returns a bounding box representing an eighth of a block (a block whose three dimensions are halved).
* Used in all stair shapes except STRAIGHT (gets added alone in the case of OUTER; alone with a quarter block in
* case of INSIDE).
*/
private static AxisAlignedBB getCollEighthBlock(IBlockState bstate)
{
EnumFacing enumfacing = (EnumFacing)bstate.getValue(FACING);
EnumFacing enumfacing1;
switch ((BlockStairs.EnumShape)bstate.getValue(SHAPE))
{
case OUTER_LEFT:
default:
enumfacing1 = enumfacing;
break;
case OUTER_RIGHT:
enumfacing1 = enumfacing.rotateY();
break;
case INNER_RIGHT:
enumfacing1 = enumfacing.getOpposite();
break;
case INNER_LEFT:
enumfacing1 = enumfacing.rotateYCCW();
}
boolean flag = bstate.getValue(HALF) == BlockStairs.EnumHalf.TOP;
switch (enumfacing1)
{
case NORTH:
default:
return flag ? AABB_OCT_BOT_NW : AABB_OCT_TOP_NW;
case SOUTH:
return flag ? AABB_OCT_BOT_SE : AABB_OCT_TOP_SE;
case WEST:
return flag ? AABB_OCT_BOT_SW : AABB_OCT_TOP_SW;
case EAST:
return flag ? AABB_OCT_BOT_NE : AABB_OCT_TOP_NE;
}
}
示例7: correctFacing
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state)
{
EnumFacing enumfacing = null;
for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL)
{
IBlockState iblockstate = worldIn.getBlockState(pos.offset(enumfacing1));
if (iblockstate.getBlock() == this)
{
return state;
}
if (iblockstate.getBlock().isFullBlock())
{
if (enumfacing != null)
{
enumfacing = null;
break;
}
enumfacing = enumfacing1;
}
}
if (enumfacing != null)
{
return state.withProperty(FACING, enumfacing.getOpposite());
}
else
{
EnumFacing enumfacing2 = (EnumFacing)state.getValue(FACING);
if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
{
enumfacing2 = enumfacing2.getOpposite();
}
if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
{
enumfacing2 = enumfacing2.rotateY();
}
if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
{
enumfacing2 = enumfacing2.getOpposite();
}
return state.withProperty(FACING, enumfacing2);
}
}
示例8: correctFacing
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state) {
EnumFacing enumfacing = null;
for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL) {
EnumFacing enumfacing1 = (EnumFacing) enumfacing0;
IBlockState iblockstate = worldIn.getBlockState(pos.offset(enumfacing1));
if (iblockstate.getBlock() == this) {
return state;
}
if (iblockstate.getBlock().isFullBlock()) {
if (enumfacing != null) {
enumfacing = null;
break;
}
enumfacing = enumfacing1;
}
}
if (enumfacing != null) {
return state.withProperty(FACING, enumfacing.getOpposite());
} else {
EnumFacing enumfacing2 = (EnumFacing) state.getValue(FACING);
if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock()) {
enumfacing2 = enumfacing2.getOpposite();
}
if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock()) {
enumfacing2 = enumfacing2.rotateY();
}
if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock()) {
enumfacing2 = enumfacing2.getOpposite();
}
return state.withProperty(FACING, enumfacing2);
}
}
示例9: correctFacing
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state)
{
EnumFacing enumfacing = null;
for (Object enumfacing10 : EnumFacing.Plane.HORIZONTAL)
{
EnumFacing enumfacing1 = (EnumFacing) enumfacing10;
IBlockState iblockstate = worldIn.getBlockState(pos.offset(enumfacing1));
if (iblockstate.getBlock() == this)
{
return state;
}
if (iblockstate.getBlock().isFullBlock())
{
if (enumfacing != null)
{
enumfacing = null;
break;
}
enumfacing = enumfacing1;
}
}
if (enumfacing != null)
{
return state.withProperty(FACING, enumfacing.getOpposite());
}
else
{
EnumFacing enumfacing2 = (EnumFacing)state.getValue(FACING);
if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
{
enumfacing2 = enumfacing2.getOpposite();
}
if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
{
enumfacing2 = enumfacing2.rotateY();
}
if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock())
{
enumfacing2 = enumfacing2.getOpposite();
}
return state.withProperty(FACING, enumfacing2);
}
}
示例10: func_191130_a
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private void func_191130_a(List<WoodlandMansionPieces.MansionTemplate> p_191130_1_, WoodlandMansionPieces.PlacementData p_191130_2_, WoodlandMansionPieces.SimpleGrid p_191130_3_, EnumFacing p_191130_4_, int p_191130_5_, int p_191130_6_, int p_191130_7_, int p_191130_8_)
{
int i = p_191130_5_;
int j = p_191130_6_;
EnumFacing enumfacing = p_191130_4_;
while (true)
{
if (!WoodlandMansionPieces.Grid.func_191109_a(p_191130_3_, i + p_191130_4_.getFrontOffsetX(), j + p_191130_4_.getFrontOffsetZ()))
{
this.func_191124_c(p_191130_1_, p_191130_2_);
p_191130_4_ = p_191130_4_.rotateY();
if (i != p_191130_7_ || j != p_191130_8_ || enumfacing != p_191130_4_)
{
this.func_191131_b(p_191130_1_, p_191130_2_);
}
}
else if (WoodlandMansionPieces.Grid.func_191109_a(p_191130_3_, i + p_191130_4_.getFrontOffsetX(), j + p_191130_4_.getFrontOffsetZ()) && WoodlandMansionPieces.Grid.func_191109_a(p_191130_3_, i + p_191130_4_.getFrontOffsetX() + p_191130_4_.rotateYCCW().getFrontOffsetX(), j + p_191130_4_.getFrontOffsetZ() + p_191130_4_.rotateYCCW().getFrontOffsetZ()))
{
this.func_191126_d(p_191130_1_, p_191130_2_);
i += p_191130_4_.getFrontOffsetX();
j += p_191130_4_.getFrontOffsetZ();
p_191130_4_ = p_191130_4_.rotateYCCW();
}
else
{
i += p_191130_4_.getFrontOffsetX();
j += p_191130_4_.getFrontOffsetZ();
if (i != p_191130_7_ || j != p_191130_8_ || enumfacing != p_191130_4_)
{
this.func_191131_b(p_191130_1_, p_191130_2_);
}
}
if (i == p_191130_7_ && j == p_191130_8_ && enumfacing == p_191130_4_)
{
break;
}
}
}
示例11: getCollEighthBlock
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
/**
* Returns a bounding box representing an eighth of a block (a block whose three dimensions are halved).
* Used in all stair shapes except STRAIGHT (gets added alone in the case of OUTER; alone with a quarter block in
* case of INSIDE).
*/
private static AxisAlignedBB getCollEighthBlock(IBlockState bstate)
{
EnumFacing enumfacing = (EnumFacing)bstate.getValue(FACING);
EnumFacing enumfacing1;
switch ((BlockStairs.EnumShape)bstate.getValue(SHAPE))
{
case OUTER_LEFT:
default:
enumfacing1 = enumfacing;
break;
case OUTER_RIGHT:
enumfacing1 = enumfacing.rotateY();
break;
case INNER_RIGHT:
enumfacing1 = enumfacing.getOpposite();
break;
case INNER_LEFT:
enumfacing1 = enumfacing.rotateYCCW();
}
boolean flag = bstate.getValue(HALF) == BlockStairs.EnumHalf.TOP;
switch (enumfacing1)
{
case NORTH:
default:
return flag ? AABB_OCT_BOT_NW : AABB_OCT_TOP_NW;
case SOUTH:
return flag ? AABB_OCT_BOT_SE : AABB_OCT_TOP_SE;
case WEST:
return flag ? AABB_OCT_BOT_SW : AABB_OCT_TOP_SW;
case EAST:
return flag ? AABB_OCT_BOT_NE : AABB_OCT_TOP_NE;
}
}
示例12: correctFacing
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state)
{
EnumFacing enumfacing = null;
for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL)
{
IBlockState iblockstate = worldIn.getBlockState(pos.offset(enumfacing1));
if (iblockstate.getBlock() == this)
{
return state;
}
if (iblockstate.isFullBlock())
{
if (enumfacing != null)
{
enumfacing = null;
break;
}
enumfacing = enumfacing1;
}
}
if (enumfacing != null)
{
return state.withProperty(FACING, enumfacing.getOpposite());
}
else
{
EnumFacing enumfacing2 = (EnumFacing)state.getValue(FACING);
if (worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock())
{
enumfacing2 = enumfacing2.getOpposite();
}
if (worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock())
{
enumfacing2 = enumfacing2.rotateY();
}
if (worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock())
{
enumfacing2 = enumfacing2.getOpposite();
}
return state.withProperty(FACING, enumfacing2);
}
}
示例13: readCustomNBT
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public void readCustomNBT(NBTTagCompound compound) {
super.readCustomNBT(compound);
this.inventory = IOInventory.deserialize(this, compound.getCompoundTag("items"));
this.inventory.setStackLimit(1, BLUEPRINT_SLOT);
this.craftingStatus = CraftingStatus.values()[compound.getInteger("status")];
if(compound.hasKey("machine") && compound.hasKey("rotation")) {
ResourceLocation rl = new ResourceLocation(compound.getString("machine"));
DynamicMachine machine = MachineRegistry.getRegistry().getMachine(rl);
if(machine == null) {
ModularMachinery.log.info("Couldn't find machine named " + rl.toString() + " for controller at " + getPos().toString());
this.foundMachine = null;
this.foundPattern = null;
this.patternRotation = null;
} else {
EnumFacing rot = EnumFacing.getHorizontal(compound.getInteger("rotation"));
EnumFacing offset = EnumFacing.NORTH;
BlockArray pattern = machine.getPattern();
while (offset != rot) {
pattern = pattern.rotateYCCW();
offset = offset.rotateY();
}
this.patternRotation = rot;
this.foundPattern = pattern;
this.foundMachine = machine;
}
} else {
this.foundMachine = null;
this.foundPattern = null;
this.patternRotation = null;
}
if(compound.hasKey("activeRecipe")) {
NBTTagCompound tag = compound.getCompoundTag("activeRecipe");
ActiveMachineRecipe recipe = new ActiveMachineRecipe(tag);
if(recipe.getRecipe() == null) {
ModularMachinery.log.info("Couldn't find recipe named " + tag.getString("recipeName") + " for controller at " + getPos().toString());
this.activeRecipe = null;
} else {
this.activeRecipe = recipe;
}
} else {
this.activeRecipe = null;
}
}