Jump to content

Forge MP, Bukkit and Minecraft 1.3


Kinniken

Recommended Posts

  • Replies 102
  • Created
  • Last Reply

Top Posters In This Topic

NetworkMod:

load()

  ModLoader.registerEntityID()

  MinecraftForge.registerEntity()

 

Should work fine.

I'd debug and see if you're receiving the ModsList packet from Forge with a proper ID, and what happens when you get the EntitySpawn packet.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Yep, it's working fine, with ISpawnHandler to send the initial data and custom packets to keep it updated. Neat.

 

There's still a lot of work to be done (I haven't touched GUIs for instance), but I feel the structure is taking shape. Now it's mostly down to coding lots and lots of custom packets.

Link to comment
Share on other sites

You would have to send the chests's tile entity. There is no simple way.

Are you sure your code should be on the client side for this?

And to preserve your profile, just add a name to the parameters in your run config.

Also, please use edit, dont triple post -.-

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Are you sure? I can't find any method returning a player in NetworkManager.

 

Otherwise, I'm having some strange issues, the server seems to be creating duplicate villager entities at a fairly high rate, especially when a player logins and thus an area becomes active again (I'm speaking of villagers previously instantiated by my code there, which just need to be loaded again). Anyone knows anything about this? Is it a known issue?

Link to comment
Share on other sites

Check the supers of the NetworkManager I KNOW you can get the player from the information you're given. Which is one of the reasons why i dont pass the player in.

And duplicate villagers... Assuimg you're referring to your millinaire villagers.

Thats your code, you're the one spawning them.

 

Either way, it shouldn't create them if they are loaded from the disc.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Otherwise, I'm having some strange issues, the server seems to be creating duplicate villager entities at a fairly high rate, especially when a player logins and thus an area becomes active again (I'm speaking of villagers previously instantiated by my code there, which just need to be loaded again). Anyone knows anything about this? Is it a known issue?

Make sure villagers are only spawned by the server or SP, never a client, many IsRemote checks are useful.  :)

Link to comment
Share on other sites

Check the supers of the NetworkManager I KNOW you can get the player from the information you're given. Which is one of the reasons why i dont pass the player in.

 

Well, that's really weird, I can't find it. And NetworkManager has no super. The one solution I can see is to maintain a map of NetworkManagers to user name, populated in onLogin() (since the login packet has the user name). That would work, assuming that the NetworkManager is constant throughout the connection.

 

And duplicate villagers... Assuimg you're referring to your millinaire villagers.

Thats your code, you're the one spawning them.

 

That's the thing, the error doesn't happen when my code creates villagers, but when chunks containing already-spawned villagers are unloaded then reloaded. But I'll triple-check, it could be due to something malfunctioning on my end.

Link to comment
Share on other sites

Ah, right! However to do that I have to cast the NetHandler to NetServerHandler first, otherwise I can't see the getUsername() method. Maybe you could add the method to NetHandler as well, with null return on the client? Would be easier to see it's there.

 

For my duplicated villagers, I think I've found out why: the server seems to load less chunks around the player than SP does. The result is that my code is looking for villagers that haven't been loaded from NBT yet and respawning them thinking they are missing - which makes Minecraft load the chunk in question and with it the "missing" villager. Looks like I need to reduce Millénaire's activity radius in MP. Anyone know what it is? What area around a player is guaranteed to be live?

Link to comment
Share on other sites

You should add that getUsername function yourself in your own sided proxy class.

 

Anyways, there is no garentee that ANY radius around the player is to be loaded. On the server you can lower it to one chunk, or you can raise it to 1,000 chunks.

Many times it's lowered.

What you *should* do is have your village object store the location of the villagers and not create new ones if they are already created, but unloaded.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

You should add that getUsername function yourself in your own sided proxy class.

 

That's what I did. I was mentioning having it in the parent class mostly for futur users. Once you know it's there making your own method trivial.

 

Anyways, there is no garentee that ANY radius around the player is to be loaded. On the server you can lower it to one chunk, or you can raise it to 1,000 chunks.

Many times it's lowered.

What you *should* do is have your village object store the location of the villagers and not create new ones if they are already created, but unloaded.

 

Actually what I did is add code that freezes the entire village if part of it is unloaded. Otherwise I was having other issues such as villagers loading chunks by travelling there or putting blocks in them, which would hit performance. Anyway, problem solved!

Link to comment
Share on other sites

Hmm, chunk unloading on the server is very agressive. You basically need to be in the village to have it be active. That's both good CPU-wise and means that villages won't progress much. Anyway, if there's anything to be done about it it can wait.

 

Otherwise, next issue ;) Whenever a village is generated (when a player explores new areas) large parts of it will be on chunks that have already been generated and sent to the client. Probably since I set my blocks with no notify Minecraft doesn't resend the changes, so the player ends up with a village made of invisible, server-side only blocks until he reconnects. Is there anyway I could have the server resend the chunks? Of course it means duplicate data sent but since this will only happen when a player explores a new area it's acceptable I feel.

Link to comment
Share on other sites

Marks the blocks as dirty {there is a function around there somewhere} or use notify.

Either way if you do it in one go, all the changes will be gathered up and sent to the client in one chunk.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Hmm, chunk unloading on the server is very agressive. You basically need to be in the village to have it be active. That's both good CPU-wise and means that villages won't progress much. Anyway, if there's anything to be done about it it can wait.

 

Otherwise, next issue ;) Whenever a village is generated (when a player explores new areas) large parts of it will be on chunks that have already been generated and sent to the client. Probably since I set my blocks with no notify Minecraft doesn't resend the changes, so the player ends up with a village made of invisible, server-side only blocks until he reconnects. Is there anyway I could have the server resend the chunks? Of course it means duplicate data sent but since this will only happen when a player explores a new area it's acceptable I feel.

Forge includes hooks to handle chunk unloading (and keeping them from being unloaded), if you want fine grained control over it near your villages.

Link to comment
Share on other sites

Interesting, I'll check it out. Not for release 1, but it might be a good option to add later.

 

Otherwise, anyone knows how I can set the "death message" people get when killed by one of my villagers? It's clearly sent by this line:

 

        return StatCollector.translateToLocalFormatted("death." + this.damageType, new Object[] {par1EntityPlayer.username});

 

Where "this.damageType" is of the form "entity.<entity name>.name". Not sure how to provide that value however. Also, is there a way to make it specific to a given entity instead of generic? If possible I'd rather have it show the villager's name instead of just "villager".

Link to comment
Share on other sites

That returns a fully translated string, you can do whatever you want with it.

It grabs the message from 'death.entity.entityname.name' in the languages file and translates it, you could do whatever you want...

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.




×
×
  • Create New...

Important Information

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