I didn't say "show me a tutorial", i said "show me what you have currently, maybe you've done something wrong". And yeah, you NEVER should just copy something you don't even understand!
It seems that the method in your ClientProxy class is never called because you do not override a method from CommonProxy. (Btw you shouldn't register the TileEntity in the ClientProxy, do it in CommonProxy).
You also should not instantiate your block using an Entity, create a method setFish() or something in the TileEntity instead (for the block it doesn't matter what fish it contains.) You can then call the method on the TE in the block's onBlockActivated() method.
If I were you I'd start over because at this point you seem to have mashed together the two tutorials. This error is probably happening because you aren't glTranslatef to the correct render location, rendering your block relative to the player. Try this:
package com.mrpablo2000.aquariumcraft.tileentity;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import com.mrpablo2000.aquariumcraft.AquariumCraft;
import com.mrpablo2000.aquariumcraft.blocks.BlockAquarium;
import com.mrpablo2000.aquariumcraft.blocks.model.ModelEmptyAquarium;
import cpw.mods.fml.common.FMLLog;
public class TileEntityEmptyAquariumRenderer extends TileEntitySpecialRenderer
{
ResourceLocation texture = (new ResourceLocation(AquariumCraft.modid+":textures/blocks/EmptyAquariumModel.png"));
private ModelEmptyAquarium model = new ModelEmptyAquarium();
private boolean field_147509_j;
public TileEntityEmptyAquariumRenderer(){}
@Override
public void renderTileEntityAt(TileEntity p_147500_1_, double x, double y, double z, float p_147500_8_) {
GL11.glPushMatrix();
GL11.glRotatef(0F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0.0F, -0.1F, 0.0F);
GL11.glRotatef(180F, 0.0F, 0.0F, 0.1F);
GL11.glTranslatef(-1.0F, -1.0F, -0.0F);
GL11.glTranslated(x, y, z); //New Line. Renders the object at the coordinates given in the function parameters. You might have to play with the other glTranslatefs to get it just right, but this should be the basis.
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
model.renderAll();
GL11.glPopMatrix();
}
}
I haven't modded for a while but that's probably close to what you should be doing
How to create a block with custom techne model?
I made it with forge guide(in website archive ), but i have got invisible block? I don't want to use WaveFront obj models!
use a TileEntitySpecialRenderer
But how? My code isn't working
could you show your current code?
https://web.archive.org/web/20160329163309/http://www.minecraftforge.net/wiki/Rendering_a_Techne_Model_as_a_Block
I just copy-paste to check this code, and it doesn't work
I didn't say "show me a tutorial", i said "show me what you have currently, maybe you've done something wrong". And yeah, you NEVER should just copy something you don't even understand!
I know, but i just have to check the code. Sorry man
TileEntity is empty
TileEntitySpecialRenderer:
http://hastebin.com/sigudedaqe.java
BlockAquarium:
http://hastebin.com/oneziquhej.java
ModelAquarium:
http://hastebin.com/gelidotoqe.java
ClientProxy:
http://hastebin.com/enajahubac.scala
ItemEmptyAquariumRender:
http://hastebin.com/otozivociy.java
It seems that the method in your ClientProxy class is never called because you do not override a method from CommonProxy. (Btw you shouldn't register the TileEntity in the ClientProxy, do it in CommonProxy).
You also should not instantiate your block using an Entity, create a method setFish() or something in the TileEntity instead (for the block it doesn't matter what fish it contains.) You can then call the method on the TE in the block's onBlockActivated() method.
Now, my block is comming with me xDDD
Anyone? Please, help me
If I were you I'd start over because at this point you seem to have mashed together the two tutorials. This error is probably happening because you aren't glTranslatef to the correct render location, rendering your block relative to the player. Try this:
I haven't modded for a while but that's probably close to what you should be doing