Jump to content

[1.3.2][SOLVED] Questions beyond tutorials


Recommended Posts

Posted

hi there finally i decided to create a forge account and ask a few questions.

first off i am not new to modding games or programming at all, i am just new to minecraft/forge modding.

 

the last 3 days i followed nearly all tutorials from the wiki and the subforums on how to do certain things with the new forge,

but now i am at a point where i do not really understand how forge handles some things.

 

i tried to create a block with subblocks consisting of "block" and "itemblock" with metadata. (working)

after that i wanted to add the ability to rotate the textures on these blocks via a tool or as a start point my hand.

 

therefore i added tileentities (of course with all the register functions etc...) everything goes the right way except the sync part.

 

the first thing i noticed is that the tileentities get created on the client as well as on the server, so far no problem,

but they do not share their nbtflags.

 

so what happens:

[*]i connect to my local server and activate my rotate function

[*]no visual effect, but server recognized click and made his action, as well as client

[*]after a few seconds the block rotates at the client side

[*]reentering the server resets all rotated blocks to default

now to the question part... (sorry for the long text hopefully you can now understand my questions)

  • is it necessary to sync all tileentities by hand?
  • if so is that the ominous packethandler stuff?
  • do i need to add this to all entity related actions?
  • how do i send this custom packet to the right target? (creating the packets and registering the packetmanager is ok got that allready)
           
  • far off but another question: is there a "new" way of how to add sounds to forge? (cant get it to work with old tut)

 

thx for all answered questions

Garbage Collection In Progress <||||    >

Posted

thx for that info.

but could someone tell me the use for a tileentity now? (except nbtflags, wich dont seem to work...)

why shouldnt i reimplement the block with some extra network stuff?

Garbage Collection In Progress <||||    >

Posted

thx for that info.

but could someone tell me the use for a tileentity now? (except nbtflags, wich dont seem to work...)

why shouldnt i reimplement the block with some extra network stuff?

A block is simple the physical existence of the block with code to change how its is placed,removed,destroyed, walked, on etc. The block also shares the same vars with all blocks. Meaning a change in one block is a change in all blocks. Also a block is limited to storing so much data usually in metadata. It normally can't save any data past the metadata.

 

A TileEntity is the spirit of a single block. You can use it for storing data, doing per tick updates, and sending/receiving packet data. You can also use it for doing special renders,having something other than a block shape. Another is having 1000 blocks in one block by storing type info in the tileEntity.

 

Posted

You made my day thx for that explanation!

Now my basic questions are answered and i can go on with the network stuff without worrying that i do things straight against forge.

Garbage Collection In Progress <||||    >

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.