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

Adding 3D moddeled block


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

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.



×
×
  • Create New...

Important Information

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