The Meaning of Life, the Universe, and Everything.
Join Date:
5/24/2012
Posts:
52
Minecraft:
ullert
Member Details
So im trying to make this model block, and i have no errors, but nothing is working :l i have been watching a tutorial on youtube, several times, but i cant seem to fix it D:
Any help apreciated!
Code:
MainClass:
public static Block ScrapWoodPile;
ScrapWoodPile = new ScrapWoodPile(226).setUnlocalizedName("ScrapWoodPile").setHardness(5.0F).setResistance(20.0F);
So im trying to make this model block, and i have no errors, but nothing is working :l i have been watching a tutorial on youtube, several times, but i cant seem to fix it D:Any help apreciated!Code:MainClass:
public static Block ScrapWoodPile;ScrapWoodPile = new ScrapWoodPile(226).setUnlocalizedName("ScrapWoodPile").setHardness(5.0F).setResistance(20.0F);GameRegistry.registerTileEntity(TileEntityScrapWoodPile.class, "RendererScrapwoodpile");ClientRegistry.bindTileEntitySpecialRenderer(TileEntityScrapWoodPile.class, new RendererScrapWoodPile());
RendererClass:
public class RendererScrapWoodPile extends TileEntitySpecialRenderer {private static final ResourceLocation texture = new ResourceLocation(FallenEarth.modid, "textures/model/ScrapWoodPile.png");private ModelScrapWoodPile model;public RendererScrapWoodPile(){this.model = new ModelScrapWoodPile();}public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {GL11.glPushMatrix();GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);GL11.glRotatef(180, 0F, 0F, 1F);this.bindTexture(texture);GL11.glPushMatrix();this.model.renderModel(0.0625F);GL11.glPopMatrix();GL11.glPopMatrix();}}
The Meaning of Life, the Universe, and Everything.
Join Date:
5/24/2012
Posts:
52
Minecraft:
ullert
Member Details
sorry, i meant, that the block is not in the game :l like i cant spawn it in. It says the item id doesnt excist, and no errors occur telling me why this happens.
sorry, i meant, that the block is not in the game :l like i cant spawn it in. It says the item id doesnt excist, and no errors occur telling me why this happens.
Try changing your block id to something like 1000.
The Meaning of Life, the Universe, and Everything.
Join Date:
5/24/2012
Posts:
52
Minecraft:
ullert
Member Details
It didnt work :l whatever Id i try to give myself ingame, it says "There is no such item with ID *number*" (*number* = any id i try to put in for the custom block)
Any help apreciated!
Code:
MainClass:
ScrapWoodPile = new ScrapWoodPile(226).setUnlocalizedName("ScrapWoodPile").setHardness(5.0F).setResistance(20.0F);
GameRegistry.registerTileEntity(TileEntityScrapWoodPile.class, "RendererScrapwoodpile");
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityScrapWoodPile.class, new RendererScrapWoodPile());
private static final ResourceLocation texture = new ResourceLocation(FallenEarth.modid, "textures/model/ScrapWoodPile.png");
private ModelScrapWoodPile model;
public RendererScrapWoodPile(){
this.model = new ModelScrapWoodPile();
}
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
GL11.glPushMatrix();
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
GL11.glRotatef(180, 0F, 0F, 1F);
this.bindTexture(texture);
GL11.glPushMatrix();
this.model.renderModel(0.0625F);
GL11.glPopMatrix();
GL11.glPopMatrix();
}
}
ModelClass:
{
//fields
ModelRenderer Plank1;
ModelRenderer Plank2;
ModelRenderer Plank3;
public ModelScrapWoodPile()
{
textureWidth = 64;
textureHeight = 32;
Plank1 = new ModelRenderer(this, 0, 0);
Plank1.addBox(2F, 0F, 0F, 13, 1, 4);
Plank1.setRotationPoint(-7F, 21F, 3F);
Plank1.setTextureSize(64, 32);
Plank1.mirror = true;
setRotation(Plank1, 0.0349066F, 0.4886922F, 0.1396263F);
Plank2 = new ModelRenderer(this, 0, 10);
Plank2.addBox(0F, 0F, 0F, 15, 1, 4);
Plank2.setRotationPoint(-4F, 23F, -7F);
Plank2.setTextureSize(64, 32);
Plank2.mirror = true;
setRotation(Plank2, 0F, -0.8726646F, 0F);
Plank3 = new ModelRenderer(this, 0, 5);
Plank3.addBox(0F, 0F, 0F, 14, 1, 4);
Plank3.setRotationPoint(-4F, 19.6F, 4.5F);
Plank3.setTextureSize(64, 32);
Plank3.mirror = true;
setRotation(Plank3, 0.1047198F, 1.22173F, 0.2792527F);
}
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);
Plank1.render(f5);
Plank2.render(f5);
Plank3.render(f5);
}
public void renderModel(float f){
Plank1.render(f);
Plank2.render(f);
Plank3.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);
}
}
TileEntityClass:
import net.minecraft.tileentity.TileEntity;
public class TileEntityScrapWoodPile extends TileEntity {
}
public ScrapWoodPile(int id){
super(id, Material.wood);
this.setCreativeTab(FallenEarthTab.FallenEarthCreativeTab);
}
public TileEntity createNewTileEntity(World world) {
return new TileEntityScrapWoodPile();
}
public int getRenderType(){
return -1;
}
public boolean isOpaqueCube(){
return false;
}
public boolean renderAsNormalBlock(){
return false;
}
public String getTextureFile(){
return "/textures/blocks/DryMud.png";
}
}
The package and import files are missing on some of them (if not all) but is there anything else that could be worng, or missing?
Try changing your block id to something like 1000.
Mapping and Modding rules | Global rules