Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/07/20 in all areas

  1. And this is why my first reply was an attempt to get you to think about your problem.
    1 point
  2. Why are you using #getHitVec? Check if mop instanceof BlockRayTraceResult, and mop.getType() == Type.Block. Then, cast mop to BlockRayTraceResult, and call #getPos. if (mop instanceof BlockRayTraceResult && mop.getType() == Type.BLOCK) { BlockRayTraceResult bmop = (BlockRayTraceResult) bmop; BlockPos pos = bmop.getPos(); I'm fairly certain that if mop.getType() == Type.BLOCK, then mop is definitely BlockRayTraceResult, but better check instanceof to be sure that mop is not null. I'm not sure, but I believe #getHitVec returns the vector in which the ray from the player's mouseover intersects the block's collision box. However, due to the fact that we have a [-0, -0] XYZ coordinate which does not have a corresponding block coordinate, ([-0, -0] in XYZ = [-1, -1] in blocks), converting the hit vector to BlockPos will result in a loss of 1 unit coordinate in the north and west directions.
    1 point
  3. I'd recommend a modeling program like Blockbench, it's what I use for all the models in my mods. It has a built in brush tool for creating a texture, but I'll usually use Photoshop or something if I want the texture to look a bit better, if you're trying to make a default block model, I believe it's just a 16x16 cube, hope this helps!
    1 point
  4. It says maxLength means the string read from the packet can not be longer than it, readString() passed in 32767. /** * Reads a string from this buffer. Expected parameter is maximum allowed string length. Will throw IOException if * string length exceeds this value! */ Quote from the comment
    1 point
  5. There is no need to raytrace at all, you already know what block the player is looking at: they just broke it. You need to use a cross product to find the perpendicular vectors to that vector so that you can identify the four orthogonally adjacent blocks, and from there, you can identify the four diagonals.
    1 point
  6. Hi ... by digging into the Chunk generation code to understand how it works World generation is very complicated, I'd suggest starting at ServerChunkProvider as an entry point, but to be honest there are so many lambdas, futures and registers in there that I think it will be difficult to trace through. If you find a good technical reference somewhere, please let me know!! -TGG
    1 point
  7. Hi Vanilla already has raytrace coded for you. No need to rewrite. Actually depending on the gameplay mechanics you want, you could just just use the player's look vec instead. i.e. if you are looking mostly down, your effect spreads out sideways even if you hit the side of the block instead of the top. The Direction class has methods to figure out which direction the player is facing based on the lookvec. -TGG
    1 point
  8. Write a custom IRecipe implementation.
    1 point
×
×
  • Create New...

Important Information

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