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. world.setBlockState(Blocks.AIR.getDefaultState(), pos, 3); //the 3 is super important part
  2. Download the mdk fresh.
  3. By the way, absolutely fire those forge events for each block you break. Other mods might have permission restrictions (think land claims that block modification except by the owner) and suchlike. You may also want to check that the block is either the same as the center block or that its harvest level (and tool) is acceptable for your tool.
  4. No. There is a specific method that has the name getCapability. It is to which Animefan8888 referrs.
  5. Override onBlockDestroyed(ItemStack, World, BlockState, BlockPos, LivingEntity) in your hammer's class. You will need a custom class that extends PickaxeItem to do this. In that method figure out which Direction the player is looking and break all the blocks perpendicular to that vector.
  6. Tile Entities are not Containers. A Tile Entity is the thing-that-is-sort-of-a-block and exists in the world and stores all of the data associated with that instance of that block. A Container is a class that connects a GUI with that TE's contents.
  7. Usually not. The only reason to create a new class is if you need custom behavior that is different from the parent class. You want a new pickaxe. You want it to function exactly like the existing pickaxes. The only difference is the tool material (the item tier). Which is a parameter to the constructor. Passing a parameter does not require a class.
  8. Somehow your property is null when it gets passed to the BlockStateContainer constructor. Also, you don't need BlockBase. There's already a "base" block class, its called Block.
  9. new PickaxeItem(...)? Seriously, you don't need to make a new class for it. Also don't make your ItemTier an anonymous class.
  10. I don't know why you commented this out, because you need it.
  11. https://github.com/majicmaj/majcraft/blob/master/src/main/java/com/majicmaj/majcraft/blocks/ArtisianStationTile.java#L54 Create LazyOptionals once. Is unlikely related to your issue, but it is still worth pointing out. See this as to why:
  12. Use an IDE and make your life so much easier. There's really no reason not to.
  13. ....so create one? Like, how hard is it to do this: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/entity/AxelTileEntity.java#L28 and https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/entity/AxelTileEntity.java#L79
  14. What part of "create it ONCE" did you not understand?
  15. s/NBT/JSON if you want to have an easier time understanding it.
  16. You can but you should not. For a variety of reasons.
  17. LazyOptional is the Type that getCapability() returns. Whatever it is that you want to return, it must be a LazyOptional. Whatever type it is that you get from getCapability, it must be a LazyOptional. In order to handle turning something into a LazyOptional or vice versa, you can't do it with a cast, because that's not what casting does.
  18. I forgot that 1.12's BlockBush had a parameterless constructor.
  19. They didn't. That's what the decompiler did because the decompiler doesn't know better because there's multiple different original Java source that compile to the same bytes. The point here is that you shouldn't blindly copy and paste stuff. You should actually understand what it's doing and evaluate if what its doing is the proper way to do things. By copying and pasting you've demonstrated that you lack sufficient knowledge of Java and we don't help with basic Java here. I am entirely within reason to point out stupid shit as being stupid. Cool. Can you post it? The problems I was pointing out could have entirely been the cause of your issue, one way or another, but if its still a problem, its hard to diagnose it without seeing your current code.
  20. No. Does it return an IMana object?
  21. I've got one from 1.12: https://github.com/Draco18s/ReasonableRealism/tree/1.12.1/src/main/java/com/draco18s/farming/entities/capabilities I haven't migrated that code to 1.14 yet, but it should be 99% functional.
  22. They haven't changed. As in, they don't need to change. The documentation remains accurate despite Minecraft having updated because Capabilities are a Forge feature and simply moved forward. There might be some tiny differences here and there where a function name gets changed, but its all stuff easily resolvable just by looking at the classes involved. The event hook hasn't really changed, you just need to find the new method name for rendering a texture on screen. You can figure this out by looking at other classes that render textures on screen.
  23. There's also tags for ingots, but I don't think modders really create new iron ingots. Also, I generally make my recipes use letters that are somewhat identifiable to what the item is. So instead of "aba" I'd do "iSi" (ingot, shears, ingot; no special meaning between lower and upper case here). But that's purely cosmetic.
  24. Its called tags. You want it to be usable with any plank, including mod added planks, use tags. That's why tags exist.

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.