當前位置: 首頁>>代碼示例>>Java>>正文


Java RenderPlayerEvent類代碼示例

本文整理匯總了Java中net.minecraftforge.client.event.RenderPlayerEvent的典型用法代碼示例。如果您正苦於以下問題:Java RenderPlayerEvent類的具體用法?Java RenderPlayerEvent怎麽用?Java RenderPlayerEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RenderPlayerEvent類屬於net.minecraftforge.client.event包,在下文中一共展示了RenderPlayerEvent類的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: renderPlayer

import net.minecraftforge.client.event.RenderPlayerEvent; //導入依賴的package包/類
@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);
		}
		
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:21,代碼來源:SpinToWin.java

示例4: renderPlayer

import net.minecraftforge.client.event.RenderPlayerEvent; //導入依賴的package包/類
@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(); } }
		 */
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:24,代碼來源:TF2EventsClient.java

示例5: renderEquippedGlove

import net.minecraftforge.client.event.RenderPlayerEvent; //導入依賴的package包/類
@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);
}
 
開發者ID:sameer,項目名稱:ExtraUtilities,代碼行數:21,代碼來源:RenderItemGlove.java

示例6: onRenderPlayerPre

import net.minecraftforge.client.event.RenderPlayerEvent; //導入依賴的package包/類
@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
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:22,代碼來源:ClientProxyCore.java

示例7: 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

示例8: gunRenderEvent

import net.minecraftforge.client.event.RenderPlayerEvent; //導入依賴的package包/類
@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;
	}
}
 
開發者ID:TeamMonumental,項目名稱:FissionWarfare,代碼行數:21,代碼來源:GunRenderEvent.java

示例9: onRenderEntity

import net.minecraftforge.client.event.RenderPlayerEvent; //導入依賴的package包/類
@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;
    }
}
 
開發者ID:Hoijima,項目名稱:Fallout_Equestria,代碼行數:10,代碼來源:EventPlayerRenders.java

示例10: onPlayerRender

import net.minecraftforge.client.event.RenderPlayerEvent; //導入依賴的package包/類
@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;
            }
        }
    }
}
 
開發者ID:goldenapple3,項目名稱:RFDrills,代碼行數:17,代碼來源:PlayerRenderHandler.java

示例11: gunRenderEvent

import net.minecraftforge.client.event.RenderPlayerEvent; //導入依賴的package包/類
@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;
	}
}
 
開發者ID:TeamMonumental,項目名稱:FusionWarfare,代碼行數:19,代碼來源:GunRenderEvent.java

示例12: onArmorRender

import net.minecraftforge.client.event.RenderPlayerEvent; //導入依賴的package包/類
@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 );
}
 
開發者ID:spacechase0,項目名稱:ComponentEquipment,代碼行數:24,代碼來源:PlayerArmorRenderer.java

示例13: onRenderPlayerPre

import net.minecraftforge.client.event.RenderPlayerEvent; //導入依賴的package包/類
@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;
        }
    }
}
 
開發者ID:maruohon,項目名稱:multishot,代碼行數:17,代碼來源:RenderEventHandler.java

示例14: renderPlayer

import net.minecraftforge.client.event.RenderPlayerEvent; //導入依賴的package包/類
@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);
    }
}
 
開發者ID:xbony2,項目名稱:Nuclear-Control,代碼行數:17,代碼來源:RenderEventHandler.java

示例15: renderPlayer

import net.minecraftforge.client.event.RenderPlayerEvent; //導入依賴的package包/類
@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);
    }
}
 
開發者ID:ME-Corp,項目名稱:SolderCraft,代碼行數:17,代碼來源:RenderEventHandler.java


注:本文中的net.minecraftforge.client.event.RenderPlayerEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。