-
Notifications
You must be signed in to change notification settings - Fork 755
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bow materials to the encyclopedia
Includes a small revamp of material tier pages
- Loading branch information
1 parent
dc02b6b
commit f1e7918
Showing
21 changed files
with
731 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
404 changes: 404 additions & 0 deletions
404
...ain/java/slimeknights/tconstruct/library/client/book/content/AbstractMaterialContent.java
Large diffs are not rendered by default.
Oops, something went wrong.
382 changes: 19 additions & 363 deletions
382
src/main/java/slimeknights/tconstruct/library/client/book/content/ContentMaterial.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/main/java/slimeknights/tconstruct/library/client/book/content/RangedMaterialContent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package slimeknights.tconstruct.library.client.book.content; | ||
|
||
import net.minecraft.resources.ResourceLocation; | ||
import slimeknights.tconstruct.TConstruct; | ||
import slimeknights.tconstruct.library.materials.definition.MaterialId; | ||
import slimeknights.tconstruct.library.materials.definition.MaterialVariantId; | ||
import slimeknights.tconstruct.library.materials.stats.MaterialStatsId; | ||
import slimeknights.tconstruct.library.utils.Util; | ||
import slimeknights.tconstruct.tools.stats.BowstringMaterialStats; | ||
import slimeknights.tconstruct.tools.stats.GripMaterialStats; | ||
import slimeknights.tconstruct.tools.stats.LimbMaterialStats; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
public class RangedMaterialContent extends AbstractMaterialContent { | ||
/** Page ID for using this index directly */ | ||
public static final ResourceLocation ID = TConstruct.getResource("ranged_material"); | ||
|
||
public RangedMaterialContent(MaterialVariantId materialVariant, boolean detailed) { | ||
super(materialVariant, detailed); | ||
} | ||
|
||
@Override | ||
public ResourceLocation getId() { | ||
return ID; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
protected MaterialStatsId getStatType(int index) { | ||
return switch (index) { | ||
case 0 -> LimbMaterialStats.ID; | ||
case 1 -> GripMaterialStats.ID; | ||
case 2 -> BowstringMaterialStats.ID; | ||
default -> null; | ||
}; | ||
} | ||
|
||
@Override | ||
protected String getTextKey(MaterialId material) { | ||
if (detailed) { | ||
String primaryKey = String.format("material.%s.%s.ranged", material.getNamespace(), material.getPath()); | ||
if (Util.canTranslate(primaryKey)) { | ||
return primaryKey; | ||
} | ||
return String.format("material.%s.%s.encyclopedia", material.getNamespace(), material.getPath()); | ||
} | ||
return String.format("material.%s.%s.flavor", material.getNamespace(), material.getPath()); | ||
} | ||
|
||
@Override | ||
protected boolean supportsStatType(MaterialStatsId statsId) { | ||
return statsId.equals(LimbMaterialStats.ID) || statsId.equals(GripMaterialStats.ID) || statsId.equals(BowstringMaterialStats.ID); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.