Jump to content

Rohzek

Forge Modder
  • Posts

    84
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Rohzek

  1. Sure thing. The link in the first post is the custom packet itself. Here's everything else that could be relevant? If anything else would help, I can post that too.
  2. So after several days of being stumped, It's time to ask I guess: I'm not quite sure how to handle packets. I have a Gui Overlay that draws from data in my custom IExtendedEntityProperties, and never updates when connected to a server. I gathered from googling that the server and client has it's own instance of that or something, so I need to send packets to update the client's. I followed the tutorial I found here on the forums to setup SimpleNetworkWrapper, and made a message to send the NBT data (http://pastebin.com/sMMePZ7P) but now... I don't know where to send it from? I tried putting it in the extended player stats class and running it when values change using: Which just.. sorta crashes. It prints out the number of mana remaining, and prints that it's sending the packet... and then disconnects. The server doesn't close, and the client doesn't close but it kicks you from the server with a fatal error.. no more information just "A fatal error has occured, connection is terminated", the server just says player disconnected.. so I don't really know where to go from here or how to fix it.
  3. Okay. So I implemented IExtendedEntityProperties, and changed the spawn code to check if the entity calling the event already had the item with a boolean. If it doesn't it runs the random chance spawn coding, if it does it does nothing. Tested through the IDE... built a version and tested in both single player and on my server. I don't have anyone else to pop in and test if it for multiple players but it works fine for me on every save/ server generation I tested. Has the downside of resetting that value every time the player dies.. and thus failing the check and spawning another item I need to find a way to make it persist.. but this has solved my initial problem, once again thank you so much mate.
  4. So.. at the center of the nested ifs... drop the item if event.harvester isn't set to null.. And earlier in the ifs check if the player has already gotten one of the drops already.. if they have then set the harvester for this event call to null? Thanks again for your help. I'll play with this for a bit and pop back in if I have more questions. When I get it working I lock the post I guess?
  5. So looking at IExtendedEntityProperties, that certainly answers questions for the next 3 or 4 things I want to play with, so thank you so much for that.. But will storing the data on a per player basis here mean the event will fire on a per player basis instead of just stopping spawning in the world/on the server altogether?
  6. So.. I don't know enough about how Minecraft works to know if this is even possible.. but.. it's worth an ask.. And if it isn't I would like to know if there is any kind of work around... I have a custom drop for Stone blocks (code here): http://pastebin.com/Yhg7fhvm Which works perfectly fine in Singleplayer but obviously crashes a server when them item is dropped. Is there even a way to limit dropping of items on a player to player basis over a server? If not is there anyway around it easily.. is there something like... making my own version of silk touch.. and giving it to players until they find the item... and then disabling it.. and just make the drop require the new silk touch? Edit: My code if anyone else has a similar question: Item Spawning: http://pastebin.com/SjLxhDAS IExtendedEntityProperties: http://pastebin.com/uU8nwVv5 Entity Spawn Handler: http://pastebin.com/kziFX23P and finally registered with: MinecraftForge.EVENT_BUS.register(new ExtendedPlayerStatsHandler());
×
×
  • Create New...

Important Information

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