本文整理汇总了Java中cpw.mods.fml.common.registry.TickRegistry类的典型用法代码示例。如果您正苦于以下问题:Java TickRegistry类的具体用法?Java TickRegistry怎么用?Java TickRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TickRegistry类属于cpw.mods.fml.common.registry包,在下文中一共展示了TickRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postInit
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
@Subscribe
public void postInit(FMLPostInitializationEvent event){
int expMods = ShoulderTransformations.CODE_MODIFICATIONS;
if(ShoulderTransformations.modifications != expMods){
logger.severe("Only found " + ShoulderTransformations.modifications + " code injections, but expected " + expMods);
logger.severe("ShoulderSurfing should be disabled!");
} else {
logger.info("Loaded " + ShoulderTransformations.modifications + " code injections, ShoulderSurfing good to go!");
}
//create mc pointer
ShoulderLoader sl = new ShoulderLoader();
sl.load();
//create tick handler
st = new ShoulderTickHandler();
TickRegistry.registerTickHandler(st, Side.CLIENT);
//register other events
MinecraftForge.EVENT_BUS.register(new ShoulderEvents());
}
示例2: postInit
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
@Subscribe
public void postInit(FMLPostInitializationEvent event){
int expMods = ShoulderTransformations.CODE_MODIFICATIONS;
if(ShoulderTransformations.modifications != expMods){
logger.severe("Only found " + ShoulderTransformations.modifications + " code injections, but expected " + expMods);
logger.severe("ShoulderSurfing should be disabled!");
} else {
logger.info("Loaded " + ShoulderTransformations.modifications + " code injections, ShoulderSurfing good to go!");
}
//create mc pointer
ShoulderLoader sl = new ShoulderLoader();
sl.load();
//create tick handler
st = new ShoulderTickHandler();
TickRegistry.registerTickHandler(st, Side.CLIENT);
}
示例3: preInit
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
@Subscribe
public void preInit(FMLPreInitializationEvent event)
{
try
{
this.gameTickHandler.setMod(mod);
this.guiTickHandler.setMod(mod);
TickRegistry.registerTickHandler(this.gameTickHandler, Side.CLIENT);
TickRegistry.registerTickHandler(this.guiTickHandler, Side.CLIENT);
GameRegistry.registerWorldGenerator(ModLoaderHelper.buildWorldGenHelper(mod));
GameRegistry.registerFuelHandler(ModLoaderHelper.buildFuelHelper(mod));
GameRegistry.registerCraftingHandler(ModLoaderHelper.buildCraftingHelper(mod));
GameRegistry.registerPickupHandler(ModLoaderHelper.buildPickupHelper(mod));
NetworkRegistry.instance().registerChatListener(ModLoaderHelper.buildChatListener(mod));
NetworkRegistry.instance().registerConnectionHandler(ModLoaderHelper.buildConnectionHelper(mod));
}
catch (Exception e)
{
controller.errorOccurred(this, e);
Throwables.propagateIfPossible(e);
}
}
示例4: preInit
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent e) {
VersionCheck.updateCheckMRPG(MysticModInfo.NAME, MysticModInfo.VERSION,
URL);
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
logger = Logger.getLogger(MysticModInfo.MODID);
logger.setParent(FMLLog.getLogger());
final Configuration config = new Configuration(
e.getSuggestedConfigurationFile());
MysticConfig.load(config);
tab = new CreativeTabsMRPG(CreativeTabs.getNextID(), "tabMysticRPG");
MysticItems.init();
MysticBlocks.init();
MysticRecipes.init();
MysticDimensions.init(); // TODO Localize biomes and dimensions
MysticBiomes.init();
LangUtil.addNames("/assets/" + MysticModInfo.MODID + "/lang/", languages);
}
示例5: universalPreInit
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
public void universalPreInit(FMLPreInitializationEvent event) {
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
packets = Network.newChannel("SevenCommons")
.register(PacketSync.class, SYNC_PACKET_ID)
.register(PacketInventoryName.class)
.register(PacketContainerButton.class)
.build();
ClassInfoUtil.preInit();
// initialize the lazy statics in the scheduler class
Reflection.initialize(Scheduler.class);
TickRegistry.registerTickHandler(new SCPlayerTicker(), Side.SERVER);
GameRegistry.registerPlayerTracker(new SCPlayerTracker());
proxy.preInit(event);
Syncing.registerFactory(Object.class, new BuiltinSyncers());
ToNbtFactories.registerFactory(Object.class, new DefaultNBTSerializers());
}
示例6: init
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
new GuiHandler();
TickRegistry.registerTickHandler(new KeyTickHandler(), Side.SERVER);
LogHelper.log(Level.INFO, "Preparing recipes");
Recipes.initShapedRecipes();
Recipes.initShapelessRecipes();
LogHelper.log(Level.INFO, "Preparing world generation");
GameRegistry.registerWorldGenerator(worldGen);
LogHelper.log(Level.INFO, "Preparing renders");
proxy.registerRenderers();
LogHelper.log(Level.INFO, "Preparing entities");
EntityRegistry.registerModEntity(EntityBlastBlox.class, "BlastBlox", EntityRegistry.findGlobalUniqueEntityId(), this, 128, 1, true);
if(ConfigBooleans.enableUpdateCheck){
LogHelper.log(Level.INFO, "Checking for new version");
NetworkRegistry.instance().registerConnectionHandler(new Update("Kingdom Keys", Reference.MOD_VER, "https://raw.github.com/Wehavecookies56/Kingdom-Keys/master/Version.txt"));
final Side side = FMLCommonHandler.instance().getEffectiveSide();
}
}
示例7: init
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
public static void init() {
// Clear all lists
listDevs.clear();
listTesters.clear();
// Retrieve all players in the lists
try {
retrievePlayerData();
} catch (IOException e) {
e.printStackTrace();
}
// Obtain texture files
Minecraft.getMinecraft().renderEngine.obtainImageData(Reference.PATH_CAPES_DEV, new ImageBufferDownload());
Minecraft.getMinecraft().renderEngine.obtainImageData(Reference.PATH_CAPES_TESTER, new ImageBufferDownload());
// Register tickhandler to set the capes
TickRegistry.registerTickHandler(new CapeTickHandler(), Side.CLIENT);
}
示例8: registerHandlers
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
@Override
public void registerHandlers() {
super.registerHandlers();
if (AddonConfig.useHUDStuff) {
renderTickHandler = new RenderTickHandler();
TickRegistry.registerTickHandler(renderTickHandler, Side.CLIENT);
}
clientTickHandler = new ClientTickHandler();
TickRegistry.registerTickHandler(clientTickHandler, Side.CLIENT);
ClientTickHandler.load();
commonTickHandler = new CommonTickHandler();
TickRegistry.registerTickHandler(commonTickHandler, Side.CLIENT);
}
示例9: init
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
@EventHandler
public void init(final FMLInitializationEvent event)
{
Agriculture.tab = new AgricultureTab("Agriculture");
LanguageRegistry.instance().addStringLocalization("itemGroup.Agriculture", "en_US", "Agriculture");
AgricultureItems.init();
AgricultureBlocks.init();
Agriculture.tab.setItemID(AgricultureBlocks.oven.blockID);
AgricultureItems.setupItems();
GameRegistry.registerWorldGenerator(new WorldGenSalt(4));
GameRegistry.registerWorldGenerator(new WorldGenSpice(AgricultureBlocks.cinnamon.blockID));
GameRegistry.registerWorldGenerator(new WorldGenSpice(AgricultureBlocks.vanilla.blockID));
TickRegistry.registerTickHandler(new TickHandler(), Side.SERVER);
NetworkRegistry.instance().registerGuiHandler(Agriculture.instance, Agriculture.proxy);
Agriculture.proxy.registerEventHandlers();
Agriculture.proxy.registerRenderers();
registerTCCrop(AgricultureBlocks.peanut, 6);
registerTCCrop(AgricultureBlocks.strawberry, 6);
registerForestryCrop(AgricultureItems.strawberry.itemID, AgricultureItems.strawberry.getDamage(), AgricultureBlocks.strawberry.blockID, 6);
registerForestryCrop(AgricultureItems.peanuts.itemID, AgricultureItems.peanuts.getDamage(), AgricultureBlocks.peanut.blockID, 6);
}
示例10: init
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
@EventHandler
public void init( FMLInitializationEvent event )
{
Block.blocksList[ Block.mobSpawner.blockID ] = null;
mobSpawner = new ToggleableMobSpawnerBlock( Block.mobSpawner.blockID );
// Associate our tile entity with the vanilla one.
if ( event.getSide().equals( Side.CLIENT ) ) registerTileEntityRenderer();
try
{
Class c = TileEntity.class;
Field nameToClassField = c.getDeclaredFields()[ 0 ];
Field classToNameField = c.getDeclaredFields()[ 1 ];
nameToClassField.setAccessible( true );
classToNameField.setAccessible( true );
Map nameToClassMap = ( Map ) nameToClassField.get( null );
Map classToNameMap = ( Map ) classToNameField.get( null );
nameToClassMap.put( "MobSpawner", ToggleableMobSpawnerTileEntity.class );
classToNameMap.put( ToggleableMobSpawnerTileEntity.class, "MobSpawner" );
}
catch ( Exception exception )
{
exception.printStackTrace();
}
toggleKey = new KeyBinding( "Toggle Spawner Status", Keyboard.KEY_M );
renderKey = new KeyBinding( "Toggle Render Status", Keyboard.KEY_N );
keyHandler = new KeyHandler( new KeyBinding[] { toggleKey, renderKey } );
statRenderer = new StatusTextRenderer();
TickRegistry.registerTickHandler( keyHandler, Side.CLIENT );
TickRegistry.registerTickHandler( statRenderer, Side.CLIENT );
}
示例11: load
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
/**
* Initialize the blocks, items, tick handler
* @param evt
*/
@EventHandler
public void load(FMLInitializationEvent evt) {
guestBedBlock = new BlockGuestBed(bedBlockID).setHardness(0.2F).setUnlocalizedName("guest_bed").setTextureName("bed");
guestBedItem = (new ItemGuestBed(bedItemID)).setMaxStackSize(1).setUnlocalizedName("guest_bed").setTextureName("bed");
GameRegistry.registerBlock(guestBedBlock, "Guest Bed Block");
LanguageRegistry.addName(guestBedBlock, "Guest Bed");
GameRegistry.registerItem(guestBedItem, "Guest Bed Item");
LanguageRegistry.addName(guestBedItem, "Guest Bed");
TickRegistry.registerTickHandler(new TickHandlerSleep(), Side.SERVER);
}
示例12: tryEnableItemStackRenderer
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
@Override
public void tryEnableItemStackRenderer()
{
if (gl32_enabled)
{
TickRegistry.registerTickHandler( new RenderTickHandler(),
Side.CLIENT );
}
else
{
LogWrapper.severe( "OpenGL 3.2 not detected, mod data dump for images and item/block JSON data will not work!" );
}
}
示例13: init
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
/**
* Wireless Remote GUI
*/
// public static GuiRedstoneWirelessRemote guiWirelessRemote;
@Override
public void init() {
TickRegistry.registerTickHandler(new ClientTickHandler(),
Side.CLIENT);
initGUIs();
super.init();
}
示例14: preInit
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
addModFlags();
Configuration config = new Configuration(
event.getSuggestedConfigurationFile());
new cfg().setConfig(config);
if(isDebug())
{
System.out.println("MineFantasy: Debug mode ACTIVE");
HeatableItem.requiresHeating = false;
}
removeRecipes();
GameRegistry.registerFuelHandler(new MineFantasyFuels());
TickRegistry.registerTickHandler(new ArmourTickHandlerMF(), FMLCommonHandler.instance().getSide());
TickRegistry.registerTickHandler(new ArmourTickHandlerMF(), Side.SERVER);
TickRegistry.registerTickHandler(new HotItemTickHandler(), FMLCommonHandler.instance().getSide());
TickRegistry.registerTickHandler(new HotItemTickHandler(), Side.SERVER);
proxy.registerTickHandlers();
proxy.registerRenderInformation();
NetworkRegistry.instance().registerGuiHandler(instance, proxy);
if (client) {
MinecraftForge.EVENT_BUS.register(new SoundManagerMF());
StatListMF.init();
}
CrossbowAmmo.addCrossbowHandler(new CrossbowAmmoMF());
rebuildRecipes();
QuiverArrowRegistry.addArrowFireHandler(new QuiverArrowsMF());
}
示例15: init
import cpw.mods.fml.common.registry.TickRegistry; //导入依赖的package包/类
@Subscribe
public void init(FMLInitializationEvent event){
//load the keyboard bindings
kbh = ShoulderKeybindings.registerKeybindings();
//create mc pointer
mc = ModLoader.getMinecraftInstance();
//create tick handler
st = new ShoulderTickHandler();
TickRegistry.registerTickHandler(st, Side.CLIENT);
}