TerraFirmaCraft

TerraFirmaCraft

2M Downloads

Rideable entities nbt loading bug

nuuno2000 opened this issue ยท 3 comments

commented
  • Every rideable animal except for horses spawns with the same speed and jump strength (1.1X jump and 1.7X speed)
  • Donkeys and camels have the minimum hp and jump strength regardless of the parents stats (1 heart and 0.4X jump) (jump issue mentioned in #1142) (Havent tested other animals)

Meta Info

  • TFC Version: 0.X.X.146
commented

I can now confirm that even after becoming adults the offspring still only have 1HP

commented

From the wiki: "When breeding two donkeys, the foal's stats are determined by averaging both parent's stats with a third set, randomly determined as above (i.e. add both parents' stats with the random value and divide by 3). Random values are used for the third set even when the value is not randomized for donkeys spawned naturally or with a spawn egg." which means that the offspring shouldnt always have the minimum jump strength.

commented

Every rideable animal except for horses spawns with the same speed and jump strength (1.1X jump and 1.7X speed)

That's vanilla: https://minecraft.gamepedia.com/Donkey#Jump_strength (page for donkeys, but it is the same for others)

Donkeys and camels have the minimum hp and jump strength regardless of the parents stats (1 heart and 0.4X jump) (jump issue mentioned in #1142) (Havent tested other animals)

Jump will be the same regardless like i said above, now health may be an actual issue, will look.

Edit:
Bug is simple: Copy-pasta in nbt load (so testing without saving and loading from disk of course would not identify)

this.geneSpeed = nbt.getFloat("geneSpeed");
this.geneJump = nbt.getFloat("geneSpeed");
this.geneHealth = nbt.getFloat("geneSpeed");

this.geneSpeed = nbt.getFloat("geneSpeed");
this.geneJump = nbt.getFloat("geneSpeed");
this.geneHealth = nbt.getFloat("geneSpeed");

this.geneSpeed = nbt.getFloat("geneSpeed");
this.geneJump = nbt.getFloat("geneSpeed");
this.geneHealth = nbt.getFloat("geneSpeed");