net.minecraft.util.text.event.HoverEvent#net.minecraftforge.fml.common.gameevent.TickEvent源码实例Demo

下面列出了net.minecraft.util.text.event.HoverEvent#net.minecraftforge.fml.common.gameevent.TickEvent 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: SkyblockAddons   文件: Scheduler.java
@SubscribeEvent()
public void ticker(TickEvent.ClientTickEvent e) {
    if (e.phase == TickEvent.Phase.START) {
        totalTicks++;
        Set<Command> commands = queue.get(totalTicks);
        if (commands != null) {
            for (Command command : commands) {
                for (int times = 0; times < command.getCount().getValue(); times++) {
                    command.getCommandType().execute(command, times+1);
                }
            }
            queue.remove(totalTicks);
        }
        if (totalTicks % 12000 == 0 || delayingMagmaCall) { // check magma boss every 15 minutes
            if (main.getPlayerListener().getMagmaAccuracy() != EnumUtils.MagmaTimerAccuracy.EXACTLY) {
                if (main.getUtils().isOnSkyblock()) {
                    delayingMagmaCall = false;
                    main.getUtils().fetchMagmaBossEstimate();
                } else if (!delayingMagmaCall) {
                    delayingMagmaCall = true;
                }
            }
        }
        ChromaManager.increment(); // Run every tick
    }
}
 
源代码2 项目: CommunityMod   文件: ClayRainMod.java
@SubscribeEvent
public void rain(TickEvent.WorldTickEvent e) {
    if (e.world.isRaining()) {
        if (e.world.rand.nextInt(5) == 0) {
            for (EntityPlayer player : e.world.playerEntities) {
                if (e.world.getBiome(player.getPosition()).canRain()) {
                    double x = e.world.rand.nextInt(maxRange * 2) - maxRange;
                    double y = 255;
                    if (player.posY < 100) y = 130;
                    double z = e.world.rand.nextInt(maxRange * 2) - maxRange;

                    EntityItem clay = new EntityItem(e.world, x + player.posX, y, z + player.posZ, new ItemStack(Items.CLAY_BALL));
                    clay.lifespan = 200;
                    e.world.spawnEntity(clay);
                }
            }
        }
    }
}
 
源代码3 项目: AdvancedRocketry   文件: SpaceObjectManager.java
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) {
	if(DimensionManager.getWorld(Configuration.spaceDimId) == null)
		return;
	
	long worldTime = DimensionManager.getWorld(Configuration.spaceDimId).getTotalWorldTime();
	//Assuming server
	//If no dim undergoing transition then nextTransitionTick = -1
	if((nextStationTransitionTick != -1 && worldTime >= nextStationTransitionTick && spaceStationOrbitMap.get(WARPDIMID) != null) || (nextStationTransitionTick == -1 && spaceStationOrbitMap.get(WARPDIMID) != null && !spaceStationOrbitMap.get(WARPDIMID).isEmpty())) {
		long newNextTransitionTick = -1;
		for(ISpaceObject obj : spaceStationOrbitMap.get(WARPDIMID)) {
			if(obj.getTransitionTime() <= worldTime) {
				moveStationToBody(obj, obj.getDestOrbitingBody());
				spaceStationOrbitMap.get(WARPDIMID).remove(obj);
			}
			else if(newNextTransitionTick == -1 || obj.getTransitionTime() < newNextTransitionTick)
				newNextTransitionTick = obj.getTransitionTime();
		}

		nextStationTransitionTick = newNextTransitionTick;
	}

}
 
源代码4 项目: AdvancedRocketry   文件: PlanetEventHandler.java
@SubscribeEvent
public void tick(TickEvent.ServerTickEvent event) {
	//Tick satellites
	if(event.phase == event.phase.END) {
		DimensionManager.getInstance().tickDimensions();
		time++;

		if(!transitionMap.isEmpty()) {
			Iterator<Entry<Long, TransitionEntity>> itr = transitionMap.entrySet().iterator();

			while(itr.hasNext()) {
				Entry<Long, TransitionEntity> entry = itr.next();
				TransitionEntity ent = entry.getValue();
				if(ent.entity.world.getTotalWorldTime() >= entry.getKey()) {
					ent.entity.setLocationAndAngles(ent.location.getX(), ent.location.getY(), ent.location.getZ(), ent.entity.rotationYaw, ent.entity.rotationPitch);
					ent.entity.getServer().getPlayerList().transferPlayerToDimension((EntityPlayerMP)ent.entity, ent.dimId, new TeleporterNoPortal(ent.entity.getServer().getWorld(ent.dimId)));
					ent.entity.startRiding(ent.entity2);

					itr.remove();
				}
			}
		}
	}
}
 
源代码5 项目: ForgeHax   文件: BoatFly.java
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
  // check if the player is really riding a entity
  if (MC.player != null && MC.player.getRidingEntity() != null) {
    
    ForgeHaxHooks.isNoClampingActivated = noClamp.getAsBoolean();
    ForgeHaxHooks.isNoBoatGravityActivated = noGravity.getAsBoolean();
    ForgeHaxHooks.isBoatSetYawActivated = setYaw.getAsBoolean();
    
    if (MC.gameSettings.keyBindJump.isKeyDown()) {
      // trick the riding entity to think its onground
      MC.player.getRidingEntity().onGround = false;
      
      // teleport up
      MC.player.getRidingEntity().motionY = MC.gameSettings.keyBindSprint.isKeyDown() ? 5 : 1.5;
    } else {
      MC.player.getRidingEntity().motionY =
          MC.gameSettings.keyBindSprint.isKeyDown() ? -1.0 : -speedY.getAsDouble();
    }

    /*if ((MC.player.posY <= maintainY.getAsDouble()-5D) && (MC.player.posY > maintainY.getAsDouble()-10D) && maintainY.getAsDouble() != 0D)
    MC.player.getRidingEntity().setPositionAndUpdate(MC.player.posX, maintainY.getAsDouble(), MC.player.posZ );*/
    
    setMoveSpeedEntity(speed.getAsDouble());
  }
}
 
源代码6 项目: ForgeHax   文件: AutoMine.java
@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {
  if (getLocalPlayer() == null || getWorld() == null) {
    return;
  }
  
  switch (event.phase) {
    case START: {
      RayTraceResult tr = LocalPlayerUtils.getMouseOverBlockTrace();
      
      if (tr == null) {
        setPressed(false);
        return;
      }
      
      setPressed(true);
      break;
    }
    case END:
      setPressed(false);
      break;
  }
}
 
源代码7 项目: Wizardry   文件: EntityFairy.java
@SubscribeEvent
public static void onStun(TickEvent.WorldTickEvent event) {
	if (event.side == Side.CLIENT) return;

	for (EntityFairy fairy : event.world.getEntities(EntityFairy.class, input -> input != null && !input.isDead)) {

		fairy.stunned = false;

		secondary:
		for (EntityPlayer player : event.world.getEntitiesWithinAABB(EntityPlayer.class, fairy.getEntityBoundingBox().grow(5))) {

			for (EnumHand hand : EnumHand.values()) {
				ItemStack stack = player.getHeldItem(hand);

				if (stack.getItem() == ModItems.FAIRY_BELL) {
					fairy.stunned = true;
					break secondary;
				}
			}
		}
	}
}
 
源代码8 项目: Wizardry   文件: PotionNullMovement.java
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onTick(TickEvent.ClientTickEvent event) {
	Minecraft mc = Minecraft.getMinecraft();
	EntityPlayerSP player = mc.player;
	if (player == null) return;
	if (player.isPotionActive(ModPotions.NULL_MOVEMENT)) {
		//player.rotationYaw = player.getEntityData().getFloat("rot_yaw");
		//player.rotationPitch = player.getEntityData().getFloat("rot_pitch");
		//player.prevRotationYaw = player.getEntityData().getFloat("rot_yaw");
		//player.prevRotationPitch = player.getEntityData().getFloat("rot_pitch");

		if (!(player.movementInput instanceof NullMovementInput))
			player.movementInput = new NullMovementInput(player.movementInput);
	} else if (!(player.movementInput instanceof MovementInputFromOptions))
		player.movementInput = new MovementInputFromOptions(mc.gameSettings);
}
 
源代码9 项目: Wizardry   文件: NemezEventHandler.java
@SubscribeEvent
public static void worldTick(TickEvent.WorldTickEvent event) {
	if (event.phase == TickEvent.Phase.START)
		reversals.removeIf((reversal) -> {
			if (reversal.world.get() == event.world) {
				if (reversal.nemez.hasNext()) {
					reversal.nemez.applySnapshot(event.world);
					if (reversal.pos != null && reversal.world.get().getTotalWorldTime() % PacketNemezReversal.SYNC_AMOUNT == 0)
						PacketHandler.NETWORK.sendToAllAround(new PacketNemezReversal(reversal.nemez),
								new NetworkRegistry.TargetPoint(reversal.world.get().provider.getDimension(),
										reversal.pos.getX() + 0.5, reversal.pos.getY() + 0.5, reversal.pos.getZ() + 0.5, 96));
				} else {
					for (Entity entity : reversal.nemez.getTrackedEntities(event.world))
						entity.setNoGravity(false);
					return true;
				}
			}
			return reversal.world.get() == null;
		});
}
 
源代码10 项目: Cyberware   文件: VanillaWares.java
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void handleSpiderVision(TickEvent.ClientTickEvent event)
{
	if (event.phase == TickEvent.Phase.START)
	{
		EntityPlayer e = Minecraft.getMinecraft().thePlayer;
		
		if (CyberwareAPI.isCyberwareInstalled(e, new ItemStack(Items.SPIDER_EYE)))
		{
			if (Minecraft.getMinecraft().entityRenderer.getShaderGroup() == null)
			{
				Minecraft.getMinecraft().entityRenderer.loadShader(new ResourceLocation("shaders/post/spider.json"));
			}
		}
		else if (e != null && !e.isSpectator())
		{
			ShaderGroup sg = Minecraft.getMinecraft().entityRenderer.getShaderGroup();
			if (sg != null && sg.getShaderGroupName().equals("minecraft:shaders/post/spider.json"))
			{
				Minecraft.getMinecraft().entityRenderer.stopUseShader();
			}
		}
		
	}
}
 
源代码11 项目: malmo   文件: ClientStateMachine.java
@Override
public void onClientTick(TickEvent.ClientTickEvent ev)
{
    // Check to see whether anything has caused us to abort - if so, go to the abort state.
    if (inAbortState())
        episodeHasCompleted(ClientState.MISSION_ABORTED);

    if (ev.phase == Phase.END)
        episodeHasCompleted(ClientState.CREATING_NEW_WORLD);

    if (++totalTicks > WAIT_MAX_TICKS)
    {
        String msg = "Too long waiting for server episode to close.";
        TCPUtils.Log(Level.SEVERE, msg);
        episodeHasCompletedWithErrors(ClientState.ERROR_TIMED_OUT_WAITING_FOR_EPISODE_CLOSE, msg);
    }
}
 
源代码12 项目: malmo   文件: KeyManager.java
/** Tick event called on the Client.<br>
 * Used to simulate pressing and releasing of our additional keys.<br>
 * This is about as close as we can (easily) get in the call stack to the point when Minecraft does the equivalent code for its own keys.
 * @param ev ClientTickEvent for this tick.
 */
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent ev)
{
    if (ev != null && ev.phase == Phase.START)
    {
        for (InternalKey binding : this.additionalKeys)
        {
            if (binding.isKeyDown())
            {
                binding.onKeyDown();
            }
            if (binding.isPressed())
            {
                binding.onPressed();
            }
        }
    }
}
 
源代码13 项目: malmo   文件: EpisodeEventWrapper.java
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent ev)
{
    // Now pass the event on to the active episode, if there is one:
    this.stateEpisodeLock.readLock().lock();
    if (this.stateEpisode != null && this.stateEpisode.isLive())
    {
    	try
    	{
    		this.stateEpisode.onClientTick(ev);
    	}
    	catch (Exception e)
    	{
    		// Do what??
    	}
    }
    this.stateEpisodeLock.readLock().unlock();
}
 
源代码14 项目: Logistics-Pipes-2   文件: EventManager.java
@SubscribeEvent
public void onWorldTick(TickEvent.WorldTickEvent event){
	if (!event.world.isRemote && event.phase == TickEvent.Phase.END){
		NBTTagList list = new NBTTagList();
		TileEntity[] updateArray = toUpdate.values().toArray(new TileEntity[toUpdate.size()]);
		for (int i = 0; i < updateArray.length; i ++){
			TileEntity t = updateArray[i];
			if (!event.world.isRemote){
				list.appendTag(t.getUpdateTag());
			}
		}
		if (!list.hasNoTags()){
			NBTTagCompound tag = new NBTTagCompound();
			tag.setTag("data", list);
			LPPacketHandler.INSTANCE.sendToAll(new MessagePipeContentUpdate(tag));
		}
		toUpdate.clear();
	}
}
 
源代码15 项目: SkyblockAddons   文件: NewScheduler.java
@SubscribeEvent
public void ticker(TickEvent.ClientTickEvent event) {
    if (event.phase == TickEvent.Phase.START) {
        synchronized (this.anchor) {
            this.totalTicks++;
            this.currentTicks++;
        }

        if (Minecraft.getMinecraft() != null) {
            this.pendingTasks.removeIf(ScheduledTask::isCompleted);

            this.pendingTasks.addAll(queuedTasks);
            queuedTasks.clear();

            try {
                for (ScheduledTask scheduledTask : this.pendingTasks) {
                    if (this.getTotalTicks() >= (scheduledTask.getAddedTicks() + scheduledTask.getDelay())) {
                        if (!scheduledTask.isCanceled()) {
                            scheduledTask.start();

                            if (!scheduledTask.isCompleted() && scheduledTask.getPeriod() > 0) {
                                scheduledTask.setDelay(scheduledTask.getPeriod());
                            }
                        }
                    }
                }
            } catch (Throwable ex) {
                ex.printStackTrace();
            }
        }
    }
}
 
源代码16 项目: SkyblockAddons   文件: RenderListener.java
@SubscribeEvent()
public void onRender(TickEvent.RenderTickEvent e) {
    if (guiToOpen == EnumUtils.GUIType.MAIN) {
        Minecraft.getMinecraft().displayGuiScreen(new SkyblockAddonsGui(guiPageToOpen, guiTabToOpen));
    } else if (guiToOpen == EnumUtils.GUIType.EDIT_LOCATIONS) {
        Minecraft.getMinecraft().displayGuiScreen(new LocationEditGui(main, guiPageToOpen, guiTabToOpen));
    } else if (guiToOpen == EnumUtils.GUIType.SETTINGS) {
        Minecraft.getMinecraft().displayGuiScreen(new SettingsGui(guiFeatureToOpen, 1, guiPageToOpen, guiTabToOpen, guiFeatureToOpen.getSettings()));
    } else if (guiToOpen == EnumUtils.GUIType.WARP) {
        Minecraft.getMinecraft().displayGuiScreen(new IslandWarpGui());
    }
    guiToOpen = null;
}
 
源代码17 项目: IGW-mod   文件: IGWSupportNotifier.java
@SubscribeEvent
public void onPlayerJoin(TickEvent.PlayerTickEvent event){
    if(event.player.world.isRemote && event.player == FMLClientHandler.instance().getClientPlayerEntity()) {
        event.player.sendMessage(ITextComponent.Serializer.jsonToComponent("[\"" + TextFormatting.GOLD + "The mod " + supportingMod + " is supporting In-Game Wiki mod. " + TextFormatting.GOLD + "However, In-Game Wiki isn't installed! " + "[\"," + "{\"text\":\"Download Latest\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/igwmod_download\"}}," + "\"]\"]"));
        FMLCommonHandler.instance().bus().unregister(this);
    }
}
 
源代码18 项目: MediaMod   文件: PlayerMessager.java
@SubscribeEvent
public void tick(TickEvent.ClientTickEvent event) {
    if (Minecraft.getMinecraft().thePlayer == null) {
        return;
    }

    while (!messages.isEmpty()) {
        Minecraft.getMinecraft().thePlayer.addChatComponentMessage(messages.poll());
    }

    while (!queuedMessages.isEmpty()) {
        sendMessage(queuedMessages.poll());
    }
}
 
源代码19 项目: TofuCraftReload   文件: TofuEventLoader.java
@SubscribeEvent
public void worldTick(TickEvent.WorldTickEvent event) {
    String s = TofuVillageCollection.fileNameForProvider(event.world.provider);

    TofuVillageCollection tofuVillageCollection = (TofuVillageCollection) event.world.getPerWorldStorage().getOrLoadData(TofuVillageCollection.class, s);

    if (tofuVillageCollection != null) {
        tofuVillageCollection.tick();
    }
}
 
源代码20 项目: CommunityMod   文件: WhatAreThose.java
@SubscribeEvent
public static void onEquipEvent(TickEvent.PlayerTickEvent event) {
    if (rand.nextInt(1000) < 1) {
        EntityPlayer player = event.player;
        BlockPos pos = new BlockPos(player.posX, player.posY, player.posZ);
        IBlockState state = player.world.getBlockState(pos.add(0, -1, 0));
        if (player.onGround) {
            for (ItemStack stack : player.inventory.armorInventory) {
                if (stack.getItem() instanceof ItemArmor && ((ItemArmor) stack.getItem()).getEquipmentSlot() == EntityEquipmentSlot.FEET && state == Blocks.DIAMOND_BLOCK) {
                    player.sendMessage(new TextComponentString("What are THOOOOOSE!?"));
                }
            }
        }
    }
}
 
源代码21 项目: CommunityMod   文件: SentientBread.java
@SubscribeEvent
public static void onClientTick(TickEvent.ClientTickEvent event)
{
    Minecraft mc = Minecraft.getMinecraft();

    if (!isLoaded)
    {
        return;
    }

    if (event.phase == TickEvent.Phase.END && mc.world != null && !mc.isGamePaused())
    {
        ItemStack stack = mc.player.getActiveItemStack();

        if (!stack.isEmpty() && stack.getItem() == Items.BREAD)
        {
            Random rand = mc.player.world.rand;

            if (rand.nextFloat() < 0.04)
            {
                String msg = MESSAGES_STOP[rand.nextInt(MESSAGES_STOP.length)];
                int i = mc.gameSettings.narrator;

                if (NARRATOR.active() && (i == 0 || i == 3)) // Don't narrate if the setting is already turned on
                {
                    NARRATOR.clear();
                    NARRATOR.say(msg);
                }

                mc.player.sendMessage(stack.getTextComponent().appendSibling(new TextComponentString(": " + msg)));
            }
        }
    }
}
 
源代码22 项目: CommunityMod   文件: SexyFont.java
@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void frame(TickEvent.RenderTickEvent e) {
	if(e.phase == TickEvent.Phase.START) {
		Minecraft mc = Minecraft.getMinecraft();
		if(mc.player == null) {
			SexyFont.sexyTime = false;
		} else {
			Item head = mc.player.inventory.armorItemInSlot(EntityEquipmentSlot.HEAD.getIndex()).getItem();
			SexyFont.sexyTime = head == SexyFont.Items.SEXY_GLASSES;
		}
	}
}
 
@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void onClientTick(TickEvent.ClientTickEvent event) {
    if (event.phase == TickEvent.Phase.START) {
        Minecraft client = Minecraft.getMinecraft();
        if (client.world != null && !client.isGamePaused()) {
            RANDOM.setSeed((client.world.getTotalWorldTime() * M) ^ client.world.getSeed());
            if (RANDOM.nextInt(CHANCE) == 0) {
                ISound sound = PositionedSoundRecord.getMasterRecord(YOU_COULD_MAKE_A_RELIGION_OUT_OF_THIS, 1.0F);
                client.getSoundHandler().playSound(sound);
            }
        }
    }
}
 
源代码24 项目: EmergingTechnology   文件: WorldTickHandler.java
@SubscribeEvent
public void tickEnd(TickEvent.WorldTickEvent event) {
    if (event.side != Side.SERVER) {
        return;
    }

    if (event.phase == TickEvent.Phase.END) {

        World world = event.world;
        int dim = world.provider.getDimension();

        ArrayDeque<ChunkPos> chunks = chunksToGen.get(dim);

        if (chunks != null && !chunks.isEmpty()) {
            ChunkPos c = chunks.pollFirst();
            long worldSeed = world.getSeed();
            Random rand = new Random(worldSeed);
            long xSeed = rand.nextLong() >> 2 + 1L;
            long zSeed = rand.nextLong() >> 2 + 1L;
            rand.setSeed(xSeed * c.x + zSeed * c.z ^ worldSeed);
            OreGenerator.instance.generateWorld(rand, c.x, c.z, world, false);
            chunksToGen.put(dim, chunks);
        } else if (chunks != null) {
            chunksToGen.remove(dim);
        }
    }
}
 
源代码25 项目: TFC2   文件: ClientRenderHandler.java
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent event)
{

	if(event.phase == Phase.START)
	{
		if(ClientRenderHandler.IsGeneratingFirstIsland)
		{
			Minecraft.getMinecraft().skipRenderWorld = true;
			skipRender = true;
		}
		else
		{
			skipRender = false;
		}
	}
	if(event.phase == Phase.END)
	{
		if(skipRender && ClientRenderHandler.IsGeneratingFirstIsland)
		{
			String gen = Core.translate("gui.generatingmapmessage");
			FontRenderer renderer = Minecraft.getMinecraft().fontRenderer;
			ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
			int sizeX = Minecraft.getMinecraft().displayWidth/2;
			int sizeY = Minecraft.getMinecraft().displayHeight/2;

			renderer.drawString(gen, sizeX/2 - (renderer.getStringWidth(gen) / 2)+1, sizeY/2+1, Color.black.getRGB());
			renderer.drawString(gen, sizeX/2 - (renderer.getStringWidth(gen) / 2), sizeY/2, Color.white.getRGB());
			Minecraft.getMinecraft().skipRenderWorld = false;
			skipRender = false;
		}
	}
}
 
源代码26 项目: Custom-Main-Menu   文件: CMMEventHandler.java
@SubscribeEvent
public void tick(TickEvent.ClientTickEvent event)
{
	if (event.phase == TickEvent.Phase.END)
	{
		if (CustomMainMenu.INSTANCE.config != null)
			CustomMainMenu.INSTANCE.config.tick();
	}
}
 
源代码27 项目: ForgeWurst   文件: WEventFactory.java
@SubscribeEvent
public static void onPlayerPreTick(TickEvent.PlayerTickEvent event)
{
	if(event.phase != Phase.START)
		return;
	
	EntityPlayer player = event.player;
	if(player != WMinecraft.getPlayer())
		return;
	
	if(!WPlayer.getWorld(player).isRemote)
		return;
	
	MinecraftForge.EVENT_BUS.post(new WUpdateEvent((EntityPlayerSP)player));
}
 
源代码28 项目: ForgeWurst   文件: WEventFactory.java
@SubscribeEvent
public static void onPlayerPreTick(TickEvent.PlayerTickEvent event)
{
	if(event.phase != Phase.START)
		return;
	
	EntityPlayer player = event.player;
	if(player != WMinecraft.getPlayer())
		return;
	
	if(!WPlayer.getWorld(player).isRemote)
		return;
	
	MinecraftForge.EVENT_BUS.post(new WUpdateEvent((EntityPlayerSP)player));
}
 
源代码29 项目: AdvancedRocketry   文件: PlanetEventHandler.java
@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.getDimension()).isTerraformed()) {
			Collection<Chunk> list = ((WorldServer)event.world).getChunkProvider().getLoadedChunks();
			if(list.size() > 0) {
				try {
					int listSize = list.size();

					for(Chunk chunk : list) {

						if(Configuration.terraformingBlockSpeed > listSize || event.world.rand.nextFloat() < Configuration.terraformingBlockSpeed/(float)listSize)
						{
							int coord = event.world.rand.nextInt(256);
							int x = (coord & 0xF) + chunk.x*16;
							int z = (coord >> 4) + chunk.z*16;

							BiomeHandler.changeBiome(event.world, Biome.getIdForBiome(((ChunkManagerPlanet)((WorldProviderPlanet)event.world.provider).chunkMgrTerraformed).getBiomeGenAt(x,z)), x, z);
						}
					}
				} catch (NullPointerException e) {
					//Ghost
				}
			}
		}
	}
}
 
源代码30 项目: Wizardry   文件: ArenaManager.java
@SubscribeEvent
public void tickPlayer(TickEvent.PlayerTickEvent event) {
	for (Arena arena : arenas) {
		if (!arena.getPlayers().contains(event.player.getUniqueID())) {
			continue;
		}
		if (event.player.getDistance(arena.getCenter().getX() + 0.5, arena.getCenter().getY(), arena.getCenter().getZ() + 0.5) > arena.getRadius()) {
			arena.end();
			continue;
		}
		if (event.player.capabilities.isFlying) {
			event.player.capabilities.isFlying = false;
		}
	}
}