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.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. On the server: The player in the message context IS the player that sent the packet On the client: The player that received the message IS the player that is playing... What more do you need?
  2. That's...not even related to container items...
  3. Override hasContainerItem and getContainerItem :| Probably not. I mean how would that work, a bucket of milk returns a glass bottle, but a bucket of water returns a bucket?
  4. You want to know what data the TE has? Yes, you override those three methods. Yes there are three. getDataPacket: sending getUpdateTag: sending onDataPacket: recieving
  5. When the button is clicked -> send a packet to the server with the relevant information (TE's pos, what button was clicked). Server gets the packet, reads the data, gets the TileEntity from the position encoded in the packet, and does things (if valid to perform).
  6. http://mcforge.readthedocs.io/en/latest/networking/simpleimpl/
  7. Hmm, if only vanilla had some items that do this... ?
  8. And that's why I wrote my Easy Registry class. I liked the simplicity of the GameRegistry from earlier versions. I realized I was going to need more than "register block, register item" but I wanted to do as little copying and pasting of things as possible.
  9. 1. This is wrong: https://github.com/Shane2482/Deadly-World-1.10/blob/master/src/main/java/shane2482/deadlyworld/proxy/ClientProxy.java#L37 2: What do you call this? https://github.com/Shane2482/Deadly-World-1.10/blob/master/src/main/java/shane2482/deadlyworld/blocks/block_lamps.java#L77-L82 Looks like a function written over and over and over. Now check how I did it: One line, done. One line, done. One line, done. Even the item I have that uses NBT data to display different icons? One line, done.
  10. Sort of not really. 1) You still need to handle the model registry via your client proxy as the event itself is client-side-only 2) You have to write the same function over and over and over
  11. It doesn't save you anything. What do you have access to inside the class object that you don't have access to from outside? Everything you need is public...
  12. You can't do it like that in 1.12, the GameRegistry is private: the events exist to make sure that everything gets registered at the proper time in the proper order. You cannot get around this.
  13. Vanilla is not set up to handle recipe stacks being anything other than 1. So don't do that.
  14. You need this: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L66-L71 Line 70 in that code is equivalent to ModelLoader.setCustomModelResourceLocation (with the indicated parameters) called during the ModelRegistryEvent. That is: You need to ask a block what states it has Get the metadata for those states† Convert those states to variant strings Register an item model for those metadatas and variant strings †There is no canonical block-saved-metadata to item-stack-metadata conversion, however, vanilla (and most mods) treat them as being the same for simplicity's sake.‡ The only place it is explicitly assumed to always be that way is in vanilla's custom world gen settings. ‡Of course, the same would be said of enum values as well, but vanilla went and fucked that up with their colors. WHITE is 15, but also 0.
  15. You're just blindly copying things. That isn't going to DO anything by itself. The point was "you need to do these things <link to a function that does these things>" not "Copy-paste my code, cross your fingers, and run it." The one function that you didn't know what it did... all it does is what you were already doing.
  16. It goes here: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L170-L177 The list its adding to gets used here: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L198
  17. You want metadata blocks? https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L66-L71
  18. See this? new ModelResourceLocation(new ResourceLocation(Reference.MOD_ID, fileName), "inventory")); Make it this: new ModelResourceLocation(item.getRegistryName(), "inventory")); Here's how I do it: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L103 (Commented out is pre-ModelRegistryEvent, but the same information is cached and handed off during said event).
  19. Don't construct resource locations yourself. block.getRegistryName() (and item.getRegistryName()) returns a ResourceLocation, use it.
  20. Caused by: java.io.FileNotFoundException: cbm:models/item/block_steel_steel_plating.json Also, show your registration code.
  21. "layer0" is the name of the texture reference used by the 3D model. It's not magic.
  22. Why is your class not Upper Cased? https://www.javatpoint.com/java-naming-conventions @diesieben07 can we add that to the common Code Style list?
  23. The only thing I can think of is texture coordinates: fitting all the boxes cleanly onto the texturemap without overlapping or leaving large void areas.

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.