net.minecraftforge.fml.common.Mod.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(214)

本文整理了Java中net.minecraftforge.fml.common.Mod.<init>()方法的一些代码示例,展示了Mod.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mod.<init>()方法的具体详情如下:
包路径:net.minecraftforge.fml.common.Mod
类名称:Mod
方法名:<init>

Mod.<init>介绍

暂无

代码示例

代码示例来源:origin: EngineHub/WorldEdit

@Mod(modid = ForgeWorldEdit.MOD_ID, name = "WorldEdit", version = "%VERSION%", acceptableRemoteVersions = "*")
public class ForgeWorldEdit {

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Mod( modid = "uvlightmapjsontest", name = "UVLightmapJsonTest", version = "0.0.0" )
public class UVLightmapJsonTest

代码示例来源:origin: SlimeKnights/TinkersConstruct

@Mod(modid = TConstruct.modID,
   name = TConstruct.modName,
   version = TConstruct.modVersion,

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Mod( modid = AppEng.MOD_ID, acceptedMinecraftVersions = "[1.12.2]", name = AppEng.MOD_NAME, version = AEConfig.VERSION, dependencies = AppEng.MOD_DEPENDENCIES, guiFactory = "appeng.client.gui.config.AEConfigGuiFactory", certificateFingerprint = "dfa4d3ac143316c6f32aa1a1beda1e34d42132e5" )
public final class AppEng

代码示例来源:origin: Vazkii/Botania

@Mod(modid = LibMisc.MOD_ID, name = LibMisc.MOD_NAME, version = LibMisc.VERSION, dependencies = LibMisc.DEPENDENCIES, guiFactory = LibMisc.GUI_FACTORY)
public class Botania {

代码示例来源:origin: superzanti/ServerSync

@Mod(modid=RefStrings.MODID, name=RefStrings.NAME, version=RefStrings.VERSION,
    serverSideOnly=true, acceptableRemoteVersions="*")
public class ForgeLoaderNET {
  @EventHandler
  public void startServersync(FMLPreInitializationEvent _e) {
    Main.main(new String[]{"server"});
  }
}

代码示例来源:origin: AntiqueAtlasTeam/AntiqueAtlas

@Mod(modid = AntiqueAtlasOverlayMod.MODID, version = AntiqueAtlasOverlayMod.VERSION, name = AntiqueAtlasOverlayMod.MODID, clientSideOnly = true, dependencies = "required-after:antiqueatlas;after:forge@[13.20.0.2262,)")
public class AntiqueAtlasOverlayMod {
  public static final String MODID = "antiqueatlasoverlay";
  public static final String VERSION = "1.2";
  public static final Logger LOGGER = LogManager.getLogger("AntiqueAtlasOverlay");
}

代码示例来源:origin: Darkhax-Minecraft/Tesla

@Mod(modid = "tesla", name = "Tesla", version = "@VERSION@", certificateFingerprint = "@FINGERPRINT@")
public class Tesla {

  private static final Logger LOG = LogManager.getLogger("Tesla");
  
  @EventHandler
  public void preInit (FMLPreInitializationEvent event) {

    CapabilityManager.INSTANCE.register(ITeslaConsumer.class, new CapabilityTeslaConsumer<>(), BaseTeslaContainer.class);
    CapabilityManager.INSTANCE.register(ITeslaProducer.class, new CapabilityTeslaProducer<>(), BaseTeslaContainer.class);
    CapabilityManager.INSTANCE.register(ITeslaHolder.class, new CapabilityTeslaHolder<>(), BaseTeslaContainer.class);
  }
  
  @EventHandler
  public void onFingerprintViolation (FMLFingerprintViolationEvent event) {

    LOG.error("Invalid fingerprint detected! The file " + event.getSource().getName() + " may have been tampered with. This version will NOT be supported by the author!");
  }
}

代码示例来源:origin: elucent/Albedo

@Mod(modid = Albedo.MODID, version = Albedo.VERSION, name = Albedo.NAME, guiFactory = "elucent.albedo.gui.AlbedoGuiFactory", clientSideOnly=true)
public class Albedo
{
  public static final String MODID = "albedo";
  public static final String VERSION = "0.1.2";
  public static final String NAME = "Albedo";
  public static boolean inited = false;
  
  @SideOnly(Side.CLIENT)
  @EventHandler
  public void preinit(FMLPreInitializationEvent event)
  {
    ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new ShaderUtil());
    MinecraftForge.EVENT_BUS.register(new EventManager());
    MinecraftForge.EVENT_BUS.register(new ConfigManager());
    ConfigManager.init(event.getSuggestedConfigurationFile());
  }
}

代码示例来源:origin: lorddusk/HQM

@Mod(modid = HQM.MODID, name = HQM.MODNAME, version = HQM.MODVERSION)
public class HQM{

代码示例来源:origin: SleepyTrousers/EnderIO

@Mod(modid = EnderIODummy.MODID, name = EnderIODummy.MOD_NAME, version = EnderIO.VERSION, dependencies = "after:" + EnderIO.MODID)
public class EnderIODummy {

 public static final @Nonnull String MODID = "enderiobase";
 public static final @Nonnull String DOMAIN = "enderio";
 public static final @Nonnull String MOD_NAME = "Ender IO Base";

}

代码示例来源:origin: SonOfTheStars/Logistics-Pipes-2

@Mod(modid = References.MODID, name = References.MODNAME, version = References.VERSION, dependencies = "", useMetadata = true)
public class LogisticsPipes2 {

代码示例来源:origin: SleepyTrousers/EnderIO

@Mod(modid = EnderIOIntegrationTicLate.MODID, name = EnderIOIntegrationTicLate.MOD_NAME, version = EnderIOIntegrationTicLate.VERSION, dependencies = EnderIOIntegrationTicLate.DEFAULT_DEPENDENCIES)
@EventBusSubscriber
public class EnderIOIntegrationTicLate implements IEnderIOAddon {

代码示例来源:origin: Vazkii/Psi

@Mod(modid = LibMisc.MOD_ID, name = LibMisc.MOD_NAME, version = LibMisc.VERSION, guiFactory = LibMisc.GUI_FACTORY, dependencies = LibMisc.DEPENDENCIES)
public class Psi {

代码示例来源:origin: Vazkii/Quark

@Mod(modid = LibMisc.MOD_ID, name = LibMisc.MOD_NAME, version = LibMisc.VERSION, guiFactory = LibMisc.GUI_FACTORY, dependencies = LibMisc.DEPENDENCIES)
public class Quark {

代码示例来源:origin: joshiejack/Mariculture

@Mod(modid = MODID, name = MODNAME, version = VERSION)
public class Mariculture {
  public static final Logger logger = LogManager.getLogger(MODNAME);

  @SidedProxy(clientSide = JAVAPATH + "MClientProxy", serverSide = JAVAPATH + "MCommonProxy")
  public static MCommonProxy proxy;

  @Instance(MODID)
  public static Mariculture instance;

  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    setConfig(event.getSuggestedConfigurationFile());
    ModuleManager.loadModules(event.getAsmData(), proxy.isClient());
    ModuleManager.loadConfigs();
    proxy.load("preInit");
  }

  @EventHandler
  public void init(FMLInitializationEvent event) {
    proxy.load("init");
  }

  @EventHandler
  public void postInit(FMLPostInitializationEvent event) {
    proxy.load("postInit");
  }
}

代码示例来源:origin: portablejim/VeinMiner

@SuppressWarnings("UnusedDeclaration")
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
  if(Loader.isModLoaded("DartCraft")) {
    devLog("Testing for dartcraft classes and functions.");
    try {
      Object obj = Class.forName("bluedart.api.IForceConsumer").getMethod("attemptRepair", ItemStack.class);
      // Class present.
      forceConsumerAvailable = true;
    } catch (ClassNotFoundException e) {
      devLog("Failed to find Dartcraft force consumer. Disabling repair support");
    } catch (NoSuchMethodException e) {
      devLog("Failed to find Dartcraft force consumer function. Disabling repair support");
    }
  }
}

代码示例来源:origin: p455w0rd/WirelessCraftingTerminal

@Mod(modid = ModGlobals.MODID, name = ModGlobals.NAME, version = ModGlobals.VERSION, dependencies = ModGlobals.DEP_LIST, acceptedMinecraftVersions = "[1.12.2]")
public class WCT {

代码示例来源:origin: portablejim/VeinMiner

@SuppressWarnings("unused")
@EventHandler
public void init(@SuppressWarnings("UnusedParameters") FMLInitializationEvent event) {
  MinecraftForge.EVENT_BUS.register(this);
  ModContainer thisMod = Loader.instance().getIndexedModList().get(ModInfo.MOD_ID);
  if(thisMod != null) {
    String fileName = thisMod.getSource().getName();
    if(fileName.contains("-dev") || !fileName.contains(".jar")) {
      debugMode = true;
      devLog("DEV VERSION");
    }
  }
  forceConsumerAvailable = false;
  if(AUTODETECT_TOOLS_TOGGLE) {
    addTools();
  }
}

代码示例来源:origin: portablejim/VeinMiner

@SuppressWarnings("UnusedDeclaration")
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
  File configDir = new File(event.getModConfigurationDirectory(), "veinminer");
  File loadedFile = new File(configDir, "modSupport.cfg");
  try {
    Configuration config = new Configuration(loadedFile);
    config.load();
    config.addCustomCategoryComment(CONFIG_AUTODETECT, CONFIG_AUTODETECT_COMMENT);
    AUTODETECT_TOOLS_TOGGLE = config.get(CONFIG_AUTODETECT, AUTODETECT_TOOLS_TOGGLE_CONFIGNAME, AUTODETECT_TOOLS_TOGGLE_DEFAULT, AUTODETECT_TOOLS_TOGGLE_DESCRIPTION).getBoolean(AUTODETECT_TOOLS_TOGGLE_DEFAULT);
    config.setCategoryComment("advanced", "You probably don't want to touch these");
    String[] badTools_array = config.getStringList("bad_tools", "advanced", BADTOOLS_DEFAULT, "Tools that break veinminer.");
    String[] falseTools_array = config.getStringList("special_snowflake_tools", "advanced", FALSETOOLS_DEFAULT, "Tools that need to be treated as special snowflakes\n");
    String[] overrideBlacklist_array = config.getStringList("override_blacklist_blocks", "advanced", OVERRIDE_BLACKLIST_DEFAULT, "Blocks to not override success for\n");
    falseTools = new LinkedHashSet<String>(Arrays.asList(falseTools_array));
    overrideBlacklist = new LinkedHashSet<String>(Arrays.asList(overrideBlacklist_array));
    badTools = new LinkedHashSet<String>(Arrays.asList(badTools_array));
    config.save();
  }
  catch(Exception e) {
    event.getModLog().error("Error writing config file");
  }
}

相关文章