Skip 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. 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
  2. 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).
  3. http://mcforge.readthedocs.io/en/latest/networking/simpleimpl/
  4. Hmm, if only vanilla had some items that do this... ?
  5. 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.
  6. 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.
  7. 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
  8. 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...
  9. 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.
  10. Vanilla is not set up to handle recipe stacks being anything other than 1. So don't do that.
  11. 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.
  12. 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.
  13. 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
  14. You want metadata blocks? https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L66-L71
  15. 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).
  16. Don't construct resource locations yourself. block.getRegistryName() (and item.getRegistryName()) returns a ResourceLocation, use it.
  17. Caused by: java.io.FileNotFoundException: cbm:models/item/block_steel_steel_plating.json Also, show your registration code.
  18. "layer0" is the name of the texture reference used by the 3D model. It's not magic.
  19. 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?
  20. 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.
  21. Oh yes, that definitely exists. It doesn't answer the question, which was: Would anything bad happen if the has/get contract is broken? Obviously if you say "true" and return "null" then yes, but he's specifically asking for situations where has returns false. The "do I need to call has or can I just check null?" question you and I talked about before.
  22. Those are added by mods. You can't add them without a mod.
  23. I imagine that if you return false from has, then get won't even be called in most cases. In the rest, I imagine that the caller would perform a null check.

Important Information

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

Account

Navigation

Search

Search

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.