Jump to content

Recommended Posts

Posted

So other than the cheesy title, I would like to ask a three part question on some things I am having trouble with.

 

 

 

Timers: Are they done differently since the client/server merge? For an example, I have a timer that sets eggs to hatch after so many ticks. I figured it would be fine since it is saved as an NBT, but sadly that was not the case. Would this be a good time to invest in a datawatcher, or is there perhaps another problem that I could be having?

 

The code is just a simple bit in onUpdate()

 

public void onUpdate()

{

hatchTime++;

    if(hatchTime>= 80)

    hatch();

    super.onUpdate();

    }

 

 

Biomes is more of a general question.

I was looking through the code to see if I could find how mushroom islands were generated, but couldn't quite find it in any of the biome files.

 

Is there a special way to make a biome that is not connected to the mainland?  And if islands are possible, would floating biomes and underground biomes also be plausible using the same logic?

 

 

Music Disks I would just like to see if there are some general pointers on.

 

I remember reading that Forge has a way to implement music files, and I was just looking for more information on how to do that.

Also, do .mp3s work, or is there a special format?

Posted

hatch() sounds like it changes the entity state/places another entity. If so, it should be serverside-only and the value should be datawatcher'd. (ie the entity should have an 'isHatched' boolean and serverside updates the client one, etc.)

Posted

Darn. I was afraid of that. Thanks.

 

Will also look into the GenLayer file. Hadn't looked there. Thanks for the replies.

 

Now only for that tricky music disk question

 

Posted

Add the time variable as an nbt uniquely saved to the entity/whatever, otherwise it won't work with 2 or more objects

"you seem to be THE best modder I've seen imo."

~spynathan

 

ლ(́◉◞౪◟◉‵ლ

Posted

Not sure what you mean, as I can build a timer into an entity and it works with multiple instances (as in each one has a unique timer). To keep the timer in it's state, however, you would need the NBT tagging. (And ofc to have it for both server and client you need to datawatcher the value, but doing that with timers is a poor idea and should instead be done with what happens when the timer expires)

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.