Jump to content

ClubPetey

Members
  • Posts

    5
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

ClubPetey's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. First to answer your question: The Packet132 is send: Whenever a player starts watching (= tracking) the chunk the TE is in Whenever a block update on that block is done (which you can force via markBlockForUpdate or something like that in the World class). But also: Packet132 sucks. It sucks badly. Why? It's much heavier than it needs to be. It always sends the overhead of a NBTTagCompound, which could be avoided. I suggest just making your own Packet250 to both tell the client to open the Gui (don't use FML's system) and transfer the data. that way you avoid the delay. I also felt Packet132 was bloated. I like your idea of going around FML to open the GUI, I'm going to try that tonight.
  2. Will updateScreen() cause the Server-side TileEntity to update the client side entity? Must understanding is "no" but I may be mistaken. I know that I can do an onInventoryChanged() on the server, which will send an update, but it's my understanding that also will not sync custom data fields I am storing in my TileEntity.
  3. Hey all, Question for you: I have a TileEntity that does some relatively heavy calculations and stores some data, fortunately it does this only once every 10 seconds. The client has no need of the data except when the Block's GUI is open. So I have only the server running the calculations. After much confusion, I had the "ah ha" moment that the client's TileEntity needs to be updated, from the server. There seems to be a few ways to do this: 1. Use the getDescriptionPacket (Packet132) method in the TileEntity. From what I read, this will update players in the vicinity on some periodic basis. My concern, this is a lot of extra traffic if people never open the GUI (which they prob. wont most of the time), and I'm not totally sure what the interval is, so I don't know if its fast enough to keep the GUI in sync with the TileEntity. 2. Send a custom packet (Packet250) from the server when the server executes the openGui(). This avoid unnecessary traffic, but causes a bit of a visible delay, as the GUI appears, then the packet is received, then the GUI is updated. My question is two parts a) Is the TileEntity the right place for this kind of work, looking at source of other mods seems to suggest the Tile is the "workhorse" for your blocks b) Am I being overly concerned about traffic and should just go with #1 for the better GUI experience, or does the packet system incur a lot of overhead and should be used as sparingly as possible. Thanks -pete
  4. 1. The EntityVillager.interact() is near the top of the event stack. it will show the Merchant GUI and stop all further processing. The only thing I see above that is a Forge EVENT_BUS message which it looks like I can install a handler for and abort the default processing, but that seems to trigger for every entity and I was concerned about lag. That may be the only option though. 2. Perfect, that was the simple explanation I was lacking. I will checkout the videos, I've been going through several, but they are all for different versions of MC so I get a little confused on what still works and what doesn't. thanks
  5. Hello all, I've recently begun my modding career and am working on my first mod for public release. I have a bunch of unrelated questions that have come up over the last few days of my research in how to build this mod and rather than post a number of times, I thought I'd list them all here in hopes that someone with more experience can assist me with some or all of them. Thanks in advance for your help. 1. How do you have an item right-click-interact with a Villager. The usual methods, onItemUse(), itemInteractionWithEntity(), etc do not get called for a villager, the right click is intercepted with Entity.interact() to popup the trade GUI and I cannot see a way to stop it for my particular item. 2. Speaking of GUIs, whats the difference between GuiScreen and GuiContainer? When I look at Gui Tutorials, some use one, some use the other, but there's never an explanation of why. 3. One of the blocks in my mod is designed to hold more that 1 stack of an item in one slot. Is there an easy way of doing this with the Container class? Or am I looking at a complete re-implementation. I've seen this ability in Applied Energistics, but I'm not sure how it was done, or how difficult it was. 4. Speaking of AE, Some of their GUIs use a scrollbox of slots to get many slots on the page, any tips on how to implement that? I haven't found any tutorial on scrolling Guis to speak of. I should mention this mod is for 1.6.2 and I'm using Forge 871.
×
×
  • Create New...

Important Information

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