Jump to content

Recommended Posts

Posted (edited)

Like the title said, my crop extend CropBlocks, it breaks on block update ONLY if it is mature. i checked every super methods, but i still cannot determine why it keeps on breaking, what i think is that it might be related to world.isRemote stuff, but the source code super methods already dealt with it and all i do is call the super method. So i am literally clueless. I watched others mod tutorials and they don't have this problem, if more info is needed i can definitely provide, i cant really understand why this happen at all.

Edited by Thomas107500
Posted

You should post your code as a github repository so people can see the big picture, and link to it here.

Logs may or may not also be useful.

Unfortunately any suggestions would be random guesses without more information. As a general rule, always post your code at the very least :)

Posted (edited)

I will do that next time coz i thought it was just an easy quick fix where i am just blind and miss some minor obvious stuff, i solved it myself the moment i motify my code a bit and run it, it turns out it was this code i wrote:

 
 
0
 Advanced issue found
 
 
Spoiler

public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) 
    {
        //Have to let light hit on the VoxelShape in order to render properly
        if(context.getEntity() instanceof Entity) 
        {
            return VoxelShapes.empty();
        }else 
        {
            return super.getCollisionShape(state, worldIn, pos, context);
        }

that made the plant able to be pass through by player caused a weird bug, i commented that out and use the doesnotblockmovement() and it worked ?

Edited by Thomas107500
Posted

Just to be sure: your block of the crop breaks when it turns mature?

 

Also your spoiler in the post above seems to be broken. (at least for me it says "Advanced issue found")

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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