本文整理汇总了Java中net.minecraftforge.client.event.RenderLivingEvent类的典型用法代码示例。如果您正苦于以下问题:Java RenderLivingEvent类的具体用法?Java RenderLivingEvent怎么用?Java RenderLivingEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RenderLivingEvent类属于net.minecraftforge.client.event包,在下文中一共展示了RenderLivingEvent类的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();
}
示例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;
}
}
示例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);
}
}
示例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());
}
}
示例5: onRenderPlayerEventPost
import net.minecraftforge.client.event.RenderLivingEvent; //导入依赖的package包/类
@SuppressWarnings("unused")
@SubscribeEvent
public void onRenderPlayerEventPost(RenderLivingEvent.Post event) {
if (event.entity != Minecraft.getMinecraft().thePlayer) {
glPushMatrix();
glEnable(GL_BLEND);
glTranslated(event.x, event.y, event.z);
if (EntityPlayer.class.isAssignableFrom(event.entity.getClass())) {
/*IInventory baubles = BaublesApi.getBaubles((EntityPlayer) event.entity);
if (baubles.getStackInSlot(2) != null) {
TextureHelper.bindTexture(textureRingOfHealth);
model.renderAll();
} TODO: Baubles replacement*/
}
glDisable(GL_BLEND);
glPopMatrix();
}
}
示例6: 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;
}
}
}
}
示例7: 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());
});
}
示例8: invoke
import net.minecraftforge.client.event.RenderLivingEvent; //导入依赖的package包/类
@Override
public void invoke(Event e) {
RenderLivingEvent.Specials.Pre format = (RenderLivingEvent.Specials.Pre) e;
NametagRenderEvent event = new NametagRenderEvent(format.entity);
event.call();
format.setCanceled(event.isCancelled());
}
示例9: renderLivingPostEntity
import net.minecraftforge.client.event.RenderLivingEvent; //导入依赖的package包/类
@SubscribeEvent
public void renderLivingPostEntity(RenderLivingEvent.Post<EntityLivingBase> event) {
if (!(event.getEntity() instanceof EntityPlayer || event.getEntity() instanceof EntityTF2Character))
return;
ClientProxy.renderCritGlow=0;
if (event.getEntity().getActivePotionEffect(TF2weapons.uber)!=null) {
GL11.glColor4f(1.0F, 1F, 1.0F, 1F);
}
// GlStateManager.enableLighting();
if (event.getEntity().getCapability(TF2weapons.WEAPONS_CAP, null).invisTicks > 0) {
GL11.glDisable(GL11.GL_BLEND);
GL11.glColor4f(1.0F, 1F, 1.0F, 1F);
}
}
示例10: onNameRender
import net.minecraftforge.client.event.RenderLivingEvent; //导入依赖的package包/类
/**
* On name render, simply render the name of the user, instead of the name of
* the entity.
*/
@SubscribeEvent
public void onNameRender(RenderLivingEvent.Specials.Pre<EntityLivingBase> event)
{
EntityLivingBase render = EntityMorph.renderEntity;
if (render == null)
{
return;
}
event.setCanceled(true);
EntityLivingBase entity = event.getEntity();
if (!this.canRenderName(render, entity))
{
return;
}
double dist = entity.getDistanceSqToEntity(this.manager.renderViewEntity);
float factor = entity.isSneaking() ? 32.0F : 64.0F;
if (dist < (double) (factor * factor))
{
GlStateManager.alphaFunc(516, 0.1F);
this.renderEntityName(entity, render.getDisplayName().getFormattedText(), event.getX(), event.getY(), event.getZ());
}
}
示例11: 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);
}
}
示例12: onRenderLivingSpecialsEvent
import net.minecraftforge.client.event.RenderLivingEvent; //导入依赖的package包/类
@SubscribeEvent
@SuppressWarnings("unused")
public void onRenderLivingSpecialsEvent(RenderLivingEvent.Specials.Pre event) {
EntityLivingBase entity = event.getEntity();
if ((entity instanceof EntityPlayer) && isInvisible((EntityPlayer) entity)) {
event.setCanceled(true);
event.setResult(Event.Result.DENY);
}
}
示例13: 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();
}
}
示例14: 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;
}
}
}
示例15: renderEntity
import net.minecraftforge.client.event.RenderLivingEvent; //导入依赖的package包/类
static void renderEntity(RenderLivingEvent.Post e) {
if (!OptionCore.UI_ONLY.getValue()) {
if (e.entity != mc.thePlayer) {
StaticRenderer.render(e.renderer.getRenderManager(), e.entity, e.x, e.y, e.z);
}
}
}