當前位置: 首頁>>代碼示例>>Java>>正文


Java Phase.START屬性代碼示例

本文整理匯總了Java中cpw.mods.fml.common.gameevent.TickEvent.Phase.START屬性的典型用法代碼示例。如果您正苦於以下問題:Java Phase.START屬性的具體用法?Java Phase.START怎麽用?Java Phase.START使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在cpw.mods.fml.common.gameevent.TickEvent.Phase的用法示例。


在下文中一共展示了Phase.START屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onTick

@SubscribeEvent
public void onTick(ClientTickEvent event)
{
    if (event.side == Side.CLIENT)
    {
        if (event.phase == Phase.START)
        {
            this.keyTick(event.type, false);
        }
        else if (event.phase == Phase.END)
        {
            this.keyTick(event.type, true);
        }
    }

}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:16,代碼來源:KeyHandler.java

示例2: tickStart

@SubscribeEvent
public void tickStart(PlayerTickEvent evt) {
	if (evt.phase != Phase.START) {
		return;
	}
	if (ticksToPoll > 0) {
		ticksToPoll--;
		return;
	}
	ticksToPoll = TICK_POLL_INTERVAL;
	
	if (versionInfo.versionCheckComplete) {
		unsubscribeFromBus();
		
		if (updateNotificationsEnabledOrCriticalUpdate()) {
			sendNotificationToPlayer(evt.player);
		}
	}
}
 
開發者ID:MagicBees,項目名稱:MagicBees,代碼行數:19,代碼來源:TickHandlerVersion.java

示例3: onServerWorldTick

@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,代碼行數:16,代碼來源:STickHandler.java

示例4: onPlayerTick

@SubscribeEvent
public void onPlayerTick(TickEvent.PlayerTickEvent event)
{
	if (event.phase != Phase.START)
		return;

	updatePosition();
	if (!moved)
		return;

	Block b = getBlockUnderPlayer();
	onElevator = (b == IndicatorMod.instance.elevatorBlock);

	if (onElevator)
		findElevators();
}
 
開發者ID:bartbes,項目名稱:OpenBlocks-Elevator-Indicator,代碼行數:16,代碼來源:IndicatorOverlay.java

示例5: onServerWorldTick

@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,代碼行數:13,代碼來源:ServerTickHandler.java

示例6: onClientTick

@SubscribeEvent
public void onClientTick(ClientTickEvent event) {
	Minecraft minecraft = FMLClientHandler.instance().getClient();
	WorldClient world = minecraft.theWorld;
	EntityClientPlayerMP player = minecraft.thePlayer;

	// Starts a version check.
	if (event.phase == Phase.START) {
		if (world != null && TickHandlerClient.checkedVersion) {
			SpaceVersionCheck.startCheck();
			TickHandlerClient.checkedVersion = false;
		}
	}

	// Sets up the atmosphere for the world.
	if (world != null) {
		for (ICoreModule module : SpaceCore.modulesList) {
			if (module instanceof ICoreCelestial) {
				ICoreCelestial celestial = (ICoreCelestial) module;
				
				if (celestial.instanceOfProvider(world.provider)) {
					if (world.provider.getSkyRenderer() == null) {
						world.provider.setSkyRenderer(celestial.createSkyProvider((IGalacticraftWorldProvider) world.provider));
					}

					if (world.provider.getCloudRenderer() == null) {
						world.provider.setCloudRenderer(new CloudRenderer());
					}	
					
					break;
				}
			}
		}
	}
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:35,代碼來源:TickHandlerClient.java

示例7: onServerTick

@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,代碼行數:12,代碼來源:ServerTickHandling.java

示例8: onServerTick

@SubscribeEvent
public void onServerTick(ServerTickEvent event) {
	if (event.phase == Phase.START) {
		for (Iterator<Map.Entry<EntityPlayer, VRPlayerData>> it = ProxyServer.vrPlayers.entrySet().iterator(); it.hasNext(); ) {
			Map.Entry<EntityPlayer, VRPlayerData> entry = it.next();
			EntityPlayer player = entry.getKey();
			if (player.isDead) {
				it.remove();
				continue;
			}
			VRPlayerData data = entry.getValue();
			if (data.entities.size() != (data.seated ? 1 : 3)) {
				createEntities(player, data);
			} else {
				for (EntityVRObject entity : data.entities) {
					//System.out.println(entity.getClass().getSimpleName() + " " + entity.posX + " " + entity.posY + " " + entity.posZ);
					if (!entity.isSpawned()) {
						if (entity.worldObj.spawnEntityInWorld(entity)) entity.setSpawned();
					}
					if (entity.isDead || entity.worldObj != player.worldObj) {
						createEntities(player, data);
						break;
					}
				}
			}
		}
	}
}
 
開發者ID:Techjar,項目名稱:VivecraftForgeExtensions,代碼行數:28,代碼來源:HandlerServerTick.java

示例9: onServerWorldTick

@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,代碼行數:11,代碼來源:ServerTickHandler.java

示例10: onServerWorldTick

@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,代碼行數:13,代碼來源:ServerTickHandler.java

示例11: clientTick

@SuppressWarnings("static-method")
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void clientTick(ClientTickEvent event) {
	if (event.phase == Phase.START) {
		sendAnalyticsActivityEvent();
	}
}
 
開發者ID:NPException,項目名稱:GameAnalyticsAPI,代碼行數:8,代碼來源:ActivityReportTickEventHandler.java

示例12: serverTick

@SuppressWarnings("static-method")
@SideOnly(Side.SERVER)
@SubscribeEvent
public void serverTick(ServerTickEvent event) {
	if (event.phase == Phase.START) {
		sendAnalyticsActivityEvent();
	}
}
 
開發者ID:NPException,項目名稱:GameAnalyticsAPI,代碼行數:8,代碼來源:ActivityReportTickEventHandler.java

示例13: worldTickEvent

@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,代碼行數:14,代碼來源:WorldEventHandler.java

示例14: onTick

@SubscribeEvent
public void onTick(ClientTickEvent event)
{
	if(event.phase == Phase.START)
	{
		tickStart();
	}
}
 
開發者ID:Microsoft,項目名稱:vsminecraft,代碼行數:8,代碼來源:ClientTickHandler.java

示例15: onTick

@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,代碼行數:15,代碼來源:CommonWorldTickHandler.java


注:本文中的cpw.mods.fml.common.gameevent.TickEvent.Phase.START屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。