Не рендерится блок из Techne

1,087
2
Вообще сделал блок в течне:
Код:
package mm.common.MMModels;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;

public class ModelEntityDeconstructor extends ModelBase
{
  //fields
    ModelRenderer Shape1;
    ModelRenderer Shape2;
    ModelRenderer Shape3;
    ModelRenderer Shape4;
    ModelRenderer Shape5;
    ModelRenderer Shape6;
    ModelRenderer Shape7;
    ModelRenderer Shape8;
    ModelRenderer Shape9;
    ModelRenderer Shape10;
    ModelRenderer Shape11;
    ModelRenderer Shape12;
    ModelRenderer Shape13;
    ModelRenderer Shape14;
    ModelRenderer Shape15;
    ModelRenderer Shape16;
  
  public ModelEntityDeconstructor()
  {
    textureWidth = 32;
    textureHeight = 32;
    
      Shape1 = new ModelRenderer(this, 0, 0);
      Shape1.addBox(0F, 0F, 0F, 6, 1, 1);
      Shape1.setRotationPoint(-3F, 23F, -8F);
      Shape1.setTextureSize(32, 32);
      Shape1.mirror = true;
      setRotation(Shape1, 0F, 0F, 0F);
      Shape2 = new ModelRenderer(this, 0, 0);
      Shape2.addBox(0F, 0F, 0F, 6, 1, 1);
      Shape2.setRotationPoint(-3F, 23F, 7F);
      Shape2.setTextureSize(32, 32);
      Shape2.mirror = true;
      setRotation(Shape2, 0F, 0F, 0F);
      Shape3 = new ModelRenderer(this, 0, 0);
      Shape3.addBox(0F, 0F, 0F, 1, 1, 6);
      Shape3.setRotationPoint(-8F, 23F, -3F);
      Shape3.setTextureSize(32, 32);
      Shape3.mirror = true;
      setRotation(Shape3, 0F, 0F, 0F);
      Shape4 = new ModelRenderer(this, 0, 0);
      Shape4.addBox(0F, 0F, 0F, 1, 1, 6);
      Shape4.setRotationPoint(7F, 23F, -3F);
      Shape4.setTextureSize(32, 32);
      Shape4.mirror = true;
      setRotation(Shape4, 0F, 0F, 0F);
      Shape5 = new ModelRenderer(this, 0, 0);
      Shape5.addBox(0F, 0F, 0F, 1, 1, 2);
      Shape5.setRotationPoint(-7F, 23F, -5F);
      Shape5.setTextureSize(32, 32);
      Shape5.mirror = true;
      setRotation(Shape5, 0F, 0F, 0F);
      Shape6 = new ModelRenderer(this, 0, 0);
      Shape6.addBox(0F, 0F, 0F, 2, 1, 1);
      Shape6.setRotationPoint(-5F, 23F, -7F);
      Shape6.setTextureSize(32, 32);
      Shape6.mirror = true;
      setRotation(Shape6, 0F, 0F, 0F);
      Shape7 = new ModelRenderer(this, 0, 0);
      Shape7.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape7.setRotationPoint(-6F, 23F, -6F);
      Shape7.setTextureSize(32, 32);
      Shape7.mirror = true;
      setRotation(Shape7, 0F, 0F, 0F);
      Shape8 = new ModelRenderer(this, 0, 0);
      Shape8.addBox(0F, 0F, 0F, 2, 1, 1);
      Shape8.setRotationPoint(3F, 23F, -7F);
      Shape8.setTextureSize(32, 32);
      Shape8.mirror = true;
      setRotation(Shape8, 0F, 0F, 0F);
      Shape9 = new ModelRenderer(this, 0, 0);
      Shape9.addBox(0F, 0F, 0F, 1, 1, 2);
      Shape9.setRotationPoint(6F, 23F, -5F);
      Shape9.setTextureSize(32, 32);
      Shape9.mirror = true;
      setRotation(Shape9, 0F, 0F, 0F);
      Shape10 = new ModelRenderer(this, 0, 0);
      Shape10.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape10.setRotationPoint(5F, 23F, -6F);
      Shape10.setTextureSize(32, 32);
      Shape10.mirror = true;
      setRotation(Shape10, 0F, 0F, 0F);
      Shape11 = new ModelRenderer(this, 0, 0);
      Shape11.addBox(0F, 0F, 0F, 2, 1, 1);
      Shape11.setRotationPoint(3F, 23F, 6F);
      Shape11.setTextureSize(32, 32);
      Shape11.mirror = true;
      setRotation(Shape11, 0F, 0F, 0F);
      Shape12 = new ModelRenderer(this, 0, 0);
      Shape12.addBox(0F, 0F, 0F, 1, 1, 2);
      Shape12.setRotationPoint(6F, 23F, 3F);
      Shape12.setTextureSize(32, 32);
      Shape12.mirror = true;
      setRotation(Shape12, 0F, 0F, 0F);
      Shape13 = new ModelRenderer(this, 0, 0);
      Shape13.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape13.setRotationPoint(5F, 23F, 5F);
      Shape13.setTextureSize(32, 32);
      Shape13.mirror = true;
      setRotation(Shape13, 0F, 0F, 0F);
      Shape14 = new ModelRenderer(this, 0, 0);
      Shape14.addBox(0F, 0F, 0F, 1, 1, 2);
      Shape14.setRotationPoint(-7F, 23F, 3F);
      Shape14.setTextureSize(32, 32);
      Shape14.mirror = true;
      setRotation(Shape14, 0F, 0F, 0F);
      Shape15 = new ModelRenderer(this, 0, 0);
      Shape15.addBox(0F, 0F, 0F, 2, 1, 1);
      Shape15.setRotationPoint(-5F, 23F, 6F);
      Shape15.setTextureSize(32, 32);
      Shape15.mirror = true;
      setRotation(Shape15, 0F, 0F, 0F);
      Shape16 = new ModelRenderer(this, 0, 0);
      Shape16.addBox(0F, 0F, 0F, 1, 1, 1);
      Shape16.setRotationPoint(-6F, 23F, 5F);
      Shape16.setTextureSize(32, 32);
      Shape16.mirror = true;
      setRotation(Shape16, 0F, 0F, 0F);
  }
  
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    Shape1.render(f5);
    Shape2.render(f5);
    Shape3.render(f5);
    Shape4.render(f5);
    Shape5.render(f5);
    Shape6.render(f5);
    Shape7.render(f5);
    Shape8.render(f5);
    Shape9.render(f5);
    Shape10.render(f5);
    Shape11.render(f5);
    Shape12.render(f5);
    Shape13.render(f5);
    Shape14.render(f5);
    Shape15.render(f5);
    Shape16.render(f5);
  }
  
  public void renderModel(float f)
  {
      Shape1.render(f);
      Shape2.render(f);
      Shape3.render(f);
      Shape4.render(f);
      Shape5.render(f);
      Shape6.render(f);
      Shape7.render(f);
      Shape8.render(f);
      Shape9.render(f);
      Shape10.render(f);
      Shape11.render(f);
      Shape12.render(f);
      Shape13.render(f);
      Shape14.render(f);
      Shape15.render(f);
      Shape16.render(f);
  }
  
  private void setRotation(ModelRenderer model, float x, float y, float z)
  {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
  }
  
  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
  {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  }

}

Дальше начал делать тайл:
Код:
package mm.common.MMTile;

import net.minecraft.tileentity.TileEntity;

public class TileEntityEntityDeconstructor extends TileEntity {
    
}

Сделал рендерер:
Код:
package mm.client.render.entity;

import org.lwjgl.opengl.GL11;

import mm.common.MMModels.ModelEntityDeconstructor;
import mm.core.MMCore;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;

public class RenderEntityDeconstructor extends TileEntitySpecialRenderer {
    
    public static final ResourceLocation texture = new ResourceLocation(MMCore.modid + ":" + "textures/models/EntityDeconstructor.png");
    
    private ModelEntityDeconstructor model;
    
    public RenderEntityDeconstructor() 
    {
        this.model = new ModelEntityDeconstructor();
    }
    
    @Override
    public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
        GL11.glPushMatrix();
            GL11.glTranslatef((float) x, (float) y, (float) z);
            GL11.glRotatef(360, 0F, 0F, 0F);
        
            this.bindTexture(texture);
            
            GL11.glPushMatrix();
                this.model.renderModel(0.0625F);
            GL11.glPopMatrix();
        GL11.glPopMatrix();
    }
    
}

Зарегал в Proxy
Код:
    public void registerRenderInformation()
    {
        TileEntitySpecialRenderer render = new RenderEntityDeconstructor();
        ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEntityDeconstructor.class, render);
        MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(MMBlocks.entityDeconstructor), new ItemRenderEntityDeconstructor(render, new TileEntityEntityDeconstructor()));
    }

Главный класс (На всяк пожарный):
Код:
package mm.core;

import static mm.core.MMCore.modid;
import static mm.core.MMCore.name;
import static mm.core.MMCore.version;

import java.util.ArrayList;

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import mm.common.lib.CreativeTabMixedMagic;
import mm.init.MMBlocks;
import mm.init.MMEnchanctments;
import mm.init.MMItems;
import mm.init.MMRecipes;
import mm.init.MMThaumonomicon;
import mm.network.proxy.MMClient;
import mm.network.proxy.MMServer;
import net.minecraft.creativetab.CreativeTabs;

@Mod(modid = modid, version = version, name = name)
public class MMCore {
    
    public static final String modid = "mixedmagic";
    public static final String version = "1.0.1710.0";
    public static final String name = "Mixed Magic";
    public static final String serverProxy = "mm.network.proxy.MMServer";
    public static final String clientProxy = "mm.network.proxy.MMClient";
    public static CreativeTabs tabMM = new CreativeTabMixedMagic(CreativeTabs.getNextID(), "mixedmagic");
    
    @SidedProxy(serverSide = serverProxy, clientSide = clientProxy)
    public static MMServer proxy;
    
    MMCore instance;
    
    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
        instance = this;
        setupModInfo(event.getModMetadata());
        MMItems.setup();
        MMBlocks.setup();
        MMEnchanctments.setup();
    }
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
        
    }
    
    @EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
        MMRecipes.setup();
        MMThaumonomicon.setup();
    }
    
    public void setupModInfo(ModMetadata meta)
    {
        meta.autogenerated = false;
        meta.modId = modid;
        meta.version = version;
        meta.name = name;
        meta.description = "This is mod of mixed magic .-.";
        ArrayList<String> authors = new ArrayList<String>();
        authors.add("JakiHappyCity");
        meta.authorList = authors;
        meta.url = "";
        meta.logoFile = "logo.png";
    }
    
}
Но вместо модели nothing to saw :(
[merge_posts_bbcode]Добавлено: 24.09.2015 20:40:43[/merge_posts_bbcode]

up please
 
Метод не активирован. И нужно в клиент прокси писать.
 
timaxa007 написал(а):
Метод не активирован. И нужно в клиент прокси писать.
"[font=monospace, sans-serif]public[/font] [font=monospace, sans-serif]static[/font] [font=monospace, sans-serif]final[/font] [font=monospace, sans-serif]String[/font][font=monospace, sans-serif] clientProxy [/font][font=monospace, sans-serif]=[/font] [font=monospace, sans-serif]"mm.network.proxy.MMClient"[/font][font=monospace, sans-serif];"[/font]
[font=monospace, sans-serif]"[/font][font=monospace, sans-serif]clientSide [/font][font=monospace, sans-serif]=[/font][font=monospace, sans-serif] clientProxy"[/font]
[font=monospace, sans-serif]Разве я не сделал второе?)[/font]
 
FanKar, понятия не имею. Ты написал метод, но класс не показан.
 
Проблема решилась. Спасибо nickita43 (Ну вообще он входит в мою команду разрабов :D)! Завтра напишу о том как он это сделал.
 
Назад
Сверху