本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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(); } }
*/
}
}
示例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);
}
示例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
}
示例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();
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
}
}
示例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;
}
}
示例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 );
}
示例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;
}
}
}
示例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);
}
}
示例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);
}
}