Java 类net.minecraft.client.entity.EntityClientPlayerMP 实例源码

项目:4Space-5    文件:TickHandlerClient.java   
@SubscribeEvent
public void onPreGuiRender(RenderGameOverlayEvent.Pre event)
{
    final Minecraft minecraft = FMLClientHandler.instance().getClient();
    final EntityClientPlayerMP player = minecraft.thePlayer;

    if (event.type == RenderGameOverlayEvent.ElementType.ALL)
    {
        if (player != null && player.ridingEntity != null && player.ridingEntity instanceof IIgnoreShift && ((IIgnoreShift) player.ridingEntity).shouldIgnoreShiftExit())
        {
            // Remove "Press shift to dismount" message when shift-exiting is disabled (not ideal, but the only option)
            String str = I18n.format("mount.onboard", new Object[] { GameSettings.getKeyDisplayString(minecraft.gameSettings.keyBindSneak.getKeyCode()) });
            if (minecraft.ingameGUI.recordPlaying.equals(str))
            {
                minecraft.ingameGUI.recordPlaying = "";
            }
        }
    }
}
项目:4Space-5    文件:GuiJoinSpaceRace.java   
public GuiJoinSpaceRace(EntityClientPlayerMP player)
{
    this.thePlayer = player;
    GCPlayerStatsClient stats = GCPlayerStatsClient.get(player);

    SpaceRace race = SpaceRaceManager.getSpaceRaceFromID(stats.spaceRaceInviteTeamID);

    if (race != null)
    {
        this.spaceRaceData = race;
    }
    else
    {
        List<String> playerList = new ArrayList<String>();
        playerList.add(player.getGameProfile().getName());
        this.spaceRaceData = new SpaceRace(playerList, SpaceRace.DEFAULT_NAME, new FlagData(48, 32), new Vector3(1, 1, 1));
    }
}
项目:4Space-5    文件:WorldUtil.java   
public static Vec3 getFogColorHook(World world)
{
    EntityClientPlayerMP player = FMLClientHandler.instance().getClient().thePlayer;
    if (world.provider.getSkyRenderer() instanceof SkyProviderOverworld)
    {
        float var20 = ((float) (player.posY) - Constants.OVERWORLD_SKYPROVIDER_STARTHEIGHT) / 1000.0F;
        var20 = MathHelper.sqrt_float(var20);
        final float var21 = Math.max(1.0F - var20 * 40.0F, 0.0F);

        Vec3 vec = world.getFogColor(1.0F);

        return Vec3.createVectorHelper(vec.xCoord * Math.max(1.0F - var20 * 1.29F, 0.0F), vec.yCoord * Math.max(1.0F - var20 * 1.29F, 0.0F), vec.zCoord * Math.max(1.0F - var20 * 1.29F, 0.0F));
    }

    return world.getFogColor(1.0F);
}
项目:Coding    文件:DragonPlayerUpdateIsDragon.java   
@Override
        public IMessage onMessage(DragonPlayerUpdateIsDragon message, MessageContext ctx) {
            EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
            if (player != null) {
                if (player != null) {
                    DragonPlayer dragonPlayer = DragonPlayer.get(player);
                    dragonPlayer.setDragon(message.value, false);
                    if (!message.value) {
                        // Some other human defaults
//                      player.noClip = false;
                        player.stepHeight = 0.5F; // Normally 0.5F for player
                    }
                }

            }
            return null;
        }
项目:TFC-Additions    文件:KeyBindingHandler.java   
@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
    PlayerInfo pi = PlayerManagerTFC.getInstance().getClientPlayer();
    EntityClientPlayerMP player = FMLClientHandler.instance().getClient().thePlayer;

    if (FMLClientHandler.instance().getClient().inGameHasFocus &&
            FMLClientHandler.instance().getClient().thePlayer.getCurrentEquippedItem() != null &&
            FMLClientHandler.instance().getClient().currentScreen == null) {
        if (Key_PrevChiselMode.isPressed()) {
            if (player.getCurrentEquippedItem().getItem() instanceof ItemChisel) {
                pi.setChiselMode(prevChiselMode(pi));
                //Let's send the actual ChiselMode so the server/client does not
                //come out of sync.
                AbstractPacket pkt = new KeyPressPacket(pi.chiselMode);
                TerraFirmaCraft.PACKET_PIPELINE.sendToServer(pkt);

            }
        }
    }
}
项目:Resilience-Client-Source    文件:EntityLivingBase.java   
/**
 * Causes this entity to do an upwards motion (jumping).
 */
protected void jump()
{
    this.motionY = 0.41999998688697815D * (Resilience.getInstance().getValues().highJumpEnabled && (this instanceof EntityClientPlayerMP) ? Resilience.getInstance().getValues().highJumpMultiplier.getValue() : 1);

    if (this.isPotionActive(Potion.jump))
    {
        this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F);
    }

    if (this.isSprinting())
    {
        float var1 = this.rotationYaw * 0.017453292F;
        this.motionX -= (double)(MathHelper.sin(var1) * 0.2F);
        this.motionZ += (double)(MathHelper.cos(var1) * 0.2F);
    }

    this.isAirBorne = true;
}
项目:Resilience-Client-Source    文件:NetHandlerPlayClient.java   
/**
 * Handles changes in player positioning and rotation such as when travelling to a new dimension, (re)spawning,
 * mounting horses etc. Seems to immediately reply to the server with the clients post-processing perspective on the
 * player positioning
 */
public void handlePlayerPosLook(S08PacketPlayerPosLook p_147258_1_)
{
    EntityClientPlayerMP var2 = this.gameController.thePlayer;
    double var3 = p_147258_1_.func_148932_c();
    double var5 = p_147258_1_.func_148928_d();
    double var7 = p_147258_1_.func_148933_e();
    float var9 = p_147258_1_.func_148931_f();
    float var10 = p_147258_1_.func_148930_g();
    var2.ySize = 0.0F;
    var2.motionX = var2.motionY = var2.motionZ = 0.0D;
    var2.setPositionAndRotation(var3, var5, var7, var9, var10);
    this.netManager.scheduleOutboundPacket(new C03PacketPlayer.C06PacketPlayerPosLook(var2.posX, var2.boundingBox.minY, var2.posY, var2.posZ, p_147258_1_.func_148931_f(), p_147258_1_.func_148930_g(), p_147258_1_.func_148929_h()), new GenericFutureListener[0]);

    if (!this.doneLoadingTerrain)
    {
        this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX;
        this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY;
        this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ;
        this.doneLoadingTerrain = true;
        this.gameController.displayGuiScreen((GuiScreen)null);
    }
}
项目:Resilience-Client-Source    文件:NetHandlerPlayClient.java   
/**
 * Verifies that the server and client are synchronized with respect to the inventory/container opened by the player
 * and confirms if it is the case.
 */
public void handleConfirmTransaction(S32PacketConfirmTransaction p_147239_1_)
{
    Container var2 = null;
    EntityClientPlayerMP var3 = this.gameController.thePlayer;

    if (p_147239_1_.func_148889_c() == 0)
    {
        var2 = var3.inventoryContainer;
    }
    else if (p_147239_1_.func_148889_c() == var3.openContainer.windowId)
    {
        var2 = var3.openContainer;
    }

    if (var2 != null && !p_147239_1_.func_148888_e())
    {
        this.addToSendQueue(new C0FPacketConfirmTransaction(p_147239_1_.func_148889_c(), p_147239_1_.func_148890_d(), true));
    }
}
项目:notenoughwands    文件:DisplacementWand.java   
@SideOnly(Side.CLIENT)
@Override
public void renderOverlay(RenderWorldLastEvent evt, EntityClientPlayerMP player, ItemStack wand) {
    MovingObjectPosition mouseOver = Minecraft.getMinecraft().objectMouseOver;
    if (mouseOver != null) {
        World world = player.worldObj;
        int x = mouseOver.blockX;
        int y = mouseOver.blockY;
        int z = mouseOver.blockZ;
        Block block = world.getBlock(x, y, z);
        if (block != null && block.getMaterial() != Material.air) {
            Set<Coordinate> coordinates = findSuitableBlocks(wand, world, mouseOver.sideHit, x, y, z);
            renderOutlines(evt, player, coordinates, 200, 230, 180);
        }
    }
}
项目:notenoughwands    文件:SwappingWand.java   
@SideOnly(Side.CLIENT)
@Override
public void renderOverlay(RenderWorldLastEvent evt, EntityClientPlayerMP player, ItemStack wand) {
    MovingObjectPosition mouseOver = Minecraft.getMinecraft().objectMouseOver;
    if (mouseOver != null) {
        Block block = player.worldObj.getBlock(mouseOver.blockX, mouseOver.blockY, mouseOver.blockZ);
        if (block != null && block.getMaterial() != Material.air) {
            int meta = player.worldObj.getBlockMetadata(mouseOver.blockX, mouseOver.blockY, mouseOver.blockZ);

            int wandId = Tools.getTagCompound(wand).getInteger("block");
            Block wandBlock = (Block) Block.blockRegistry.getObjectById(wandId);
            int wandMeta = Tools.getTagCompound(wand).getInteger("meta");
            if (wandBlock == block && wandMeta == meta) {
                return;
            }

            Set<Coordinate> coordinates = findSuitableBlocks(wand, player.worldObj, mouseOver.sideHit, mouseOver.blockX, mouseOver.blockY, mouseOver.blockZ, block, meta);
            renderOutlines(evt, player, coordinates, 200, 230, 180);
        }
    }
}
项目:notenoughwands    文件:GenericWand.java   
protected static void renderOutlines(RenderWorldLastEvent evt, EntityClientPlayerMP p, Set<Coordinate> coordinates, int r, int g, int b) {
    double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX) * evt.partialTicks;
    double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY) * evt.partialTicks;
    double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ) * evt.partialTicks;

    GL11.glPushAttrib(GL11.GL_CURRENT_BIT | GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_ENABLE_BIT | GL11.GL_LIGHTING_BIT | GL11.GL_TEXTURE_BIT);
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_LIGHTING);

    GL11.glPushMatrix();
    GL11.glTranslated(-doubleX, -doubleY, -doubleZ);

    renderOutlines(coordinates, r, g, b, 4);

    GL11.glPopMatrix();
    GL11.glPopAttrib();
}
项目:mcpvp-mod    文件:KitCTF.java   
public static KitCTF getKit(EntityClientPlayerMP player) {

    for (KitCTF kit : kits.values()) {

        Item helm   = player.inventory.armorInventory[3] == null ? KitsCTF.empty : player.inventory.armorInventory[3].getItem();
        Item chest  = player.inventory.armorInventory[2] == null ? KitsCTF.empty : player.inventory.armorInventory[2].getItem();
        Item legs   = player.inventory.armorInventory[1] == null ? KitsCTF.empty : player.inventory.armorInventory[1].getItem();
        Item boots  = player.inventory.armorInventory[0] == null ? KitsCTF.empty : player.inventory.armorInventory[0].getItem();

        if (helm    != kit.helm.getItem())  continue;
        if (chest   != kit.chest.getItem()) continue;
        if (legs    != kit.legs.getItem())  continue;
        if (boots   != kit.boots.getItem()) continue;

        return kit;
    }
    return new KitCTF("None", Blocks.web, null, null, null, null);
}
项目:mcpvp-mod    文件:ArmorDisplay.java   
public static void getArmor() {
    if (Main.mc.thePlayer == null || Main.mc.thePlayer.inventory == null) return;

    EntityClientPlayerMP player = Main.mc.thePlayer;

    items.clear();
    if (player.inventory.armorInventory[3] != null) items.add(player.inventory.armorInventory[3]);
    if (player.inventory.armorInventory[2] != null) items.add(player.inventory.armorInventory[2]);
    if (player.inventory.armorInventory[1] != null) items.add(player.inventory.armorInventory[1]);
    if (player.inventory.armorInventory[0] != null) items.add(player.inventory.armorInventory[0]);
    if (player.getCurrentEquippedItem()    != null 
            && !player.getCurrentEquippedItem().isStackable() 
            && player.getCurrentEquippedItem().isItemStackDamageable()) 
        items.add(player.getCurrentEquippedItem());

    w = itemSize + getStringWidth() + 2;
    h = itemSize * items.size();
}
项目:Farrago    文件:RifleItemRenderer.java   
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    EntityClientPlayerMP player = ((EntityClientPlayerMP) data[1]);
    float scopeMult = Math.min((FarragoMod.scopeTicks+ClientProxy.timer.renderPartialTicks)/5f, 1.0f);
    GL11.glTranslatef(1.0f, 0f, 0f);
    GL11.glRotatef(180F, 1.0f, 0.0f, 0.0f);
    GL11.glRotatef(180F, 0.0f, 0.0f, 1.0f);
    if (FarragoMod.scoped) {
        if (player.isUsingItem()) {
            GL11.glTranslatef(0f, scopeMult*-0.5f, scopeMult*0.4f);
            GL11.glRotatef(5F, 0.0f, scopeMult, 0.0f);
            GL11.glRotatef(10F, scopeMult, 0.0f, 0.0f);
        } else {
            GL11.glTranslatef(0f, 0f, scopeMult);
            GL11.glRotatef(-2F, scopeMult, scopeMult, 0.0f);
        }
    }
    IIcon icon = item.getItem().getIcon(item, 0, player, player.getItemInUse(), player.getItemInUseCount());
    ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMinU(), icon.getMinV(), icon.getMaxU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 0.0625f);
}
项目:Farrago    文件:ToolBlockRenderer.java   
@PaneEventHandler
public void onDisplay(PaneDisplayEvent e) {
    oldRenderDistance = mc.gameSettings.renderDistanceChunks;
    mc.gameSettings.renderDistanceChunks = 3;
    fakeWorld = new WorldClient(new NetHandlerPlayClient(Minecraft.getMinecraft(), null, new NetworkManager(true)), new WorldSettings(new WorldInfo(new NBTTagCompound())), 0, EnumDifficulty.EASY, Minecraft.getMinecraft().mcProfiler);
    for (int x = -1; x <= 1; x++) {
        for (int z = -1; z <= 1; z++) {
            fakeWorld.getChunkProvider().loadChunk(x, z);
        }
    }
    fakeWorld.setBlock(0, 64, 0, Blocks.lit_furnace);
    fakeWorld.getGameRules().setOrCreateGameRule("doDaylightCycle", "false");
    fakeWorld.setWorldTime(6000);
    mc.thePlayer = new EntityClientPlayerMP(mc, fakeWorld,
            new FakeSession(), new FakeNetHandler(mc, null, new FakeNetManager(true)),
            new FakeStatFileWriter());
    mc.thePlayer.sendQueue.getNetworkManager().setNetHandler(mc.thePlayer.sendQueue);
    mc.thePlayer.movementInput = new MovementInput();
    mc.playerController = new PlayerControllerMP(mc, mc.thePlayer.sendQueue);
    mc.renderViewEntity = mc.thePlayer;
    mc.theWorld = fakeWorld;
    mc.renderGlobal.setWorldAndLoadRenderers(fakeWorld);
    MinecraftForge.EVENT_BUS.register(this);
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handlePlayerPosLook(S08PacketPlayerPosLook p_147258_1_)
{
    EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer;
    double d0 = p_147258_1_.func_148932_c();
    double d1 = p_147258_1_.func_148928_d();
    double d2 = p_147258_1_.func_148933_e();
    float f = p_147258_1_.func_148931_f();
    float f1 = p_147258_1_.func_148930_g();
    entityclientplayermp.ySize = 0.0F;
    entityclientplayermp.motionX = entityclientplayermp.motionY = entityclientplayermp.motionZ = 0.0D;
    entityclientplayermp.setPositionAndRotation(d0, d1, d2, f, f1);
    this.netManager.scheduleOutboundPacket(new C03PacketPlayer.C06PacketPlayerPosLook(entityclientplayermp.posX, entityclientplayermp.boundingBox.minY, entityclientplayermp.posY, entityclientplayermp.posZ, p_147258_1_.func_148931_f(), p_147258_1_.func_148930_g(), p_147258_1_.func_148929_h()), new GenericFutureListener[0]);

    if (!this.doneLoadingTerrain)
    {
        this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX;
        this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY;
        this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ;
        this.doneLoadingTerrain = true;
        this.gameController.displayGuiScreen((GuiScreen)null);
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleConfirmTransaction(S32PacketConfirmTransaction p_147239_1_)
{
    Container container = null;
    EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer;

    if (p_147239_1_.func_148889_c() == 0)
    {
        container = entityclientplayermp.inventoryContainer;
    }
    else if (p_147239_1_.func_148889_c() == entityclientplayermp.openContainer.windowId)
    {
        container = entityclientplayermp.openContainer;
    }

    if (container != null && !p_147239_1_.func_148888_e())
    {
        this.addToSendQueue(new C0FPacketConfirmTransaction(p_147239_1_.func_148889_c(), p_147239_1_.func_148890_d(), true));
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handlePlayerPosLook(S08PacketPlayerPosLook p_147258_1_)
{
    EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer;
    double d0 = p_147258_1_.func_148932_c();
    double d1 = p_147258_1_.func_148928_d();
    double d2 = p_147258_1_.func_148933_e();
    float f = p_147258_1_.func_148931_f();
    float f1 = p_147258_1_.func_148930_g();
    entityclientplayermp.ySize = 0.0F;
    entityclientplayermp.motionX = entityclientplayermp.motionY = entityclientplayermp.motionZ = 0.0D;
    entityclientplayermp.setPositionAndRotation(d0, d1, d2, f, f1);
    this.netManager.scheduleOutboundPacket(new C03PacketPlayer.C06PacketPlayerPosLook(entityclientplayermp.posX, entityclientplayermp.boundingBox.minY, entityclientplayermp.posY, entityclientplayermp.posZ, p_147258_1_.func_148931_f(), p_147258_1_.func_148930_g(), p_147258_1_.func_148929_h()), new GenericFutureListener[0]);

    if (!this.doneLoadingTerrain)
    {
        this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX;
        this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY;
        this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ;
        this.doneLoadingTerrain = true;
        this.gameController.displayGuiScreen((GuiScreen)null);
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleConfirmTransaction(S32PacketConfirmTransaction p_147239_1_)
{
    Container container = null;
    EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer;

    if (p_147239_1_.func_148889_c() == 0)
    {
        container = entityclientplayermp.inventoryContainer;
    }
    else if (p_147239_1_.func_148889_c() == entityclientplayermp.openContainer.windowId)
    {
        container = entityclientplayermp.openContainer;
    }

    if (container != null && !p_147239_1_.func_148888_e())
    {
        this.addToSendQueue(new C0FPacketConfirmTransaction(p_147239_1_.func_148889_c(), p_147239_1_.func_148890_d(), true));
    }
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72490_a(Packet103SetSlot p_72490_1_) {
   EntityClientPlayerMP var2 = this.field_72563_h.field_71439_g;
   if(p_72490_1_.field_73637_a == -1) {
      var2.field_71071_by.func_70437_b(p_72490_1_.field_73636_c);
   } else {
      boolean var3 = false;
      if(this.field_72563_h.field_71462_r instanceof GuiContainerCreative) {
         GuiContainerCreative var4 = (GuiContainerCreative)this.field_72563_h.field_71462_r;
         var3 = var4.func_74230_h() != CreativeTabs.field_78036_m.func_78021_a();
      }

      if(p_72490_1_.field_73637_a == 0 && p_72490_1_.field_73635_b >= 36 && p_72490_1_.field_73635_b < 45) {
         ItemStack var5 = var2.field_71069_bz.func_75139_a(p_72490_1_.field_73635_b).func_75211_c();
         if(p_72490_1_.field_73636_c != null && (var5 == null || var5.field_77994_a < p_72490_1_.field_73636_c.field_77994_a)) {
            p_72490_1_.field_73636_c.field_77992_b = 5;
         }

         var2.field_71069_bz.func_75141_a(p_72490_1_.field_73635_b, p_72490_1_.field_73636_c);
      } else if(p_72490_1_.field_73637_a == var2.field_71070_bA.field_75152_c && (p_72490_1_.field_73637_a != 0 || !var3)) {
         var2.field_71070_bA.func_75141_a(p_72490_1_.field_73635_b, p_72490_1_.field_73636_c);
      }
   }

}
项目:RuneCraftery    文件:NetClientHandler.java   
public void handleTransaction(Packet106Transaction par1Packet106Transaction)
{
    Container container = null;
    EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer;

    if (par1Packet106Transaction.windowId == 0)
    {
        container = entityclientplayermp.inventoryContainer;
    }
    else if (par1Packet106Transaction.windowId == entityclientplayermp.openContainer.windowId)
    {
        container = entityclientplayermp.openContainer;
    }

    if (container != null && !par1Packet106Transaction.accepted)
    {
        this.addToSendQueue(new Packet106Transaction(par1Packet106Transaction.windowId, par1Packet106Transaction.shortWindowId, true));
    }
}
项目:thatconference-baconmod    文件:PlayerTickHandler.java   
@SubscribeEvent
public void onPlayerTick(PlayerTickEvent event) {
    // this happens on every tick (20x per second)
    EntityClientPlayerMP player = _mc.thePlayer;

    IAttributeInstance movement = player.getEntityAttribute(SharedMonsterAttributes.movementSpeed); 
    if (player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() instanceof BaconBoots) {
        // if they're wearing bacon boots and they don't have the move bonus applied, then apply it
        if (movement.getModifier(BaconBoots.BaconBootsMoveBonusUUID) == null) {
            movement.applyModifier(BaconBoots.BaconBootsMoveBonus);
        }
    }
    else {
        // if they're not wearing bacon boots and they have the move bonus applied, then remove it
        if (movement.getModifier(BaconBoots.BaconBootsMoveBonusUUID) != null) {
            movement.removeModifier(BaconBoots.BaconBootsMoveBonus);
        }
    }
}
项目:BetterNutritionMod    文件:NetClientHandler.java   
public void handleTransaction(Packet106Transaction par1Packet106Transaction)
{
    Container container = null;
    EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer;

    if (par1Packet106Transaction.windowId == 0)
    {
        container = entityclientplayermp.inventoryContainer;
    }
    else if (par1Packet106Transaction.windowId == entityclientplayermp.openContainer.windowId)
    {
        container = entityclientplayermp.openContainer;
    }

    if (container != null && !par1Packet106Transaction.accepted)
    {
        this.addToSendQueue(new Packet106Transaction(par1Packet106Transaction.windowId, par1Packet106Transaction.shortWindowId, true));
    }
}
项目:Andrew2448PowersuitAddons    文件:ClientTickHandler.java   
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
    Minecraft mc = Minecraft.getMinecraft();

    if(type.contains(TickType.CLIENT) && mc.theWorld != null) {

        EntityClientPlayerMP player = mc.thePlayer;
        ItemStack torso = player.getCurrentArmor(2);
        if (torso != null && torso.getItem() instanceof ItemPowerArmorChestplate) {
            if (MuseItemUtils.itemHasActiveModule(torso, MagnetModule.MODULE_MAGNET)) {
                if (AddonConfig.useDebugMode) {
                    AddonLogger.logDebug("Entering client tick handler for magnet.");
                }
                updateMagnetMode(mc.theWorld, player);
            }
        }
    }
}
项目:FallingEarth    文件:ClientTickHandler.java   
public void onTickInGame()
{
    Minecraft mc = Minecraft.getMinecraft();
    EntityClientPlayerMP var3 = Minecraft.getMinecraft().thePlayer;
    WorldClient var4 = mc.theWorld;
    if (var3 != null)
    {
        ItemStack boots = var3.inventory.armorInventory[0];
        ItemStack legs = var3.inventory.armorInventory[1];
        ItemStack chest = var3.inventory.armorInventory[2];
        ItemStack helm = var3.inventory.armorInventory[3];

        if (boots == null || legs == null || chest == null || helm == null)
        {
            var3.capabilities.setPlayerWalkSpeed(0.1F);
        }
        else if (boots.itemID == ItemHelper.meteoriticBoots.itemID
                && legs.itemID == ItemHelper.meteoriticLegs.itemID
                && chest.itemID == ItemHelper.meteoriticBody.itemID
                && helm.itemID == ItemHelper.meteoriticHead.itemID)
        {
            var3.capabilities.setPlayerWalkSpeed(0.2F);
        }
    }
}
项目:WeaponsMod    文件:ClientTick.java   
@Override
    public void tickStart(EnumSet<TickType> type, Object... tickData) {
        // TODO Auto-generated method stub
        keyNum = 0;
        if(Keyboard.isKeyDown(Keyboard.KEY_SPACE)){
            keyNum = 1;
        }
        if(keyNum != 0){
//      System.out.println("keydown: " + keyNum);
        }
        if (keyNum == 1)
        {
            EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
            EventShipControl event = new EventShipControl(player.username, keyNum);
            MinecraftForge.EVENT_BUS.post(event);
//          System.out.println("posed event: " + player.username);
        }

    }
项目:bit-client    文件:ModuleKillaura.java   
private void unhitBlock() {
    Field f = null;
    try {
        f = EntityClientPlayerMP.class.getDeclaredField("field_78778_j");
        f.setAccessible(true);
        f.set(Wrapper.thePlayer(), false);
        f.setAccessible(false);
    } catch (Exception e) {
    }
}
项目:bit-client    文件:ModuleTriggerbot.java   
private void unhitBlock() {
    Field f = null;
    try {
        f = EntityClientPlayerMP.class.getDeclaredField("field_78778_j");
        f.setAccessible(true);
        f.set(Wrapper.thePlayer(), false);
        f.setAccessible(false);
    } catch (Exception e) {
    }
}
项目:ExtraUtilities    文件:GuiFilingCabinet.java   
@Override
public int compare(final Slot arg0, final Slot arg1) {
    if (!arg0.getHasStack()) {
        if (!arg1.getHasStack()) {
            return 0;
        }
        return 1;
    }
    else {
        if (!arg1.getHasStack()) {
            return -1;
        }
        final EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
        final boolean sneak = player.movementInput.sneak;
        player.movementInput.sneak = false;
        final String i1 = this.concat(arg0.getStack().getTooltip((EntityPlayer)Minecraft.getMinecraft().thePlayer, true));
        final String i2 = this.concat(arg1.getStack().getTooltip((EntityPlayer)Minecraft.getMinecraft().thePlayer, true));
        player.movementInput.sneak = sneak;
        final int a = i1.compareTo(i2);
        if (a != 0) {
            return a;
        }
        final int b = arg0.getStack().getItem().getUnlocalizedName().compareTo(arg0.getStack().getItem().getUnlocalizedName());
        if (b != 0) {
            return b;
        }
        final int c = this.intCompare(arg0.getStack().getItemDamage(), arg0.getStack().getItemDamage());
        if (c != 0) {
            return c;
        }
        return 0;
    }
}
项目:4Space-5    文件:EventHandlerMars.java   
@SubscribeEvent
public void onPlayerWakeUp(EventWakePlayer event)
{
    ChunkCoordinates c = event.entityPlayer.playerLocation;
    Block blockID = event.entityPlayer.worldObj.getBlock(c.posX, c.posY, c.posZ);
    int metadata = event.entityPlayer.worldObj.getBlockMetadata(c.posX, c.posY, c.posZ);

    if (blockID == MarsBlocks.machine && metadata >= BlockMachineMars.CRYOGENIC_CHAMBER_METADATA)
    {
        if (!event.flag1 && event.flag2 && event.flag3)
        {
            event.result = EnumStatus.NOT_POSSIBLE_HERE;

            if (event.entityPlayer.worldObj.isRemote && event.bypassed && event.entityPlayer instanceof EntityClientPlayerMP)
            {
                GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMars(EnumSimplePacketMars.S_WAKE_PLAYER, new Object[] { }));
            }
        }
        else if (!event.flag1 && !event.flag2 && event.flag3)
        {
            if (!event.entityPlayer.worldObj.isRemote)
            {
                event.entityPlayer.heal(5.0F);
                GCPlayerStats.get((EntityPlayerMP) event.entityPlayer).cryogenicChamberCooldown = 6000;

                for (WorldServer worldServer : MinecraftServer.getServer().worldServers)
                {
                    worldServer.setWorldTime(0);
                }
            }
        }
    }
}
项目:4Space-5    文件:GCPlayerHandler.java   
@SideOnly(Side.CLIENT)
public void onEntityConstructingClient(EntityEvent.EntityConstructing event)
{
    if (event.entity instanceof EntityClientPlayerMP)
    {
        if (GCPlayerStatsClient.get((EntityClientPlayerMP) event.entity) == null)
        {
            GCPlayerStatsClient.register((EntityClientPlayerMP) event.entity);          
        }

        Minecraft.getMinecraft().gameSettings.sendSettingsToServer();
    }
}
项目:4Space-5    文件:PlayerUtil.java   
@SideOnly(Side.CLIENT)
public static EntityClientPlayerMP getPlayerBaseClientFromPlayer(EntityPlayer player, boolean ignoreCase)
{
    EntityClientPlayerMP clientPlayer = FMLClientHandler.instance().getClientPlayerEntity();

    if (clientPlayer == null && player != null)
    {
        GCLog.severe("Warning: Could not find player base client instance for player " + player.getGameProfile().getName());
    }

    return clientPlayer;
}
项目:4Space-5    文件:TickHandlerClient.java   
@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;
                }
            }
        }
    }
}
项目:SignPicture    文件:SignEntity.java   
public @Nullable TileEntitySign capturePlace() {
    final EntityClientPlayerMP player = Client.mc.thePlayer;
    final WorldClient world = Client.mc.theWorld;
    if (player!=null&&world!=null) {
        final MovingObjectPosition m = MovePos.getMovingPos();
        final MovePos p = MovePos.getBlockPos();
        if (m!=null&&p!=null) {
            setVisible(true);
            return onItemUse(player, world, p.x, p.y, p.z, m.sideHit);
        }
    }
    return null;
}
项目:OpenTeleporter    文件:PacketPlayerPosition.java   
@Override
public IMessage onMessage(PacketPlayerPosition message, MessageContext ctx) {
    if(ctx.side == Side.CLIENT){
        EntityClientPlayerMP thePlayer = Minecraft.getMinecraft().thePlayer;
        thePlayer.setPosition(message.x, message.y, message.z);
    }
    return null;
}
项目:FissionWarfare    文件:GuiTeamManager.java   
public void addTeam() {

    if (!teamField.getText().isEmpty()) {

        ((EntityClientPlayerMP)player).sendChatMessage("/scoreboard teams add " + teamField.getText()); 
        teamField.setText("");
    }
}
项目:FissionWarfare    文件:GuiTeamManager.java   
public void addPlayer() {

    if (getSelectedTeam() != null && !playerField.getText().isEmpty()) {

        ((EntityClientPlayerMP)player).sendChatMessage("/scoreboard teams join " + getSelectedTeam().getRegisteredName() + " " + playerField.getText());    
        playerField.setText("");
    }   
}
项目:PopularMMOS-EpicProportions-Mod    文件:blockBirthdayPresent.java   
@SideOnly(Side.CLIENT)
   public void presentOpened(){
    EntityClientPlayerMP event1 = Minecraft.getMinecraft().thePlayer;
        /*
    if(true){
    if(entity instanceof EntityPlayer)((EntityPlayer)entity).addStat(Achievements.achievementpresent, l);
    }
         */
    //event1.addStat(Stats.presentsbroken, 1);
    //event1.triggerAchievement(Achievements.achievementpresent);
    //event1.addChatComponentMessage(new ChatComponentText("�b�lHappy Birthday" + event1.getDisplayName() + "�b�l!"));

}
项目:Coding    文件:DragonPlayerUpdateDragonName.java   
@Override
public IMessage onMessage(DragonPlayerUpdateDragonName message, MessageContext ctx) {
    EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
    if (player != null) {
        DragonPlayer dragonPlayer = DragonPlayer.get(player);
        if (dragonPlayer != null)
            dragonPlayer.setDragonName(message.text);
    }
    return null;
}
项目:Coding    文件:DragonAbilityLavaToObsidian.java   
@Override
public IMessage onMessage(DragonAbilityLavaToObsidian message, MessageContext ctx) {
    EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
    for (int i = 0; i < 10; i++) {
        float d0 = player.worldObj.rand.nextFloat() - 0.5F;
            player.worldObj.spawnParticle("splash", message.x + d0, message.y + d0 + 1.0F, message.z + d0, 0, 0, 0);
    }
    return null;
}