本文整理汇总了Java中net.minecraftforge.fml.common.Loader.isModLoaded方法的典型用法代码示例。如果您正苦于以下问题:Java Loader.isModLoaded方法的具体用法?Java Loader.isModLoaded怎么用?Java Loader.isModLoaded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.fml.common.Loader
的用法示例。
在下文中一共展示了Loader.isModLoaded方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: IGWSupportNotifier
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
/**
* Needs to be instantiated somewhere in your mod's loading stage.
*/
public IGWSupportNotifier() {
if (FMLCommonHandler.instance().getSide() == Side.CLIENT && !Loader.isModLoaded("IGWMod")) {
File dir = new File(".", "config");
Configuration config = new Configuration(new File(dir, "IGWMod.cfg"));
config.load();
if (config.get(Configuration.CATEGORY_GENERAL, "enable_missing_notification", true, "When enabled, this will notify players when IGW-Mod is not installed even though mods add support.").getBoolean()) {
ModContainer mc = Loader.instance().activeModContainer();
String modid = mc.getModId();
List<ModContainer> loadedMods = Loader.instance().getActiveModList();
for (ModContainer container : loadedMods) {
if (container.getModId().equals(modid)) {
supportingMod = container.getName();
MinecraftForge.EVENT_BUS.register(this);
ClientCommandHandler.instance.registerCommand(new CommandDownloadIGW());
break;
}
}
}
config.save();
}
}
示例2: buildValidItemsArray
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
private static void buildValidItemsArray()
{
List<Item> valid_items = new ArrayList<Item>();
valid_items.add(Items.POTIONITEM);
valid_items.add(Items.SPLASH_POTION);
valid_items.add(Items.LINGERING_POTION);
valid_items.add(Items.TIPPED_ARROW);
if (Loader.isModLoaded("potioncore"))
{
valid_items.add(Item.getByNameOrId("potioncore:custom_potion"));
valid_items.add(Item.getByNameOrId("potioncore:custom_arrow"));
}
VALID_ITEMS = valid_items.toArray(new Item[valid_items.size()]);
}
示例3: onPostRender
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
@SubscribeEvent
public void onPostRender(RenderWorldLastEvent evt) {
if (!Loader.isModLoaded("baubles")) return;
EntityPlayer thePlayer = Minecraft.getMinecraft().player;
for(EntityPlayer entity : Minecraft.getMinecraft().world.playerEntities) {
IBaublesItemHandler baubles = BaublesApi.getBaublesHandler(entity);
ItemStack scarfStack = baubles.getStackInSlot(BAUBLE_AMULET);
if (scarfStack==null || scarfStack.isEmpty() || scarfStack.getItem()!=ThermionicsItems.SCARF) return;
Scarf scarf = scarfCache.getIfPresent(entity);
if (scarf==null) {
scarf = new Scarf();
scarfCache.put(entity, scarf);
scarf.readFromNBT(scarfStack.getTagCompound());
//System.out.println("Created scarf:"+(scarf.leftScarf.size()+scarf.rightScarf.size())+" nodes.");
} else {
scarf.updateFromNBT(scarfStack.getTagCompound());
//System.out.println("Updated scarf:"+(scarf.leftScarf.size()+scarf.rightScarf.size())+" nodes.");
}
double dx = thePlayer.prevPosX + (thePlayer.posX - thePlayer.prevPosX) * evt.getPartialTicks();
double dy = thePlayer.prevPosY + (thePlayer.posY - thePlayer.prevPosY) * evt.getPartialTicks();
double dz = thePlayer.prevPosZ + (thePlayer.posZ - thePlayer.prevPosZ) * evt.getPartialTicks();
LayerScarf.renderScarf(
dx, dy, dz,
entity, null, scarf, evt.getPartialTicks(),
Minecraft.getMinecraft().world);
}
}
示例4: preInit
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
public void preInit(FMLPreInitializationEvent event)
{
// Handle configuration
File configDir = event.getModConfigurationDirectory();
config = new Configuration(new File(configDir.getPath(), "simplechunks.cfg"));
try
{
config.load();
GeneralConfig.readConfig(config);
}
catch (Exception e)
{
SimpleChunks.logger.error("Error loading config file!", e);
}
finally
{
if (config.hasChanged())
{
config.save();
}
}
// Integrate with other mods
if (Loader.isModLoaded("theoneprobe"))
{
TOPCompat.register();
}
// Register chunkloading callback
ForgeChunkManager.setForcedChunkLoadingCallback(SimpleChunks.instance, new ChunkLoadingHandler());
}
示例5: addInformation
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
tooltip.add(ChatFormatting.ITALIC + "" + ReadableNumberConverter.INSTANCE.toWideReadableForm(getEnergyStored(stack)) + "/" + ReadableNumberConverter.INSTANCE.toWideReadableForm(getMaxEnergyStored(stack)) + " RF");
tooltip.add("Stored Water: " + getFluidStored(stack) / 1000 + "/" + FLUID_CAPACITY / 1000 + " Buckets");
tooltip.add("");
tooltip.add(I18n.format("tooltip.tanaddons.thirstquencher.desc"));
tooltip.add(I18n.format("tooltip.tanaddons.thirstquencher.desc2"));
tooltip.add(I18n.format("tooltip.tanaddons.thirstquencher.desc3"));
if (Loader.isModLoaded(ModGlobals.MODID_BAUBLES)) {
tooltip.add(I18n.format("tooltip.tanaddons.baublesitem", "any"));
}
}
示例6: preInit
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
public static void preInit() {
//Add soulforged steel as a liquid
if (Loader.isModLoaded("betterwithmods")) {
Fluid soulforgedSteel = new Fluid("soulforged_steel", new ResourceLocation("tconstruct:blocks/fluids/molten_metal"), new ResourceLocation("tconstruct:blocks/fluids/molten_metal_flow"));
FluidRegistry.registerFluid(soulforgedSteel);
FluidRegistry.addBucketForFluid(soulforgedSteel);
NBTTagCompound tag = new NBTTagCompound();
tag.setString("fluid", soulforgedSteel.getName());
tag.setString("ore", "SoulforgedSteel");
tag.setBoolean("toolforge", false);
FMLInterModComms.sendMessage("tconstruct", "integrateSmeltery", tag);
}
}
示例7: registerListener
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
public static void registerListener()
{
enabled = Loader.isModLoaded("Dynmap");
if (enabled)
Gateway.register();
else
Log.debug("Dynmap is not available; integration disabled");
}
示例8: registerUpgrades
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
private static void registerUpgrades(IForgeRegistry<Item> registry) {
for (EnumUpgrade upgrade : EnumUpgrade.values()) {
if (upgrade != EnumUpgrade.THAUMCRAFT || Loader.isModLoaded(ModIds.THAUMCRAFT)) {
String upgradeName = upgrade.toString().toLowerCase() + "_upgrade";
Item upgradeItem = new ItemMachineUpgrade(upgradeName, upgrade.ordinal());
registerItem(registry, upgradeItem);
upgrades.put(upgrade, upgradeItem);
}
}
}
示例9: TileEntityBattery
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
public TileEntityBattery() {
//Batteries have a bit of a complicated relationship with their neighbors.
capabilities.registerForSides(CapabilityEnergy.ENERGY, ()->new NoExtractEnergyStorageView(energyStorage),
RelativeDirection.TOP, RelativeDirection.BOTTOM, RelativeDirection.PORT, RelativeDirection.STARBOARD, RelativeDirection.STERN);
capabilities.registerForSides(CapabilityEnergy.ENERGY, ()->new NoReceiveEnergyStorageView(energyStorage),
RelativeDirection.BOW);
capabilities.registerForSides(CapabilityEnergy.ENERGY, ()->energyStorage,
RelativeDirection.WITHIN);
energyStorage.listen(this::markDirty);
if (Loader.isModLoaded("probedataprovider")) {
ProbeDataSupport.registerRFInspector(this, capabilities);
}
}
示例10: isOptifineInstalled
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
public static boolean isOptifineInstalled() {
if(!isOptifineInstalled) {
isOptifineInstalled = Loader.isModLoaded("optifine");
}
return isOptifineInstalled;
}
示例11: addInformation
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
tooltip.add(ChatFormatting.ITALIC + "" + ReadableNumberConverter.INSTANCE.toWideReadableForm(getEnergyStored(stack)) + "/" + ReadableNumberConverter.INSTANCE.toWideReadableForm(getMaxEnergyStored(stack)) + " RF");
tooltip.add("");
tooltip.add(I18n.format("tooltip.tanaddons.ptempregulator.desc"));
tooltip.add(I18n.format("tooltip.tanaddons.ptempregulator.desc2"));
if (Loader.isModLoaded(ModGlobals.MODID_BAUBLES)) {
tooltip.add(I18n.format("tooltip.tanaddons.baublesitem", "any"));
}
}
示例12: isIc2Available
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
public static boolean isIc2Available() {
if (ic2Available != null) return ic2Available;
boolean loaded = Loader.isModLoaded("IC2");
if (Loader.instance().hasReachedState(LoaderState.CONSTRUCTING)) {
ic2Available = loaded;
}
return loaded;
}
示例13: init
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
public static void init() {
if (Loader.isModLoaded("probedataprovider")) {
internal = new InternalActual();
PROBE_PRESENT = true;
} else {
internal = new InternalDummy();
}
internal.init();
}
示例14: isLoaded
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
public boolean isLoaded() {
return Loader.isModLoaded(getId());
}
示例15: registerVillagerTrades
import net.minecraftforge.fml.common.Loader; //导入方法依赖的package包/类
public static void registerVillagerTrades()
{
careerKrog.addTrade(1, new VillagerTradeItemForItem(new ItemStack(ModItems.shiny_stone), new EntityVillager.PriceInfo(1, 1),
new ItemStack(Items.LEATHER), new EntityVillager.PriceInfo(2, 2)));
careerKrog.addTrade(1, new VillagerTradeItemForItem(new ItemStack(Items.PAINTING), new EntityVillager.PriceInfo(1, 1),
new ItemStack(Blocks.CACTUS), new EntityVillager.PriceInfo(8, 16)));
careerKrog.addTrade(1, new VillagerTradeItemForItem(new ItemStack(Items.FISHING_ROD), new EntityVillager.PriceInfo(1, 1),
new ItemStack(Items.FISH), new EntityVillager.PriceInfo(5, 8)));
careerKrog.addTrade(2, new VillagerTradeItemForItem(new ItemStack(Items.DYE), new EntityVillager.PriceInfo(5, 10),
new ItemStack(Blocks.VINE), new EntityVillager.PriceInfo(2, 4)));
if (Loader.isModLoaded("tconstruct"))
{
Item arrowhead = Item.REGISTRY.getObject(new ResourceLocation("tconstruct", "arrow_head"));
if (arrowhead != null)
{
NBTTagCompound material = new NBTTagCompound();
material.setString("Material", "obsidian");
ItemStack stack = new ItemStack(arrowhead);
stack.setTagCompound(material);
careerKrog.addTrade(2, new VillagerTradeItemForItem(new ItemStack(Items.COAL, 1, 1), new EntityVillager.PriceInfo(10, 20),
stack, new EntityVillager.PriceInfo(1, 1)));
}
}
if (Loader.isModLoaded("actuallyadditions"))
{
Item crystal = Item.REGISTRY.getObject(new ResourceLocation("actuallyadditions", "item_crystal"));
if (crystal != null)
{
ItemStack starterKit = createChickenSpawnerKit();
careerKrog.addTrade(3, new VillagerTradeItemForItem(new ItemStack(crystal, 1, 4), new EntityVillager.PriceInfo(1, 3),
starterKit, new EntityVillager.PriceInfo(1, 1)));
}
}
careerTorg.addTrade(1, new VillagerTradeItemForItem(new ItemStack(Items.BEEF), new EntityVillager.PriceInfo(1, 3),
new ItemStack(Blocks.SAPLING, 1, 3), new EntityVillager.PriceInfo(1, 3)));
careerTorg.addTrade(1, new VillagerTradeItemForItem(new ItemStack(Items.LEATHER), new EntityVillager.PriceInfo(2, 4),
new ItemStack(Items.MELON_SEEDS), new EntityVillager.PriceInfo(4, 6)));
Block net = Block.REGISTRY.getObject(new ResourceLocation("actuallyadditions", "block_fishing_net"));
if (net != Blocks.AIR)
{
careerTorg.addTrade(2, new VillagerTradeItemForItem(new ItemStack(net), new EntityVillager.PriceInfo(1, 1),
new ItemStack(Items.DYE, 1, 3), new EntityVillager.PriceInfo(24, 36)));
}
if (Loader.isModLoaded("rustic"))
{
NBTTagCompound parrotTag = new NBTTagCompound();
parrotTag.setString("id", "minecraft:parrot");
ItemStack parrotEgg = new ItemStack(Items.SPAWN_EGG, 1);
parrotEgg.setTagInfo("EntityTag", parrotTag);
careerTorg.addTrade(3, new VillagerTradeItemForItem(new ItemStack(rustic.common.items.ModItems.HONEYCOMB), new EntityVillager.PriceInfo(30, 40),
parrotEgg, new EntityVillager.PriceInfo(1, 1)));
}
}