• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java WorldTickEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: onWorldTick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onWorldTick(WorldTickEvent event)
{
	//Update N-API isClient so Forge mods and N-API mods get along better.
	event.world.isClient = event.world.isRemote;
	EventFactory.fireEvent(new EventWorldTicked(event.world));
}
 
开发者ID:Niadel,项目名称:N-API,代码行数:8,代码来源:EventHandlerFML.java


示例17: onWorldTick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onWorldTick(WorldTickEvent event) {
	int dim = event.world.provider.dimensionId;
	if (climateUpdaters.containsKey(dim)) {
		climateUpdaters.get(dim).onWorldTick(event);
	}
}
 
开发者ID:AlexDGr8r,项目名称:MeteorsMod,代码行数:8,代码来源:HandlerMeteorTick.java


示例18: tick

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void tick(WorldTickEvent event) {
	if (event.side != Side.SERVER || event.phase != Phase.END || isReplacing)
		return;

	if (replacements == null) {
		replacements = new HashMap<Block, Block>();
		if (EtFuturum.enableBrewingStands)
			replacements.put(Blocks.brewing_stand, ModBlocks.brewing_stand);
		if (EtFuturum.enableColourfulBeacons)
			replacements.put(Blocks.beacon, ModBlocks.beacon);
		if (EtFuturum.enableEnchants)
			replacements.put(Blocks.enchanting_table, ModBlocks.enchantment_table);
		if (EtFuturum.enableInvertedDaylightSensor)
			replacements.put(Blocks.daylight_detector, ModBlocks.daylight_sensor);
	}

	if (replacements.isEmpty())
		return;

	isReplacing = true;
	World world = event.world;

	for (int i = 0; i < world.loadedTileEntityList.size(); i++) {
		TileEntity tile = (TileEntity) world.loadedTileEntityList.get(i);
		int x = tile.xCoord;
		int y = tile.yCoord;
		int z = tile.zCoord;
		Block replacement = replacements.get(world.getBlock(x, y, z));
		if (replacement != null && ((IConfigurable) replacement).isEnabled()) {
			NBTTagCompound nbt = new NBTTagCompound();
			tile.writeToNBT(nbt);
			if (tile instanceof IInventory) {
				IInventory invt = (IInventory) tile;
				for (int j = 0; j < invt.getSizeInventory(); j++)
					invt.setInventorySlotContents(j, null);
			}
			world.setBlock(x, y, z, replacement);
			TileEntity newTile = world.getTileEntity(x, y, z);
			newTile.readFromNBT(nbt);
			break;
		}
	}
	isReplacing = false;
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:46,代码来源:WorldTickEventHandler.java


示例19: onWorldTickEvent

import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onWorldTickEvent(final WorldTickEvent event) {
	if (event.side == Side.SERVER && event.phase == Phase.END && doMerge()) {
		mergeItems(event.world);
	}
}
 
开发者ID:OreCruncher,项目名称:ThermalRecycling,代码行数:7,代码来源:EntityItemMergeHandler.java


示例20: onWorldTick

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

        if (world.provider instanceof MothershipWorldProvider)
        {
            // ((MothershipWorldProvider)world.provider).update();
            final Object[] entityList = world.loadedEntityList.toArray();

            for (final Object o : entityList)
            {
                if (o instanceof Entity)
                {
                    final Entity e = (Entity) o;
                    // failsafe?
                    if (e.worldObj.provider instanceof MothershipWorldProvider)
                    {
                        if(e.posY < 0) {
                            CelestialBody parent = ((MothershipWorldProvider)e.worldObj.provider).getParent();
                            if(parent == null) {
                                // jumped off mid-transit
                                if(e instanceof EntityLivingBase) {
                                    ((EntityLivingBase)e).attackEntityFrom(DamageSourceAR.dsFallOffShip, 9001);
                                } else {
                                    e.worldObj.removeEntity(e);
                                }
                            } else {

                                if(!parent.getReachable() || (parent.getTierRequirement() > AmunRa.config.mothershipMaxTier)) {
                                    // crash into
                                    if(e instanceof EntityLivingBase) {
                                        ((EntityLivingBase)e).attackEntityFrom(DamageSourceAR.getDSCrashIntoPlanet(parent), 9001);
                                    } else {
                                        e.worldObj.removeEntity(e);
                                    }
                                } else {
                                    if(e instanceof EntityPlayerMP && e.ridingEntity instanceof EntityShuttle) {
                                        sendPlayerInShuttleToPlanet((EntityPlayerMP)e, (EntityShuttle)e.ridingEntity, world, parent.getDimensionID());
                                    } else if(e instanceof EntityShuttle && e.riddenByEntity instanceof EntityPlayerMP) {
                                        sendPlayerInShuttleToPlanet((EntityPlayerMP)e.riddenByEntity, (EntityShuttle)e, world, parent.getDimensionID());
                                    } else {
                                        // go there naked, as GC intended
                                        WorldUtil.transferEntityToDimension(e, parent.getDimensionID(), world, false, null);
                                    }
                                }
                            }
                        } else { // if(e.posY < 0) {
                            if(e instanceof EntityAutoRocket) {
                                EntityAutoRocket rocket = (EntityAutoRocket)e;

                                MothershipWorldProvider msProvider = (MothershipWorldProvider)e.worldObj.provider;
                                if(msProvider.isInTransit()) {

                                    if(rocket.launchPhase == EnumLaunchPhase.IGNITED.ordinal()) {
                                        rocket.cancelLaunch();
                                    } else if(rocket.launchPhase == EnumLaunchPhase.LAUNCHED.ordinal()) {
                                        if(rocket instanceof EntityShuttle) {
                                            ((EntityShuttle)rocket).setLanding();
                                        } else {
                                            rocket.dropShipAsItem();
                                            rocket.setDead();
                                        }
                                    }
                                }
                            }
                        }



                    } // if (e.worldObj.provider instanceof MothershipWorldProvider)
                } // if (o instanceof Entity)
            } // for (final Object o : entityList)
        } // if (world.provider instanceof MothershipWorldProvider)
    } // (event.phase == Phase.START)
}
 
开发者ID:katzenpapst,项目名称:amunra,代码行数:79,代码来源:TickHandlerServer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Mode类代码示例发布时间:2022-05-21
下一篇:
Java DefaultKafkaConsumerFactory类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap