本文整理匯總了Java中mekanism.api.transmitters.DynamicNetwork類的典型用法代碼示例。如果您正苦於以下問題:Java DynamicNetwork類的具體用法?Java DynamicNetwork怎麽用?Java DynamicNetwork使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DynamicNetwork類屬於mekanism.api.transmitters包,在下文中一共展示了DynamicNetwork類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: newPart
import mekanism.api.transmitters.DynamicNetwork; //導入依賴的package包/類
@Override
public TMultiPart newPart(ItemStack stack, EntityPlayer player, World world, BlockCoord coord, int face, Vector3 vecHit)
{
TransmitterType type = TransmitterType.values()[stack.getItemDamage()];
if(type.getTransmission() != TransmissionType.ITEM)
{
Coord4D obj = new Coord4D(coord.x, coord.y, coord.z, world.provider.dimensionId);
List<DynamicNetwork> networks = new ArrayList<>();
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
{
TileEntity tile = obj.getFromSide(side).getTileEntity(world);
if(tile instanceof ITransmitterTile && TransmissionType.checkTransmissionType(((ITransmitterTile)tile).getTransmitter(), type.getTransmission()))
{
networks.add(((ITransmitterTile)tile).getTransmitter().getTransmitterNetwork());
}
}
if(networks.size() > 0)
{
/*if(!networks.iterator().next().canMerge(networks))
{
return null;
}*/
}
}
return PartTransmitter.getPartType(TransmitterType.values()[getDamage(stack)]);
}