Jump to content

Frefreak

Members
  • Posts

    9
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Frefreak's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Ok so I did need something else (like a custom ItemStackHandler or override detectAndSendChanges). Thank you! This clears up my doubt.
  2. Have you remove that `detectAndSendChanges` in ContainerREAnalyzer.java? That issue only arise without it. And I was asking if it is really necessary or if I did something wrong elsewhere since all the tutorials I read didn't mention I also need `detectAndSendChanges`in order to make the changes detected.
  3. I have made some changes, but I'm not sure what's missing in the git repository. I tried clone it to new folder and gradle build works just fine. EDIT: Is it the missing of gradlew.bat? ok I added that.
  4. Sorry for the late reply, here you go: BlockREAnalyzer: and this is the registering part: BlockRE: tileentity is registered in GeneralProxy, ClientProxy and ServerProxy are just inherited from it and calling super methods in 3 stages respectively. I also setup a git repo here
  5. What should be the recommend way to do this?
  6. After adding override for `getUpdatePacket` and `onDataPacket` then remove `detectAndSendChanges`, its inventory still doesn't persist. The problem seems to be the inventory doesn't even stored (no writeToNBT called) on server side, not a server to client syncing problem. `getUpdatePacket` doesn't been called when I make changes to the inventory. I read it elsewhere that getUpdatePacket is called by `notifyBlockUpdate`, do I need to call it somewhere manually?
  7. I implemented a block with tileentity which has a gui and inventory using capabilities and `IItemHandler`. After some struggling everything seems to work fine except I notice that when I put something into the only slot of that block (or TE), then exit and reconnect, that something is very likely to disappear. Here are the code of that tileentity and container. This happens when I don't override `detectAndSendChanges` Using some print statements I can confirm that `ItemStackHandler` in tileentity is correctly updated as soon as new items are put in (or taken out), however when exit there's no call to writeToNBT. Only after I trigger something in the client and send a packet to server, writeToNBT get called, and the changes to inventory persist. Currently the only way I found is to override `detectAndSendChanges` as show in the code. However I'm not sure is this the correct way to do this. Doesn't this should be handled automatically because from all the tutorials I read, they all basically does the same thing as mine here, and none of them mentions the necessity to override detectAndSendChanges to make the inventory behave "correctly" in common sense. I want to ask if its I'm missing something obviously or is this override expected?
  8. I figured it out it's access transformer that I need to use. However just add `useDepAts = true` doesn't seem to work, but that's another problem...
  9. I think there's something fundamentally I don't understand. I'm playing around with Botania and in my project I want to include it (and baubles) as dependencies. What I did is putting the de-obfuscate jars of these 2 mods into libs dir. From what I read this should be sufficient to include a mod as dependency. However when I run `gradlew runClient` the game crashes with java.lang.IllegalAccessError. The version I use of botania is r1.10-353 and baubles 1.5.2. The first time it crash with forge 14.23.1.2607 (as of writing the newest), which happens at botania somewhere in a renderWandModeDisplay method of HUDHandler.java, its trying to access `remainingHighlightTicks` field in GuiIngame class. The behavior is whenever I try to select "wand of forest" in my toolbar mc crashes. I looked it up in intellij IDEA and found it is a protect field. So the crash makes sense. Initially I thought it is because of forge version mismatch so I tried to use version 2555, and now it crashes even when loading, also IllegalAccessError. From what I see in IDE `register` is a private static method. I cloned botania's source from github which uses 2555 build version, import as a new project and everything seems to be fine. What confuses me most is in this project if I jump to the above two spots those fields are public! does botania modified the way how forge source generated? Or is there something I did wrong? (basically all I do after unzipping is, copy all files begin with gradle, build.gradle and gitignore to an empty folder, run `setupDecompWorkspace` and `build`, import build.gradle into intellij IDEA and run `genIntellijRuns`). I really hope someone could clear my doubts. Also, in this scenario what should I do to use botania as dependency and not crashing?
×
×
  • Create New...

Important Information

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