本文整理汇总了Java中net.minecraftforge.fml.common.ModAPIManager类的典型用法代码示例。如果您正苦于以下问题:Java ModAPIManager类的具体用法?Java ModAPIManager怎么用?Java ModAPIManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModAPIManager类属于net.minecraftforge.fml.common包,在下文中一共展示了ModAPIManager类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSpecialParameters
import net.minecraftforge.fml.common.ModAPIManager; //导入依赖的package包/类
@Override
public ArrayList<Object> getSpecialParameters() {
//This was typed to Object from no-type.
ArrayList<Object> result = new ArrayList<Object>();
result.add("pump");
result.add("conserve");
result.add("craftingCenter");
result.add("craftingPedestal");
result.add("pumpAlt");
result.add("pumpProjectile");
result.add("pumpFall");
result.add("pumpLight");
result.add("pumpRedstone");
result.add("pumpProjectileAlt");
result.add("pumpFallAlt");
result.add("pumpCreative");
result.add("pumpLightAlt");
result.add("pumpRedstoneAlt");
if (ModAPIManager.INSTANCE.hasAPI("CoFHAPI|energy")) {
result.add("flux");
}
return result;
}
示例2: checkForMods
import net.minecraftforge.fml.common.ModAPIManager; //导入依赖的package包/类
private void checkForMods() {
IC2Loaded = Loader.isModLoaded("IC2");
IGWModLoaded = Loader.isModLoaded("IGWMod");
BCLoaded = ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools");
CofhCoreLoaded = ModAPIManager.INSTANCE.hasAPI("CoFHAPI|item");
NEILoaded = Loader.isModLoaded("NotEnoughItems");
JEILoaded = Loader.isModLoaded("JEI");
EnderIOLoaded = Loader.isModLoaded("EnderIO");
ColoredLightCoreLoaded = Loader.isModLoaded("coloredlightcore");
ACLoaded = Loader.isModLoaded("AgriCraft");
}
示例3: init
import net.minecraftforge.fml.common.ModAPIManager; //导入依赖的package包/类
public static void init(@Nonnull FMLPostInitializationEvent event) {
if (ModAPIManager.INSTANCE.hasAPI("cofhapi|item")) {
// Add support for TE wrench
try {
Class.forName("crazypants.enderio.base.integration.te.TEToolProvider").newInstance();
} catch (Exception e) {
Log.warn("Could not find Thermal Expansion Wrench definition. Wrench integration with it may fail");
}
}
}
示例4: ModSorter
import net.minecraftforge.fml.common.ModAPIManager; //导入依赖的package包/类
public ModSorter(List<ModContainer> modList, Map<String, ModContainer> nameLookup)
{
HashMap<String, ModContainer> sortingNameLookup = Maps.newHashMap(nameLookup);
ModAPIManager.INSTANCE.injectAPIModContainers(modList, sortingNameLookup);
buildGraph(modList, sortingNameLookup);
}
示例5: transform
import net.minecraftforge.fml.common.ModAPIManager; //导入依赖的package包/类
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass)
{
String lookupName = name;
if(name.endsWith("$class"))
{
lookupName = name.substring(0, name.length() - 6);
}
if (optionals == null || !optionals.containsKey(lookupName))
{
return basicClass;
}
ClassNode classNode = new ClassNode();
ClassReader classReader = new ClassReader(basicClass);
classReader.accept(classNode, 0);
if (logDebugInfo) FMLRelaunchLog.finer("Optional removal - found optionals for class %s - processing", name);
for (ASMData optional : optionals.get(lookupName))
{
String modId = (String) optional.getAnnotationInfo().get("modid");
if (Loader.isModLoaded(modId) || ModAPIManager.INSTANCE.hasAPI(modId))
{
if (logDebugInfo) FMLRelaunchLog.finer("Optional removal skipped - mod present %s", modId);
continue;
}
if (logDebugInfo) FMLRelaunchLog.finer("Optional on %s triggered - mod missing %s", name, modId);
if (optional.getAnnotationInfo().containsKey("iface"))
{
Boolean stripRefs = (Boolean)optional.getAnnotationInfo().get("striprefs");
if (stripRefs == null) stripRefs = Boolean.FALSE;
stripInterface(classNode,(String)optional.getAnnotationInfo().get("iface"), stripRefs);
}
else
{
stripMethod(classNode, optional.getObjectName());
}
}
if (logDebugInfo) FMLRelaunchLog.finer("Optional removal - class %s processed", name);
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
classNode.accept(writer);
return writer.toByteArray();
}
示例6: areRequirementsMet
import net.minecraftforge.fml.common.ModAPIManager; //导入依赖的package包/类
@Override
public boolean areRequirementsMet()
{
return ModAPIManager.INSTANCE.hasAPI("CoFHAPI|energy");
}
示例7: getTooltipData
import net.minecraftforge.fml.common.ModAPIManager; //导入依赖的package包/类
@Override
public List<String> getTooltipData(World world, EntityPlayer player, BlockPos pos) {
List<String> result = new ArrayList<String>();
TileEntity tileEntity = world.getTileEntity(pos);
if (tileEntity instanceof AuraTile) {
if (tileEntity instanceof AuraTileCapacitor) {
AuraTileCapacitor capacitor = (AuraTileCapacitor) tileEntity;
result.add("Max Storage: " + capacitor.storageValues[capacitor.storageValueIndex]);
}
result.add("Aura Stored: ");
result.add("Aura: " + ((AuraTile) tileEntity).storage);
} else {
result.add("No Aura");
}
if (tileEntity instanceof AuraTileCapacitor) {
if (((AuraTileCapacitor) tileEntity).ticksDisabled > 0) {
result.add("Time until functional: " + ((AuraTileCapacitor) tileEntity).ticksDisabled / 20);
}
}
if (tileEntity instanceof AuraTilePumpBase) {
result.add("Time left: " + ((AuraTilePumpBase) tileEntity).pumpPower + " seconds");
result.add("Power: " + ((AuraTilePumpBase) tileEntity).pumpSpeed + " power per second");
if (((AuraTilePumpBase) tileEntity).isAlternator()) {
AuraTilePumpBase altPump = (AuraTilePumpBase) tileEntity;
int power = (int) (altPump.pumpSpeed * altPump.getAlternatingFactor());
result.add("Phase Power: " + power);
}
}
if (ModAPIManager.INSTANCE.hasAPI("CoFHAPI|energy")) {
if (tileEntity instanceof AuraTileRF) {
AuraTileRF auraTileRF = (AuraTileRF) tileEntity;
result.add("RF/t Output: " + auraTileRF.lastPower * Config.powerFactor);
}
} else if (tileEntity instanceof CraftingCenterTile) {
CraftingCenterTile tile = (CraftingCenterTile) tileEntity;
if (tile.getRecipe() != null) {
result.add("Making: " + tile.getRecipe().result.getDisplayName());
for (EnumFacing direction : CraftingCenterTile.pedestalRelativeLocations) {
AuraTilePedestal pedestal = (AuraTilePedestal) world.getTileEntity(pos.offset(direction));
if (tile.getRecipe() != null) {
result.add(" Power received:" + pedestal.powerReceived + "/" + tile.getRecipe().getAuraFromItem(pedestal.itemStack));
} else {
AuraCascade.log.warn("Invalid recipe when checking crafting center");
}
}
} else {
result.add("No Valid Recipe Selected");
}
}
return result;
}
示例8: collectData
import net.minecraftforge.fml.common.ModAPIManager; //导入依赖的package包/类
private List<String> collectData() {
List<String> result = new ArrayList<String>();
if (FMLCommonHandler.instance().getSide() == Side.CLIENT && FMLClientHandler.instance().hasOptifine()) {
result.add(" * Optifine is installed. This is NOT supported.");
}
if (EnderIO.proxy.isDedicatedServer()) {
if (!FMLServerHandler.instance().getServer().isServerInOnlineMode() && System.getProperty("INDEV") == null) {
Log.warn("@Devs: See github for dev env setup; set INDEV if needed.");
result.add(" * Offline mode for dedicated servers is NOT supported by Ender IO.");
}
}
for (ModContainer modContainer : ModAPIManager.INSTANCE.getAPIList()) {
String apiVersionString = modContainer.getVersion();
if (apiVersionString == null) {
apiVersionString = "";
}
// if ("appliedenergistics2|API".equals(modContainer.getModId())) {
// if ("rv1".equals(apiVersionString) || "rv2".equals(apiVersionString) || "rv3".equals(apiVersionString)) {
// result.add(" * An unsupportted old AE2 API is installed (" + apiVersionString + " from "
// + modContainer.getSource().getName() + ").");
// result.add(" Ender IO was build against API version rv4 and will NOT work with older versions.");
// } else if (!"rv4".equals(apiVersionString)) {
// result.add(" * An unknown AE2 API is installed (" + apiVersionString + " from "
// + modContainer.getSource().getName() + ").");
// result.add(" Ender IO was build against API version rv4 and may or may not work with a newer version.");
// }
// } else
if (modContainer.getModId() != null && modContainer.getModId().startsWith("EnderIOAPI")) {
if (!EnderIOAPIProps.VERSION.equals(apiVersionString)) {
result.add(" * Another mod is shipping a version of our API that doesn't match our version (" + apiVersionString
+ " from " + modContainer.getSource().getName() + "). That may not actually work.");
} else if (modContainer.getSource().getName() != null
&& (!modContainer.getSource().getName().startsWith("EnderIO") && !modContainer.getSource().getName().startsWith("enderio") && !modContainer
.getSource().getName().equals("bin"))) {
result.add(" * Our API got loaded from " + modContainer.getSource().getName() + ". That's unexpected.");
}
}
}
String badBrand = null;
for (String brand : FMLCommonHandler.instance().getModName().split(",")) {
if (brand != null && !brand.equals("fml") && !brand.equals("forge")) {
if (badBrand == null) {
badBrand = brand;
} else {
badBrand += ", " + brand;
}
}
}
if (badBrand != null) {
result.add("An unsupported base software is installed: '" + badBrand + "'. This is NOT supported.");
}
return result;
}