Skip to content

Commit

Permalink
Fixes #266, crimson/warped wood having Flammable trait
Browse files Browse the repository at this point in the history
  • Loading branch information
SilentChaos512 committed Nov 28, 2020
1 parent ca817b1 commit c3a319c
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Individual traits can now supply extra wiki lines in their JSON. _This is not synced with the client on dedicated servers._ Useful for adding more information to frequently confused traits, like Lucky.
### Changed
- Materials will no longer inherit stats and traits from their parent of they provide any of their own [related to #266]
- Improvements to formatting of the trait wiki page dump command
- Material list is formatted for easier reading
- Shows list of parts that provide traits (useful for upgrades)
### Fixed
- Crimson wood and warped wood having the flammable trait [#266]
- Damage on use for block filler traits (Road Maker) being loaded incorrect (value was truncated to an int)

## [2.3.9] - 2020-11-26
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,23 @@
},
"name": {
"translate": "material.silentgear.wood.crimson"
},
"traits": {
"main": [
{
"name": "silentgear:flexible",
"level": 2
},
{
"name": "silentgear:jagged",
"level": 1
}
],
"rod": [
{
"name": "silentgear:flexible",
"level": 1
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,23 @@
},
"name": {
"translate": "material.silentgear.wood.warped"
},
"traits": {
"main": [
{
"name": "silentgear:flexible",
"level": 2
},
{
"name": "silentgear:jagged",
"level": 1
}
],
"rod": [
{
"name": "silentgear:flexible",
"level": 1
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1110,8 +1110,16 @@ protected Collection<MaterialBuilder> getMaterials() {
ret.add(wood(sgWood, "jungle", Items.JUNGLE_PLANKS, 0xB88764));
ret.add(wood(sgWood, "oak", Items.OAK_PLANKS, 0xB8945F));
ret.add(wood(sgWood, "spruce", Items.SPRUCE_PLANKS, 0x82613A));
ret.add(wood(sgWood, "crimson", Items.CRIMSON_PLANKS, 0x7E3A56));
ret.add(wood(sgWood, "warped", Items.WARPED_PLANKS, 0x398382));
ret.add(wood(sgWood, "crimson", Items.CRIMSON_PLANKS, 0x7E3A56)
.trait(PartType.MAIN, Const.Traits.FLEXIBLE, 2)
.trait(PartType.MAIN, Const.Traits.JAGGED, 1)
.trait(PartType.ROD, Const.Traits.FLEXIBLE, 1)
);
ret.add(wood(sgWood, "warped", Items.WARPED_PLANKS, 0x398382)
.trait(PartType.MAIN, Const.Traits.FLEXIBLE, 2)
.trait(PartType.MAIN, Const.Traits.JAGGED, 1)
.trait(PartType.ROD, Const.Traits.FLEXIBLE, 1)
);

// Rough wood
ret.add(new MaterialBuilder(SilentGear.getId("wood/rough"), 0, Ingredient.EMPTY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public boolean allowedInPart(PartType partType) {
@Override
public Collection<StatInstance> getStatModifiers(IMaterialInstance material, ItemStat stat, PartType partType, ItemStack gear) {
Collection<StatInstance> ret = new ArrayList<>(stats.getOrDefault(partType, EMPTY_STAT_MAP).get(stat));
if (getParent() != null) {
if (ret.isEmpty() && getParent() != null) {
ret.addAll(getParent().getStatModifiers(material, stat, partType, gear));
}
return ret;
Expand All @@ -133,7 +133,7 @@ public Collection<StatInstance> getStatModifiers(IMaterialInstance material, Ite
@Override
public List<TraitInstance> getTraits(PartType partType, ItemStack gear) {
List<TraitInstance> ret = new ArrayList<>(traits.getOrDefault(partType, Collections.emptyList()));
if (getParent() != null) {
if (ret.isEmpty() && getParent() != null) {
ret.addAll(getParent().getTraits(partType, gear));
}
return ret;
Expand Down

0 comments on commit c3a319c

Please sign in to comment.