Jump to content

Boy132

Members
  • Posts

    54
  • Joined

  • Last visited

Posts posted by Boy132

  1. 12 hours ago, Draco18s said:

    By the way:

    if(false && !world.isRemote) // Forge: NOP all this.

     

    Why do you still have that block it does nothing?

    You're right, I removed this part. :)

     

    12 hours ago, Draco18s said:

    Its also a terrible idea to use +10 as your UPPER/LOWER value. Metadata is limited by 16 states, meaning you're limiting your max age to 6, whereas if you used a single bit (+8) you could have max ages up to 8. It also means you can use bitwise logic instead (int age = meta & 7; int halfAsInt = meta & 8).

    Haven't thought so much about it but I changed this too.

     

    12 hours ago, Draco18s said:

    this.seed = new CoreSeedFood(name, 3, this);

     

    You can't do this. You are not allowed to create items at this point in the startup process. How do you even register this item?

    Why can't I do this? I add all my Blocks/ Items to Lists in my Init classes and then iterate through these lists in the registry events - and it works. :D

     

    12 hours ago, Draco18s said:

    And after a lot of testing, I've determined the issue. This function is run when you use bonemeal:

     

    
        @Override
        public void onBlockAdded(World world, BlockPos pos, IBlockState state)
        {
            if(getHalf(state) == EnumCropHalf.LOWER)
                world.setBlockState(pos.up(), getDefaultState().withProperty(HALF, EnumCropHalf.UPPER), 2);
        }

     

    It does not run when the block updates.

    Ahhh thank you very much! I changed the if to

    if(getHalf(state) == EnumCropHalf.LOWER && getAge(state) == 0)

    and now it works.

     

    Just one little question: do you now why HWYLA shows that the lower part is "mature" (even if it's not). The upper part is shown correctly and other "normal" crops are correct too?

  2. I copied the chunk loading check and the grow events check from the BlockCrops class. :)

     

    getAge is from the super class BlockCrops:

    protected int getAge(IBlockState state)
    {
        return ((Integer)state.getValue(this.getAgeProperty())).intValue();
    }

    And this does work, normal growing (updateTick) kind of works but when I use bonemeal (grow) on the lower half the upper one gets not updated.

  3. Hey,

     

    I want to create a double block crop (corn) but the top blockstate isn't updating. (see the screenshots: https://imgur.com/a/ndTM2jk)

     

    https://pastebin.com/wvb0X6L5

    https://pastebin.com/GcENDYY3

    https://pastebin.com/hxVhr473

     

    The setBlockState methods return true and the "input" blockstate is correct but the age of the crop is not updated. (also WAILA says that the bottom crop is always "mature" even it's not?)

     

    EDIT: Okay, "natural" growing works fine. Using bonemeal causes this problem but I still don't know why.

×
×
  • Create New...

Important Information

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