Jump to content

LazerBeans

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by LazerBeans

  1. So what changes should I make to the json model? Sorry about all of the issues, I'm new to Minecraft's TileEntities and rendering. EDIT: Somehow it's working now. First issue I just had while running was missing textures and wrong models for everything, so I just reinput the model call into the variants (the ModelLoader was complaining that there was no model for them, even though I set the default.) When I fixed that, after all other changes, the z-fighting went away. Thank you all for your help, now I'm going to get started on making the GUI work!
  2. It doesn't seem to like that, claiming that TileEntityCardboardBox() is not a TileEntity, and it's trying to get me to change the return type. which is false. It won't let me override without the Block# notation either. Block#createTileEntity() is notation for the method called createTileEntity in the class Block . It has parameters, but I didn't specify them as it has no overloads(methods with the same name but different parameters). If you type a method name in a class and press the autocomplete keybind(Ctrl+Space in Eclipse), your IDE will display all methods with that name that you can override. Great, that's fixed now. Thanks! I was following a TileEntity with GUI tutorial (I can't remember which, it was a while ago, and I ported the code over. I recall it not working then either.) Is the normal block model just in the json? Because the TESR uses the ModelCardboardBox class for itself.
  3. It doesn't seem to like that, claiming that TileEntityCardboardBox() is not a TileEntity, and it's trying to get me to change the return type. which is false. It won't let me override without the Block# notation either.
  4. Thanks! Only issue is I can't figure out which methods to call in order to get the required EntityPlayer and boolean parameters. All other changes are accounted for. (I can't believe I missed that I was calling cube_all ><) EDIT: It seems that I have another issue now: createNewTileEntity was implemented earlier and isn't replaced by Block. Is there a replacement function?
  5. Of course, here it is: ArborCraftBlocks: BlockCardboardBox:
  6. Yes, here is the TESR file: and the ModelCardboardBox class: Hope those help.
  7. Hello, I've been working on modding for some time now (very basic, nothing special) but I've decided to upgrade to 1.10 and try working with TileEntities. I have a cardboard box which has some issues (not opening GUI) but I'll get that solved later. For now, my block model is rendering weirdly, with odd black scratches that show up based on the direction I'm facing. Here is an album of the images: http://imgur.com/a/eTKQ2 And now the .jsons: block.cardboard_box.json item.cardboard_box.json blockstates.cardboard_box.json NOTE: The inventory variant in the blockstate is the same because Forge needed one, so I just used the same as the normal. It doesn't do anything special when it opens. Any help is appreciated, I can supply any other files as necessary. Sorry if it's a stupid issue that I just don't see .
  8. Thanks! This worked. Now I just need to get the inventory model working...
  9. I'll just post the ClientProxy here anyway. ClientProxy: http://pastebin.com/gUrJ7Nqm CommonProxy: http://pastebin.com/fkA4wZ8K If anyone else can join in to help, that would be greatly appreciated.
  10. Yes it is, in my main PreInit(). MineBoard.java: http://pastebin.com/KLjKhLBY I can show my ClientProxy as well, but it calls MineBoardBlocks.init() as well. Another important thing to note is that the code is virtually identical to the code for items, which works, with the key difference being that I needed to change the Item parameter to a Block in the registerRender() function. And in my main mod file, init() is being called before registerRenders(), so there really shouldn't be any issue there.
  11. Hi all, I've been delving into 1.9 modding and am trying to create a simple cardboard block. Everything seems fine, except when I run my eclipse setup I get a null pointer exception during initialization. I can see that `item` is apparently null, is there a different way to do this render call? I've been following ChampionAsh5357's tutorial, and have noticed some issues earlier (namely with registry, but I've got that sorted out) if that helps any. Provided below are the error and the file in which the error occurs. Error: http://pastebin.com/uLGLwyrz MineBoardBlocks.java: http://pastebin.com/RJ5FU6Kq Thanks in advance!
  12. If your game is crashing, we'll need a crash report to pinpoint the source of the error.
  13. Assuming you used Techne for the model...
  14. Maybe the texture itself is bad. Check Techne and you file to make sure that you've textured your mob properly (in the texture, and even in Techne). Other than that, perhaps the file is corrupt. Can you open it? Try opening in GIMP, Photoshop, etc.
  15. Here's a look at my RenderPenguin class: package ArctiCraftMob; import org.lwjgl.opengl.GL11; import com.LazerBeanz.LazerCraft.ArctiCraft.ArctiCraft; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import ArctiCraftMob.EntityPenguin; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; @SideOnly(Side.CLIENT) public class RenderPenguin extends RenderLiving { private static final ResourceLocation penguinTexture = new ResourceLocation("arcticraft" + ":" + "textures/entity/arcticpenguin.png"); private static final String __OBFID = "CL_00000983"; public RenderPenguin(ModelBase modelbase, float f) { super(modelbase, f); } protected void preRenderCallback(EntityLivingBase entitylivingbase, float f) { GL11.glRotatef(270, 0, 1, 0); } public void doRender(EntityPenguin entitypenguin, double d1, double d2, double d3, float f1, float f2) { super.doRender((EntityLiving)entitypenguin, d1, d2, d3, f1, f2); } protected ResourceLocation getEntityTexture(EntityPenguin entitypenguin) { return penguinTexture; } protected float handleRotationFloat(EntityPenguin entitypenguin, float f) { float f1 = entitypenguin.field_70888_h + (entitypenguin.field_70886_e - entitypenguin.field_70888_h) * f; float f2 = entitypenguin.field_70884_g + (entitypenguin.destPos - entitypenguin.field_70884_g) * f; return (MathHelper.sin(f1) + 1.0F) * f2; } public void doRender(EntityLiving entityliving, double d1, double d2, double d3, float f1, float f2) { this.doRender((EntityPenguin)entityliving, d1, d2, d3, f1, f2); } protected float handleRotationFloat(EntityLivingBase entitylivingbase, float f) { return this.handleRotationFloat((EntityPenguin)entitylivingbase, f); } public void doRender(EntityLivingBase entitylivingbase, double d1, double d2, double d3, float d4, float f) { this.doRender((EntityPenguin)entitylivingbase, d1, d2, d3, d4, f); } protected ResourceLocation getEntityTexture(Entity entity) { return this.getEntityTexture((EntityPenguin)entity); } public void doRender(Entity entity, double d1, double d2, double d3, float f1, float f2) { this.doRender((EntityPenguin)entity, d1, d2, d3, f1, f2); } } What you need to look at are the ResourceLocation parts. That should help you out!
  16. I see. I mistook "render" for the render within ModelPenguin... And I fixed the angle to 270 as well. Thanks again, sorry to be a hassle!
  17. Also, make sure that you (eventually) remove examplemod. When you release your mod, the jar will include the mod, and you don't want that.
  18. Yes you can. It works with Minecraft, and it works with my mod.
  19. My preRenderCallback method is now as follows: protected void preRenderCallback(EntityLivingBase par1, float par2) { GL11.glRotatef(90, 0, 1, 0); } Should I be calling for the method anywhere? Here is my full ModelPenguin: package ArctiCraftMob; import org.lwjgl.opengl.GL11; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.MathHelper; public class ModelPenguin extends ModelBase { //fields ModelRenderer Leg1; ModelRenderer Leg2; ModelRenderer Body; ModelRenderer Arm1; ModelRenderer Arm2; ModelRenderer Head; ModelRenderer Foot1; ModelRenderer Foot2; protected void preRenderCallback(EntityLivingBase par1, float par2) { GL11.glRotatef(90, 0, 1, 0); } public ModelPenguin() { textureWidth = 64; textureHeight = 32; Leg1 = new ModelRenderer(this, 42, 12); Leg1.addBox(0F, 0F, 0F, 1, 7, 1); Leg1.setRotationPoint(0F, 17F, -2F); Leg1.setTextureSize(64, 32); Leg1.mirror = true; setRotation(Leg1, 0F, 0F, 0F); Leg2 = new ModelRenderer(this, 42, 12); Leg2.addBox(0F, 0F, 0F, 1, 7, 1); Leg2.setRotationPoint(0F, 17F, 1F); Leg2.setTextureSize(64, 32); Leg2.mirror = true; setRotation(Leg2, 0F, 0F, 0F); Body = new ModelRenderer(this, 46, 12); Body.addBox(0F, 0F, 0F, 3, 11, 6); Body.setRotationPoint(-1F, 6F, -3F); Body.setTextureSize(64, 32); Body.mirror = true; setRotation(Body, 0F, 0F, 0F); Arm1 = new ModelRenderer(this, 32, 0); Arm1.addBox(0F, 0F, 0F, 3, 11, 1); Arm1.setRotationPoint(2F, 6F, -3F); Arm1.setTextureSize(64, 32); Arm1.mirror = true; setRotation(Arm1, 0.2617994F, 3.141593F, 0F); Arm2 = new ModelRenderer(this, 32, 0); Arm2.addBox(0F, 0F, 0F, 3, 11, 1); Arm2.setRotationPoint(-1F, 6F, 3F); Arm2.setTextureSize(64, 32); Arm2.mirror = true; setRotation(Arm2, 0.2617994F, 0F, 0F); Head = new ModelRenderer(this, 42, 0); Head.addBox(0F, -2F, -3F, 5, 6, 6); Head.setTextureOffset(24, 0); //beak Head.setRotationPoint(-2F, 2F, 0F); Head.setTextureSize(64, 32); Head.mirror = true; setRotation(Head, 0F, 0F, 0F); Foot1 = new ModelRenderer(this, 36, 26); Foot1.addBox(0F, 0F, -3F, 2, 0, 3); Foot1.setRotationPoint(0F, 24F, 0F); Foot1.setTextureSize(64, 32); Foot1.mirror = true; setRotation(Foot1, 0F, 0F, 0F); Foot2 = new ModelRenderer(this, 36, 26); Foot2.addBox(0F, 0F, 0F, 2, 0, 3); Foot2.setRotationPoint(0F, 24F, 0F); Foot2.setTextureSize(64, 32); Foot2.mirror = true; setRotation(Foot2, 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); if (this.isChild) { float f6 = 2.0F; GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 5.0F * f5, 2.0F * f5); this.Head.renderWithRotation(f5); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6); GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); this.Body.render(f5); this.Leg1.render(f5); this.Leg2.render(f5); this.Arm1.render(f5); this.Arm2.render(f5); this.Foot1.render(f5); this.Foot2.render(f5); GL11.glPopMatrix(); } else { this.Leg1.render(f5); this.Leg2.render(f5); this.Body.render(f5); this.Arm1.render(f5); this.Arm2.render(f5); this.Head.renderWithRotation(f5); this.Foot1.render(f5); this.Foot2.render(f5); } } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7) { float f6 = (180F / (float)Math.PI); this.Head.rotateAngleX = par5 / (180F / (float)Math.PI); this.Head.rotateAngleY = par4 / (180F / (float)Math.PI); this.Body.rotateAngleY = par5 / (180F / (float)Math.PI); this.Leg1.rotateAngleZ = MathHelper.cos(par1 * 0.3331F) * 1.4F * par2; this.Leg2.rotateAngleZ = MathHelper.cos(par1 * 0.3331F + (float)Math.PI) * 1.4F * par2; this.Arm1.rotateAngleZ = MathHelper.cos(par1 * 0.3331F) * 1.4F * par2; this.Arm2.rotateAngleZ = MathHelper.cos(par1 * 0.3331F + (float)Math.PI) * 1.4F * par2; } }
  20. Agreed. My EntityPenguin has the following code: public class EntityPenguin extends EntityAnimal { //all of the code here }
  21. Is it something wrong with the method? The function? Can anyone help please?
  22. Bump. I seriously don't know why glRotatef() isn't working...
  23. Here's something that might help. Change public ModelCetosUterus(); to public ModelCetosUterus() { } Then continue with rendering and such. Method declarations are basic Java.
  24. Hm... I added a new preRenderCallback method, with the glRotatef, but it doesn't seem to be working. protected void preRenderCallback() { GL11.glRotatef(90, 0, 1, 0); } Should this be before the ModelPenguin() method? It's currently between ModelPenguin() and render(). EDIT: Tried and does not work
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.