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. This might help: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/util/LootUtils.java If you have questions about specific lines, I'd be more than happy to answer them.
  2. for(int i = 0; i < size; i++) { IBlockState stateAt = world.getBlockState(pos); Block block = stateAt.getBlock(); if(block.getBlockHardness(stateAt, world, pos) == -1) break; world.setBlockState(pos, crystal); pos = pos.offset(shift); } What do you think this loop does?
  3. I don't know what your hollow-out and make-crystal are supposed to be doing. Your crystals are clearly one block in size, so why are you placing several of them at once?
  4. Blocks and Items are all singletons: that is, only one instance of them exists. All those things you see in your inventory? Those are ItemStack instances that simply point to the Item instance and say "I am a copy of that." TileEntities are because Blocks can only store 4 bits of information in the world ("metadata") and in order to have any more than that, it needs to create an Entity (Cows and Zombies are entities too!) in order to store that data.
  5. And the code that does that?
  6. Do you know how to check what block exists in the world? Do that. Find some stone with air above it.
  7. 1) You haven't located 2) You don't pass pos to your gen.generate method.
  8. I don't know how that was so hard.
  9. Find a block of stone with air above it. pos = pos.up()
  10. You need to use Capabilities. The data must be stored in the ItemStack (and ItemStacks have capabilities). There are some methods in the Item class that allow you to supply a capability for your own items.
  11. 1) It is the remaining items after attempting to insert (e.g. you got a stack of 64 wood, but only had room for 32, the remaining 32 are returned). The game crashes if you return null because ItemStacks are @NonNull 2) Not usually. I suppose you could, but why? 3) Those methods are there for subclasses to implement. There are no vanilla (well Forge, actually) subclasses. The Block class does this all the time.
  12. Yep, same thing here. It'll just be tricker to find the "master" block
  13. If someone creates the coke furnace and then removes all the blocks except the one they right clicked, that wouldn't be good, would it?
  14. The shape of your furnace is rotation agnostic. First: find the bock behind the one clicked (you get a facing value, offset by that ejection -1) then just check all the locations from there. Additionally, you'll need to make your blocks invalidate the TE (if it exists) when broken. That will be trickier, but each block can figure it out (or just have the TE periodically validate itself)
  15. Why are you creating a random metadata? What if the only valid values are 0, 1, 3, 7, and 12?
  16. There is no instance of MultiblockCokeFurnace that you ever need to create, you just have to change the blockstate of the block clicked on so that a TileEntity can be created (this is what hasTileEntity and createTileEntity are for, so you can specify which states of the block have a TE and which don't).
  17. Better idea: mod.bedrockbreaker "mod" is not a top level domain (and even if it was, this is a reference to it being a mod)
  18. package names are intended to mirror the owner's Web presence. Google uses the com.google prefix because they are Google.com You are not this company: http://bedrock.com
  19. When the block is clicked...you know the exact arrangement you want. Check all of those block positions, if all of them match, success.
  20. Do you want to detect players or EntityLivingBase? Your post and your title disagree. Second, what about your code doesn't work? Have you tried the debugger?
  21. Ok cool. My code is likely holdover from when I did things in 1.11 (that is: I made it work without getSubItems and when I updated to 1.12, it still worked)

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.