本文整理汇总了Java中net.minecraft.client.renderer.entity.Render类的典型用法代码示例。如果您正苦于以下问题:Java Render类的具体用法?Java Render怎么用?Java Render使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Render类属于net.minecraft.client.renderer.entity包,在下文中一共展示了Render类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onInitGuiPost
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onInitGuiPost(GuiScreenEvent.InitGuiEvent.Post event)
{
if(!hasShownFirstGui)
{
hasShownFirstGui = true;
//Add the layer renderers
Render renderer = Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(EntityLlama.class);
if(renderer instanceof RenderLlama)
{
RenderLlama renderLlama = (RenderLlama)renderer;
renderLlama.addLayer(new LayerFancyLlama(renderLlama));
}
}
}
示例2: renderArm
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
private static void renderArm(EnumHandSide p_187455_1_) {
Minecraft mc = Minecraft.getMinecraft();
mc.getTextureManager().bindTexture(mc.player.getLocationSkin());
Render<AbstractClientPlayer> render = mc.getRenderManager()
.<AbstractClientPlayer>getEntityRenderObject(mc.player);
RenderPlayer renderplayer = (RenderPlayer) render;
GlStateManager.pushMatrix();
float f = p_187455_1_ == EnumHandSide.RIGHT ? 1.0F : -1.0F;
GlStateManager.rotate(92.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(f * -41.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.translate(f * 0.3F, -1.1F, 0.45F);
if (p_187455_1_ == EnumHandSide.RIGHT) {
renderplayer.renderRightArm(mc.player);
} else {
renderplayer.renderLeftArm(mc.player);
}
GlStateManager.popMatrix();
}
示例3: func_178095_a
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
private void func_178095_a(AbstractClientPlayer clientPlayer, float p_178095_2_, float p_178095_3_)
{
float f = -0.3F * MathHelper.sin(MathHelper.sqrt_float(p_178095_3_) * (float)Math.PI);
float f1 = 0.4F * MathHelper.sin(MathHelper.sqrt_float(p_178095_3_) * (float)Math.PI * 2.0F);
float f2 = -0.4F * MathHelper.sin(p_178095_3_ * (float)Math.PI);
GlStateManager.translate(f, f1, f2);
GlStateManager.translate(0.64000005F, -0.6F, -0.71999997F);
GlStateManager.translate(0.0F, p_178095_2_ * -0.6F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
float f3 = MathHelper.sin(p_178095_3_ * p_178095_3_ * (float)Math.PI);
float f4 = MathHelper.sin(MathHelper.sqrt_float(p_178095_3_) * (float)Math.PI);
GlStateManager.rotate(f4 * 70.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(f3 * -20.0F, 0.0F, 0.0F, 1.0F);
this.mc.getTextureManager().bindTexture(clientPlayer.getLocationSkin());
GlStateManager.translate(-1.0F, 3.6F, 3.5F);
GlStateManager.rotate(120.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(200.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.scale(1.0F, 1.0F, 1.0F);
GlStateManager.translate(5.6F, 0.0F, 0.0F);
Render<AbstractClientPlayer> render = this.renderManager.<AbstractClientPlayer>getEntityRenderObject(this.mc.thePlayer);
GlStateManager.disableCull();
RenderPlayer renderplayer = (RenderPlayer)render;
renderplayer.renderRightArm(this.mc.thePlayer);
GlStateManager.enableCull();
}
示例4: func_178095_a
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
private void func_178095_a(AbstractClientPlayer clientPlayer, float p_178095_2_, float p_178095_3_)
{
float f = -0.3F * MathHelper.sin(MathHelper.sqrt_float(p_178095_3_) * (float)Math.PI);
float f1 = 0.4F * MathHelper.sin(MathHelper.sqrt_float(p_178095_3_) * (float)Math.PI * 2.0F);
float f2 = -0.4F * MathHelper.sin(p_178095_3_ * (float)Math.PI);
GlStateManager.translate(f, f1, f2);
GlStateManager.translate(0.64000005F, -0.6F, -0.71999997F);
GlStateManager.translate(0.0F, p_178095_2_ * -0.6F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
float f3 = MathHelper.sin(p_178095_3_ * p_178095_3_ * (float)Math.PI);
float f4 = MathHelper.sin(MathHelper.sqrt_float(p_178095_3_) * (float)Math.PI);
GlStateManager.rotate(f4 * 70.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(f3 * -20.0F, 0.0F, 0.0F, 1.0F);
this.mc.getTextureManager().bindTexture(clientPlayer.getLocationSkin());
GlStateManager.translate(-1.0F, 3.6F, 3.5F);
GlStateManager.rotate(120.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(200.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.scale(1.0F, 1.0F, 1.0F);
GlStateManager.translate(5.6F, 0.0F, 0.0F);
Render render = this.renderManager.getEntityRenderObject(this.mc.thePlayer);
GlStateManager.disableCull();
RenderPlayer renderplayer = (RenderPlayer)render;
renderplayer.renderRightArm(this.mc.thePlayer);
GlStateManager.enableCull();
}
示例5: resetDisplayListModels
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
public static void resetDisplayListModels()
{
if (needResetModels)
{
needResetModels = false;
SMCLog.info("Reset model renderers");
for (Render render : mc.getRenderManager().getEntityRenderMap().values())
{
if (render instanceof RenderLiving)
{
RenderLiving renderliving = (RenderLiving)render;
resetDisplayListModel(renderliving.getMainModel());
}
}
}
}
示例6: renderArm
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
private void renderArm(EnumHandSide p_187455_1_)
{
this.mc.getTextureManager().bindTexture(this.mc.player.getLocationSkin());
Render<AbstractClientPlayer> render = this.renderManager.<AbstractClientPlayer>getEntityRenderObject(this.mc.player);
RenderPlayer renderplayer = (RenderPlayer)render;
GlStateManager.pushMatrix();
float f = p_187455_1_ == EnumHandSide.RIGHT ? 1.0F : -1.0F;
GlStateManager.rotate(92.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(f * -41.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.translate(f * 0.3F, -1.1F, 0.45F);
if (p_187455_1_ == EnumHandSide.RIGHT)
{
renderplayer.renderRightArm(this.mc.player);
}
else
{
renderplayer.renderLeftArm(this.mc.player);
}
GlStateManager.popMatrix();
}
示例7: renderArm
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
private void renderArm(EnumHandSide p_187455_1_)
{
this.mc.getTextureManager().bindTexture(this.mc.thePlayer.getLocationSkin());
Render<AbstractClientPlayer> render = this.renderManager.<AbstractClientPlayer>getEntityRenderObject(this.mc.thePlayer);
RenderPlayer renderplayer = (RenderPlayer)render;
GlStateManager.pushMatrix();
float f = p_187455_1_ == EnumHandSide.RIGHT ? 1.0F : -1.0F;
GlStateManager.rotate(92.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(f * -41.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.translate(f * 0.3F, -1.1F, 0.45F);
if (p_187455_1_ == EnumHandSide.RIGHT)
{
renderplayer.renderRightArm(this.mc.thePlayer);
}
else
{
renderplayer.renderLeftArm(this.mc.thePlayer);
}
GlStateManager.popMatrix();
}
示例8: onInitGuiPost
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onInitGuiPost(GuiScreenEvent.InitGuiEvent.Post event)
{
if(!hasShownFirstGui)
{
hasShownFirstGui = true;
//Add the layer renderers
Render renderer = Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(EntityRabbit.class);
if(renderer instanceof RenderRabbit)
{
RenderRabbit renderRabbit = (RenderRabbit)renderer;
renderRabbit.addLayer(new LayerFancyBunny(renderRabbit));
}
}
}
示例9: preInit
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
@Override
public void preInit(FMLPreInitializationEvent evt) {
MCDoom.instance.getGoreProperty().setConfigEntryClass(GuiConfigEntries.NumberSliderEntry.class);
MCDoom.instance.getMaxGoreParticles().setConfigEntryClass(GuiConfigEntries.NumberSliderEntry.class);
MinecraftForge.EVENT_BUS.register(screenEventHandler);
MinecraftForge.EVENT_BUS.register(soundEventsHandler);
registerItems();
RenderingRegistry.registerEntityRenderingHandler(PlasmaBallEntity.class, new IRenderFactory<PlasmaBallEntity>() {
@Override
public Render<? super PlasmaBallEntity> createRenderFor(RenderManager manager) {
return new RenderPlasmaBall(manager);
}
});
loadWeaponRenderers();
}
示例10: register
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
public static <ENTITY extends Entity> void register(Class<ENTITY> classes, final Class<? extends Render<ENTITY>> render)
{
RenderingRegistry.registerEntityRenderingHandler(classes, new IRenderFactory<ENTITY>() {
@Override
public Render<ENTITY> createRenderFor(RenderManager manager)
{
try
{
return render.getConstructor(RenderManager.class).newInstance(manager);
}
catch (Exception e)
{
e.printStackTrace();
}
return null;
}
});
}
示例11: injectModel
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
void injectModel(EntityPlayer player) {
Minecraft mc = Minecraft.getMinecraft();
Render<EntityPlayer> pr = mc.getRenderManager().getEntityRenderObject(player);
if (!((Render) pr instanceof RenderPlayer)) {
if (!invalid) {
Core.logWarning("Unable to patch Player model!");
}
invalid = true;
return;
}
RenderPlayer playerRenderer = (RenderPlayer) (Render) pr;
ModelRenderer head = playerRenderer.getMainModel().bipedHead;
if (head.childModels != null) {
for (Iterator<ModelRenderer> it = head.childModels.iterator(); it.hasNext(); ) {
ModelRenderer child = it.next();
if (child instanceof LmpMaskRenderer) {
it.remove();
}
}
}
head.addChild(new LmpMaskRenderer(playerRenderer.getMainModel()));
}
示例12: sanitizeEntityRenderers
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
@SideOnly (Side.CLIENT)
public static void sanitizeEntityRenderers(RenderManager renderManager) {
if (!hasSanitized) {
try {
for (Render<? extends Entity> render : renderManager.entityRenderMap.values()) {
if (render != null) {
for (Field field : render.getClass().getDeclaredFields()) {
if (field.getType().equals(RenderItem.class)) {
field.setAccessible(true);
field.set(render, CCRenderItem.getOverridenRenderItem());
}
}
}
}
} catch (Exception e) {
throw new RuntimeException("Unable to reflect an EntityRenderer!", e);
}
hasSanitized = true;
}
}
示例13: getOldRenderer
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static RenderPlayer getOldRenderer(String keyword) {
RenderManager manager = Minecraft.getMinecraft().getRenderManager();
Map< Class <? extends Entity > , Render<? extends Entity >> entityRenderMap = manager.entityRenderMap;
for(Field field : manager.getClass().getDeclaredFields()) {
if(field.getType() == Map.class) {
field.setAccessible(true);
try {
Object obj = field.get(manager);
if(obj == entityRenderMap) {
continue;
}
Map<String, RenderPlayer> skinMap = (Map<String, RenderPlayer>) obj;
return skinMap.get(keyword);
} catch (IllegalAccessException e) {
InfinityLib.instance.getLogger().printStackTrace(e);
}
}
}
return null;
}
示例14: createRenderFor
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
@Override
public Render<E> createRenderFor(RenderManager manager) {
try {
return renderClass.getConstructor(RenderManager.class).newInstance(manager);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
示例15: setRenderHead
import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
private void setRenderHead(EntityLivingBase entity, boolean setRender) {
if (entity.getItemStackFromSlot(EntityEquipmentSlot.HEAD).getItem() == Itemss.PNEUMATIC_HELMET
&& (ConfigHandler.client.useHelmetModel || DateEventHandler.isIronManEvent())) {
Render renderer = Minecraft.getMinecraft().getRenderManager().getEntityRenderObject(entity);
if (renderer instanceof RenderBiped) {
ModelBiped modelBiped = (ModelBiped) ((RenderBiped) renderer).getMainModel();
modelBiped.bipedHead.showModel = setRender;
}
}
}