本文整理匯總了Java中micdoodle8.mods.galacticraft.api.transmission.tile.IOxygenReceiver類的典型用法代碼示例。如果您正苦於以下問題:Java IOxygenReceiver類的具體用法?Java IOxygenReceiver怎麽用?Java IOxygenReceiver使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IOxygenReceiver類屬於micdoodle8.mods.galacticraft.api.transmission.tile包,在下文中一共展示了IOxygenReceiver類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: renderTileEntityAt
import micdoodle8.mods.galacticraft.api.transmission.tile.IOxygenReceiver; //導入依賴的package包/類
@Override
public void renderTileEntityAt(
TileEntity te,
double x,
double y,
double z,
float partialTicks) {
if(te instanceof TileEntityHydroponics) {
TileEntityHydroponics tile = (TileEntityHydroponics)te;
GL11.glPushMatrix();
GL11.glTranslatef((float) x, (float) y, (float) z);
final TileEntity[] connections = OxygenUtil.getAdjacentOxygenConnections(tile);
// meh
for(int i = 0; i<connections.length;i++) {
TileEntity cur = connections[i];
ForgeDirection direction = ForgeDirection.values()[i];
if(cur instanceof IOxygenReceiver) {
if(((IOxygenReceiver)cur).getOxygenRequest(direction.getOpposite()) <= 0) {
connections[i] = null;
}
}
}
boolean hasNorth = connections[ForgeDirection.NORTH.ordinal()] != null;
boolean hasSouth = connections[ForgeDirection.SOUTH.ordinal()] != null;
boolean hasWest = connections[ForgeDirection.WEST.ordinal()] != null;
boolean hasEast = connections[ForgeDirection.EAST.ordinal()] != null;
final Tessellator tess = Tessellator.instance;
model.render(tess, tile.getPlantGrowthStatus(), hasNorth, hasSouth, hasWest, hasEast);
GL11.glPopMatrix();
}
}
示例2: getRequest
import micdoodle8.mods.galacticraft.api.transmission.tile.IOxygenReceiver; //導入依賴的package包/類
/**
* @return How much oxygen this network needs.
*/
@Override
public float getRequest(TileEntity... ignoreTiles)
{
List<Float> requests = new ArrayList<Float>();
for (TileEntity tileEntity : new HashSet<TileEntity>(this.oxygenTiles.keySet()))
{
if (Arrays.asList(ignoreTiles).contains(tileEntity))
{
continue;
}
if (tileEntity instanceof IOxygenReceiver)
{
if (!tileEntity.isInvalid())
{
if (tileEntity.worldObj.getBlockTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord) == tileEntity)
{
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
{
Vector3 tileVec = new Vector3(tileEntity);
TileEntity tile = tileVec.modifyPositionFromSide(direction).getTileEntity(tileEntity.worldObj);
if (((IOxygenReceiver) tileEntity).canConnect(direction, NetworkType.OXYGEN) && this.getTransmitters().contains(tile))
{
requests.add(((IOxygenReceiver) tileEntity).getOxygenRequest(direction));
continue;
}
}
}
}
}
}
float total = 0.0F;
for (Float f : requests)
{
total += f;
}
return total / requests.size();
}