Posted January 9, 20214 yr Hi, I'm trying to make a dust-like block (think redstone), but I can't figure out how to make the texture connect with the texture of the block next to it. I tried looking at the RedstoneWireBlock and FourWayBlock classes like someone on the Discord server suggested, but I can't really understand them. I can reuse vanilla redstone's blockstate, but I don't know what to put in the block's class itself. If anyone could give me some pointers or something, I'd really appreciate it. Thanks!
January 9, 20214 yr What did you not understand of those classes you looked at? Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
January 9, 20214 yr Author Well, it's just a lot to take in, and I'm having trouble figuring out which parts I need. I also don't really want to just copy and paste a bunch of code from another class, since I'm not really going to learn from it. Pretty much all of the code in those classes is confusing to me, and barely makes sense, so I'm not really sure what to do.
January 11, 20214 yr I took a look at RedstoneWireBlock and placed some dust in Minecraft to see what's up (you can press F3 and look at the dust to see properties). There's a RedstoneSide enum that can be either NONE, SIDE, or UP. Each side of the block (north, south, east, west) has an associated RedstoneSide value. These side properties are mapped to these enum values in a BlockState (field_235543_o_). Consider a block of redstone dust, Block A. If Block A was not surrounded by any blocks and the dust was pointing in all directions, the NORTH, SOUTH, EAST, and WEST properties would all be SIDE. If there was another redstone dust to the north of Block A, then Block A's NORTH and SOUTH properties would be SIDE, and its EAST and WEST properties would be NONE. If there was a solid block to the north of Block A with a dust on top, then Block A's NORTH property would be UP, its SOUTH property would be SIDE, and its EAST and WEST properties would be NONE. From a quick look it seems like func_235554_l_ builds a shape for each valid block state. You can probably look at the blocks adjacent to yours and set these properties accordingly, then use the properties to change the block state.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.