Jump to content

Adding 3D moddeled block


yuvalr00

Recommended Posts

 

    @Override

    public Packet getDescriptionPacket()

    {

        NBTTagCompound tag = new NBTTagCompound();

        writeToNBT(tag);

        return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag);

    }

 

    @Override

    public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)

    {

        readFromNBT(packet.func_148857_g());

    }

Link to comment
Share on other sites

there is my class:

public int customField;

@Override

public void writeToNBT(NBTTagCompound par1)

{

  super.writeToNBT(par1);

  par1.setInteger("customField", customField);

}

 

@Override

public void readFromNBT(NBTTagCompound par1)

{

  super.readFromNBT(par1);

  this.customField = par1.getInteger("customField");

}

 

 

public TileEntity createTileEntity(World world, int metadata)

{

  return new RcTileEntity();

}

 

public Packet getDescriptionPacket() {

    NBTTagCompound nbtTag = new NBTTagCompound();

    this.writeToNBT(nbtTag);

    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag);

    }

 

    public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) {

    readFromNBT(packet.customParam1);

    }

 

}

where to place it?

 

Link to comment
Share on other sites

In your renderer. Make a

private static MyModel model;

object.

 

In the costructor add

model = new MyModel();

 

And in the rendetTileEntityAt you add

model.render(0.0625F);

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



×
×
  • Create New...

Important Information

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