AgriCraft

AgriCraft

30M Downloads

Default stats being returned

SAFCxHarter opened this issue ยท 4 comments

commented

Quick description

Taken clippings from a mutated crop with stats

  • Growth 3/10
  • Gain 4/10
  • Strength 2/10

Planted these clippings on crop sticks, broke the crop sticks with the plants fully grown and it returns unanalyzed seeds. Once analyzing said seeds, it returns them to the default stats of 1/1/1

Related issues and searches

Stats, Default Stats, Stats Issue

Mods and versions used

  • Minecraft: 1.12.2
  • AgriCraft: 2.12.0-1.12.0-a1
  • InfinityLib: 1.12.0

Steps to replicate the issue

  1. Increased seed stats through whatever method
  2. Take clippings from said plant, analyze the clippings
  3. Plant them until they "take" and succesfully plant
  4. Grow them to full maturity
  5. Break the crop sticks
  6. Analyze seeds that get dropped
  7. Seed stats should have returned to 1/1/1

Expectations and explanations

The seeds that dropped from the crop that was broken shouldnt have returned to the default Tier 1 stats
of 1/1/1 they should have carried over the stats from the parent plant. In this case 3/4/2

I would have preferred the stats to succesfully carry over when I destroyed the parent plant. This is a bug because this did not happen and the stats reverted to the default stats of 1/1/1

Your environment

  • How are you playing?
    • Operating System: Windows 10
    • Launcher: Twitch App
    • Modpack: Custom Modpack
  • What kind of server:
    • Singleplayer
    • Multiplayer
  • Game Modes:
    • Survival
    • Creative
  • Save File:
    • Brand new save
    • Only an existing save

Screenshots (or videos)

stage 1 - clippings
stage 2 - plant maturity
step 3 - break and get seed s
step 4- analyze seed
step 5 - default stats returned

commented

The problem seems to be with the function that creates the ItemStack for the seeds. When the function toStack(int size) on AgriSeed.java returns, it is setting the capNBT tag, and not the tag used by the item stack to identify seeds. To fix, simply replace the current return with something like:
"
ItemStack toReturn = new ItemStack(stack.getItem(), size, stack.getMetadata());
toReturn.setTagCompound(tag);
return toReturn;
"
This also fixes the "Wrong seed drop" from the issue #1097, issue #1100 and issue #1101 .

commented

Can also confirm this happening. Used a Mystical Agriculture seed to test, used mutations to get to 10/10/10, then took a clipping. After planting the clipping and it growing I broke the crop sticks with the plant fully grown, analysed the seed, and it was 1/1/1.

Minecraft: 1.12.2
AgriCraft: 2.12.0-1.12.0-a1
InfinityLib: 1.12.0

commented

Submitted PR now, checks passed, ready to be looked over. If there are any problems, let me know on the pull request page.

commented

So use that method instead of this? I'll fork that in right away and submit a PR.
return new ItemStack(stack.getItem(), size, stack.getMetadata(), tag);