use of hellfirepvp.astralsorcery.common.constellation.ConstellationBaseItem in project AstralSorcery by HellFirePvP.
the class ContainerTome method slotChanged.
public void slotChanged() {
if (EffectiveSide.get().isServer()) {
LinkedList<IConstellation> saveConstellations = new LinkedList<>();
for (int i = 36; i < 63; i++) {
ItemStack in = inventorySlots.get(i).getStack();
if (in.isEmpty()) {
continue;
}
if (!(in.getItem() instanceof ConstellationBaseItem)) {
continue;
}
IConstellation c = ((ConstellationBaseItem) in.getItem()).getConstellation(in);
if (c != null) {
saveConstellations.add(c);
}
}
ResearchManager.updateConstellationPapers(saveConstellations, this.owningPlayer);
}
}
use of hellfirepvp.astralsorcery.common.constellation.ConstellationBaseItem in project AstralSorcery by HellFirePvP.
the class ItemTome method getTomeStorage.
public static IInventory getTomeStorage(ItemStack stack, PlayerEntity player) {
Inventory inventory = new Inventory(27);
getStoredConstellations(stack, player).stream().map(cst -> {
ItemStack cstPaper = new ItemStack(ItemsAS.CONSTELLATION_PAPER);
if (cstPaper.getItem() instanceof ConstellationBaseItem) {
((ConstellationBaseItem) cstPaper.getItem()).setConstellation(cstPaper, cst);
}
return cstPaper;
}).forEach(inventory::addItem);
return inventory;
}
Aggregations