Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Entity rendering as a white box


Nomis
 Share

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

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
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.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • It doesn't work even if I remove every mod Please help
    • Hi, so I was making an item that sends info to the server to do some work, and I want the server to send the client back the results? How do I do that? Here is my code:   The snippet that sends the packet to the server SimpleChannelNetwork.CHANNEL.sendToServer(new CreateStructureCompass("fortress"));   The file that manage the traffic package io.github.bossmania.NetherandEndMaps.core.network; import io.github.bossmania.NetherandEndMaps.NetherandEndMaps; import io.github.bossmania.NetherandEndMaps.core.network.message.CreateStructureCompass; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.network.NetworkRegistry; import net.minecraftforge.fml.network.simple.SimpleChannel; public class SimpleChannelNetwork { public static final String NETWORK_VERSION = "0.1.0"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(NetherandEndMaps.MOD_ID, "network"), () -> NETWORK_VERSION, version -> version.equals(NETWORK_VERSION), version -> version.equals(NETWORK_VERSION)); public static void init() { CHANNEL.registerMessage(0, CreateStructureCompass.class ,CreateStructureCompass::encode, CreateStructureCompass::decode, CreateStructureCompass::handle); } }   the code that handle the packet receive and where I want the server to send back a packet to the client package io.github.bossmania.NetherandEndMaps.core.network.message; import java.util.function.Supplier; import io.github.bossmania.NetherandEndMaps.common.items.TemporaryItem; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.gen.feature.structure.Structure; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.fml.network.NetworkEvent; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; public class CreateStructureCompass { public String structureType; public CreateStructureCompass() { } //create the constructor and store the structureType public CreateStructureCompass(String structureType) { this.structureType = structureType; } //encode the message public static void encode(CreateStructureCompass message, PacketBuffer buffer) { buffer.writeString(message.structureType); } //decode the message public static CreateStructureCompass decode(PacketBuffer buffer) { return new CreateStructureCompass(buffer.readString()); } //execute function when message is sent to server public static void handle(CreateStructureCompass message, Supplier<NetworkEvent.Context> contextSupplier) { NetworkEvent.Context context = contextSupplier.get(); context.enqueueWork(() -> { //get the player and the server ServerPlayerEntity player = context.getSender(); ServerWorld SEWorld = player.getServerWorld(); //get the location of the structure BlockPos structureLocation = SEWorld.func_241117_a_(Structure.FORTRESS, player.getPosition(),100, false); //this is where I want the server to send structureLocation back to the player }); context.setPacketHandled(true); } }  
    • I cannot get an instance of MC Forge to run with either the vanilla launcher or GDLauncher, yet vanilla MC and Fabric MC work fine in both.  I am running the latest versions of everything, and no 1.18-compatible version of Forge will launch even though they all install without fail. Using the vanilla launcher I get exit code 0 and the following logs: Debug log Latest log With GDLauncher I get the following console output:  
    • In 1.15 and before, you could get the item being held/dragged by the cursor using PlayerInventory#getItemStack. This no longer seems to be the case. How do we do this now?
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.