[1.7.2] Текстура для партикла

183
1
4
День добрый, ни как не могу привязать текстуру к партиклу. Рендер зарегистрирован в прокси

Код:
RenderingRegistry.registerEntityRenderingHandler(EntityBullet.class, new RenderEntityBullet()); // Рендер дается на класс, который наследует мой партикл.

Сам рендер
Код:
package ru.ma.main.client.render;

import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

import ru.ma.main.entity.EntityBullet;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
  * <i><u>Render for bullets</i></u>
  * @author RedEnergy
  * @since 16.09.2014
  */
@SideOnly(Side.CLIENT)
public class RenderEntityBullet extends Render {

   public void doRender(Entity entity, double par2, double par4, double par6, float par8, float par9) {
      GL11.glPushMatrix();
      GL11.glTranslatef((float)par2, (float)par4, (float)par6);
      GL11.glEnable('\u803a');
      GL11.glDisable(2884);
      GL11.glNormal3f(0.0F, 1.0F, 0.0F);
      GL11.glEnable(3042);
      GL11.glBlendFunc(770, 771);
      GL11.glAlphaFunc(516, 0.01F);
      this.bindEntityTexture(entity);
      Tessellator tessellator = Tessellator.instance;
      tessellator.startDrawingQuads();
      tessellator.setNormal(0.0F, 1.0F, 0.0F);
      EntityBullet entityBullet = (EntityBullet)entity;
      GL11.glScalef(entityBullet.scale, entityBullet.scale, entityBullet.scale);
      float f4 = 1.0F;
      float f5 = 0.5F;
      float f6 = 0.25F;
      int textureIndex = entityBullet.getTextureIndex();
      int textureWidth = entityBullet.getTextureWidth();
      int textureAmount = entityBullet.getAmountOfTextures();
      float minU = (float)(textureIndex % textureAmount * textureWidth) / (float)(textureWidth * textureAmount);
      float maxU = (float)(textureIndex % textureAmount * textureWidth + textureWidth) / (float)(textureWidth * textureAmount);
      float minV = 0.0F;
      float maxV = 1.0F;
      GL11.glRotatef(180.0F - super.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-super.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
      if(!entityBullet.isInvisible() && entityBullet.age > entityBullet.getTicksBeforeVisible()) {
         if(entityBullet.hasBrightness()) {
            tessellator.setBrightness(entityBullet.getBrightness());
         }

         tessellator.addVertexWithUV(-0.5D, -0.25D, 0.0D, (double)minU, (double)maxV);
         tessellator.addVertexWithUV(0.5D, -0.25D, 0.0D, (double)maxU, (double)maxV);
         tessellator.addVertexWithUV(0.5D, 0.75D, 0.0D, (double)maxU, (double)minV);
         tessellator.addVertexWithUV(-0.5D, 0.75D, 0.0D, (double)minU, (double)minV);
      }

      tessellator.draw();
      GL11.glDisable('\u803a');
      GL11.glDisable(3042);
      GL11.glDepthMask(true);
      GL11.glAlphaFunc(516, 0.1F);
      GL11.glPopMatrix();
   }

   protected ResourceLocation getEntityTexture(Entity entity) {
      return ((EntityBullet)entity).getTexture();
   }
}

Текстура прописана в классе партикла
Код:
   public static final ResourceLocation entityTexture = new ResourceLocation(Info.modid+":textures/entity/bullet/flame.png");

Однако в игре по прежнему фиолетово-черное полотно.
 
2,955
12
Дак ты биндь текстуру через Minecraft.getMinecraft().renderEngine.bindTexture(getEntityTexture(entity)) перед тем как рендерить, никто за тебя это не будет делать.
 
183
1
4
Dragon2488 написал(а):
Дак ты биндь текстуру через Minecraft.getMinecraft().renderEngine.bindTexture(getEntityTexture(entity)) перед тем как рендерить, никто за тебя это не будет делать.
31 строка в рендере
Код:
      this.bindTexture(getEntityTexture(entity));
 
Сверху