MineColonies

MineColonies

53M Downloads

University requires one tier level higher than the research depth

JiaYow opened this issue ยท 1 comments

commented

Minecolonies version

Version: minecolonies-0.11.861-ALPHA-universal

Expected behavior

Tier-1 research in the University should require University Level 1, Tier-2 research in the University should require University Level 2, etc.

Actual behaviour

Trying to research an item that's the exact level of the university does nothing as long as the university is below tier 5. The research is not started, and there is also no error prompt or any feedback whatsoever.

The university needs to be one level over the research tier for the research to start.
This also means that tier1 university cannot research anything at the moment.

Steps to reproduce the problem

  1. Have a tier 1 university
  2. Try to research something. Anything.

Fix

Commit ac346e5 modified line 84 et. al. of WindowResearchTree.java from
if (research != null && building.getBuildingLevel() > building.getColony().getResearchManager().getResearchTree().getResearchInProgress().size() && building.getBuildingLevel() > building.getColony().getResearchManager().getResearchTree().getResearchInProgress().size() && research.hasEnoughResources(new InvWrapper(Minecraft.getInstance().player.inventory)))

, which had an obvious copypaste error, to

if (research != null && building.getBuildingLevel() > building.getColony().getResearchManager().getResearchTree().getResearchInProgress().size() && (building.getBuildingLevel() > research.getDepth() || building.getBuildingLevel() == building.getBuildingMaxLevel()) && research.hasEnoughResources(new InvWrapper(Minecraft.getInstance().player.inventory)))

building.getBuildingLevel() > research.getDepth() here should be building.getBuildingLevel() >= research.getDepth()
(compare this to line 224 in the same file)

commented

Hotfixed, thanks :)