Jump to content

Entity rendering as a white box


Nomis

Recommended Posts

IO2iSoi.png

 

I'm trying to create a block renders as a techne model but this is what i get ^^^

 

I have no idea why this happens. Here is my src code:

 

Main Mod

 

@Mod(modid = FactoryCraft.MODID, name = FactoryCraft.NAME, version = FactoryCraft.VERSION)
public class FactoryCraft {
@SidedProxy(clientSide = "me.FactoryCraft.FactoryCraft.ClientProxy", serverSide = "me.FactoryCraft.FactoryCraft.CommonProxy")
public static CommonProxy proxy;

    public static final String MODID = "FactoryCraft";
    public static final String VERSION = "0.0.1a";
    public static final String NAME = "Factory Craft";
    
    public static Block woodMachineFrame = new WoodMachineFrame(1234, Material.wood).setBlockName("WoodMachineFrame").setBlockTextureName(FactoryCraft.MODID + ":planks");    
    @Instance(FactoryCraft.MODID)
    public static FactoryCraft instance;
    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
    	GameRegistry.registerBlock(woodMachineFrame, "WoodMachineFrame");
    	
    	Items.init();
    	Entities.init();
    }

 

 

ClientProxy

 

public class ClientProxy extends CommonProxy {
@Override
public void initRenderes() {
	RenderingRegistry.registerEntityRenderingHandler(EntityChimney.class, new RenderChimney());
}
}

 

 

The Entity

 

public class EntityChimney extends Entity {

public EntityChimney(World world) {
	super(world);
}

public EntityChimney(World world, double x, double y, double z) {
	super(world);

	posX = x;
	posY = y;
	posZ = z;
}

@Override
protected void entityInit() {
}

@Override
protected void readEntityFromNBT(NBTTagCompound var1) {
}

@Override
protected void writeEntityToNBT(NBTTagCompound var1) {	
}
}

 

 

The Model (The names are in danish... But it's made in techne)

 

public class ModelChimney extends ModelBase
{
  //fields
    ModelRenderer fladeF;
    ModelRenderer fladeR;
    ModelRenderer fladeL;
    ModelRenderer fladeB;
    ModelRenderer streg1;
    ModelRenderer streg2;
    ModelRenderer streg3;
    ModelRenderer streg4;
    ModelRenderer streg5;
    ModelRenderer streg6;
    ModelRenderer streg7;
    ModelRenderer streg8;
    ModelRenderer Shape9;
    ModelRenderer streg10;
    ModelRenderer streg11;
    ModelRenderer streg12;
  
  public ModelChimney()
  {
    textureWidth = 64;
    textureHeight = 32;
    
      fladeF = new ModelRenderer(this, 0, 0);
      fladeF.addBox(0F, 0F, 0F, 6, 16, 1);
      fladeF.setRotationPoint(-3F, 8F, -7F);
      fladeF.setTextureSize(64, 32);
      fladeF.mirror = true;
      setRotation(fladeF, 0F, 0F, 0F);
      fladeR = new ModelRenderer(this, 0, 0);
      fladeR.addBox(0F, 0F, 0F, 1, 16, 6);
      fladeR.setRotationPoint(-7F, 8F, -3F);
      fladeR.setTextureSize(64, 32);
      fladeR.mirror = true;
      setRotation(fladeR, 0F, 0F, 0F);
      fladeL = new ModelRenderer(this, 0, 0);
      fladeL.addBox(0F, 0F, 0F, 1, 16, 6);
      fladeL.setRotationPoint(6F, 8F, -3F);
      fladeL.setTextureSize(64, 32);
      fladeL.mirror = true;
      setRotation(fladeL, 0F, 0F, 0F);
      fladeB = new ModelRenderer(this, 0, 0);
      fladeB.addBox(0F, 0F, 0F, 6, 16, 1);
      fladeB.setRotationPoint(-3F, 8F, 6F);
      fladeB.setTextureSize(64, 32);
      fladeB.mirror = true;
      setRotation(fladeB, 0F, 0F, 0F);
      streg1 = new ModelRenderer(this, 0, 0);
      streg1.addBox(0F, 0F, 0F, 1, 16, 1);
      streg1.setRotationPoint(-6F, 8F, 3F);
      streg1.setTextureSize(64, 32);
      streg1.mirror = true;
      setRotation(streg1, 0F, 0F, 0F);
      streg2 = new ModelRenderer(this, 0, 0);
      streg2.addBox(0F, 0F, 0F, 1, 16, 1);
      streg2.setRotationPoint(-6F, 8F, -4F);
      streg2.setTextureSize(64, 32);
      streg2.mirror = true;
      setRotation(streg2, 0F, 0F, 0F);
      streg3 = new ModelRenderer(this, 0, 0);
      streg3.addBox(0F, 0F, 0F, 1, 16, 1);
      streg3.setRotationPoint(4F, 8F, -5F);
      streg3.setTextureSize(64, 32);
      streg3.mirror = true;
      setRotation(streg3, 0F, 0F, 0F);
      streg4 = new ModelRenderer(this, 0, 0);
      streg4.addBox(0F, 0F, 0F, 1, 16, 1);
      streg4.setRotationPoint(5F, 8F, -4F);
      streg4.setTextureSize(64, 32);
      streg4.mirror = true;
      setRotation(streg4, 0F, 0F, 0F);
      streg5 = new ModelRenderer(this, 0, 0);
      streg5.addBox(0F, 0F, 0F, 1, 16, 1);
      streg5.setRotationPoint(5F, 8F, 3F);
      streg5.setTextureSize(64, 32);
      streg5.mirror = true;
      setRotation(streg5, 0F, 0F, 0F);
      streg6 = new ModelRenderer(this, 0, 0);
      streg6.addBox(0F, 0F, 0F, 1, 16, 1);
      streg6.setRotationPoint(-5F, 8F, 4F);
      streg6.setTextureSize(64, 32);
      streg6.mirror = true;
      setRotation(streg6, 0F, 0F, 0F);
      streg7 = new ModelRenderer(this, 0, 0);
      streg7.addBox(0F, 0F, 0F, 1, 16, 1);
      streg7.setRotationPoint(3F, 8F, 5F);
      streg7.setTextureSize(64, 32);
      streg7.mirror = true;
      setRotation(streg7, 0F, 0F, 0F);
      streg8 = new ModelRenderer(this, 0, 0);
      streg8.addBox(0F, 0F, 0F, 1, 16, 1);
      streg8.setRotationPoint(-4F, 8F, 5F);
      streg8.setTextureSize(64, 32);
      streg8.mirror = true;
      setRotation(streg8, 0F, 0F, 0F);
      Shape9 = new ModelRenderer(this, 0, 0);
      Shape9.addBox(0F, 0F, 0F, 1, 16, 1);
      Shape9.setRotationPoint(4F, 8F, 4F);
      Shape9.setTextureSize(64, 32);
      Shape9.mirror = true;
      setRotation(Shape9, 0F, 0F, 0F);
      streg10 = new ModelRenderer(this, 0, 0);
      streg10.addBox(0F, 0F, 0F, 1, 16, 1);
      streg10.setRotationPoint(-5F, 8F, -5F);
      streg10.setTextureSize(64, 32);
      streg10.mirror = true;
      setRotation(streg10, 0F, 0F, 0F);
      streg11 = new ModelRenderer(this, 0, 0);
      streg11.addBox(0F, 0F, 0F, 1, 16, 1);
      streg11.setRotationPoint(3F, 8F, -6F);
      streg11.setTextureSize(64, 32);
      streg11.mirror = true;
      setRotation(streg11, 0F, 0F, 0F);
      streg12 = new ModelRenderer(this, 0, 0);
      streg12.addBox(0F, 0F, 0F, 1, 16, 1);
      streg12.setRotationPoint(-4F, 8F, -6F);
      streg12.setTextureSize(64, 32);
      streg12.mirror = true;
      setRotation(streg12, 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);
    fladeF.render(f5);
    fladeR.render(f5);
    fladeL.render(f5);
    fladeB.render(f5);
    streg1.render(f5);
    streg2.render(f5);
    streg3.render(f5);
    streg4.render(f5);
    streg5.render(f5);
    streg6.render(f5);
    streg7.render(f5);
    streg8.render(f5);
    Shape9.render(f5);
    streg10.render(f5);
    streg11.render(f5);
    streg12.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 f, float f1, float f2, float f3, float f4, float f5)
  {
    //super.setRotationAngles(f, f1, f2, f3, f4, f5);
  }

}

 

 

Render

 

public class RenderChimney extends Render {

private ModelChimney model;
private static final ResourceLocation texture = new ResourceLocation(FactoryCraft.MODID, ":Chimney.png");

public RenderChimney() {
	model = new ModelChimney();
	shadowSize = 0.5F;
}

@Override
public void doRender(Entity entity, double x, double y, double z, float yaw, float partialTickTime) {
	GL11.glPushMatrix();

	GL11.glTranslatef((float) x, (float) y, (float) z);
	GL11.glScalef(-1F, -1F, -1F);

	bindEntityTexture(entity);

	model.render(entity, 0F, 0F, 0F, 0F, 0F, 0.0625F);

	GL11.glPopMatrix();
}

@Override
protected ResourceLocation getEntityTexture(Entity var1) {
	return texture;
}

}

 

Author of the unreleased mod Factory Craft

I'm usually known as MnomisC

IGN MnomisC

Link to comment
Share on other sites

Hi

 

So I'm guessing that your white box is the right shape for the chimney, it just doesn't have any bricks, i.e. the texture is not showing.

 

I'm not really familiar with techne models, but I imagine that either texturing is turned off, you haven't bound the texture properly, or the path to the texture is wrong.  Hopefully someone else on this forum can be more specific...

 

-TGG

 

 

Link to comment
Share on other sites

Hi

 

So I'm guessing that your white box is the right shape for the chimney, it just doesn't have any bricks, i.e. the texture is not showing.

 

I'm not really familiar with techne models, but I imagine that either texturing is turned off, you haven't bound the texture properly, or the path to the texture is wrong.  Hopefully someone else on this forum can be more specific...

 

-TGG

 

I don't think that's the model, because he has a couple of shapes in his model class.

 

I had the same problem earlier and I left it alone, and after I touched some of my gui code my entity completely stopped rendering.

 

Sorry. :(

Kain

Link to comment
Share on other sites

hey I am one of the two modder's in this mod i am not experienced with modding and java i am stil just learning but i can give you information

 

Have you applied in your proxy - I don't think so :[

proxy.initRenderes()

 

ClientProxy.java

 

package me.FactoryCraft.FactoryCraft;

import me.FactoryCraft.FactoryCraft.Entity.EntityChimney;
import me.FactoryCraft.FactoryCraft.Renderer.RenderChimney;
import cpw.mods.fml.client.registry.RenderingRegistry;

public class ClientProxy extends CommonProxy {
@Override
public void initRenderes() {
	RenderingRegistry.registerEntityRenderingHandler(EntityChimney.class, new RenderChimney());
	System.out.println("Test");
}
}

 

CommonProxy.java

 

package me.FactoryCraft.FactoryCraft;

public class CommonProxy {
public void initRenderes() {

}
}

 

Hi

 

So I'm guessing that your white box is the right shape for the chimney, it just doesn't have any bricks, i.e. the texture is not showing.

 

I'm not really familiar with techne models, but I imagine that either texturing is turned off, you haven't bound the texture properly, or the path to the texture is wrong.  Hopefully someone else on this forum can be more specific...

 

-TGG

 

 

this is how it should look:

without texture

 

 

Abe1oMV.png

 

 

with texture

 

 

0WqFSqW.png

 

 

Link to comment
Share on other sites

hey I am one of the two modder's in this mod i am not experienced with modding and java i am stil just learning but i can give you information

 

Have you applied in your proxy - I don't think so :[

proxy.initRenderes()

 

ClientProxy.java

 

package me.FactoryCraft.FactoryCraft;

import me.FactoryCraft.FactoryCraft.Entity.EntityChimney;
import me.FactoryCraft.FactoryCraft.Renderer.RenderChimney;
import cpw.mods.fml.client.registry.RenderingRegistry;

public class ClientProxy extends CommonProxy {
@Override
public void initRenderes() {
	RenderingRegistry.registerEntityRenderingHandler(EntityChimney.class, new RenderChimney());
	System.out.println("Test");
}
}

 

CommonProxy.java

 

package me.FactoryCraft.FactoryCraft;

public class CommonProxy {
public void initRenderes() {

}
}

 

 

Hi

 

I think coolbody4531 is right - you have defined initRenderes(), but you never seem to call it?

 

Something like

    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
    	GameRegistry.registerBlock(woodMachineFrame, "WoodMachineFrame");
    	
    	Items.init();
    	Entities.init();
    }
   @EventHandler
    public void postInit(FMLPostInitializationEvent event) {
    	proxy.initRenderes();
    }

 

Some further background info here if you're interested

http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html

 

-TGG

Link to comment
Share on other sites

Hi

 

I think coolbody4531 is right - you have defined initRenderes(), but you never seem to call it?

 

Something like

    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
    	GameRegistry.registerBlock(woodMachineFrame, "WoodMachineFrame");
    	
    	Items.init();
    	Entities.init();
    }
   @EventHandler
    public void postInit(FMLPostInitializationEvent event) {
    	proxy.initRenderes();
    }

 

Some further background info here if you're interested

http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html

 

-TGG

Thank you it work's now we just have to make the texture work :P and have a hitbox..

8EoiOh7.png

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • One of my players is suddenly unable to join a locally hosted MC Eternal server. We have been playing on this server for about 2-3 weeks now. I have tried erasing his player files and his reputation file, and now it just coughs up this and kicks him out: [User Authenticator #5/INFO] [minecraft/NetHandlerLoginServer]: UUID of player EthosTheGod is 7692d8db-02c3-424f-a4ab-0e4e259b106b [20:25:36] [User Authenticator #4/INFO] [minecraft/NetHandlerLoginServer]: UUID of player EthosTheGod is 7692d8db-02c3-424f-a4ab-0e4e259b106b [20:29:35] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Did the system time change, or is the server overloaded? Running 575849ms behind, skipping 11516 tick(s) [20:29:35] [Server thread/INFO] [minecraft/NetHandlerLoginServer]: com.mojang.authlib.GameProfile@4a6c63f1[id=7692d8db-02c3-424f-a4ab-0e4e259b106b,name=EthosTheGod,properties={textures=[com.mojang.authlib.properties.Property@241ea89e]},legacy=false] (/IP.ADDRESS) lost connection: Disconnected [20:29:35] [Server thread/INFO] [minecraft/NetHandlerLoginServer]: com.mojang.authlib.GameProfile@6ab6c661[id=7692d8db-02c3-424f-a4ab-0e4e259b106b,name=EthosTheGod,properties={textures=[com.mojang.authlib.properties.Property@7f19aae3]},legacy=false] (/IP.ADDRESS) lost connection: Disconnected It just says "connection timed out" on his end. Any ideas?
    • I'm trying to migrate my mod from 1.20 to 1.21. Some packages in the forge api were changed so my mod did have some classes not working. I've changed everything i needed but still is getting me the following error error: cannot access Registry DeferredRegister.create(ForgeRegistries.BLOCKS, FarmMod.MOD_ID); ^ class file for net.minecraft.core.Registry not found The piece of code that is wrong is   public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, FarmMod.MOD_ID); And here are my imports   import com.lucas.farmmod.FarmMod; import com.lucas.farmmod.block.custom.BaseIrrigatorBlock; import com.lucas.farmmod.item.ModItems; import com.lucas.farmmod.item.custom.BaseIrrigatorBlockItem; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; The class DeferredRegister is throwing the error in the print below     I've tried running rebuilding my project in every way possible, tried refreshing my dependencies but nothing works. What can i do?
    • It sounds like there might be a synchronization issue with your PartEntity. Ensure that the part entity’s position is updated in your entity's tick method to continuously match the main entity’s location.
    • For keyboard and mouse inputs, Minecraft Forge utilizes the event system to manage interactions, making it easier to handle across different mods. If you’re looking to bypass this and read inputs directly, you’d typically look into the KeyboardListener and MouseListener classes in the game's code. These classes process input events directly from the user's hardware. If you're experimenting with inputs a lot, you might find a compact keypad handy for quick commands. Check out numeric keyboard . It can speed up your coding workflow! Good luck!
  • Topics

×
×
  • Create New...

Important Information

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