Cache MakerRecipe, move stimulant to MakerInfoProvider

This commit is contained in:
P0nk
2023-03-04 17:20:16 +01:00
parent b329709776
commit 6073b20d65
8 changed files with 99 additions and 36 deletions

View File

@@ -101,7 +101,11 @@ public class MakerProcessor {
} else {
if (ItemConstants.isEquipment(toCreate)) { // only equips uses stimulant and reagents
if (p.readByte() != 0) { // stimulant
stimulantid = ii.getMakerStimulant(toCreate);
Optional<Integer> makerStimulant = infoProvider.getStimulant(toCreate);
if (makerStimulant.isEmpty()) {
throw new IllegalArgumentException("Maker item %d has no stimulator".formatted(toCreate));
}
stimulantid = makerStimulant.get();
if (!c.getAbstractPlayerInteraction().haveItem(stimulantid)) {
stimulantid = -1;
}