本文整理汇总了Java中net.minecraftforge.common.util.ForgeDirection.NORTH属性的典型用法代码示例。如果您正苦于以下问题:Java ForgeDirection.NORTH属性的具体用法?Java ForgeDirection.NORTH怎么用?Java ForgeDirection.NORTH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraftforge.common.util.ForgeDirection
的用法示例。
在下文中一共展示了ForgeDirection.NORTH属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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 MonoSwitch) {
MonoSwitch monoSwitch = (MonoSwitch) 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;
}
if ((meta + 2) % 2 == 0) meta = 0;
else meta = 1;
world.setBlockMetadataWithNotify(x, y, z, meta, 2);
}
}
示例2: canConnectRedstone
@Override
public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side)
{
TileEntity te = world.getTileEntity(x, y, z);
ForgeDirection fd;
switch (side)
{
case -1: fd = ForgeDirection.UP; break;
case 0: fd = ForgeDirection.NORTH; break;
case 1: fd = ForgeDirection.EAST; break;
case 2: fd = ForgeDirection.SOUTH; break;
case 3: fd = ForgeDirection.WEST; break;
default: fd = ForgeDirection.UNKNOWN; break;
}
return te instanceof TileEntityTransistor && ((TileEntityTransistor)te).canConnectRedstone(fd);
}
示例3: 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;
}
}
示例4: 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;
}
示例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 GateFrontN) {
GateFrontN gateFrontN = (GateFrontN) world.getTileEntity(x, y, z);
switch (meta) {
case 0:
gateFrontN.direction = ForgeDirection.SOUTH;
break;
case 1:
gateFrontN.direction = ForgeDirection.WEST;
break;
case 2:
gateFrontN.direction = ForgeDirection.NORTH;
break;
case 3:
gateFrontN.direction = ForgeDirection.EAST;
break;
default:
break;
}
world.setBlockMetadataWithNotify(x, y, z, meta, 2);
}
}
示例6: 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);
}
示例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: 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);
}
示例9: getDirection
public static ForgeDirection getDirection(int side){
switch(side){
case 0:
return ForgeDirection.SOUTH;
case 1:
return ForgeDirection.WEST;
case 2:
return ForgeDirection.NORTH;
case 3:
return ForgeDirection.EAST;
}
return null;
}
示例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 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;
}
}
示例12: 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;
}
}
示例13: getLookDirection
public static ForgeDirection getLookDirection(EntityLivingBase livingBase){
double side = MathHelper.floor_double((double)(livingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
switch((int) side){
case 0:
return ForgeDirection.SOUTH;
case 1:
return ForgeDirection.WEST;
case 2:
return ForgeDirection.NORTH;
case 3:
return ForgeDirection.EAST;
}
return null;
}
示例14: receiveEnergy
@Override
public int receiveEnergy(ForgeDirection fd, int amount, boolean simulate)
{
switch (worldObj.getBlockMetadata(xCoord, yCoord, zCoord))
{
case 2: if(fd == ForgeDirection.SOUTH) return storage.receiveEnergy(amount, simulate);
case 3: if(fd == ForgeDirection.WEST) return storage.receiveEnergy(amount, simulate);
case 4: if(fd == ForgeDirection.NORTH) return storage.receiveEnergy(amount, simulate);
case 5: if(fd == ForgeDirection.EAST) return storage.receiveEnergy(amount, simulate);
default: return 0;
}
}
示例15: 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;
}
}