New bookshelf type and books nullify each other

- Added Thaumium Block as an example of a new valid bookshelf type, for testing;
- Changed check for other Books of Knowledge - removed the unexplained bonus to knowledge and made it so additional Books in range stop checkSurroundings and reset knowledge to 0, to prevent multiple books using the same bookshelf setup.
This commit is contained in:
Daniel Mendes committed 2024-03-27 18:25:26 +00:00
1 parent 63dbc361b8
commit 0f9fd9bea7
2 files changed
+6 -5

No files matched your search

@@ -186,9 +186,9 @@ public class TileKnowledgeBook extends SynchronizedTileEntity
} else if (te != null && te instanceof IKnowledgeProvider) {
this.surroundingKnowledge += ((IKnowledgeProvider) te)
.getProvidedKnowledge(this.worldObj, absX, absY, absZ);
} else if (at instanceof IKnowledgeProvider) {
this.surroundingKnowledge += ((IKnowledgeProvider) at)
.getProvidedKnowledge(this.worldObj, absX, absY, absZ);
} else if (at instanceof IKnowledgeProvider && xx != 0) {
this.surroundingKnowledge = 0;
return;
} else {
for (BlockSnapshot sn : TileKnowledgeBook.knowledgeIncreaseMap.keySet()) {
if (sn.block.equals(at) && sn.metadata == meta) {
@@ -374,8 +374,7 @@ public class TileKnowledgeBook extends SynchronizedTileEntity
AspectList workResearchList = new AspectList();
for (Aspect a : researchTags.aspects.keySet()) {
int value = researchTags.aspects.get(a);
int newVal = (int) Math
.max(TileKnowledgeBook.LOWEST_AMOUNT, ((double) value) * TileKnowledgeBook.MULTIPLIER);
int newVal = (int) (value * TileKnowledgeBook.MULTIPLIER * researchComplexity + (researchWarp ^ 2));
workResearchList.add(a, newVal);
}
this.workResearchAspects = workResearchList;
@@ -50,9 +50,11 @@ public class IntegrationAutomagy extends IntegrationMod {
// Better bookshelves -> MOAR knowledge
Block betterBookshelf = Block.getBlockFromName("Automagy:blockBookshelfEnchanted");
Block testBookshelf = Block.getBlockFromName("Thaumcraft:blockCosmeticSolid");
if (betterBookshelf != null) {
TileKnowledgeBook.knowledgeIncreaseMap.put(new TileKnowledgeBook.BlockSnapshot(betterBookshelf, 0), 2);
TileKnowledgeBook.knowledgeIncreaseMap.put(new TileKnowledgeBook.BlockSnapshot(betterBookshelf, 1), 4);
TileKnowledgeBook.knowledgeIncreaseMap.put(new TileKnowledgeBook.BlockSnapshot(testBookshelf, 4), 20);
}
}