Jump to content

Animefan8888

Forge Modder
  • Posts

    6157
  • Joined

  • Last visited

  • Days Won

    59

Everything posted by Animefan8888

  1. To do what Choonster said you cant use a world Capability. Instead use just the events he suggested. Mainly the ChunkDataEvent ones. They will allow you to save specifically to a chunk. Through the usage of the ChunkDataEvent.Load/Save#getData which returns an NBTTagCompound. I didn't know these events existed and glossed over the ChunkDataEvent in Choonsters post.
  2. This is not going to work. cap.chunkData.put(event.getChunk().getPos(), cap.getVoidEnergyStored(event.getChunk().getPos())); Think about it.
  3. Well then the value is null. Post your ChunkLoad Event
  4. You will be getting an Integer. Yes I know that, but what would I put into the get method ( What obj ) A ChunkPos(your key). Did you read that link I sent you? Yes but I dont have access to a chunkPos.. Should include that in the parameters? Yes
  5. Two possibilities I see [*]energyUsed isn't changing at all (not likely) [*]Or your if checking in detectAndSendChanges is not working (correctly). To fix this since you don't have that many variables to work with you can manually do it, look at ContainerFurnace#detectAndSendChanges for an example of manual.
  6. You will be getting an Integer. Yes I know that, but what would I put into the get method ( What obj ) A ChunkPos(your key). Did you read that link I sent you?
  7. Put a println in Container#updateProgressBar so that it prints id and data.
  8. You should get an error because there is no key for the get method.
  9. No the integer is your energy... the x and y values are in the ChunkPos...
  10. https://docs.oracle.com/javase/7/docs/api/java/util/Map.html
  11. It is definitely possible you just need to deal with threads. Your window should run on its own Thread, and use Listeners (like you would with a Packet) to get the data you need.
  12. Not as in depth as you want for this one assuming you mean the code.
  13. public Map<ChunkPos, Integer> chunkData; is never initialized.
  14. As far as I know it is still not supporting 1.7.10 and down, everything above that is good.
  15. Your problem is your setField, it doesn't set everything which is used to update the values on the client side.
  16. Do you mean BloomeryGUIHandler and GuiHandlerRegistry? GuiHandlerRegistry is just to register all of my Gui's and BloomeryGUIHandler is specificly for the Bloomery. Well I meant why are you going to have more than one. Why don't you just use a switch statement or an if else statement to handle your GUIs and Containers? item.getMetadata(1) // Doesn't work the way you think it does. "// TODO: Figure out difference between simulate = true and simulate = false" If simulate is true then the process doesn't happen, if false it does happen. In this case if true it doesn't mess with your ItemStacks, if false the ItemStacks change. Also quick question did you follow a tutorial? I originally followed TheGreyGhost's code here but I'm trying to switch it to Forge's capability system. Also, checked getMetadata, thought it just returned the int I put in, but I switched it to getMetadata(ItemStack) now. For that todo I originally had insertItem, but I switched it to setStackInSlot. I'm guessing it would be better to use insertItem? Thank you for explaining it though. Yes it would be better to use insertItem and extractItem because it already handles the current slot being null. And you are going to need to create your own implementation of insertItem and possibly extract item. Also... That is not what you told it to do. Edit: Also that is not what TGG did.
×
×
  • Create New...

Important Information

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