当前位置: 首页>>代码示例>>Java>>正文


Java RenderPlayerEvent.Post方法代码示例

本文整理汇总了Java中net.minecraftforge.client.event.RenderPlayerEvent.Post方法的典型用法代码示例。如果您正苦于以下问题:Java RenderPlayerEvent.Post方法的具体用法?Java RenderPlayerEvent.Post怎么用?Java RenderPlayerEvent.Post使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.client.event.RenderPlayerEvent的用法示例。


在下文中一共展示了RenderPlayerEvent.Post方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onRenderPlayer

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
@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);
        }
    }
}
 
开发者ID:ProxyNeko,项目名称:Proxys-Lib,代码行数:20,代码来源:SpecialPeopleCapeHandler.java

示例2: onRenderPlayer

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
@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);
        }
    }
}
 
开发者ID:ProxyNeko,项目名称:Proxys-Lib,代码行数:20,代码来源:NekoCapeHandler.java

示例3: onPlayerPostRender

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:mchorse,项目名称:metamorph,代码行数:21,代码来源:RenderingHandler.java

示例4: renderPlayer

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
@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();
	}
}
 
开发者ID:Aroma1997,项目名称:BetterChests,代码行数:24,代码来源:ClientEventListener.java

示例5: renderPlayerPost

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
@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;
}
 
开发者ID:PorPit,项目名称:MineCamera,代码行数:8,代码来源:EventLoader.java

示例6: onPlayerRenderPost

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerRenderPost(RenderPlayerEvent.Post event) {
    EntityPlayer player = event.getEntityPlayer();
    PossessivePlayer possessivePlayer = PossessHandler.get(player);
    if (possessivePlayer != null) {
        if (possessivePlayer.isAnimating()) {
            GlStateManager.popMatrix();
        }
    }
}
 
开发者ID:Fararise,项目名称:Possessed,代码行数:11,代码来源:ClientEventHandler.java

示例7: onPlayerRender

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
@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);
		}
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:16,代码来源:CapeHandler.java

示例8: onRenderPlayerPost

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
@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;
	}
}
 
开发者ID:Techjar,项目名称:VivecraftForgeExtensions,代码行数:12,代码来源:HandlerRenderEvent.java

示例9: onWeaponCarry

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
@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);
        }
    }
}
 
开发者ID:Hoijima,项目名称:Fallout_Equestria,代码行数:11,代码来源:EventPlayerRenders.java

示例10: renderPlayer

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
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);
        }
    }
}
 
开发者ID:Tencao,项目名称:SAO-UI---1.8,代码行数:8,代码来源:RenderHandler.java

示例11: OnRenderPlayer

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void OnRenderPlayer(RenderPlayerEvent.Post e)
{
	ItemStack itemStack = e.entityPlayer.getCurrentArmor(3);
	if (itemStack != null && itemStack.getItem() instanceof SantaHat)
	{
		float shift = e.entityPlayer.isSneaking() ? 0.24F : 0F;

		GL11.glPushMatrix();
		GL11.glTranslatef((float) e.x, (float) e.y - shift, (float) e.z);
		GL11.glRotatef(180F, 1, 0, 0);
		santa.render((float) Math.toRadians(((EntityPlayer) e.entity).rotationPitch), (float) Math.toRadians(((EntityPlayer) e.entity).rotationYawHead), 0.0625F);
		GL11.glPopMatrix();
	}
}
 
开发者ID:ironcraft,项目名称:nowel,代码行数:16,代码来源:EventHandler.java

示例12: onDrawPlayerHead

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onDrawPlayerHead(RenderPlayerEvent.Post event) {
  ItemStack is = event.entityPlayer.getEquipmentInSlot(4);
  if (!needsHeadHiding(is)) {
    return;
  }

  event.renderer.modelBipedMain.bipedHead.showModel = true;
  event.renderer.modelBipedMain.bipedHeadwear.showModel = true;
}
 
开发者ID:twothe,项目名称:DaVincing,代码行数:11,代码来源:ProxyClient.java

示例13: PlayerPostrenderer

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void PlayerPostrenderer(RenderPlayerEvent.Post evt) {

	/* ===== RENDERING SHIELDS===== */
	ItemStack shield = PlayerRpgInventory.get(evt.entityPlayer).getShield();
	if (shield != null) {
		if (shield.getItem() instanceof ItemRpgInvArmor) {
			ItemRpgInvArmor theShield = ((ItemRpgInvArmor) shield.getItem());
			if (theShield.isMantle() && evt.entityPlayer.isSneaking() && PlayerRpgInventory.get(evt.entityPlayer).isBlocking()) {
				renderMantle(evt.entityPlayer, ((ItemRpgInvArmor) shield.getItem()).getMantleTexture(), false);
			}
		}
	}
}
 
开发者ID:ArtixAllMighty,项目名称:rpginventory,代码行数:15,代码来源:RenderRpgPlayer.java

示例14: onDrawPlayerHead

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT) @SubscribeEvent
public void onDrawPlayerHead(RenderPlayerEvent.Post event){
	ItemStack is = event.entityPlayer.getEquipmentInSlot(4);
	if(!needsHeadHiding(is))return;
	
	event.renderer.modelBipedMain.bipedHead.showModel = true;
	event.renderer.modelBipedMain.bipedHeadwear.showModel = true;
}
 
开发者ID:hypercross,项目名称:minepainter,代码行数:9,代码来源:EventHandler.java

示例15: miniPost

import net.minecraftforge.client.event.RenderPlayerEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@ForgeSubscribe(priority = EventPriority.HIGHEST)
public void miniPost(RenderPlayerEvent.Post event){
	if(((EntityLivingBase) event.entity).isPotionActive(FCraftPotions.miniPot)){
		GL11.glPopMatrix();
		if(event.entity instanceof EntityPlayer){
			EntityPlayer player = (EntityPlayer) event.entity;
			/*				player.yOffset = 1.62F;
			player.ySize = 0.0F;*/
		}
	}
}
 
开发者ID:Unrelentless,项目名称:FantasyCraft-Mod,代码行数:13,代码来源:FCraftEffectsHandler.java


注:本文中的net.minecraftforge.client.event.RenderPlayerEvent.Post方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。