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


Java RenderLivingEvent.Pre方法代码示例

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


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

示例1: onRenderLiving

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
@SideOnly(Side.CLIENT)
@Override
public void onRenderLiving(RenderLivingEvent.Pre event, RenderLivingBase renderer, int amplifier) {
	GlStateManager.pushMatrix();

	EnumDyeColor dye = EnumDyeColor.byDyeDamage(Math.min(amplifier, EnumDyeColor.values().length - 1));
	int rgb = dye.getColorValue();

	float r = (rgb >>> 16 & 0xFF) / 256.0F;
	float g = (rgb >>> 8 & 0xFF) / 256.0F;
	float b = (rgb & 0xFF) / 256.0F;
	GlStateManager.color(r, g, b);

	GlStateManager.popMatrix();
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:17,代码来源:SkinTintBrew.java

示例2: entityColorRender

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void entityColorRender(final RenderLivingEvent.Pre event) {
    final String s = EnumChatFormatting.getTextWithoutFormattingCodes(event.entity.getCommandSenderName());
    if (s.startsWith("Aureylian") && !(event.entity instanceof EntityPlayer)) {
        GL11.glColor4f(0.9686f, 0.7059f, 0.8392f, 1.0f);
        this.resetRender = true;
    }
    if (EventHandlerClient.holograms.contains(s) && (!(event.entity instanceof EntityPlayer) || !((EntityPlayer)event.entity).getHideCape())) {
        GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.45f);
        GL11.glEnable(3042);
        GL11.glBlendFunc(770, 771);
        this.resetRender = true;
    }
    if (s.equals("RWTema") && !(event.entity instanceof EntityPlayer)) {
        GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.65f);
        GL11.glEnable(3042);
        GL11.glBlendFunc(770, 771);
        this.resetRender = true;
    }
    if (s.equals("jadedcat") && (!(event.entity instanceof EntityPlayer) || !((EntityPlayer)event.entity).getHideCape())) {
        GL11.glColor4f(0.69f, 0.392f, 0.847f, 1.0f);
        this.resetRender = true;
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:25,代码来源:EventHandlerClient.java

示例3: renderPlayer

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void renderPlayer (RenderLivingEvent.Pre event) {
	if (event.getEntity() instanceof AbstractClientPlayer) {
		AbstractClientPlayer player = (AbstractClientPlayer) event.getEntity();

		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);
	}
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:17,代码来源:RenderEventHandler.java

示例4: entityPreRender

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void entityPreRender(RenderLivingEvent.Pre event) {
    if (GelsPlus.proxy.getRegistry().coloredList().containsKey(event.entity.getEntityId())) {
        GelAbility gel = null;
        try {
            gel = GelsPlus.proxy.getRegistry().getGel(GelsPlus.proxy.getRegistry().coloredList().get(event.entity.getEntityId())).newInstance();
        } catch (Exception e) {
            e.printStackTrace();
            GelsPlus.pktHandler.sendEverywhere(new PacketUpdateRegistry(event.entity));
            return;
        }
        if (gel != null)
            RenderUtils.applyColor(gel.gelColor());
    }
}
 
开发者ID:Lomeli12,项目名称:GelsPlus,代码行数:17,代码来源:RenderEvent.java

示例5: onEntityLiving

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onEntityLiving(RenderLivingEvent.Pre<EntityPlayer> event){
	if(event.getEntity() instanceof EntityPlayer){
		EntityPlayer player = (EntityPlayer)event.getEntity();
		ItemStack stackMainHand = player.getHeldItemMainhand();
		if(stackMainHand != null && stackMainHand.getItem() == CommonProxy.itemCombustibleLemonLauncher){
			ModelBiped modelBiped = (ModelBiped)event.getRenderer().getMainModel();
			switch(Minecraft.getMinecraft().gameSettings.mainHand){
			case LEFT:
				modelBiped.leftArmPose = ArmPose.BOW_AND_ARROW;
				break;
			case RIGHT:
				modelBiped.rightArmPose = ArmPose.BOW_AND_ARROW;
				break;
			default:
				break;
			}
		}
	}
}
 
开发者ID:Phlenum,项目名称:Combustible-Lemon-Launcher,代码行数:21,代码来源:HoldLikeBowHook.java

示例6: onRender

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
@SubscribeEvent
public void onRender(RenderLivingEvent.Pre event) {
	Collection<BrewEffect> effects = BrewStorageHandler.getBrewEffects(event.getEntity());
	effects.stream().filter(effect -> effect.getBrew() instanceof IBrewRenderLiving).forEach(effect -> {
		if (event.isCanceled()) return;
		((IBrewRenderLiving) effect.getBrew()).onRenderLiving(event, event.getRenderer(), effect.getAmplifier());
	});
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:10,代码来源:ClientEvents.java

示例7: onRenderLivingEvent

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
@SuppressWarnings("unused")
public void onRenderLivingEvent(RenderLivingEvent.Pre event) {
    EntityLivingBase entity = event.getEntity();
    if((entity instanceof EntityPlayer) && isInvisible((EntityPlayer) entity)) {
        event.setCanceled(true);
        event.setResult(Event.Result.DENY);
    }
}
 
开发者ID:InfinityRaider,项目名称:NinjaGear,代码行数:10,代码来源:RenderPlayerHandler.java

示例8: onRenderLiving_Pre

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.TOP)
public void onRenderLiving_Pre(RenderLivingEvent.Pre<EntityLivingBase> event) {
	if (last == event.getEntity())
		return;
	Minecraft minecraft = Minecraft.getMinecraft();
	EntityPlayer player = minecraft.player;
	EntityLivingBase living = event.getEntity();
	int id = living.getEntityData().getInteger(NBT_KEY_RENDER);
	if (id != 0) {
		AlchemyEventSystem.markEventCanceled(event);
		last = AlchemyEntityManager.getEntityById(AlchemyEntityManager.FRIENDLY_LIVING_LIST, id, minecraft.world);
		float partialTick = minecraft.getRenderPartialTicks();
		double lx = living.lastTickPosX + (living.posX - living.lastTickPosX) * partialTick;
		double ly = living.lastTickPosY + (living.posY - living.lastTickPosY) * partialTick;
		double lz = living.lastTickPosZ + (living.posZ - living.lastTickPosZ) * partialTick;
		double px = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTick;
		double py = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTick;
		double pz = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTick;
		float f = living.prevRotationYaw + (living.rotationYaw - living.prevRotationYaw) * partialTick;
		glPushMatrix();
		glTranslated(lx - px, ly - py, lz - pz);
		glRotatef(-f % 360, 0, 1, 0);
		RenderHelper.renderEntity(last, partialTick);
		glPopMatrix();
	}
}
 
开发者ID:NekoCaffeine,项目名称:Alchemy,代码行数:28,代码来源:PotionWitchcraft.java

示例9: holding

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void holding(RenderLivingEvent.Pre event)
{
	Minecraft mc = Minecraft.getMinecraft();
	EntityPlayer thePlayer = mc.player;
	ItemStack stack = thePlayer.getActiveItemStack();
	if (!event.isCanceled() && event.getEntity().equals(thePlayer) && stack != null) {
		if (stack.getItem() instanceof ItemRangedWeapon) {
			ModelPlayer model = (ModelPlayer) event.getRenderer().getMainModel();
			// TODO adapt for left/right handed
			model.rightArmPose = ArmPose.BOW_AND_ARROW;
		}
	}
}
 
开发者ID:BubbleTrouble14,项目名称:ARKCraft,代码行数:15,代码来源:ClientEventHandler.java

示例10: holding

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void holding(RenderLivingEvent.Pre event)
{
	Minecraft mc = Minecraft.getMinecraft();
	EntityPlayer thePlayer = mc.thePlayer;
	ItemStack stack = thePlayer.getCurrentEquippedItem();
	if (!event.isCanceled() && event.entity.equals(thePlayer) && stack != null)
	{
		if (stack.getItem() instanceof ItemRangedWeapon)
		{
			ModelPlayer model = (ModelPlayer) event.renderer.getMainModel();
			model.aimedBow = true;
		}
	}
}
 
开发者ID:Archiving,项目名称:ARKCraft-Code,代码行数:16,代码来源:ClientEventHandler.java

示例11: onRenderLivingPre

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onRenderLivingPre(RenderLivingEvent.Pre<EntityPlayer> event)
{
    if (this.viewEntityOriginal != null)
    {
        this.mc.getRenderManager().renderViewEntity = this.viewEntityOriginal;
        this.viewEntityOriginal = null;
    }
}
 
开发者ID:maruohon,项目名称:multishot,代码行数:10,代码来源:RenderEventHandler.java

示例12: onPlayerRenderPre

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onPlayerRenderPre(RenderLivingEvent.Pre event) {
       if(nameIsGood(event.entity)){
           GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
           GL11.glEnable(GL11.GL_BLEND);
           GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
       }
}
 
开发者ID:Chisel-2,项目名称:Chisel-2,代码行数:9,代码来源:PlayerSpecials.java

示例13: render

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void render(RenderLivingEvent.Pre event) {
	String s = EnumChatFormatting.getTextWithoutFormattingCodes(event.entity.getCommandSenderName());
	if (s.equals("jaredlll08") && event.entity instanceof EntityPlayer) {
		GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.50F);
		GL11.glEnable(3042);
		GL11.glBlendFunc(770, 771);
		resetRender = true;
	}
}
 
开发者ID:jaredlll08,项目名称:Fluxed-Trinkets,代码行数:11,代码来源:EventHandler.java

示例14: onEntityRender

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public static void onEntityRender(RenderLivingEvent.Pre<EntityLivingBase> event) {
  if (TelePadConfig.telepadShrinkEffect.get()) {
    final NBTTagCompound entityData = event.getEntity().getEntityData();
    boolean isTarget = false;
    if (entityData.getBoolean(TileTelePad.TELEPORTING_KEY)) {
      isTarget = true;
      // shrink the entity for longer than the teleport lasts so it doesn't pop big again at the source location
      entityData.setInteger("eio_delay", 7);
    } else if (entityData.hasKey("eio_delay")) {
      int delay = entityData.getInteger("eio_delay") - 1;
      if (delay > 0) {
        entityData.setInteger("eio_delay", delay);
      } else {
        entityData.removeTag("eio_delay");
        entityData.removeTag("eio_teleportrotation");
      }
      isTarget = true;
    }
    if (isTarget) {
      final float progress = entityData.hasKey(TileTelePad.PROGRESS_KEY) ? entityData.getFloat(TileTelePad.PROGRESS_KEY) : 1;
      GlStateManager.pushMatrix();
      GlStateManager.translate(event.getX(), event.getY(), event.getZ());
      final float scale = 1 - progress * 0.75f;
      GlStateManager.scale(scale, scale, scale);
      GlStateManager.translate(-event.getX(), -event.getY(), -event.getZ());
      entityData.setBoolean("eio_needs_pop", true);
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:31,代码来源:TeleportEntityRenderHandler.java

示例15: RenderLivingEvent

import net.minecraftforge.client.event.RenderLivingEvent; //导入方法依赖的package包/类
@ForgeSubscribe
public void RenderLivingEvent(RenderLivingEvent.Pre event)
{
	if (event.entity instanceof EntityPlayer)
	{
		if (event.entity.ridingEntity != null
				&& event.entity.ridingEntity instanceof EntityMech)
		{
			event.setCanceled(true);
		}
	}
}
 
开发者ID:Iamshortman,项目名称:ModJam3-Exocraft,代码行数:13,代码来源:ExoCraftClientEventHandler.java


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