Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. Depends on what you want to do with it. But no, this probably won't do what you really want. If the player doesn't have the capability, you're going to get a blank one, make some changes to it, then toss it in the garbage. It is better to use ifPresent, which takes in a lambda operator. But in general: Capability cap = player.GetCapability(...).orElse(null); if(cap != null) { //do stuff } is the same as player.GetCapability(...).ifPresent(cap -> { //do stuff });
  2. Comparing blocks is as easy as world.getBlockState().getBlock() == aBlock. You have an array, use a loop or other array lookup convenience method. Checking diagonals means you want to check a volume not a direction so you should use BlockPos.getAllInBox().
  3. Why not check how vanilla does it?
  4. You're mostly on your own. There aren't tutorials for this sort of thing as worldgen is very complex.
  5. On block placed: Check to see if structure is complete. It is? Do thing.
  6. You can make any biome provider you want to. SingleBiomeProvider is easy because it (a) already exists and (b) requires virtually no configuration. Replacing it with something else is as simple as "use a different provider" (but you're going to need to specify more details).
  7. Because people who come here know how to program with Fabric. Yes. That makes sense.
  8. 1) Because you don't save that variable either and 2) You could do without it entirely by storing garbage data in the BlockPos by default (say, a y value of -1) and if the data is garbage after read has been called, do the thing you currently do in first tick.
  9. Ah, thanks. I'd done a google search (as the mojang website is a nightmare to try and search for information on) and hadn't even seen an announcement. Anyway. There's some detail.
  10. Single player uses an integrated server. Its how "open to LAN" even functions at all.
  11. You see this method? https://github.com/MistaOmega/Opes/blob/master/src/main/java/mistaomega/opes/tiles/TerraEngineTile.java#L198 Do you see any code related to the mining position there? No? Why not?
  12. Teach a man how to fish, etc etc.
  13. Vanilla has leaves, right? Go find them. Use the search. "transparent block" should get you five or six results You're following someone else's shitty YouTube tutorial. You're doing things because they did things without stopping to think "why did they create that class?" and whether or not that class served a valid purpose. Using inheritance to avoid code reuse is not a valid purpose. We've had this issue listed in the common problems post for about a year.
  14. Any reason you aren't extending LeavesBlock? Any reason you aren't telling the game your block is transparent? Any reason you are using BlockItemBase? (A base block item already exists, its called BlockItem).
  15. I'm not sure the client player is aware of its bed location, I think that's server-side information. As for where to store this information, you need to answer a few questions: Is this mod client side only? Does this information need to be saved to disk and reloaded the next time the player joins a world?
  16. And this is why my first reply was an attempt to get you to think about your problem.
  17. For example: Me: "What is a waypoint?" You - it is a location in space represented by 3 values. Me: "So, a BlockPos"
  18. Think about "what are waypoints?" and "what object are they relevant to, so I can store them there?"
  19. Which part are you having problems with? Do you need help comparing blocks? (your TODO) Do you need help checking diagonals? (the thread title) Something else?
  20. The problem isn't "you have sounds and your sounds.json file is bad" but that "Mac OS has injected files into a location and the game thinks its a sounds.json file"
  21. The strings "hm" and "hm: (the " being part of the string) are probably unique enough.
  22. This is not a thing. Dinnerbone mentioned that it would be "a cool thing to have" six years ago. That's the most recent comment on it from anyone at Mojang.
  23. He already did: And it does contain the error. I spotted it easily.
×
×
  • Create New...

Important Information

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