当前位置: 首页>>代码示例>>Java>>正文


Java TickEvent.WorldTickEvent方法代码示例

本文整理汇总了Java中cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent方法的典型用法代码示例。如果您正苦于以下问题:Java TickEvent.WorldTickEvent方法的具体用法?Java TickEvent.WorldTickEvent怎么用?Java TickEvent.WorldTickEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cpw.mods.fml.common.gameevent.TickEvent的用法示例。


在下文中一共展示了TickEvent.WorldTickEvent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onWorldTickLoad

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onWorldTickLoad(TickEvent.WorldTickEvent event)
{
	EAWorldData eaWD = EAWorldData.forWorld((WorldServer)event.world);
	eaWD.markDirty();
	
	if(event.phase == TickEvent.Phase.START)
	{
		EAPlugin.internalTick();
		for(EAPluginContainer plugin : EALoader.instance().loadedPlugins)
		{	
			try
			{
				plugin.plugin.onTick(event.world);
			}
			catch(Exception e)
			{
				e.printStackTrace();
			}
		}
	}
}
 
开发者ID:Cephrus,项目名称:Elite-Armageddon,代码行数:23,代码来源:Handler.java

示例2: serverTickEvent

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void serverTickEvent(TickEvent.WorldTickEvent event) {
	if(zmaster587.advancedRocketry.api.Configuration.allowTerraforming && event.world.provider.getClass() == WorldProviderPlanet.class) {

		if(DimensionManager.getInstance().getDimensionProperties(event.world.provider.dimensionId).isTerraformed()) {
			List<Chunk> list = ((WorldServer)event.world).theChunkProviderServer.loadedChunks;
			if(list.size() > 0) {
				for(int i = 0; i < Configuration.terraformingBlockSpeed; i++) {
					Chunk chunk = list.get(event.world.rand.nextInt(list.size()));
					int coord = event.world.rand.nextInt(256);
					int x = (coord & 0xF) + chunk.xPosition*16;
					int z = (coord >> 4) + chunk.zPosition*16;

					BiomeHandler.changeBiome(event.world, ((WorldProviderPlanet)event.world.provider).chunkMgrTerraformed.getBiomeGenAt(x,z).biomeID, x, z);
				}
			}
		}
	}
}
 
开发者ID:zmaster587,项目名称:AdvancedRocketry,代码行数:20,代码来源:PlanetEventHandler.java

示例3: onWorldTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onWorldTick(TickEvent.WorldTickEvent tickEvent)
{
    /*for (IJob job : unscheduledBackgroundJobs)
    {
        scheduleBackgroundJob(job);
    }
    unscheduledBackgroundJobs.clear();*/

    int jobQuota = 32;
    while (!scheduledTickJobs.isEmpty() && --jobQuota > 0)
    {
        IJob job = scheduledTickJobs.poll();
        job.start();
    }
}
 
开发者ID:AtomicBlom,项目名称:SchematicMetaBlocks,代码行数:17,代码来源:JobProcessor.java

示例4: onWorldTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onWorldTick(TickEvent.WorldTickEvent event)
{
	if (genQueue.isEmpty())
		return;

	if (event.phase == TickEvent.Phase.START)
		return;

	int count = 0;
	ArrayList<RetroGenEntry> removeQueue = Lists.newArrayList();
	ArrayList<RetroGenEntry> iterationQueue = (ArrayList<RetroGenEntry>) genQueue.clone();

	for (RetroGenEntry entry : iterationQueue)
	{
		entry.gen.generate(entry.world.rand, entry.world, entry.coord.chunkX, entry.coord.chunkZ);
		removeQueue.add(entry);
		count++;

		if (count >= 32)
			break;
	}

	genQueue.removeAll(removeQueue);
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10,代码行数:26,代码来源:RetroactiveWorldGenerator.java

示例5: clientTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void clientTick(TickEvent.WorldTickEvent event)
{
    if(event.phase == TickEvent.Phase.START)
        preTick(event.world);
    else
        postTick(event.world);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:9,代码来源:WorldExtensionManager.java

示例6: onWorldTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onWorldTick(TickEvent.WorldTickEvent event)
{
	EntityPlayer player;
	
	player = null;
	for (Dungeon d : Main.DUNGEONS)
	{
		if (event.world.provider.dimensionId == d.DIM_ID && d.is_running)
		{
			if (event.world.playerEntities.size() == 0)
			{
				d.is_running = false;
				d.current_team = null;
			}
			else
			{
				for (Object obj : event.world.playerEntities)
				{
					if (((EntityPlayer)obj).getTeam() == null || !((EntityPlayer)obj).getTeam().isSameTeam(d.current_team)) //le joueur quitte le groupe du donjon
					{
						player = (EntityPlayer)obj;
						break ;
					}
				}
			}
		}
		if (player != null)
		{
			Main.getPlayerServer(player).travelToDimension(d.DIM_RETOUR, player.dimension);
			player.addChatComponentMessage(new ChatComponentText("You are no longer in this dungeon's group."));
			player = null;
		}
	}
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:36,代码来源:ServerEvent.java

示例7: onTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onTick(TickEvent.WorldTickEvent event) {
	final World world = event.world;
	if( world != null && !world.isRemote 
			&& world.difficultySetting.getDifficultyId() > 0 
			&& world.getWorldInfo().getWorldTime() % 300L == 0L ) {
		final List list = world.playerEntities;
		if( list != null && list.size() > 0 ) {
			final int maxNum = 12 + (list.size() * 6);
			this.setMaxAnimals(maxNum);
		}
		this.doCustomSpawning(world, true, true);
	}
}
 
开发者ID:allaryin,项目名称:FairyFactions,代码行数:15,代码来源:Spawner.java

示例8: onTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onTick(TickEvent.WorldTickEvent worldt)
{
	if(!EALoader.isPluginLoaded(this))return;
	World world = worldt.world;
	super.internalTick();
	
	if(day >= 8) phase = day;
	else phase = 8;
	
	if(phase >= 1)
	{
		world.getWorldInfo().setRaining(true);
		world.getWorldInfo().setRainTime(24000);
	}
	
	for(int i = 0; i < world.playerEntities.size(); i++)
	{
		EntityPlayer focusPlayer = (EntityPlayer)world.playerEntities.get(i);
		
		int randX = world.rand.nextInt(16);
		int randZ = world.rand.nextInt(16);
		int playerPosX = MathHelper.floor_double(focusPlayer.posX);
		int playerPosZ = MathHelper.floor_double(focusPlayer.posZ);
		int randY = EAToolkit.getTopBlock(world, randX + playerPosX, randZ + playerPosZ);
		
		byte effectRange = 7;
		for(int xOffset = -effectRange; xOffset <= effectRange; xOffset++)
		{
			for(int zOffset = -effectRange; zOffset <= effectRange; zOffset++)
			{
				if(phase >= 1)
				{
					Block block = world.getBlock(randX + playerPosX, randY, randZ + playerPosZ);
				}
			}
		}
	}
}
 
开发者ID:Cephrus,项目名称:Elite-Armageddon,代码行数:40,代码来源:LunarDeath.java

示例9: onServerWorldTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onServerWorldTick(TickEvent.WorldTickEvent event)
{
    World world = event.world;

    if (event.phase == TickEvent.Phase.START)
    {
        if (world.provider.dimensionId == 0 && !Recipes.areAnvilRecipesRegistered())
        {
            Recipes.registerAnvilRecipes(world);
        }
    }
}
 
开发者ID:Bunsan,项目名称:TerraFirmaStuff,代码行数:14,代码来源:ServerTickHandler.java

示例10: tick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void tick(TickEvent.WorldTickEvent event)
{
    if (event.phase == TickEvent.Phase.END)
    {
        event.world.theProfiler.startSection("bioSystem");
        BioSystemHandler handler = BioSystemHandler.get(event.world);
        if (handler != null)
            handler.update();
        event.world.theProfiler.endSection();
    }
}
 
开发者ID:Dynious,项目名称:Biota,代码行数:13,代码来源:CommonEventHandler.java

示例11: onWorldTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onWorldTick(TickEvent.WorldTickEvent event) {
    if (event.phase == TickEvent.Phase.START)
        return;

    if (event.side == Side.CLIENT)
        return;

    TriggerRegistry.fireTrigger(PassiveTrigger.Type.WORLD, event.world);
}
 
开发者ID:dmillerw,项目名称:EventMod,代码行数:11,代码来源:EventHandler.java

示例12: onTickEnd

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onTickEnd(TickEvent.WorldTickEvent event) {
    if (event.phase != TickEvent.Phase.END)
        return;
    if (event.world.provider.dimensionId != 0)
        return;

    Queue<IDiscordCallback> processQueue = discordResponses;
    Queue<IDiscordCallback> transferQueue = clientDiscordResponses;
    if (event.world.isRemote) {
        processQueue = clientDiscordResponses;
        transferQueue = discordResponses;
    }

    //We only have one queue accessible externally to simplify the API.
    //Instead of having the network layer handle the difference, the caller
    //just makes sure that the difference is available in the callback object.
    //If we are running on a dedicated server, then client callbacks are
    //discarded.  Ideally, we shouldn't be generating them.
    while (!processQueue.isEmpty()) {
        IDiscordCallback response = processQueue.remove();

        if (response.shouldRunOnServer() == !event.world.isRemote)
            response.run();
        else if (!MinecraftServer.getServer().isDedicatedServer())
            transferQueue.add(response);
    }
}
 
开发者ID:CannibalVox,项目名称:McDiscord,代码行数:29,代码来源:DiscordResponseHandler.java

示例13: onTickEvent

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onTickEvent(TickEvent.WorldTickEvent ev) {
    if(ev.side == Side.CLIENT)
        return;


    for(Resident res : MyTownUniverse.instance.residents) {
        res.tick();
    }

    if((Config.instance.costTownUpkeep.get() > 0 || Config.instance.costAdditionalUpkeep.get() > 0) && ev.phase == TickEvent.Phase.START) {
        if (ticked) {
            if(lastCalendarDay != -1 && Calendar.getInstance().get(Calendar.DAY_OF_YEAR) != lastCalendarDay) {
                for (int i = 0; i < MyTownUniverse.instance.towns.size(); i++) {
                    Town town = MyTownUniverse.instance.towns.get(i);
                    if (!(town instanceof AdminTown)) {
                        town.bank.payUpkeep();
                        if(town.bank.getDaysNotPaid() == Config.instance.upkeepTownDeletionDays.get() && Config.instance.upkeepTownDeletionDays.get() > 0) {
                            MyTown.instance.LOG.info("Town {} has been deleted because it didn't pay upkeep for {} days.", town.getName(), Config.instance.upkeepTownDeletionDays.get());
                            getDatasource().deleteTown(town);
                        } else {
                            getDatasource().saveTownBank(town.bank);
                        }
                    }
                }
                ticked = false;
            }
            lastCalendarDay = Calendar.getInstance().get(Calendar.DAY_OF_YEAR);
        } else {
            ticked = true;
        }
    }
}
 
开发者ID:MyEssentials,项目名称:MyTown2,代码行数:34,代码来源:Ticker.java

示例14: onServerTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onServerTick(TickEvent.WorldTickEvent event) {
    if (event.type == TickEvent.Type.WORLD) {
        if (callbacks.containsKey(event.world.provider.dimensionId)) {
            Queue<FutureTask> callbackList = callbacks.get(event.world.provider.dimensionId);
            FutureTask callback;
            while ((callback = callbackList.poll()) != null) {
                callback.run();
            }
        }
    }
}
 
开发者ID:theoriginalbit,项目名称:MoarPeripherals,代码行数:13,代码来源:TickHandler.java

示例15: onWorldTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
  public void onWorldTick(TickEvent.WorldTickEvent event){
  	if (needLoad && Minecraft.getMinecraft().ingameGUI != null) {
      	fileIO.getInstance().loadLanguageFiles();
      	needLoad = false;
}
  }
 
开发者ID:tank22119,项目名称:text-operator,代码行数:8,代码来源:TextOperator.java


注:本文中的cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。