本文整理汇总了Java中net.minecraftforge.fml.common.event.FMLPreInitializationEvent类的典型用法代码示例。如果您正苦于以下问题:Java FMLPreInitializationEvent类的具体用法?Java FMLPreInitializationEvent怎么用?Java FMLPreInitializationEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FMLPreInitializationEvent类属于net.minecraftforge.fml.common.event包,在下文中一共展示了FMLPreInitializationEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
logger = event.getModLog();
config = new Configuration(event.getSuggestedConfigurationFile());
doConfig();
int id = 1; // Don't use 0, more easy debug.
snw = NetworkRegistry.INSTANCE.newSimpleChannel(MOD_ID);
snw.registerMessage(Request.Handler.class, Request.class, id++, Side.SERVER);
snw.registerMessage(Data.Handler.class, Data.class, id++, Side.CLIENT);
proxy.preInit();
}
示例2: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event){
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
canBeDeactivated = config.getBoolean("canBeDeactivated", Configuration.CATEGORY_GENERAL, true, "If the wopper can be deactivated using redstone");
wopperSpeed = config.getInt("speed", Configuration.CATEGORY_GENERAL, 10, 1, 1000, "The amount of ticks that have to pass before the wopper does a movement action again");
if(config.hasChanged()){
config.save();
}
blockWopper = new BlockWopper("wopper");
GameRegistry.registerTileEntity(TileEntityWopper.class, MOD_ID+":wopper");
proxy.preInit();
}
示例3: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
@Override
public void preInit(FMLPreInitializationEvent event) {
super.preInit(event);
/*
for (final String name : Fluids.getFluidBlockRegistry().keySet()) {
final Block block = Fluids.getFluidBlockByName(name);
final Item item = Item.getItemFromBlock(block);
if (!item.getRegistryName().getResourceDomain().equals(BaseFoods.MODID))
continue;
final ModelResourceLocation fluidModelLocation = new ModelResourceLocation(item.getRegistryName().getResourceDomain() + ":" + name, "fluid");
ModelBakery.registerItemVariants(item);
ModelLoader.setCustomMeshDefinition(item, stack -> fluidModelLocation);
ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return fluidModelLocation;
}
});
}
*/
}
示例4: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
public void preInit(FMLPreInitializationEvent e) {
MinecraftForge.EVENT_BUS.register(new ForgeEventHandlers());
McJtyLib.preInit(e);
CommandHandler.registerCommands();
GeneralConfig.preInit(e);
File directory = e.getModConfigurationDirectory();
mainConfig = new Configuration(new File(directory.getPath(), "needtobreathe.cfg"));
Config.readConfig(mainConfig);
// PacketHandler.registerMessages("meecreeps");
SimpleNetworkWrapper network = PacketHandler.registerMessages(NeedToBreathe.MODID, "needtobreathe");
NTBMessages.registerNetworkMessages(network);
// Initialization of blocks and items typically goes here:
// ModEntities.init();
ModItems.init();
ModBlocks.init();
}
示例5: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
public void preInit(FMLPreInitializationEvent event)
{
// Load configuration from file
File configDir = event.getModConfigurationDirectory();
config = new Configuration(new File(configDir.getPath(), "btweagles.cfg"));
Config.readConfig();
registerFluids();
ModEntities.init();
if (Loader.isModLoaded("thermalexpansion"))
{
IntegrationThermal.preInit();
}
}
示例6: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
@Override
public void preInit(FMLPreInitializationEvent event)
{
MinecraftForge.EVENT_BUS.register(new ModItemModels());
MinecraftForge.EVENT_BUS.register(new GuiMana());
MinecraftForge.EVENT_BUS.register(new GuiHealth());
MinecraftForge.EVENT_BUS.register(new EventRenderOverlayText());
}
示例7: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
@Override
public void preInit(FMLPreInitializationEvent event){
super.preInit(event);
//ShaderUtil.init();
//ModelManager.init();
RegistryManager.registerRendering();
RenderingRegistry.registerEntityRenderingHandler(EntityGhostHorse.class, RenderGhostHorse::new);
}
示例8: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
/**
* Run before anything else. Read your config, create blocks, items, etc, and
* register them with the GameRegistry.
*/
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {
logger = e.getModLog();
creativeTab = new CompatCreativeTabs("lector") {
@Override
protected Item getItem() {
return ModItems.manual;
}
};
this.proxy.preInit(e);
}
示例9: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
switch (event.getSide()) {
case CLIENT: {
//---- initialize mods ----//
getModManager().loadClasses();
}
default:
break;
}
}
示例10: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
public void preInit(FMLPreInitializationEvent e) {
ModConfig.init();
ModBlocks.init();
ModItems.init();
ModRecipes.init();
ModIntegration.preInit();
ModNetworking.init();
}
示例11: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
config = new UCConfig();
config.loadConfig(event);
proxy.preInit(event);
proxy.initAllModels();
proxy.checkResource();
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
}
示例12: ItemLoader
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
public ItemLoader(FMLPreInitializationEvent event) {
register(itemCamera, "camera");
register(itemTripod, "tripod");
register(itemBattery, "battery");
register(itemFilm, "film");
register(itemPhotoPaper, "photo_paper");
register(itemPictureBook, "picture_book");
register(itemCntsTempLiquid, "cnts_temp_liquid");
register(itemDevelopingAgent, "developing_agent");
register(itemPicture, "picture");
register(itemGlassesHelmet, "glasses_helmet");
}
示例13: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
NetworkRegistry.INSTANCE.registerGuiHandler(Elicitation.instance, new GuiHandler());
Items.setup();
}
示例14: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
@Override
public void preInit(FMLPreInitializationEvent evt)
{
super.preInit(evt);
ExPPlayerCapability.register();
ExPWorldCapability.register();
ExPCropCapability.register();
ExPFarmlandCapability.register();
ExPSeedsCapability.register();
ExPAnimalCapability.register();
}
示例15: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {
LOG = e.getModLog();
Map<Object, ModContainer> forgeListenerOwners = getForgeListenerOwners();
// Remove CreeperHost ads.
forgeListenerOwners.entrySet().stream()
.filter(objectModContainerEntry -> objectModContainerEntry.getValue().getModId().equals("creeperhost"))
.forEach(objectModContainerEntry -> {
LOG.info("CreeperKiller Removed {} handler from forge, CreeperHost ads will no longer be displayed", objectModContainerEntry.getKey().toString());
MinecraftForge.EVENT_BUS.unregister(objectModContainerEntry.getKey());
}
);
}