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. Your main class does not extend Block
  2. What block do you want to have this feature? What class is it represented by? Congrats. Also
  3. This is why I am a strong advocate of "read your fucking logs" and "learning to read your fucking logs."
  4. https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/ores/block/ore/BlockHardOreBase.java#L74-L77
  5. Yeah, Block.Properties. Take a look at existing usage.
  6. https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it
  7. Check also what properties are being passed to the vanilla block's constructor. Oh and if you're going to do fuckall custom code, you don't need your own class. Just call new on GlassBlock directly.
  8. Find and post the log file too.
  9. If you have specific questions I can answer them, but general "how it works" is outside my ability. I just know that Forge does some magic to attach capabilities to ICapabilityProviders in some fashion.
  10. Corus fruit uses it. I believe it is an acceptable general use feature, yes.
  11. Would've been nice if you included more than that, but sure, that's sufficient. Problematic code #14
  12. This is the real error: Originating at:
  13. Take a look at the classes I use to track cows being milked: https://github.com/Draco18s/ReasonableRealism/tree/1.12.1/src/main/java/com/draco18s/farming/entities/capabilities
  14. You can write your own WorldgenMinable class.
  15. Surely the wheat block has code that runs in some tick-like manner that is the code you want to call. Have you tried looking at the wheat block?
  16. That is a block without a facing parameter. If you mean one that has a facing property: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/farming/entities/TileEntityTanner.java#L136
  17. What have you tried?
  18. Capabilities are easy. There's only three or four things you need to do. The first is to remove any existing IInventory code. Then add (in place of ItemStack[]) an ItemStackHandler. You can use one or multiple, depending on how you want to expose these as slots, or collection of slots, in the places that they're used. Next, override getCapability. if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY), you return one of your the ItemStackHandler fields. If you want more than one to be exposed, you can merge them with CombinedInvWrapper. Return super for any case you don't handle. Third, override hasCapability and make it return true for any case where you return an ItemStackHandler (and call super for other cases). A lot of modders override this to return this.getCapability(capability, facing) != null; The only "tricky" part is that if you want to expose different slots for different sides or do things like having output-only slots, but that's largely logic. Fourth, you need to update your Gui/Container to use SlotItemHandler (or a subclass thereof) instead of Slot. And a couple of examples: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/ores/entities/TileEntitySifter.java#L141 https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/ores/inventory/ContainerSifter.java#L27 https://github.com/Draco18s/ReasonableRealism/tree/1.12.1/src/main/java/com/draco18s/hardlib/api/internal/inventory
  19. You do it by exposing the TileEntity's item stack handler capability by side. If the hopper can only take the output slot, then you only let it access the output slot when the side being accessed is DOWN. https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/ores/entities/TileEntitySifter.java#L153-L155 Vice versa for the input slot. https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/ores/entities/TileEntitySifter.java#L150-L152
  20. Because your color property is stored in the TE, the block is not automatically re-rendered when you change that value. You need to inform the client that the value has changed, and re-render the block. https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/farming/entities/TileEntityTanner.java#L95-L98
  21. Well, there are two logs: "minecraft:log" and "minecraft:log2" One of them is oak, spruce, jungle, and birch, the other is acacia and dark oak. You're trying to set log2 to oak, which is not an allowed variant.
  22. Do be careful though, this is a dark abyss that looks back at you.

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.