Рендор модели блока

Версия Minecraft
1.7.10
54
17
Всем привет! Есть проблема сделал один блок но когда делаю второй блок и рендер второго блока то первый становится таким же как второй!!! Помогите решить данную загадку
 
Крч тема такая. Рендер для всех тайлов один. То есть ты аргументом в регистрацию подаешь экземпляр, который будет рендерить все привязанные к нему тайлы. Учитываю это ты не должен хранить какую либо ункальную инфу о блоке в рендере, а ты сто проц это делаешь.
 
У меня идет так
Java:
ClientRegistry.bindTileEntitySpecialRenderer(te, new RenderBlockBase(model, texture1));

А потом
Код:
public class RenderBlockBase extends TileEntitySpecialRenderer {

    public static BaseModelBlock model = null;
    public static ResourceLocation texture = null;

    public RenderBlockBase(BaseModelBlock model, ResourceLocation texture) {
        this.model = model;
        this.texture = texture;
    }

    @Override
    public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float f) {
        render((TEBlock)tile, x, y, z, f);
    }

    private void render(TEBlock tileEntity, double x, double y, double z, float f) {
        GL11.glPushMatrix();
        GL11.glTranslated(x, y, z);
        GL11.glTranslatef(0.5F, 1.5F, 0.5F);

        int rotation = 0;
        if(tileEntity != null) {
            rotation = tileEntity.getFacing();
        }

        if(rotation == 0){
            GL11.glRotatef(180, 0.0F, 0.0F, 1.0F);
            GL11.glRotatef(rotation, 0.0F, 90.0F, 0.0F);
        } else {
            GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
            GL11.glRotatef(rotation * 90, 0.0F, 1.0F, 0.0F);
        }

        bindTexture(this.texture);
        this.model.render();
        GL11.glPopMatrix();
    }

}
 
У меня идет так
Java:
ClientRegistry.bindTileEntitySpecialRenderer(te, new RenderBlockBase(model, texture1));

А потом
Код:
public class RenderBlockBase extends TileEntitySpecialRenderer {

    public static BaseModelBlock model = null;
    public static ResourceLocation texture = null;

    public RenderBlockBase(BaseModelBlock model, ResourceLocation texture) {
        this.model = model;
        this.texture = texture;
    }

    @Override
    public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float f) {
        render((TEBlock)tile, x, y, z, f);
    }

    private void render(TEBlock tileEntity, double x, double y, double z, float f) {
        GL11.glPushMatrix();
        GL11.glTranslated(x, y, z);
        GL11.glTranslatef(0.5F, 1.5F, 0.5F);

        int rotation = 0;
        if(tileEntity != null) {
            rotation = tileEntity.getFacing();
        }

        if(rotation == 0){
            GL11.glRotatef(180, 0.0F, 0.0F, 1.0F);
            GL11.glRotatef(rotation, 0.0F, 90.0F, 0.0F);
        } else {
            GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
            GL11.glRotatef(rotation * 90, 0.0F, 1.0F, 0.0F);
        }

        bindTexture(this.texture);
        this.model.render();
        GL11.glPopMatrix();
    }

}
Тут вроде норм все. А ты случаем не регаешь этот рендер для каждого нового тайла?
 
Еще раз тебе повторяю. Рендер для всех моделей одинаковый. Регистрируя его по новой ты его заменяешь(регистрировать рендер дважды бред, кстати). Заменяешь для всех. Осознай это.
 
Если ты хочешь чтоб он рендерил разное тебе нужно чтобы он доставал текстуру и модель из тайла. Тайл каждый раз новый.
 
Назад
Сверху