Java 类net.minecraftforge.client.event.RenderPlayerEvent 实例源码

项目:Proxys-Lib    文件:SpecialPeopleCapeHandler.java   
@SubscribeEvent
public static void onRenderPlayer(RenderPlayerEvent.Post event)
{
    EntityPlayer player = event.getEntityPlayer();
    String uuid = player.getUUID(player.getGameProfile()).toString();
    if(player instanceof AbstractClientPlayer && UUIDS.contains(uuid) && !done.contains(player))
    {
        AbstractClientPlayer clplayer = (AbstractClientPlayer) player;
        if(clplayer.hasPlayerInfo())
        {
            NetworkPlayerInfo info = ReflectionHelper.getPrivateValue(AbstractClientPlayer.class, clplayer, ObfuscatedNames.PLAYER_INFO);
            Map<MinecraftProfileTexture.Type, ResourceLocation> textures = ReflectionHelper.getPrivateValue(NetworkPlayerInfo.class, info, ObfuscatedNames.PLAYER_TEXTURES);
            ResourceLocation loc = new ResourceLocation("proxyslib", "textures/whoknows/special_cape.png");
            textures.put(MinecraftProfileTexture.Type.CAPE, loc);
            textures.put(MinecraftProfileTexture.Type.ELYTRA, loc);
            done.add(player);
        }
    }
}
项目:Proxys-Lib    文件:NekoCapeHandler.java   
@SubscribeEvent
public static void onRenderPlayer(RenderPlayerEvent.Post event)
{
    EntityPlayer player = event.getEntityPlayer();
    String uuid = player.getUUID(player.getGameProfile()).toString();
    if(player instanceof AbstractClientPlayer && UUIDS.contains(uuid) && !done.contains(player))
    {
        AbstractClientPlayer clplayer = (AbstractClientPlayer) player;
        if(clplayer.hasPlayerInfo())
        {
            NetworkPlayerInfo info = ReflectionHelper.getPrivateValue(AbstractClientPlayer.class, clplayer, ObfuscatedNames.PLAYER_INFO);
            Map<MinecraftProfileTexture.Type, ResourceLocation> textures = ReflectionHelper.getPrivateValue(NetworkPlayerInfo.class, info, ObfuscatedNames.PLAYER_TEXTURES);
            ResourceLocation loc = new ResourceLocation("proxyslib", "textures/whoknows/dev_cape.png");
            textures.put(MinecraftProfileTexture.Type.CAPE, loc);
            textures.put(MinecraftProfileTexture.Type.ELYTRA, loc);
            done.add(player);
        }
    }
}
项目:Mods    文件:SpinToWin.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void renderPlayer(RenderPlayerEvent.Pre event) {
    if(event.getEntity().getDataManager().get(SPIN_TIME)){

        event.getRenderer().getMainModel().rightArmPose=ArmPose.BOW_AND_ARROW;
        GlStateManager.pushMatrix();
        ItemStack stack=event.getEntityPlayer().getHeldItemMainhand();
        int spinCooldown=this.getSpinCooldown(stack, event.getEntityPlayer());
        if(event.getEntityPlayer().getEntityData().getInteger("SpinTime")>this.getDuration(stack, event.getEntityPlayer())-spinCooldown*0.8f){
            GlStateManager.rotate((this.getDuration(stack, event.getEntityPlayer())-
                    (event.getEntity().getEntityData().getInteger("SpinTime")-event.getPartialRenderTick()))*-(90/this.getSpinCooldown(stack, event.getEntityPlayer())), 0, 1, 0);
        }
        else{
            GlStateManager.rotate((this.getDuration(stack, event.getEntityPlayer())-
                    (event.getEntity().getEntityData().getInteger("SpinTime")-event.getPartialRenderTick()))*(360/this.getSpinCooldown(stack, event.getEntityPlayer())), 0, 1, 0);
        }

    }
}
项目:Mods    文件:TF2EventsClient.java   
@SubscribeEvent
public void renderPlayer(RenderPlayerEvent.Pre event) {
    if (event.getEntityPlayer() != Minecraft.getMinecraft().player) {
        renderBeam(event.getEntityPlayer(), event.getPartialRenderTick());
        /*
         * InventoryWearables
         * inventory=event.getEntityPlayer().getCapability(TF2weapons.
         * INVENTORY_CAP, null); for(int
         * i=0;i<inventory.getInventoryStackLimit();i++){ ItemStack
         * stack=inventory.getStackInSlot(i); if(stack!=null){
         * GlStateManager.pushMatrix();
         * event.getRenderer().getMainModel().bipedHead.postRender(0.0625f);
         * GlStateManager.translate(0.0F, -0.25F, 0.0F);
         * GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
         * GlStateManager.scale(0.625F, -0.625F, -0.625F);
         * 
         * Minecraft.getMinecraft().getItemRenderer().renderItem(event.
         * getEntityPlayer(), stack,
         * ItemCameraTransforms.TransformType.HEAD);
         * GlStateManager.popMatrix(); } }
         */
    }
}
项目:ExtraUtilities    文件:RenderItemGlove.java   
@SubscribeEvent
public void renderEquippedGlove(final RenderPlayerEvent.Specials.Post event) {
    if (event.entityPlayer == null) {
        return;
    }
    final ItemStack heldItem = event.entityPlayer.getHeldItem();
    if (heldItem == null || heldItem.getItem() != ExtraUtils.glove) {
        return;
    }
    final int dmg = heldItem.getItemDamage();
    final RenderPlayer renderplayer = event.renderer;
    float[] col = EntitySheep.fleeceColorTable[ItemGlove.getColIndex(1, dmg)];
    GL11.glColor3f(col[0], col[1], col[2]);
    Minecraft.getMinecraft().getTextureManager().bindTexture(RenderItemGlove.glove1);
    renderplayer.modelBipedMain.bipedRightArm.render(0.0625f);
    col = EntitySheep.fleeceColorTable[ItemGlove.getColIndex(0, dmg)];
    GL11.glColor3f(col[0], col[1], col[2]);
    Minecraft.getMinecraft().getTextureManager().bindTexture(RenderItemGlove.glove2);
    renderplayer.modelBipedMain.bipedRightArm.render(0.0625f);
}
项目:4Space-5    文件:ClientProxyCore.java   
@SubscribeEvent
public void onRenderPlayerPre(RenderPlayerEvent.Pre event)
{
    GL11.glPushMatrix();

    final EntityPlayer player = event.entityPlayer;

    if (player.ridingEntity instanceof EntityTieredRocket && player == Minecraft.getMinecraft().thePlayer
            && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0)
    {
        EntityTieredRocket entity = (EntityTieredRocket) player.ridingEntity;
        GL11.glTranslatef(0, -entity.getRotateOffset() - PLAYER_Y_OFFSET, 0);
        float anglePitch = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * event.partialRenderTick;
        float angleYaw = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * event.partialRenderTick;
        GL11.glRotatef(-angleYaw, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(anglePitch, 0.0F, 0.0F, 1.0F);
        GL11.glTranslatef(0, entity.getRotateOffset() + PLAYER_Y_OFFSET, 0);
    }

    //Gravity - freefall - jetpack changes in player model orientation can go here
}
项目:metamorph    文件:RenderingHandler.java   
/**
 * Pop the matrix if animation is running 
 */
@SubscribeEvent
public void onPlayerPostRender(RenderPlayerEvent.Post event)
{
    EntityPlayer player = event.getEntityPlayer();
    IMorphing capability = Morphing.get(player);

    /* No morph, no problem */
    if (capability == null)
    {
        return;
    }

    if (capability.isAnimating())
    {
        GlStateManager.popMatrix();
    }
}
项目:FissionWarfare    文件:GunRenderEvent.java   
@SubscribeEvent(priority=EventPriority.LOW)
public void gunRenderEvent(RenderPlayerEvent.Pre event) {

    ItemStack item = event.entityPlayer.getHeldItem();

    RenderPlayer rp = event.renderer;

    if (item != null && item.getItem() instanceof ItemGun) {

        rp.modelBipedMain.aimedBow = true;
        rp.modelArmor.aimedBow = true;
        rp.modelArmorChestplate.aimedBow = true;
    } 

    else {
        rp.modelBipedMain.aimedBow = false;
        rp.modelArmor.aimedBow = false;
        rp.modelArmorChestplate.aimedBow = false;
    }
}
项目:RFDrills    文件:PlayerRenderHandler.java   
@SubscribeEvent
public void onPlayerRender(RenderPlayerEvent.Pre event){ //handles 3rd person rendering
    if(ConfigHandler.animationType == 1) {
        if (event.entityPlayer == null || event.entityPlayer.getCurrentEquippedItem() == null)
            return;
        ItemStack equippedStack = event.entityPlayer.getCurrentEquippedItem();

        if (equippedStack.getItem() instanceof IEnergyTool && equippedStack.getItem().getItemUseAction(equippedStack) == EnumAction.bow) {
            if (event.entityPlayer.isSwingInProgress) {
                event.renderer.modelArmor.aimedBow = true;
                event.renderer.modelArmorChestplate.aimedBow = true;
                event.renderer.modelBipedMain.aimedBow = true;
            }
        }
    }
}
项目:FusionWarfare    文件:GunRenderEvent.java   
@SubscribeEvent(priority=EventPriority.LOW)
public void gunRenderEvent(RenderPlayerEvent.Pre event) {

    ItemStack item = event.entityPlayer.getHeldItem();

    RenderPlayer rp = event.renderer;

    if (item != null && (item.getItem() instanceof ItemFusionGun || item.getItem() instanceof ItemRocketLauncher)) {

        rp.modelBipedMain.aimedBow = true;
        rp.modelArmor.aimedBow = true;
        rp.modelArmorChestplate.aimedBow = true;
    } else {
        rp.modelBipedMain.aimedBow = false;
        rp.modelArmor.aimedBow = false;
        rp.modelArmorChestplate.aimedBow = false;
    }
}
项目:ComponentEquipment    文件:PlayerArmorRenderer.java   
@SubscribeEvent
public void onArmorRender( RenderPlayerEvent.SetArmorModel event )
{
    if ( event.stack == null || !( event.stack.getItem() instanceof ArmorItem ) )
    {
        return;
    }
    event.result = 1;
    ArmorItem item = ( ArmorItem ) event.stack.getItem();

    ArmorModel model = ( ArmorModel ) item.getArmorModel( event.entityLiving, event.stack, event.slot );
    model.isSneak = event.entityLiving.isSneaking();
    if ( event.entityLiving instanceof EntityPlayer )
    {
        ItemStack held = event.entityPlayer.inventory.getCurrentItem();
        model.heldItemRight = ( held != null ) ? 0 : 1;
        if ( held != null )
        {
            model.aimedBow = event.entityPlayer.getItemInUseCount() > 0 && held.getItemUseAction().equals( EnumAction.bow );
        }
    }
    event.renderer.setRenderPassModel( model );
}
项目:multishot    文件:RenderEventHandler.java   
@SubscribeEvent
public void onRenderPlayerPre(RenderPlayerEvent.Pre event)
{
    if (Configs.getUseFreeCamera() && (State.getMotion() || State.getRecording()))
    {
        RenderManager manager = this.mc.getRenderManager();

        // This (plus the onRenderLivingPre to reset this) fixes the player not getting rendered
        // in the free camera view in single player because of the !entity.isUser() check in RenderPlayer.doRender().
        if (this.renderingFreeCamera && event.getEntityPlayer().isUser())
        {
            this.viewEntityOriginal = manager.renderViewEntity;
            manager.renderViewEntity = this.mc.player;
        }
    }
}
项目:Nuclear-Control    文件:RenderEventHandler.java   
@SubscribeEvent
public void renderPlayer(RenderPlayerEvent.Specials.Pre event) {
    AbstractClientPlayer player = (AbstractClientPlayer) event.entityPlayer;

    UserManager manager = UserManager.INSTANCE;
    User user = manager.getUser(player.getCommandSenderName());
    if (user == null) return;

    ICape cape = user.capes.get(0);
    if (cape == null) return;

    boolean flag = cape.isTextureLoaded(player);
    if (!flag) {
        cape.loadTexture(player);
    }
}
项目:SolderCraft    文件:RenderEventHandler.java   
@SubscribeEvent
public void renderPlayer(RenderPlayerEvent.Specials.Pre event) {
    AbstractClientPlayer player = (AbstractClientPlayer) event.entityPlayer;

    UserManager manager = UserManager.getInstance();
    User user = manager.getUser(player.getCommandSenderName());
    if (user == null) return;

    ICape cape = user.capes.get(0);
    if (cape == null) return;

    boolean flag = cape.isTextureLoaded(player);
    if (!flag) {
        cape.loadTexture(player);
    }
}
项目:mcpvp-mod    文件:RenderEventHandler.java   
@SubscribeEvent
public void renderPlayer(RenderPlayerEvent.Specials.Pre event) {
    AbstractClientPlayer player = (AbstractClientPlayer) event.entityPlayer;

    UserManager manager = UserManager.INSTANCE;
    User user = manager.getUser(player.getCommandSenderName());
    if (user == null) return;

    ICape cape = user.capes.get(0);
    if (cape == null) return;

    boolean flag = cape.isTextureLoaded(player);
    if (!flag) {
        cape.loadTexture(player);
    }
}
项目:AdventureBackpack2    文件:RenderHandler.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void playerSpecialsRendering(RenderPlayerEvent.Specials.Pre event)
{

    float rotationY = event.renderer.modelBipedMain.bipedBody.rotateAngleY;
    float rotationX = event.renderer.modelBipedMain.bipedBody.rotateAngleX;
    float rotationZ = event.renderer.modelBipedMain.bipedBody.rotateAngleZ;

    double x = event.entity.posX;
    double y = event.entity.posY;
    double z = event.entity.posZ;

    float pitch = event.entity.rotationPitch;
    float yaw = event.entity.rotationYaw;
    ClientProxy.rendererWearableEquipped.render(event.entity, x, y, z, rotationX, rotationY, rotationZ, pitch, yaw);

    event.renderCape = false;
}
项目:FantasyCraft-Mod    文件:FCraftEffectsHandler.java   
@SideOnly(Side.CLIENT)
@ForgeSubscribe(priority = EventPriority.HIGHEST)
public void miniPre(RenderPlayerEvent.Pre event){
    if(((EntityLivingBase) event.entity).isPotionActive(FCraftPotions.miniPot)){
        GL11.glPushMatrix();
        GL11.glScalef(0.2F, 0.2F, 0.2F);
        //GL11.glTranslatef(0, -6.5F, 0);
        if(event.entity instanceof EntityPlayer){
            EntityPlayer player = (EntityPlayer) event.entity;
            player.height = 0.5F;
            player.yOffset = 0.55F;
            mc.thePlayer.eyeHeight = 0.02F;
            player.boundingBox.setBounds(player.posX - (double)player.width/2.0F, player.posY - (double)player.yOffset + (double)player.ySize, player.posZ - (double)player.width/2.0F, player.posX + (double)player.width/2.0F, player.posY - (double)player.yOffset + (double)player.ySize + (double)player.height, player.posZ + (double)player.width/2.0F);
        }
    }
}
项目:Realms-of-Chaos    文件:RenderEventHandler.java   
@SubscribeEvent
public void renderPlayer(RenderPlayerEvent.Specials.Pre event) {
    AbstractClientPlayer player = (AbstractClientPlayer) event.entityPlayer;

    UserManager manager = UserManager.INSTANCE;
    User user = manager.getUser(player.getCommandSenderName());
    if (user == null) return;

    ICape cape = user.capes.get(0);
    if (cape == null) return;

    boolean flag = cape.isTextureLoaded(player);
    if (!flag) {
        cape.loadTexture(player);
    }
}
项目:BetterChests    文件:ClientEventListener.java   
@SubscribeEvent
public void renderPlayer(RenderPlayerEvent.Post event) {
    EntityPlayer player = event.getEntityPlayer();

    ItemStack bag = getBagInInv(player);

    if (!bag.isEmpty()) {
        GL11.glPushMatrix();

        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glTranslatef(0.0F, 17 * ONE_PIXEL, 0.0F);
        GL11.glRotatef( - player.renderYawOffset, 0.0F, 1.0F, 0.0F);
        GL11.glTranslatef(0.0F, 0.0F, -4 * ONE_PIXEL);
        if (player.isSneaking()) {
            GL11.glTranslatef(0, -5 * ONE_PIXEL, 0);
            GL11.glRotatef(28.6F, 1.0F, 0.0F, 0.0F);
            GL11.glTranslatef(0, 0, -3 * ONE_PIXEL);
        }

        Minecraft.getMinecraft().getRenderItem().renderItem(bag, TransformType.FIXED);
        GL11.glPopMatrix();
    }
}
项目:CodeLyokoMod    文件:RenderEventHandler.java   
@SubscribeEvent
public void renderPlayer(RenderPlayerEvent.Specials.Pre event) {
    AbstractClientPlayer player = (AbstractClientPlayer) event.entityPlayer;

    UserManager manager = UserManager.getInstance();
    User user = manager.getUser(player.getCommandSenderName());
    if (user == null) return;

    ICape cape = user.capes.get(0);
    if (cape == null) return;

    boolean flag = cape.isTextureLoaded(player);
    if (!flag) {
        cape.loadTexture(player);
    }
}
项目:DeveloperCapes    文件:RenderEventHandler.java   
@SubscribeEvent
public void renderPlayer(RenderPlayerEvent.Specials.Pre event) {
    AbstractClientPlayer player = (AbstractClientPlayer) event.entityPlayer;

    UserManager manager = UserManager.getInstance();
    User user = manager.getUser(player.getUniqueID().toString());
    if (user == null) return;

    ICape cape = user.capes.get(0);
    if (cape == null) return;

    boolean flag = cape.isTextureLoaded(player);
    if (!flag) {
        cape.loadTexture(player);
    }
}
项目:MineCamera    文件:EventLoader.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void renderPlayerPre(RenderPlayerEvent.Pre event) {
    Minecraft mc = Minecraft.getMinecraft();
    renderEntity = mc.getRenderManager().renderViewEntity;
    mc.getRenderManager().renderViewEntity = mc.thePlayer;
    mc.entityRenderer.loadEntityShader(mc.thePlayer);
}
项目:MineCamera    文件:EventLoader.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void renderPlayerPost(RenderPlayerEvent.Post event) {
    Minecraft mc = Minecraft.getMinecraft();
    // System.out.println(Minecraft.getMinecraft().thePlayer.getMirroredYaw(Mirror.LEFT_RIGHT));
    mc.getRenderManager().renderViewEntity = renderEntity;
}
项目:connor41-etfuturum2    文件:ClientEventHandler.java   
@SubscribeEvent
public void renderPlayerEventPre(RenderPlayerEvent.Pre event) {
    if (EtFuturum.enableTransparentAmour) {
        OpenGLHelper.enableBlend();
        OpenGLHelper.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    }
}
项目:Possessed    文件:ClientEventHandler.java   
@SubscribeEvent
public void onPlayerRenderPre(RenderPlayerEvent.Pre event) {
    EntityPlayer player = event.getEntityPlayer();
    PossessivePlayer possessivePlayer = PossessHandler.get(player);
    if (possessivePlayer != null) {
        float partialTicks = event.getPartialRenderTick();
        float animation = Math.min(PossessivePlayer.POSSESS_ANIMATION_LENGTH, Math.max(0.0F, possessivePlayer.getPossessAnimation() + (possessivePlayer.isPossessing() ? partialTicks : -partialTicks)));
        RenderManager renderManager = ClientEventHandler.MINECRAFT.getRenderManager();
        boolean renderShadow = renderManager.isRenderShadow();
        EntityLivingBase entity = possessivePlayer.getPossessing();
        renderManager.setRenderShadow(false);
        GlStateManager.pushMatrix();
        int light = !entity.isBurning() ? entity.getBrightnessForRender(partialTicks) : 0xF000F0;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, light % 0x10000, light / 0x10000);
        if (!possessivePlayer.isAnimating()) {
            if (ClientEventHandler.MINECRAFT.currentScreen != null) {
                possessivePlayer.update(player, true);
            }
            event.setCanceled(true);
        }
        if (!(entity.isDead && entity.deathTime > 20)) {
            renderManager.doRenderEntity(entity, event.getX(), event.getY(), event.getZ(), entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks, partialTicks, true);
        }
        GlStateManager.popMatrix();
        renderManager.setRenderShadow(renderShadow);
        if (possessivePlayer.isAnimating()) {
            GlStateManager.pushMatrix();
            float renderAnimation = 1.0F - animation / PossessivePlayer.POSSESS_ANIMATION_LENGTH;
            GlStateManager.translate((possessivePlayer.getOriginalX() - (player.prevPosX + (player.posX - player.prevPosX) * partialTicks)) * renderAnimation, (possessivePlayer.getOriginalY() - (player.prevPosY + (player.posY - player.prevPosY) * partialTicks)) * renderAnimation, (possessivePlayer.getOriginalZ() - (player.prevPosZ + (player.posZ - player.prevPosZ) * partialTicks)) * renderAnimation);
            float scale = renderAnimation * 0.5F + 0.5F;
            GlStateManager.scale(scale, scale, scale);
            GlStateManager.color(1.0F, 1.0F, 1.0F, renderAnimation);
        }
    }
}
项目:Possessed    文件:ClientEventHandler.java   
@SubscribeEvent
public void onPlayerRenderPost(RenderPlayerEvent.Post event) {
    EntityPlayer player = event.getEntityPlayer();
    PossessivePlayer possessivePlayer = PossessHandler.get(player);
    if (possessivePlayer != null) {
        if (possessivePlayer.isAnimating()) {
            GlStateManager.popMatrix();
        }
    }
}
项目:4Space-5    文件:ClientProxyCore.java   
@SubscribeEvent
public void onRenderPlayerEquipped(RenderPlayerEvent.Specials.Pre event)
{
    final Entity ridden = event.entityPlayer.ridingEntity;
    if (ridden instanceof EntityAutoRocket || ridden instanceof EntityLanderBase)
    {
        event.setCanceled(true);
    }
}
项目:CrystalMod    文件:DisguiseClientHandler.java   
@SubscribeEvent
  @SideOnly(Side.CLIENT)
  public void onRenderPlayerPre(RenderPlayerEvent.Pre event)
  {
if(event.getRenderer() !=null && event.getRenderer() instanceof RenderMiniPlayer){
    return;
}
ExtendedPlayer ePlayer = ExtendedPlayerProvider.getExtendedPlayer(event.getEntityPlayer());
if(ePlayer !=null && (ePlayer.getPlayerDisguiseUUID() !=null || ePlayer.isMini()))
      {
          event.setCanceled(true);
          float f1 = event.getEntityPlayer().prevRotationYaw + (event.getEntityPlayer().rotationYaw - event.getEntityPlayer().prevRotationYaw) * event.getPartialRenderTick();
          if(Minecraft.getMinecraft().getRenderManager().renderEngine != null && Minecraft.getMinecraft().getRenderManager().renderViewEntity != null && Minecraft.getMinecraft().getRenderManager() !=null)
          {
            if(event.getEntityPlayer() instanceof AbstractClientPlayer){
                if(miniPlayer.renderNormal.getRenderManager() == null){
                    miniPlayer.renderNormal = new RenderMiniPlayer(Minecraft.getMinecraft().getRenderManager(), false);
                }
                if(miniPlayer.renderSlim.getRenderManager() == null){
                    miniPlayer.renderSlim = new RenderMiniPlayer(Minecraft.getMinecraft().getRenderManager(), true);
                }

                UUID renderUUID = event.getEntityPlayer().getUniqueID();
                if(ePlayer.getPlayerDisguiseUUID() !=null){
                    renderUUID = ePlayer.getPlayerDisguiseUUID();
                }
                PlayerSkin skin = DownloadedTextures.getPlayerSkin(renderUUID);
                String type = skin.getSkinType();
                if(type == "slim")miniPlayer.renderSlim.doRender((AbstractClientPlayer) event.getEntityPlayer(), event.getX(), event.getY(), event.getZ(), f1, event.getPartialRenderTick());
                else miniPlayer.renderNormal.doRender((AbstractClientPlayer) event.getEntityPlayer(), event.getX(), event.getY(), event.getZ(), f1, event.getPartialRenderTick());
            }
          }
      }
  }
项目:Wizardry    文件:CapeHandler.java   
@SubscribeEvent
public void onPlayerRender(RenderPlayerEvent.Post event) {
    EntityPlayer player = event.getEntityPlayer();
    float delta = event.getPartialRenderTick();

    boolean iWalked = new Vec3d(player.posX, player.posY, player.posZ).distanceTo(new Vec3d(player.prevPosX, player.prevPosY, player.prevPosZ)) > 0.15;

    if (!player.isInvisible() && ((player.getActivePotionEffect(ModPotions.VANISH) != null && iWalked) || player.getActivePotionEffect(ModPotions.VANISH) == null))
        if (delta < 1) { // not rendering in inventory
            double x = -TileEntityRendererDispatcher.staticPlayerX;
            double y = -TileEntityRendererDispatcher.staticPlayerY;
            double z = -TileEntityRendererDispatcher.staticPlayerZ;
            instance().getCape(player).render(player, x, y, z, delta);
        }
}
项目:Aether-Legacy    文件:AetherClientEvents.java   
@SubscribeEvent
public void onInvisibilityPlayerUpdate(RenderPlayerEvent.Pre event)
{
    EntityPlayer player = event.getEntityPlayer();
    PlayerAether playerAether = PlayerAether.get(player);

    if (playerAether != null)
    {
        if (playerAether.wearingAccessory(ItemsAether.invisibility_cape))
        {
            event.setCanceled(true);
        }
    }
}
项目:VivecraftForgeExtensions    文件:HandlerRenderEvent.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onRenderPlayerPre(RenderPlayerEvent.Pre event) {
    if (ProxyClient.isVRPlayer(event.entityPlayer)) {
        VRPlayerData data = ProxyClient.vrPlayerIds.get(event.entityPlayer.getEntityId());
        ModelBiped model = event.renderer.modelBipedMain;
        model.bipedHead.showModel = false;
        model.bipedLeftArm.showModel = data.seated;
        model.bipedRightArm.showModel = data.seated;
        model.bipedHeadwear.showModel = false;
        event.entityPlayer.ignoreFrustumCheck = true;
    }
}
项目:VivecraftForgeExtensions    文件:HandlerRenderEvent.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onRenderPlayerPost(RenderPlayerEvent.Post event) {
    if (ProxyClient.isVRPlayer(event.entityPlayer)) {
        ModelBiped model = event.renderer.modelBipedMain;
        model.bipedHead.showModel = true;
        model.bipedLeftArm.showModel = true;
        model.bipedRightArm.showModel = true;
        model.bipedHeadwear.showModel = true;
    }
}
项目:VivecraftForgeExtensions    文件:HandlerRenderEvent.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onRenderPlayerSpecials(RenderPlayerEvent.Specials.Pre event) {
    if (ProxyClient.isVRPlayer(event.entityPlayer)) {
        VRPlayerData data = ProxyClient.vrPlayerIds.get(event.entityPlayer.getEntityId());
        event.renderHelmet = false;
        event.renderItem = data.seated;
    }
}
项目:InfinityLib    文件:PlayerStateHandler.java   
@SideOnly(Side.CLIENT)
private void cancelRenderEvent(RenderPlayerEvent event) {
    if(getState(event.getEntityPlayer()).isInvisible()) {
        if(event.isCancelable()) {
            event.setCanceled(true);
        }
        event.setResult(Event.Result.DENY);
    }
}
项目:InfinityLib    文件:ArmSwingHandler.java   
@SubscribeEvent
@SuppressWarnings("unused")
public void onPlayerRenderCall(RenderPlayerEvent.Pre event) {
    ModelPlayer model = event.getRenderer().getMainModel();
    if(model instanceof ModelPlayerCustomized) {
        float left = this.getSwingProgress(event.getEntityPlayer(), EnumHand.OFF_HAND, event.getPartialRenderTick());
        float right = this.getSwingProgress(event.getEntityPlayer(), EnumHand.MAIN_HAND, event.getPartialRenderTick());
        ((ModelPlayerCustomized) model).setSwingProgress(left, right);
    }
}
项目:Fallout_Equestria    文件:EventPlayerRenders.java   
@SubscribeEvent
public void onRenderEntity(RenderPlayerEvent.Pre event) {
    if (event.getEntity() instanceof EntityPlayer && !done) {
        EntityPlayer player = (EntityPlayer) event.getEntity();
        event.getRenderer().addLayer(new GunRender(event.getRenderer().getRenderManager().getSkinMap().get(player)));
        event.getRenderer().addLayer(new ArmorLayerRender(event.getRenderer().getRenderManager().getSkinMap().get(player)));
        done = true;
    }
}
项目:Fallout_Equestria    文件:EventPlayerRenders.java   
@SubscribeEvent(receiveCanceled = true)
public void onWeaponCarry(RenderPlayerEvent.Post event) {
    if (event.getEntity() instanceof EntityPlayer && !done) {
        EntityPlayer player = (EntityPlayer) event.getEntity();
        if (player.getHeldItemMainhand().getItem() instanceof Item_Firearm) {
            event.isCanceled();
            event.getRenderer().getMainModel().rightArmPose.equals(ModelBiped.ArmPose.EMPTY);
        }
    }
}
项目:Factorization    文件:NeptuneCape.java   
@SubscribeEvent
public void renderLmp(RenderPlayerEvent.Pre event) {
    if (invalid) return;
    EntityPlayer player = event.entityPlayer;
    if (dirty) {
        dirty = false;
        injectModel(player);
    }
    should_render_mask = !hideMask(player) && isNameWhitelisted(player.getName());
    if (should_render_mask) {
        LmpMaskRenderer.rendering_player = (AbstractClientPlayer) player;
    }
}
项目:SAO-UI---1.8    文件:RenderHandler.java   
static void renderPlayer(RenderPlayerEvent.Post e) {
    if (!OptionCore.UI_ONLY.getValue()) {
        if (e.entityPlayer != null) {
            StaticRenderer.render(e.renderer.getRenderManager(), e.entityPlayer, e.entityPlayer.posX, e.entityPlayer.posY, e.entityPlayer.posZ);
        }
    }
}
项目:Coding    文件:DragonPlayerEventHandler.java   
@SubscribeEvent
    public void OnPlayerRender(RenderPlayerEvent.Pre event) {
        if (DragonPlayer.get((EntityPlayer) event.entity).isDragon()) {
            event.setCanceled(true);
//          this.setSize(0.6F, 1.62F); // normal player size

            // shorter dragon hit box (not tested)
//          event.entityPlayer.height = 1.62F;      // normally 1.62F
//          event.entityPlayer.boundingBox.maxY = event.entityPlayer.boundingBox.minY + event.entityPlayer.height;

            // Longer dragon hit box (works as long as it is square)
//          event.entityPlayer.width = 1.5F;
//          event.entityPlayer.boundingBox.maxZ = event.entityPlayer.boundingBox.minZ + event.entityPlayer.width;
//          event.entityPlayer.boundingBox.maxX = event.entityPlayer.boundingBox.minX + event.entityPlayer.width;

            // Hit box more centered
//          event.entityPlayer.yOffset =  0.92F;    // normally 1.62F
//          event.entityPlayer.eyeHeight = event.entityPlayer.yOffset - 1.5F;  // normally 0.12F
//          renderPlayerDragon.doRender(event.entityPlayer, 0D, -0.4D, 0D, 0F, 0F);

            // Below sort of works, gets stuck once in awhile
//          event.entityPlayer.eyeHeight = 1.12F;  // normally 0.12F
//          event.entityPlayer.yOffset =  0.62F;    // normally 1.62F
//          renderPlayerDragon.doRender(event.entityPlayer, 0D, -0.4D, 0D, 0F, 0F);

            String dragon = DragonPlayer.get((EntityPlayer) event.entity).getDragonName();
            IDragonRendererCreationHandler renderPlayerDragon = DragonRegistry.instance().getDragonRenderer(dragon);
            ((Render) renderPlayerDragon).doRender(event.entityPlayer, 0D, -1.4D, 0D, 0F, 0F);
            // Old single setting:
//          renderPlayerDragon.doRender(event.entityPlayer, 0D, -1.4D, 0D, 0F, 0F);
        }
    }