Resourceful Bees

Resourceful Bees

10M Downloads

Bees reappearing out of hive makes honeycomb count decrease to miminum of 2

SuperKnux opened this issue · 10 comments

commented

If this is about a specific bee please report to the pack dev as we do not create bees we just give tools to pack devs.
If you do report a "bug" that is about a specific bee or set of bees it will be instantly closed due to it most likely being
an issue with the bees that pack devs added themself and not our code.
Describe the bug
Sometimes, when bees emerge out of a beehive and honeycombs are supposed to generate, the honeycombs in the hive goes down or stays at a minimum of 2.

To Reproduce
Steps to reproduce the behavior:

  1. Play MC with mod installed
  2. Set up tiered beehive at least tier 2 or higher (not apiary, haven't tested yet)
  3. Wait for bees to generate honeycombs.

Expected behavior
After at least 2 honeycombs are generated, sometimes when honeycombs are supposed to be generated, the honeycomb count decreases down to 2.

Screenshots or Crash Logs
If applicable, add screenshots or crash logs to help explain your problem.

please complete the following information:

  • Forge Version [e.g. '1.16.5 - 36.1.0']
  • Mod Version [e.g. '0.6.5b']

Additional context
I'm actually playing Enigmatica 6 which includes this mod. That might be a cause of the problem.

commented
if (entity instanceof BeeEntity) {
                        BeeEntity vanillaBeeEntity = (BeeEntity) entity;
                        ItemStack honeycomb = new ItemStack(Items.HONEYCOMB);

                        if (beehiveState == State.HONEY_DELIVERED) {
                            vanillaBeeEntity.dropOffNectar();
                            int i = getHoneyLevel(state);
                            if (i < 5) {
                                if (entity instanceof ICustomBee && ((ICustomBee)entity).getBeeData().hasHoneycomb()) {
                                    honeycomb = ((ICustomBee)entity).getBeeData().getCombStack();
                                }

                                if (!honeycomb.isEmpty()) this.getHoneycombs().add(0, honeycomb);

                                recalculateHoneyLevel();
                            }
                        }

                        BeeInfoUtils.ageBee(((BTEBeeAccessor) tileBee).getTicksInHive(), vanillaBeeEntity);
                        if (entities != null) entities.add(entity);
                    }

this isn’t even possible.

commented

My guess would be that the bee was never delivering honey in the first place and as such a honeycomb was never generated. Bc as long as it triggers that it’s delivering honey it will always add a comb and never subtract one. Even if it’s just a vanilla honeycomb

edit: if you can get me a video of the comb count changing then changing back I would love to see it

commented

I've had this reported on the E6 issue tracker as well, the details there might help: EnigmaticaModpacks/Enigmatica6#1950

commented

Ive just tested this in dev and couldnt reproduce at all

commented

You tested Tier 1 Beehives going from honey level 4 to 5? Just wanna be sure here 😄

commented

Yeah I tested with a tier 1 hive going from level 4 to 5 and it did its normal operation so idk if something else is in play causing this to happen

commented

I was able to figure out the issue. it had to do with TOP and when holding shift to see the combs in the hive. Internally I store all of the combs separately but when I display them I do so with a count on a single item stack. So when I was building the new list for TOP I was inadvertently modifying the original data in the hive rather than copies of the data. essentially it stopped functioning correctly bc while it appeared the counts were incorrect they really weren't. At honey level 4 you could have an item stack with a count of 2 and then 3 item stacks of air so visually you would see 2 combs and think honey level should be 2 but internally the list had a size of 4 meaning the honey level was calculating properly.

tl;dr -> I have it fixed in my local copy, for the time being if you don't look at the combs in a hive it will work fine. I'll close this when I commit the changes.

Edit: also this affected any honey level and any tier hive.

commented

I don't understand why this is happening. It makes zero sense following the logic. I can also confirm that it does happen in dev and in ATM6 as well. I need to figure out why it happens and verify if it's only the T1 hive or if all are affected. I also can't believe that it has taken this long for this to come up as a bug report since the code has remained relatively unchanged for many many months now

commented

Nice catch! Quantum-state bug 😄

commented

For sure! Took me a bit to figure out how to reproduce it and realize what was going on. Happy I was able to figure it out though :)