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.

Choonster

Moderators
  • Joined

  • Last visited

Everything posted by Choonster

  1. You passed an invalid or null value as the mod argument of EntityPlayer#openGui . This probably means you didn't annotate your mod's instance field with @Instance or you used the wrong mod ID in the annotation.
  2. If your GUI has no Container , return null from IGuiHandler#getServerGuiElement and only call EntityPlayer#openGUI on the client. If it's crashing, post the crash report and your code.
  3. Adding @SuppressWarnings("deprecation") to my overrides of the deprecated Block methods definitely stops them displaying as deprecated. I'm using IDEA.
  4. EnumHelper.addArmorMaterial had the toughness parameter added a while back, make sure you're using the latest version of Forge.
  5. Subscribe to LivingAttackEvent , check if the entity is wearing your armour and the DamageSource is DamageSource.wither and cancel the event.
  6. Packets are handled on a separate thread in 1.8+, so you need to schedule a task on the main thread before you can safely interact with game objects. This page explains more. If scheduling a task on the main thread doesn't fix this, post your new code. The client player is created and spawned when the client receives SPacketJoinGame from the server. The server sends this before spawning the player, so it should usually be received before a packet sent from EntityJoinWorldEvent .
  7. EntityJoinWorldEvent is fired for all entities, not just players. Check if the entity is a player before trying to retrieve the capability. If it still doesn't work, post your code.
  8. Capabilities are only attached and read from NBT after AttachCapabilityEvent has been fired. You should send the packet from EntityJoinWorldEvent . To make the capability persist through respawning, subscribe to PlayerEvent.Clone and copy the capability's data from the old player to the new one.
  9. Nobody said anything about canConnectToRedstone , the method is called canConnectRedstone .
  10. Override the method in your class. It's not hard.
  11. Redstone won't connect to your block if you return false from Block#canConnectRedstone . This is what diesieben07 has been telling you.
  12. NBT is only for storing data on disk, don't use it to store data at runtime. Your WorldSavedData should store the data as objects and only use NBT when reading from/writing to the save. The data should be stored in a non-static field so each instance of the WorldSavedData has its own copy. Your actual problem is that you're using the Minecraft class all over the place; it's a client-only class, it can only be used in client-only code. displayResults should take an EntityPlayer argument and send the messages to it. SupernaturalItemsEvents#onItemRightClick should pass its own EntityPlayer argument to displayResults .
  13. Line 80 of SPNWorldSavedData is either using the Minecraft class (which is client-only) itself or trying to call something that uses it. If you want more help, post your code. Without seeing your code, all we can do is give you general advice like reading up on sides here.
  14. There are two instances of RenderPlayer , one for the Steve model (thick arms) and one for the Alex model (thin arms). Your current code will only add the layer to the first one that renders. In postInit, you should iterate through RenderManager#getSkinMap and add the layer to every RenderPlayer instance in the map. Don't use RenderPlayerEvent here at all.
  15. Bounding boxes are still handled in code. Override Block#getBoundingBox to return your block's bounding box.
  16. Without seeing your code, all we can do is guess at possible causes. Post your code.
  17. I believe the build process appends the Git branch name to the file name when it's not master , so most of the early builds for a given version will have the suffix while the latter ones won't.
  18. Create a JSON model in a program like MrCrayfish's Model Creator or an OBJ/B3D model in a mainstream 3D modelling program like 3ds Max or Blender and use the standard baked model system used by most blocks/items. Block models are specified by blockstates files. I have an explanation of the model loading process here.
  19. I assumed each player would have their own quest progress (or progress shared in a party) like HQM, so I told you to use a capability. If the progress is global, world saved data is the correct choice.
  20. TileEntity#getTileData is for storing external data on a TileEntity , it doesn't contain the TileEntity 's own data. Use INBTSerializable#serializeNBT (inherited by TileEntity ) to write an INBTSerializable object to NBT.
  21. The error occurs when FML attempts to load your proxy class before creating an instance of it, so your server proxy is trying to use a client-only class.
  22. The vanilla blockstates format (which you're using) doesn't support retexturing models, you need to use Forge's format for that. This will also let you set the textures and model based on the index property and the rotation based on the direction property instead of having to specify every combination of property values yourself.
  23. Quest progress should probably be saved using a Capability attached to the player, not using World Saved Data. Whenever a value changes that the client needs to know about, send a packet to update it. The site I linked previously also has a section on networking, including the Simple Network Implementation (which you should use).
  24. I answered this in your previous thread.
  25. Better Sleeping is trying to use client-only code on the server. Report this to the author.

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.