本文整理匯總了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;
}
}
}