[1.7.10] Текстура ентити

svk

1,185
3
Есть метод
Код:
    protected ResourceLocation getEntityTexture(EntityPlasmaShell p_110775_1_)
    {
        return TextureMap.locationItemsTexture;
    }
Как туда вписать свою текстуру? И как сделать что-то вроде анимации, надо несколько файлов или всё можно встроить в 1?
 
annalifegame написал(а):
svk написал(а):
annalifegame написал(а):
Dovakin написал(а):
Обычный метод из рендера
Когда я рендерила своего энтити, такого у меня не было
Подскажи как текстурку поставить.
Я ставила как и в 1.6
Да откуда мне знать как в 1.6. ставится? : )
 
svk написал(а):
annalifegame написал(а):
svk написал(а):
annalifegame написал(а):
Dovakin написал(а):
Обычный метод из рендера
Когда я рендерила своего энтити, такого у меня не было
Подскажи как текстурку поставить.
Я ставила как и в 1.6
Да откуда мне знать как в 1.6. ставится? : )
Даже тааак?:D
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("youid", "texture/skins/youmob.png"));
 
Код:
        ResourceLocation test = Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("modgun","materials/vpishka.png"));

Type mismatch: cannot convert from void to ResourceLocation
[merge_posts_bbcode]Добавлено: 03.03.2015 22:23:33[/merge_posts_bbcode]

Ты думаешь я не пробовал?)
 
svk написал(а):
Код:
        ResourceLocation test = Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("modgun","materials/vpishka.png"));

Type mismatch: cannot convert from void to ResourceLocation
Господи. причем здесь энтити и вспышка, господи
[merge_posts_bbcode]Добавлено: 04.03.2015 00:25:08[/merge_posts_bbcode]

svk написал(а):
Код:
        ResourceLocation test = Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("modgun","materials/vpishka.png"));

Type mismatch: cannot convert from void to ResourceLocation
[merge_posts_bbcode]Добавлено: 03.03.2015 22:23:33[/merge_posts_bbcode]

Ты думаешь я не пробовал?)
Тооолько, ради тебя я поищу что нибудь стоящее))
 
Переопределить надо какой-то метод. Сам найдешь(возвращает локацию)
 
annalifegame написал(а):
svk написал(а):
Код:
        ResourceLocation test = Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("modgun","materials/vpishka.png"));

Type mismatch: cannot convert from void to ResourceLocation
Господи. причем здесь энтити и вспышка, господи
[merge_posts_bbcode]Добавлено: 04.03.2015 00:25:08[/merge_posts_bbcode]

svk написал(а):
Код:
        ResourceLocation test = Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("modgun","materials/vpishka.png"));

Type mismatch: cannot convert from void to ResourceLocation
[merge_posts_bbcode]Добавлено: 03.03.2015 22:23:33[/merge_posts_bbcode]

Ты думаешь я не пробовал?)
Тооолько, ради тебя я поищу что нибудь стоящее))
Я просто для теста вставил, чё сразу возмущаться-то? :0
:blush:
 
Dovakin написал(а):
GetEntityTexture переопредели. И верни твой ресурс локация

А откуда ресурс локацию достать? Там какой-то int требует
Код:
Minecraft.getMinecraft().renderEngine.getResourceLocation(int)
 
Верни херову локацию. return new ResourceLocation(args...). Вижу джаву плохо знаешь?
 
У меня есть 4 текстуры (16х 64х 128х 256х) но все они отображаются квадратом в несколько пикселей цвета, помогите.
Код:
package com.svk.industrialGuns.render;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity;

import com.svk.industrialGuns.base.ModInfo;
import com.svk.industrialGuns.entity.EntityPlasmaShell;

import net.minecraft.init.Items;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;

@SideOnly(Side.CLIENT)
public class RenderPlasmaShell extends Render
{
    private float field_77002_a;
    private static final String __OBFID = "CL_00000995";

    public RenderPlasmaShell(float p_i1254_1_)
    {
        this.field_77002_a = p_i1254_1_;
    }

    /**
     * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
     * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
     * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
     * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
     */
    public void doRender(EntityPlasmaShell p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
    {
        GL11.glPushMatrix();
        this.bindEntityTexture(p_76986_1_);
        GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        float f2 = this.field_77002_a;
        GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F);
        IIcon iicon = Items.fire_charge.getIconFromDamage(0);
        Tessellator tessellator = Tessellator.instance;
        float f3 = iicon.getMinU();
        float f4 = iicon.getMaxU();
        float f5 = iicon.getMinV();
        float f6 = iicon.getMaxV();
        float f7 = 1.0F;
        float f8 = 0.5F;
        float f9 = 0.25F;
        GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, 1.0F, 0.0F);
        tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6);
        tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6);
        tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5);
        tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5);
        tessellator.draw();
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        GL11.glPopMatrix();
    }

    /**
     * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
     */
    private static ResourceLocation getEntityTexture(EntityPlasmaShell p_110775_1_)
    {
        return new ResourceLocation(ModInfo.MODID, "textures/entity/plasmashell0.png");
    }

    /**
     * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
     */
    protected ResourceLocation getEntityTexture(Entity p_110775_1_)
    {
        return this.getEntityTexture((EntityPlasmaShell)p_110775_1_);
    }

    /**
     * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
     * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
     * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
     * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
     */
    public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
    {
        this.doRender((EntityPlasmaShell)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
    }
}
 
Назад
Сверху