本文整理匯總了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);
}
}
}
示例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);
}
}
}
示例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)
{
}
}
示例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();
}
示例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)
{
}
}
示例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;
}
}
}
}
}
示例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();
}
}
}
示例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;
}
}
}
}
}
}
示例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();
}
}
}
示例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)
{
}
}
示例11: clientTick
@SuppressWarnings("static-method")
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void clientTick(ClientTickEvent event) {
if (event.phase == Phase.START) {
sendAnalyticsActivityEvent();
}
}
示例12: serverTick
@SuppressWarnings("static-method")
@SideOnly(Side.SERVER)
@SubscribeEvent
public void serverTick(ServerTickEvent event) {
if (event.phase == Phase.START) {
sendAnalyticsActivityEvent();
}
}
示例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);
}
}
示例14: onTick
@SubscribeEvent
public void onTick(ClientTickEvent event)
{
if(event.phase == Phase.START)
{
tickStart();
}
}
示例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);
}
}
}