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. I believe that OnBlockPlacedIntoWorld is called after its placed by worldgen.
  2. That's because world models are registered automatically. The block's registry name points to the blockstate file, the blockstate points to the model, everything's good. Items you have to register manually. Fortunately you're doing that with your ModelRegistryEvent. But there could still be any number of things going wrong. You have to read your log to find out what.
  3. We still need the crash log. We don't know what's wrong. All you've told us is that "it crashed." Which is about as helpful as calling up your doctor and saying, "it hurts" and hanging up.
  4. The fek is this: https://github.com/Colton-Slayden/Solis/blob/master/src/main/java/com/royalreject/solis/proxy/ClientProxy.java#L27 ForgeRegistries.BLOCKS.getKey(b)? You mean b.getRegistryName()? https://github.com/Colton-Slayden/Solis/blob/master/src/main/java/com/royalreject/solis/gameObjs/ObjHandler.java#L23 Why the function? Is event.getRegistry().register(new ItemBlock(scorchedEarth).setRegistryName(scorchedEarth.getRegistryName)) insufficient somehow? https://github.com/Colton-Slayden/Solis/blob/master/src/main/java/com/royalreject/solis/gameObjs/ObjHandler.java#L18 Don't use static initializes.
  5. There is not enough information here. You have used the word "exception handling" without defining that term (because it means something very different to a programmer). However I can answer this: "Is there a way for a block to ignore the active shader?" No, no there is not.
  6. Caused by: java.lang.NullPointerException at net.minecraft.client.renderer.block.model.ModelResourceLocation.<init>(ModelResourceLocation.java:24) at com.DrVaristy.LeeMod.Proxy.ClientProxy.registerItemRenderer(ClientProxy.java:11) Something on line 11 of your client proxy is null. I can't tell you what because I'm not bloody psychic.
  7. Careful with ItemHandlerSubclasses that override insertion/extraction behavior. Sometimes you want your machine to be able to insert things and not external forces, such as the player or hoppers. If you use a subclass that prevents insertion categorically, you can't add items to it even when you want to. For such things I use a wrapper that I expose with GetCapability and have an internal regular handler that works as standard: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/api/internal/inventory/OutputItemStackHandler.java Note that all interaction is either passed to the internal wrapped handler or special logic is applied. This allows a machine to insert items into its own output slot, but nothing else can.
  8. So...invert the rest of your logic that deals with the field.
  9. Yes that. That's what I meant.
  10. ...yes that's why they're different. GIF is a 256 color indexed pallet, pngs are loss-lessly compressed. It's why they're called image formats. It'd be like converting a txt file to a zip file and then complaining that you can't unzip it. Or a zip to a txt and getting gibberish and wondering why.
  11. Not directly. It was in the code I linked to, but my actual post never says anything about RecipeSorter. It might only be there as a holdover from before it was deprecated.
  12. Closest I can think of is the ToolMold that I made. Eg. this recipe (and its siblings). The tool mold's subitems are determined based on the available recipes which I manually manage via an API hook, as item models need to be baked before recipes are ever loaded. But the code you created above could be placed into a function that creates the resulting item list, which then is referenced by both your item's getSubItems method and your ModelRegistryEvent method.
  13. Or don't. You don't have to do it. Its not a forum rule, just a thing some people do because they think its helpful.
  14. For example... https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/resources/assets/hardlib/recipes/_factories.json#L3 https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/resources/assets/expindustry/recipes/mold_bucket.json#L2
  15. Start by looking at the vanilla fireball. Get that working. Figure out why it is the color it is (its probably a texture) and change it. Then look into particles. Light is going to be difficult as vanilla only calculates light from either the sky (infinite everywhere) or from blocks.
  16. OreDictionary.getOres(name) will return all stacks with a given registered oredict name. OreDictionary.getOreNames() will return all registered oredict names. OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[j]) will get the ore name(s) for a given item stack (note the array access).
  17. Kill this with fire. You do not need this. All this interface does is make you implement the same code over and over and over again. ALL items need models. All of them. And none of the information necessary to register that model is private. Just loop through your block and item lists in your model registry event. Anyway, you haven't provided enough code to identify the problem.
  18. That won't work. The event is called when new is called, and when item stacks are new, they don't have a tag. Alright.
  19. when i is 0, it removes 0. [(0),1,2,3,4] when i is 1, it removes 2. [1,(2),3,4] when i is 2, it removes 4. [1,3,(4)] when i is 3, the loop terminates. [1,3].size() < 3
  20. The affected blocks list still contains the effected blocks, which will be broken unless you change that list. Just because you turned them into obsidian doesn't change the fact that which blocks will be affected has already been calculated.
  21. https://www.tutorialspoint.com/java/switch_statement_in_java.htm
  22. I want to be able to add a capability to an "existing" item stack. The reason not to apply this capability to all item stacks is because I'm going to be tracking a pretty hefty chunk of data and I don't want to attach that to everything, just the stacks that need it (applied via a machine), and narrowing by item type doesn't help much, as I'm going to want to apply this to a wide variety of item types. Is there a way to do this? If not, I may have to fall back to storing the data in its serialized format in the stack's NBT instead, which is not ideal, but workable.
  23. When should this happen?
  24. It is. There is only one Item. You want per-stack data, you need to store the data in the stack (old: nbt, new: capabilities). You cheated, it broke, and no one is surprised.

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.