-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
Why?
-
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 });
-
[1.14.4] How can I make my leaves check for logs diagonally?
Draco18s replied to X Squishling X's topic in Modder Support
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(). -
Why not check how vanilla does it?
-
[1.15.2] Custom WorldType with multiple biomes?
Draco18s replied to Stanlyhalo's topic in Modder Support
You're mostly on your own. There aren't tutorials for this sort of thing as worldgen is very complex. -
[1.15.2] Custom WorldType with multiple biomes?
Draco18s replied to Stanlyhalo's topic in Modder Support
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). -
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.
-
[1.15.2] How to send mining and walking function to player?
Draco18s replied to IdiomCoder's topic in Modder Support
Single player uses an integrated server. Its how "open to LAN" even functions at all. -
Leaf block showing transparent sections as black
Draco18s replied to Cyanideee's topic in Modder Support
Teach a man how to fish, etc etc. -
Leaf block showing transparent sections as black
Draco18s replied to Cyanideee's topic in Modder Support
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. -
Leaf block showing transparent sections as black
Draco18s replied to Cyanideee's topic in Modder Support
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). -
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?
-
And this is why my first reply was an attempt to get you to think about your problem.
-
For example: Me: "What is a waypoint?" You - it is a location in space represented by 3 values. Me: "So, a BlockPos"
-
Think about "what are waypoints?" and "what object are they relevant to, so I can store them there?"
-
[1.14.4] How can I make my leaves check for logs diagonally?
Draco18s replied to X Squishling X's topic in Modder Support
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? -
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"
-
The strings "hm" and "hm: (the " being part of the string) are probably unique enough.
-
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.
-
He already did: And it does contain the error. I spotted it easily.