本文整理汇总了Java中net.minecraftforge.common.ForgeDirection.UP属性的典型用法代码示例。如果您正苦于以下问题:Java ForgeDirection.UP属性的具体用法?Java ForgeDirection.UP怎么用?Java ForgeDirection.UP使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraftforge.common.ForgeDirection
的用法示例。
在下文中一共展示了ForgeDirection.UP属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tryPlantingCocoa
private boolean tryPlantingCocoa(Vect position) {
Vect current = position;
while(isWoodBlock(current) && BlockLog.limitToValidMetadata(getBlockMeta(current)) == 3) {
for(ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
if(direction == ForgeDirection.UP || direction == ForgeDirection.DOWN)
continue;
Vect candidate = new Vect(current.x + direction.offsetX, current.y, current.z + direction.offsetZ);
if(isAirBlock(candidate))
return housing.plantGermling(cocoa, world, candidate.x, candidate.y, candidate.z);
}
current = current.add(new Vect(0, 1, 0));
if(current.y - position.y > 1)
break;
}
return false;
}
示例2: DirectionTo
/**
* Will Return NULL if it's at some diagonal!
*/
public ForgeDirection DirectionTo(WorldCoord loc)
{
int ox = x - loc.x;
int oy = y - loc.y;
int oz = z - loc.z;
int xlen = Math.abs( ox );
int ylen = Math.abs( oy );
int zlen = Math.abs( oz );
if ( loc.isEqual( this.copy().add( ForgeDirection.EAST, xlen ) ) )
return ForgeDirection.EAST;
if ( loc.isEqual( this.copy().add( ForgeDirection.WEST, xlen ) ) )
return ForgeDirection.WEST;
if ( loc.isEqual( this.copy().add( ForgeDirection.NORTH, zlen ) ) )
return ForgeDirection.NORTH;
if ( loc.isEqual( this.copy().add( ForgeDirection.SOUTH, zlen ) ) )
return ForgeDirection.SOUTH;
if ( loc.isEqual( this.copy().add( ForgeDirection.UP, ylen ) ) )
return ForgeDirection.UP;
if ( loc.isEqual( this.copy().add( ForgeDirection.DOWN, ylen ) ) )
return ForgeDirection.DOWN;
return null;
}
示例3: getFireSpreadSpeed
@Override
public int getFireSpreadSpeed(World world, int x, int y, int z, int metadata, ForgeDirection face) {
if (face == ForgeDirection.DOWN)
return 20;
else if (face != ForgeDirection.UP)
return 10;
else
return 5;
}
示例4: extractItem
/**
* Extracts saplings from top and bottom, wood from the sides.
*/
@Override
public ItemStack[] extractItem(boolean doRemove, ForgeDirection from, int maxItemCount) {
for (int i = 0; i < harvestStacks.length; i++) {
if (harvestStacks[i] == null) {
continue;
}
ItemStack product = null;
// Extract only saplings from top or bottom
if (hasWindfallById(harvestStacks[i].getItem().itemID)) {
if (Config.harvesterSideSensitive && this.isSideSensitive && from != ForgeDirection.DOWN && from != ForgeDirection.UP) {
continue;
} else {
product = getWindfall(harvestStacks[i]);
}
} else if (Config.harvesterSideSensitive && this.isSideSensitive && (from == ForgeDirection.DOWN || from == ForgeDirection.UP)) {
continue;
} else {
product = new ItemStack(harvestStacks[i].getItem().itemID, 1, 0);
}
if (doRemove && product != null) {
decrStackSize(i, 1);
}
// if(!hasProperSoil() && tile.worldObj.rand.nextInt(100) < 25)
// return new ItemStack(Block.dirt);
// else
return new ItemStack[] { product };
}
return new ItemStack[0];
}
示例5: addItem
@Override
public int addItem(ItemStack stack, boolean doAdd, ForgeDirection from) {
if (!this.isLinked())
return 0;
IInventory inventory = getOrCreateTradeInventory();
ItemStack tradegood = inventory.getStackInSlot(TradeStation.SLOT_TRADEGOOD);
// Special handling for paper
if (stack.itemID == Item.paper.itemID) {
// Handle paper as resource if its not the trade good or pumped in from above or below
if ((tradegood != null && tradegood.itemID != Item.paper.itemID) || from == ForgeDirection.DOWN || from == ForgeDirection.UP)
return StackUtils.addToInventory(stack, inventory, doAdd, TradeStation.SLOT_LETTERS_1, TradeStation.SLOT_LETTERS_COUNT);
}
// Special handling for stamps
if (stack.getItem() instanceof IStamps) {
// Handle stamps as resource if its not the trade good or pumped in from above or below
if ((tradegood != null && !(tradegood.getItem() instanceof IStamps)) || from == ForgeDirection.DOWN || from == ForgeDirection.UP)
return StackUtils.addToInventory(stack, inventory, doAdd, TradeStation.SLOT_STAMPS_1, TradeStation.SLOT_STAMPS_COUNT);
}
// Everything else
if (tradegood == null)
return 0;
if (!tradegood.isItemEqual(stack))
return 0;
return StackUtils.addToInventory(stack, inventory, doAdd, TradeStation.SLOT_INPUTBUF_1, TradeStation.SLOT_BUFFER_COUNT);
}
示例6: getStartInventorySide
@Override
public int getStartInventorySide(ForgeDirection side) {
// BOTTOM
if (side == ForgeDirection.DOWN)
return SLOT_DRONE;
// TOP
else if (side == ForgeDirection.UP)
return SLOT_QUEEN;
// SIDES
else
return SLOT_PRODUCT_1;
}
示例7: getSizeInventorySide
@Override
public int getSizeInventorySide(ForgeDirection side) {
if (side == ForgeDirection.DOWN || side == ForgeDirection.UP)
return 1;
else
return SLOT_PRODUCT_COUNT;
}
示例8: getStartInventorySide
@Override
public int getStartInventorySide(ForgeDirection side) {
if (side == ForgeDirection.UP || side == ForgeDirection.DOWN)
return SLOT_WASTE_1;
else
return SLOT_FUEL;
}
示例9: getSizeInventorySide
@Override
public int getSizeInventorySide(ForgeDirection side) {
if (side == ForgeDirection.UP || side == ForgeDirection.DOWN)
return SLOT_WASTE_COUNT;
else
return 1;
}
示例10: getStartInventorySide
@Override
public int getStartInventorySide(ForgeDirection side) {
// BOTTOM
if (side == ForgeDirection.DOWN)
return outputSlot1;
// TOP
else if (side == ForgeDirection.UP)
return canSlot;
// SIDES
else
return inputSlot1;
}
示例11: getSizeInventorySide
@Override
public int getSizeInventorySide(ForgeDirection side) {
if (side == ForgeDirection.UP)
return 1;
else if (side == ForgeDirection.DOWN)
return 4;
else
return 6;
}
示例12: addItem
@Override
public int addItem(ItemStack stack, boolean doAdd, ForgeDirection from) {
if (from == ForgeDirection.UP && RecipeManager.findMatchingSmelting(stack) != null)
return inventory.addStack(stack, SLOT_METAL, 1, false, doAdd);
return inventory.addStack(stack, SLOT_INVENTORY_1, SLOT_INVENTORY_COUNT, false, doAdd);
}
示例13: extractItem
@Override
public ItemStack[] extractItem(boolean doRemove, ForgeDirection from, int maxItemCount) {
ItemStack product = null;
for (int i = SLOT_PRODUCT_1; i < SLOT_PRODUCT_1 + SLOT_PRODUCT_COUNT; i++) {
if (inventory.getStackInSlot(i) == null) {
continue;
}
// Princesses can only be extracted from top.
if (inventory.getStackInSlot(i).itemID == ForestryItem.beePrincessGE.itemID) {
if (PluginForestryApiculture.apiarySideSensitive && from != ForgeDirection.UP) {
continue;
}
product = inventory.getStackInSlot(i).copy();
if (doRemove) {
inventory.getStackInSlot(i).stackSize = 0;
inventory.setInventorySlotContents(i, null);
}
break;
// Drones can only be extracted from the bottom.
} else if (inventory.getStackInSlot(i).itemID == ForestryItem.beeDroneGE.itemID) {
if (PluginForestryApiculture.apiarySideSensitive && from != ForgeDirection.DOWN) {
continue;
}
product = StackUtils.createSplitStack(inventory.getStackInSlot(i), 1);
product.stackSize = 1;
if (doRemove) {
inventory.getStackInSlot(i).stackSize--;
if (inventory.getStackInSlot(i).stackSize <= 0) {
inventory.setInventorySlotContents(i, null);
}
}
break;
// Everything else to be extracted from the sides
} else {
if (PluginForestryApiculture.apiarySideSensitive && (from == ForgeDirection.UP || from == ForgeDirection.DOWN)) {
continue;
}
product = StackUtils.createSplitStack(inventory.getStackInSlot(i), 1);
if (doRemove) {
inventory.getStackInSlot(i).stackSize--;
if (inventory.getStackInSlot(i).stackSize <= 0) {
inventory.setInventorySlotContents(i, null);
}
}
break;
}
}
return new ItemStack[] { product };
}