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


Java WorldTickEvent类代码示例

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


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

示例1: update

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void update(WorldTickEvent evt) {
  if(evt.world != world) {
    return;
  }
  if(activeCondition != null && !activeCondition.isConditionMet(world, structure, worldPos)) {
    return;
  }

  spawnActiveParticles();

  if(spawnCondition != null && !spawnCondition.isConditionMet(world, structure, worldPos)) {
    return;
  }
  remainingSpawnTries = behaviour.getNumberSpawned() + behaviour.getMaxSpawnRetries();
  for (int i = 0; i < behaviour.getNumberSpawned() && remainingSpawnTries > 0; ++i) {
    if(!trySpawnEntity()) {
      break;
    }
  }

}
 
开发者ID:SleepyTrousers,项目名称:Structures,代码行数:23,代码来源:VirtualSpawnerInstance.java

示例2: onServerWorldTick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent 
  public void onServerWorldTick(WorldTickEvent e) 
  { 
      if (e.phase == Phase.START) 
      { 
      	if (e.world.provider.dimensionId == 0  && !ModRecipes.ScriptsReloaded)
      	{
      		//ModRecipes.initialiseAnvil(); 

      	}	
      } 
else if(e.phase == Phase.END)
{
	
}
  }
 
开发者ID:AnodeCathode,项目名称:TechNodefirmacraftMod,代码行数:17,代码来源:STickHandler.java

示例3: onWorldTick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onWorldTick(WorldTickEvent event) {
    if(event.side == Side.SERVER && event.phase == Phase.END) {
        World world = event.world;
        if (world.provider.dimensionId == 0) { // only operate on overworld (for now)
            Long thisTick = world.getWorldTime();
            if (instantTickDelay == 0) {
                if (WorldTickEvents.eventPendingInstant) {
                    if (eventPendingInstantUsers.size() > 0) { // player instants
                        doPlayerInstants();
                    }
                }
                instantTickDelay = instantTickDelayReset;
            }
            instantTickDelay--;
            if (thisTick % ticksPerQuartHour == 0) { // check for stuff every in-game quarter-hour
                globalTicker(event);
            }
        }
    }
}
 
开发者ID:CosmicDan-Minecraft,项目名称:Imperium,代码行数:22,代码来源:WorldTickEvents.java

示例4: handle

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void handle(WorldTickEvent wte) {
	if(burningArrowCache.containsKey(wte.world)) {
		HashSet<EntityArrow> arrows=burningArrowCache.get(wte.world);
		synchronized(arrows) {
			Iterator<EntityArrow> iter=arrows.iterator();
			while(iter.hasNext()) {
				Entity e=iter.next();
				if(e.worldObj==wte.world) {
					try {
						if(arrowDotIsInGround.getBoolean(e)) {
							iter.remove();
							int x=(int) (e.posX-.5);
							int y=(int) (e.posY);
							int z=(int) (e.posZ-.5);
							if(wte.world.getBlock(x,y,z) ==Blocks.air)
								wte.world.setBlock(x,y,z, Blocks.fire);
						}
					} catch (Exception except) {
						except.printStackTrace();
					}
				}
			}
		}
	}
}
 
开发者ID:planetguy32,项目名称:Gizmos,代码行数:27,代码来源:FlamingArrows.java

示例5: onServerWorldTick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent 
  public void onServerWorldTick(WorldTickEvent e) 
  { 
      if (e.phase == Phase.START) 
      { 
      	if (e.world.provider.dimensionId == 0)
      		ModRecipes.initialiseAnvil(); 
      } 
else if(e.phase == Phase.END)
{

}
  }
 
开发者ID:Wahazar,项目名称:TFCPrimitiveTech,代码行数:14,代码来源:ServerTickHandler.java

示例6: onServerTick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerTick(WorldTickEvent event)
   {		
       if(event.phase == Phase.START)
       {
       	if(event.world.provider.dimensionId == 0 && AnvilRecipeHandler.world == null)
       	{
       		AnvilRecipeHandler.world = event.world;
       		AnvilRecipeHandler.getInstance().registerRecipes();
       	}
       }
   }
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:13,代码来源:ServerTickHandling.java

示例7: onServerWorldTick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent 
public void onServerWorldTick(WorldTickEvent e) 
{ 
    if (e.phase == Phase.START) 
    { 
    	if (e.world.provider.dimensionId == 0 && e.world.getWorldInfo().getSeed() != wSeed) {
    		ModRecipes.initialiseAnvil(e.world);
    		wSeed = e.world.getWorldInfo().getSeed();
    	}
    } 
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:12,代码来源:ServerTickHandler.java

示例8: onServerWorldTick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent 
  public void onServerWorldTick(WorldTickEvent e) 
  { 
      if (e.phase == Phase.START) 
      { 
      	if (e.world.provider.dimensionId == 0)
      		TFCPPRecipes.initialiseAnvil(); 
      } 
else if(e.phase == Phase.END)
{

}
  }
 
开发者ID:Wahazar,项目名称:TerraFirmaProgressivePack,代码行数:14,代码来源:ServerTickHandler.java

示例9: onWorldTick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onWorldTick(WorldTickEvent event) {
    if (!addWorldTick.isEmpty()) {
        hWorldTick.addAll(addWorldTick);
        addWorldTick.clear();
    }
    for (Iterator<LIHandler> it = hWorldTick.iterator(); it.hasNext(); ) {
        LIHandler handler = it.next();
        if (handler.isDead())
            it.remove();
        else
            handler.trigger(event);
    }
}
 
开发者ID:LambdaInnovation,项目名称:LambdaLib,代码行数:15,代码来源:LIFMLGameEventDispatcher.java

示例10: onTick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onTick(WorldTickEvent evt)
{
	if(evt.phase == Phase.END)
	{
		LogisticStorage.network.get().updateFields(evt.world);
	}
	else
	{
		handleTicks(evt.world);
	}
}
 
开发者ID:TinyModularThings,项目名称:Logistic-Storage,代码行数:13,代码来源:TickHandler.java

示例11: worldTickEvent

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
  public void worldTickEvent(WorldTickEvent event) {
Profiler profiler = event.world.theProfiler;
if(!(profiler instanceof CustomProfiler))
	return;
CustomProfiler customProfiler = (CustomProfiler)profiler;
  	
  	if(event.phase == Phase.START) {
  		customProfiler.setStage(CustomProfiler.Stage.BeforeLoop);
  	}
  	else {
  		customProfiler.setStage(CustomProfiler.Stage.None);
  	}
  }
 
开发者ID:wildex999,项目名称:TickDynamic,代码行数:15,代码来源:WorldEventHandler.java

示例12: onTick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onTick(WorldTickEvent event)
{
	if(event.side == Side.SERVER)
	{
		if(event.phase == Phase.START)
		{
			tickStart(event.world);
		}
		else if(event.phase == Phase.END)
		{
			tickEnd(event.world);
		}
	}
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:16,代码来源:CommonWorldTickHandler.java

示例13: onServerWorldTick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerWorldTick(WorldTickEvent event)
{
    World world = event.world;
    
    if(event.phase == Phase.START)
    {
        if(world.provider.dimensionId == 0 && !Recipes.areAnvilRecipesRegistered())
        {
            Recipes.registerAnvilRecipes(world);
        }
    }
}
 
开发者ID:Aleksey-Terzi,项目名称:DecorationsTFC,代码行数:14,代码来源:ServerTickHandler.java

示例14: globalTicker

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
private void globalTicker(WorldTickEvent event) {
    World world = event.world;
    Long timeOfDay = world.getWorldTime() % 24000L;
    if (timeOfDay == ticksDawn) { // new day has dawned
        WorldData.worldDay += 1;
        sendGlobalMessage(StatCollector.translateToLocalFormatted("text.newDayDawns", WorldData.worldDay));
        WorldEvents.saveSettings(world, "global");
    }
    doPlayerEvents();
}
 
开发者ID:CosmicDan-Minecraft,项目名称:Imperium,代码行数:11,代码来源:WorldTickEvents.java

示例15: onServerWorldTick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerWorldTick(WorldTickEvent event)
{
    World world = event.world;
    
    if(event.phase == Phase.START)
    {
        if(world.provider.dimensionId == 0 && !Recipes.areAnvilRecipesRegistered())
        {
            Recipes.registerAnvilRecipes();
        }
    }
}
 
开发者ID:Aleksey-Terzi,项目名称:LanternsTFC,代码行数:14,代码来源:ServerTickHandler.java


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