Jump to content

Kinniken

Members
  • Posts

    266
  • Joined

  • Last visited

Everything posted by Kinniken

  1. Lex, any chance of that happening? Thinking more about my future update plans I realise that what I really need is asymmetric compatibility - basically, when I add new features such as items or blocks, I can have the new client be backward compatible with older servers, but obviously not the reverse. With the toString() method this can't be done in any way I can think of. My only "solution" would be to keep the strings the same and then do my own check on start-up.
  2. BTW, for anybody interested, I have a public beta of Millénaire MP available on my website: millenaire.org Seems to be mostly working fine, with just a few bugs to track down.
  3. It would be useful, how did you gather the data? atrain is right, I could make one myself from the various mods, but that sounds like a good way to forget some since I'm not very up to date on the major mods being played today.
  4. Hi guys, I see that Forge now ships with a 4096 block id fix, which is great news for Millénaire. So I was thinking of changing my current blocks ids (all below 256) into a new range, where I wouldn't clash with other mods. Does anyone know if there is a list anywhere of the block id ranges used by the main mods? Thanks K.
  5. Ah yes, it's just a matter of calling ModLoader.addLocalization(). Perfect.
  6. 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".
  7. Thanks, that worked (the notify, not the dirty marking, for some reason). I'm almost ready for a private beta. A public one shouldn't be too far of.
  8. 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.
  9. 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. 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!
  10. 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?
  11. 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. 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.
  12. 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?
  13. An other quick question: how do I get the user name of the client which disconnected in onDisconnect()? If it's not possible I guess I can loop through the users present on the server to find the missing one.
  14. Ok, I'll check that. I think I'll need it client side, my trading screen depends on having infos on all the resources the village has. However it will only be when the player has the trading GUI open, so it won't generate much packets.
  15. I noticed that the inventory of chests only gets synched when the player open them, which causes problems for me since I have code dependent on that content being up-to-date client-side. Is there a simple way of triggering such a refresh?
  16. Is there a way to preserve a player profile when running a server in MCP? It's annoying to start again at spawn every time.
  17. 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.
  18. I've figured it out. It's because the type is written in the packet as a byte, and the number I had chosen was above 256. The packet is received properly now (and promptly crash the client because some needed data isn't there, so I couldn't check the mouvement update works fine).
  19. Weird. Is there any other initialisation I need? What is the minimum code to get this working?
  20. Just an idea, could it be because I extend NetworkMod indirectly?
  21. The weird thing is that custom packets work fine. I'll try that debugging.
  22. Yes: public abstract class BaseMillenaireMod extends NetworkMod implements IConnectionHandler, IPacketHandler { So for that NetworkHandler, I just keep a reference to it from onConnect()? Why do I need to do this on the client and not on the server?
  23. Also, to send packets form the server to the clients I can use methods like this: ((MinecraftServer)ModLoader.getMinecraftServerInstance()).configManager.sendPacketToPlayersAroundPoint(p.x, p.y, p.z, range, 0, packet); What should I use client-side to send packets to the server? Should it be MinecraftForge.sendPacket? If yes, what is the NetworkManager I'm expected to pass to it?
  24. Not much to see, just this in mod_Millenaire.load() on client and server side: MinecraftForge.registerEntity(MillVillager.class, instance,VILLAGER_ENT_ID, 80, 3, true); (after the ModLoader.registerEntityID) Did I miss something?
  25. Also, I have multiple types of packets to send. Should I declare several channels or am I expected to put a packet id as the first value in the data?
×
×
  • Create New...

Important Information

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