Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

LordSaad

Members
  • Joined

  • Last visited

  1. No no no... My display is updating properly. Getting the cap seems to return the proper one as well. So it's definitely working CLIENT side. But the clone event returns the default cap, so it's not changing on the SERVER. So i have to send the packet from client to server, right? You said it exists on the server, but I'm updating the value from the client.
  2. So basically make a packet that sends from client to server that acts on the cap. Right? That's what I'm getting here. That should be easy.
  3. How is it not updating though? I have a hud thing that renders the int on my hud, running the command (which sends a sync packet) updates it on my hud as well, therefore I can only assume it's being sent and read properly. Is the packet insufficient? What would I have to do?
  4. Ignore the purse for a sec. I was trying a lot of things and didn't update everything per solution. https://github.com/LordSaad44/Cash-Shop/blob/master/src/main/java/me/lordsaad/cashshop/common/command/CommandWallet.java#L49 I'm updating the cap here server side and it works perfectly. It's clone copying that's dysfunctional...
  5. I just uploaded a new commit with the fix you suggested, you have a point, i should be setting it. But that actually didn't work. It failed with the same result. https://github.com/LordSaad44/Cash-Shop/blob/master/src/main/java/me/lordsaad/cashshop/common/core/EventHandler.java
  6. I made a capability that saves 1 int in the player. It acts as the amount of money they have in their account. Upon death or relog, the cap resets back to it's default value. It works PERFECTLY otherwise. I've asked multiple people. 5/6 don't know how caps work, the remaining 1/6 couldn't figure out the issue because my cap is basically a carbon copy of his, yet his persists. Anyways, capability package: https://github.com/LordSaad44/Cash-Shop/tree/master/src/main/java/me/lordsaad/cashshop/api/capability Class that's hooking the cap to the player: https://github.com/LordSaad44/Cash-Shop/blob/master/src/main/java/me/lordsaad/cashshop/api/ModCapabilities.java Packet: https://github.com/LordSaad44/Cash-Shop/tree/master/src/main/java/me/lordsaad/cashshop/common/network Registering the cap: https://github.com/LordSaad44/Cash-Shop/blob/master/src/main/java/me/lordsaad/cashshop/common/CommonProxy.java#L26 (registering the event down in postInit) (works perfectly, i breakpointed) I tried the respawn event (PlayerEvent.Clone), but the original entity in the event had it's cap reset as well, so i was copying the default reset value from the original entity over to the new entity. Respawn(clone) event: https://github.com/LordSaad44/Cash-Shop/blob/master/src/main/java/me/lordsaad/cashshop/common/core/EventHandler.java
  7. That worked perfectly. Thank you I was registering them in common because I assumed that's how they worked. How the hell are Elucent's mods working properly? https://github.com/RootsTeam/Roots/blob/master/src/main/java/elucent/roots/proxy/CommonProxy.java#L28 I'm just really curious. He doesn't even register these in the main mod file.
  8. http://i.imgur.com/kcbTBi5.png A fatal error? LOG: http://pastebin.com/wVZxmgem What am i doing wrong in my packet handler?
  9. I'll do that later. What should I do to fix the registration of the caps right now?
  10. Should I call the same line: CapabilityManager.INSTANCE.register(IWizardryCapability.class, new WizardryCapabilityStorage(), DefaultWizardryCapability.class); In the clientProxy's preInit as well? or in the main class's preInit or what? I just tried registering the cap in clientproxy and that crashed, then tried the main class's preinit and that crashed as well. I'm assuming I shouldn't be registering it like that. What must I do?
  11. It is. CommonProxy -> preInit() { } http://i.imgur.com/I5y3cSb.png
  12. My apologize, Intellij must've reformatted and removed redundant imports. I just pushed a new commit, and here's the new log: http://pastebin.com/YuifF4q8
  13. I did paste the error, it's a above... http://pastebin.com/1mq5KEXZ That's the null pointer I get from getCapability(player).
  14. So what should I do? I assumed that was the perfect event to attach a capability, but if I cant even get the entity, what am I supposed to do?
  15. http://i.imgur.com/3ZiYUcY.png Breakpointed. Why is the player entity null?! the capability: http://i.imgur.com/9Qo16az.png That's correct, but the entityPlayer does NOT look promising... Why is it null?! http://i.imgur.com/cpNHNig.png

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.