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