本文整理汇总了Java中net.minecraftforge.common.util.ForgeDirection.SOUTH属性的典型用法代码示例。如果您正苦于以下问题:Java ForgeDirection.SOUTH属性的具体用法?Java ForgeDirection.SOUTH怎么用?Java ForgeDirection.SOUTH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraftforge.common.util.ForgeDirection
的用法示例。
在下文中一共展示了ForgeDirection.SOUTH属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildComponent
@Override
@SuppressWarnings("unchecked")
public void buildComponent(StructureComponent component, List list, Random random) {
ComponentTiamatCenterLine componentE = new ComponentTiamatCenterLine(random, (this.boundingBox.minX >> 4) + 1, (this.boundingBox.minZ >> 4), ForgeDirection.EAST, 1);
((ComponentTiamatCenter) component).structureComponents.add(componentE);
list.add(componentE);
ComponentTiamatCenterLine componentW = new ComponentTiamatCenterLine(random, (this.boundingBox.minX >> 4) - 1, (this.boundingBox.minZ >> 4), ForgeDirection.WEST, 1);
((ComponentTiamatCenter) component).structureComponents.add(componentW);
list.add(componentW);
ComponentTiamatCenterLine componentS = new ComponentTiamatCenterLine(random, (this.boundingBox.minX >> 4), (this.boundingBox.minZ >> 4) + 1, ForgeDirection.SOUTH, 1);
((ComponentTiamatCenter) component).structureComponents.add(componentS);
list.add(componentS);
ComponentTiamatCenterLine componentN = new ComponentTiamatCenterLine(random, (this.boundingBox.minX >> 4), (this.boundingBox.minZ >> 4) - 1, ForgeDirection.NORTH, 1);
((ComponentTiamatCenter) component).structureComponents.add(componentN);
list.add(componentN);
}
示例2: ReversalForgeDirection
public static ForgeDirection ReversalForgeDirection(ForgeDirection dir){
if (dir == null) return null;
switch (dir){
case UP:
return ForgeDirection.DOWN;
case DOWN:
return ForgeDirection.UP;
case EAST:
return ForgeDirection.WEST;
case WEST:
return ForgeDirection.EAST;
case NORTH:
return ForgeDirection.SOUTH;
case SOUTH:
return ForgeDirection.NORTH;
default:
return null;
}
}
示例3: getPlayerDirection
/**
* プレイヤーの向きを取得します
*
* @param player プレイヤー
* @return 向きの {@link ForgeDirection}
*/
private static ForgeDirection getPlayerDirection(EntityLivingBase player) {
int playerDirY = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int playerDirP = MathHelper.floor_double((double) (player.rotationPitch * 4.0F / 360.0F) + 0.5D) & 3;
switch (playerDirP) {
case 1:
return ForgeDirection.DOWN;
case 3:
return ForgeDirection.UP;
default:
}
switch (playerDirY) {
case 0:
return ForgeDirection.NORTH;
case 1:
return ForgeDirection.EAST;
case 2:
return ForgeDirection.SOUTH;
case 3:
return ForgeDirection.WEST;
}
return null;
}
示例4: onBlockPlacedBy
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int meta = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
if (world.getTileEntity(x, y, z) instanceof GateFront) {
GateFront gateFront = (GateFront) world.getTileEntity(x, y, z);
switch (meta) {
case 0:
gateFront.direction = ForgeDirection.SOUTH;
break;
case 1:
gateFront.direction = ForgeDirection.WEST;
break;
case 2:
gateFront.direction = ForgeDirection.NORTH;
break;
case 3:
gateFront.direction = ForgeDirection.EAST;
break;
default:
break;
}
world.setBlockMetadataWithNotify(x, y, z, meta, 2);
}
}
示例5: onBlockPlacedBy
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int meta = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
if (world.getTileEntity(x, y, z) instanceof GateBase) {
GateBase gateBase = (GateBase) world.getTileEntity(x, y, z);
switch (meta) {
case 0:
gateBase.direction = ForgeDirection.SOUTH;
break;
case 1:
gateBase.direction = ForgeDirection.WEST;
break;
case 2:
gateBase.direction = ForgeDirection.NORTH;
break;
case 3:
gateBase.direction = ForgeDirection.EAST;
break;
default:
break;
}
world.setBlockMetadataWithNotify(x, y, z, meta, 2);
}
}
示例6: onBlockPlacedBy
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int meta = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
world.setBlockMetadataWithNotify(x, y, z, meta, 2);
if (world.getTileEntity(x, y, z) instanceof MagnetSwitch) {
MagnetSwitch monoSwitch = (MagnetSwitch) world.getTileEntity(x, y, z);
switch (meta) {
case 0:
monoSwitch.direction = ForgeDirection.SOUTH;
break;
case 1:
monoSwitch.direction = ForgeDirection.WEST;
break;
case 2:
monoSwitch.direction = ForgeDirection.NORTH;
break;
case 3:
monoSwitch.direction = ForgeDirection.EAST;
break;
default:
break;
}
}
}
示例7: generateChorusPlant
public static void generateChorusPlant(World world, int x, int y, int z, int pass) {
int height;
for (height = 0; height < 4; height++) {
if (!ChorusFlower.canPlantStay(world, x, y + height, z)) {
world.setBlock(x, y + height, z, ModBlocks.chorus_flower, 5, 2);
break;
}
world.setBlock(x, y + height, z, ModBlocks.chorus_plant);
}
if (height > 1) {
world.setBlock(x, y + height, z, ModBlocks.chorus_plant);
boolean grew = false;
if (pass < 5) {
ForgeDirection[] dirs = new ForgeDirection[] { ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.NORTH, ForgeDirection.SOUTH };
for (int j = 0; j < world.rand.nextInt(4); j++) {
ForgeDirection dir = dirs[world.rand.nextInt(dirs.length)];
int xx = x + dir.offsetX;
int yy = y + height + dir.offsetY;
int zz = z + dir.offsetZ;
if (world.isAirBlock(xx, yy, zz) && ChorusFlower.isSpaceAroundFree(world, xx, yy, zz, dir.getOpposite())) {
generateChorusPlant(world, xx, yy, zz, pass + 1);
grew = true;
}
}
}
if (!grew)
world.setBlock(x, y + height, z, ModBlocks.chorus_flower, 5, 2);
}
}
示例8: randomDisplayTick
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
if (world.getBlockMetadata(x, y, z) == 1) {
ForgeDirection dir = getRandomDirection(rand);
if (dir != ForgeDirection.UP && !World.doesBlockHaveSolidTopSurface(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) {
double d0 = x;
double d1 = y;
double d2 = z;
if (dir == ForgeDirection.DOWN) {
d1 -= 0.05D;
d0 += rand.nextDouble();
d2 += rand.nextDouble();
} else {
d1 += rand.nextDouble() * 0.8D;
if (dir == ForgeDirection.EAST || dir == ForgeDirection.WEST) {
d2 += rand.nextDouble();
if (dir == ForgeDirection.EAST)
d0++;
else
d0 += 0.05D;
} else {
d0 += rand.nextDouble();
if (dir == ForgeDirection.SOUTH)
d2++;
else
d2 += 0.05D;
}
}
world.spawnParticle("dripWater", d0, d1, d2, 0.0D, 0.0D, 0.0D);
}
}
}
示例9: setBlockBoundsBasedOnState
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
ForgeDirection dir = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z));
if (dir == ForgeDirection.DOWN || dir == ForgeDirection.UP)
setBlockBounds(0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);
else if (dir == ForgeDirection.WEST || dir == ForgeDirection.EAST)
setBlockBounds(0.0F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);
else if (dir == ForgeDirection.NORTH || dir == ForgeDirection.SOUTH)
setBlockBounds(0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);
}
示例10: canConnectRedstone
public boolean canConnectRedstone(ForgeDirection fd)
{
switch (worldObj.getBlockMetadata(xCoord, yCoord, zCoord))
{
case 2: return (fd == ForgeDirection.WEST);
case 3: return (fd == ForgeDirection.NORTH);
case 4: return (fd == ForgeDirection.EAST);
case 5: return (fd == ForgeDirection.SOUTH);
default: return false;
}
}
示例11: canConnectEnergy
@Override
public boolean canConnectEnergy(ForgeDirection fd)
{
switch (worldObj.getBlockMetadata(xCoord, yCoord, zCoord))
{
case 2: return (fd == ForgeDirection.NORTH || fd == ForgeDirection.SOUTH);
case 3: return (fd == ForgeDirection.EAST || fd == ForgeDirection.WEST);
case 4: return (fd == ForgeDirection.NORTH || fd == ForgeDirection.SOUTH);
case 5: return (fd == ForgeDirection.EAST || fd == ForgeDirection.WEST);
default: return false;
}
}
示例12: canConnectEnergy
@Override
public boolean canConnectEnergy(ForgeDirection fd)
{
switch (worldObj.getBlockMetadata(xCoord, yCoord, zCoord))
{
case 0: return fd == ForgeDirection.DOWN;
case 1: return fd == ForgeDirection.UP;
case 2: return fd == ForgeDirection.WEST;
case 3: return fd == ForgeDirection.NORTH;
case 4: return fd == ForgeDirection.EAST;
case 5: return fd == ForgeDirection.SOUTH;
default: return false;
}
}
示例13: getLightDir
public ForgeDirection getLightDir(World world, int x , int y, int z) {
switch (world.getBlockMetadata(x, y, z) & 0x3) {
case 0: return ForgeDirection.NORTH;
case 1: return ForgeDirection.EAST;
case 2: return ForgeDirection.SOUTH;
case 3: return ForgeDirection.WEST;
}
return ForgeDirection.UNKNOWN;
}
示例14: extractEnergy
@Override
public int extractEnergy(ForgeDirection fd, int amount, boolean simulate)
{
switch (worldObj.getBlockMetadata(xCoord, yCoord, zCoord))
{
case 2: if(fd == ForgeDirection.NORTH) return storage.extractEnergy(amount, simulate);
case 3: if(fd == ForgeDirection.EAST) return storage.extractEnergy(amount, simulate);
case 4: if(fd == ForgeDirection.SOUTH) return storage.extractEnergy(amount, simulate);
case 5: if(fd == ForgeDirection.WEST) return storage.extractEnergy(amount, simulate);
default: return 0;
}
}
示例15: getDir
/******************************************************************************************************************/
public static ForgeDirection getDir(World world, int x, int y, int z) {
switch (world.getBlockMetadata(x, y, z)) {
case 0: return ForgeDirection.NORTH;
case 1: return ForgeDirection.SOUTH;
case 2: return ForgeDirection.WEST;
case 3: return ForgeDirection.EAST;
case 4: return ForgeDirection.UP;
case 5: return ForgeDirection.DOWN;
}
return ForgeDirection.UNKNOWN;
}