Package net.minecraft.entity.player

Examples of net.minecraft.entity.player.EntityPlayer


  @Override
  public void onWornTick(ItemStack stack, EntityLivingBase player) {
    Brew brew = getBrew(stack);
    if(brew != BotaniaAPI.fallbackBrew && player instanceof EntityPlayer && !player.worldObj.isRemote) {
      EntityPlayer eplayer = (EntityPlayer) player;
      PotionEffect effect = brew.getPotionEffects(stack).get(0);
      float cost = (float) brew.getManaCost(stack) / effect.getDuration() / (1 + effect.getAmplifier()) * 2.5F;
      boolean doRand = cost < 1;
      if(ManaItemHandler.requestManaExact(stack, eplayer, (int) Math.ceil(cost), false)) {
        PotionEffect currentEffect = player.getActivePotionEffect(Potion.potionTypes[effect.getPotionID()]);
View Full Code Here


  }

  @SubscribeEvent
  public void updatePlayerFlyStatus(LivingUpdateEvent event) {
    if(event.entityLiving instanceof EntityPlayer) {
      EntityPlayer player = (EntityPlayer) event.entityLiving;

      ItemStack tiara = PlayerHandler.getPlayerBaubles(player).getStackInSlot(0);
      if(playersWithFlight.contains(playerStr(player))) {
        if(shouldPlayerHaveFlight(player)) {
          player.capabilities.allowFlying = true;
          if(player.capabilities.isFlying) {
            if(!player.worldObj.isRemote)
              ManaItemHandler.requestManaExact(tiara, player, COST, true);
            else if(Math.abs(player.motionX) > 0.1 || Math.abs(player.motionZ) > 0.1) {
              double x = event.entityLiving.posX - 0.5;
              double y = event.entityLiving.posY - 1.7;
              double z = event.entityLiving.posZ - 0.5;

              player.getGameProfile().getName();
              float r = 1F;
              float g = 1F;
              float b = 1F;

              switch(tiara.getItemDamage()) {
View Full Code Here

    drawBar(xf, yf, fgRect.x, fgRect.y, fw, fgRect.height, false);
    mc.fontRenderer.drawStringWithShadow(name, tx, y - 10, 0xA2018C);
    GL11.glDisable(GL11.GL_BLEND);
   
    Entity e = (Entity) currentBoss;
    EntityPlayer p = mc.thePlayer;
    if(e.isDead || !p.worldObj.loadedEntityList.contains(e) || MathHelper.pointDistanceSpace(e.posX, e.posY, e.posZ, p.posX, p.posY, p.posZ) > 32)
      currentBoss = null;
  }
View Full Code Here

      GuiScreen gui = Minecraft.getMinecraft().currentScreen;
      if(gui == null || !gui.doesGuiPauseGame()) {
        ticksInGame++;

        EntityPlayer player = Minecraft.getMinecraft().thePlayer;
        if(player != null) {
          ItemStack stack = player.getCurrentEquippedItem();
          if(stack != null && stack.getItem() instanceof ItemTwigWand) {
            List<TileSignature> list = new ArrayList(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().theWorld));
            for(TileSignature sig : list) {
              if(!sig.remoteWorld)
                continue;
View Full Code Here

  @Override
  public void setExtraReach(EntityLivingBase entity, float reach) {
    super.setExtraReach(entity, reach);
    Minecraft mc = Minecraft.getMinecraft();
    EntityPlayer player = mc.thePlayer;
    if(entity == player) {
      if(!(mc.playerController instanceof IExtendedPlayerController)) {
        GameType type = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.CURRENT_GAME_TYPE);
        NetHandlerPlayClient net = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.NET_CLIENT_HANDLER);
        BotaniaPlayerController controller = new BotaniaPlayerController(mc, net);
View Full Code Here

  }

  @SubscribeEvent
  public void onEntityDamaged(LivingHurtEvent event) {
    if(event.source.getEntity() instanceof EntityPlayer && event.entityLiving instanceof EntityLiving && !event.entityLiving.worldObj.isRemote && Math.random() < 0.6F) {
      EntityPlayer player = (EntityPlayer) event.source.getEntity();
      ItemStack amulet = PlayerHandler.getPlayerBaubles(player).getStackInSlot(0);
      if(amulet != null && amulet.getItem() == this) {
        final int cost = 250;
        if(ManaItemHandler.requestManaExact(amulet, player, cost, false)) {
          final int range = 20;
View Full Code Here

  }

  @SubscribeEvent(priority = EventPriority.HIGHEST)
  public void onPlayerDeath(LivingDeathEvent event) {
    if(event.entity instanceof EntityPlayer) {
      EntityPlayer player = (EntityPlayer) event.entity;
      ItemStack amulet = PlayerHandler.getPlayerBaubles(player).getStackInSlot(0);

      if(amulet != null && amulet.getItem() == this) {
        event.setCanceled(true);
        player.setHealth(player.getMaxHealth());
        player.addPotionEffect(new PotionEffect(Potion.resistance.id, 300, 6));
        player.addChatMessage(new ChatComponentTranslation("botaniamisc.savedByLaurel"));
        player.worldObj.playSoundAtEntity(player, "botania:goldenLaurel", 1F, 0.3F);
        PlayerHandler.getPlayerBaubles(player).setInventorySlotContents(0, null);
      }
    }
  }
View Full Code Here

          AnimalChest chest = ReflectionHelper.getPrivateValue(EntityHorse.class, horse, LibObfuscation.HORSE_CHEST);
          if(scanInventory(chest, pstack))
            positionsBuilder.append(horse.getEntityId()).append(";");

        } else if(e instanceof EntityPlayer) {
          EntityPlayer player_ = (EntityPlayer) e;
          InventoryPlayer inv = player_.inventory;
          InventoryBaubles binv = PlayerHandler.getPlayerBaubles(player_);
          if(scanInventory(inv, pstack) || scanInventory(binv, pstack))
            positionsBuilder.append(player_.getEntityId()).append(";");

        } else if(e instanceof EntityVillager) {
          EntityVillager villager = (EntityVillager) e;
          ArrayList<MerchantRecipe> recipes = villager.getRecipes(player);
          if(pstack != null)
View Full Code Here

            renderPoolRecipeHUD(event.resolution, (TilePool) tile, stack);
        }
      }

      profiler.startSection("manaBar");
      EntityPlayer player = Minecraft.getMinecraft().thePlayer;
      int totalMana = 0;
      int totalMaxMana = 0;
      boolean anyRequest = false;
      boolean creative = false;
View Full Code Here

    GuiDraw.changeTexture(TextureMap.locationBlocksTexture);
    RenderItem.getInstance().renderIcon(35, 29, BlockAlfPortal.portalTex, 48, 48);
  }

  private static boolean hasElvenKnowledge() {
    EntityPlayer player = Minecraft.getMinecraft().thePlayer;
    if (player != null) {
      for (ItemStack stack : player.inventory.mainInventory) {
        if (stack != null && stack.getItem() instanceof ILexicon) {
          ILexicon lexicon = (ILexicon) stack.getItem();
          if (lexicon.isKnowledgeUnlocked(stack, BotaniaAPI.elvenKnowledge)) {
View Full Code Here

TOP

Related Classes of net.minecraft.entity.player.EntityPlayer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.