Skip to content

Commit

Permalink
fix: cannot place niters in reformation array
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed Jan 22, 2024
1 parent cf524f8 commit e72d89b
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// 1.20.1 2024-01-08T16:09:19.1787279 Tags for minecraft:item mod id theurgy
// 1.20.1 2024-01-22T15:11:39.9421714 Tags for minecraft:item mod id theurgy
7a78325a639e879280cccf4d15f364e02da86003 data/forge/tags/items/gems.json
9a414088a384ea8077655b79eb53ac263aaae5e3 data/forge/tags/items/gems/sal_ammoniac.json
04abd356cb9b230f4d1adcf90db05571e8a17d05 data/forge/tags/items/ores/sal_ammoniac.json
9148832ee4e83df2b37e23918707fd8046f26ff7 data/forge/tags/items/ores_in_ground/deepslate.json
f8295983ffdb0c42c6c8b12788a5b63c1eb43f72 data/forge/tags/items/ores_in_ground/stone.json
e801bdef0719e27dd7decd88269ada7c5740348e data/forge/tags/items/sugar.json
c1ae367d1f7b1391996652acb8c12cfbe63abfc8 data/theurgy/tags/items/alchemical_mercuries.json
6b2cc4608ef32324e28685c927a71faff559feb3 data/theurgy/tags/items/alchemical_niters.json
07760e14b03fd0089485f8825e5961fedbd2ab80 data/theurgy/tags/items/alchemical_salts.json
d5a5bd4c35eb69220e7e4ec0e991474a2f4442b4 data/theurgy/tags/items/alchemical_sulfurs.json
34afd6e0275950da142439ac05cd7455f47850e4 data/theurgy/tags/items/alchemical_sulfurs/abundant.json
Expand All @@ -27,6 +28,7 @@ a1f5db5c4c9d4b747e83dd3f796c8698304575bf data/theurgy/tags/items/alchemical_sulf
35133e95f1c8fdd7a1c21afcc231fc0bffefb9a8 data/theurgy/tags/items/alchemical_sulfurs/other_minerals/rare.json
a60fef1f5fe3c9aab793de4942e301732c51df6a data/theurgy/tags/items/alchemical_sulfurs/precious.json
214fcce95acb2086d5fd0fd4247b8445aaf55efd data/theurgy/tags/items/alchemical_sulfurs/rare.json
3bd13300b62d36e233ff4d34de69f118e502d263 data/theurgy/tags/items/alchemical_sulfurs_and_niters.json
c2e9d4fba333d2af3dbe84b5773c1c1c5e055dc4 data/theurgy/tags/items/gems/mercury/high.json
959c361f3fbee6edb10161ff4ebc2850ef625547 data/theurgy/tags/items/gems/mercury/low.json
e85a6add1492e3a02b8a37a6308fc632e930180f data/theurgy/tags/items/gems/mercury/medium.json
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"values": [
"theurgy:alchemical_sulfur_gems_abundant",
"theurgy:alchemical_sulfur_gems_common",
"theurgy:alchemical_sulfur_gems_rare",
"theurgy:alchemical_sulfur_gems_precious",
"theurgy:alchemical_sulfur_metals_abundant",
"theurgy:alchemical_sulfur_metals_common",
"theurgy:alchemical_sulfur_metals_rare",
"theurgy:alchemical_sulfur_metals_precious",
"theurgy:alchemical_sulfur_other_minerals_abundant",
"theurgy:alchemical_sulfur_other_minerals_common",
"theurgy:alchemical_sulfur_other_minerals_rare",
"theurgy:alchemical_sulfur_other_minerals_precious"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"values": [
{
"id": "#theurgy:alchemical_sulfurs",
"required": false
},
{
"id": "#theurgy:alchemical_niters",
"required": false
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ protected void onContentTypeChanged(int slot, ItemStack oldStack, ItemStack newS

@Override
public boolean isItemValid(int slot, ItemStack stack) {
return stack.is(ItemTagRegistry.ALCHEMICAL_SULFURS) && super.isItemValid(slot, stack);
return stack.is(ItemTagRegistry.ALCHEMICAL_SULFURS_AND_NITERS) && super.isItemValid(slot, stack);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected void onContentTypeChanged(int slot, ItemStack oldStack, ItemStack newS

@Override
public boolean isItemValid(int slot, ItemStack stack) {
return stack.is(ItemTagRegistry.ALCHEMICAL_SULFURS) && super.isItemValid(slot, stack);
return stack.is(ItemTagRegistry.ALCHEMICAL_SULFURS_AND_NITERS) && super.isItemValid(slot, stack);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ protected void addTags(HolderLookup.Provider pProvider) {
}
});

var nitersTag = this.tag(ItemTagRegistry.ALCHEMICAL_NITERS);
SulfurRegistry.SULFURS.getEntries().forEach(sulfur -> {
if(sulfur.get() instanceof AlchemicalSulfurItem alchemicalSulfurItem){
if(alchemicalSulfurItem.type() == AlchemicalSulfurType.NITER)
nitersTag.add(sulfur.get());
}
});

this.tag(ItemTagRegistry.ALCHEMICAL_SULFURS_AND_NITERS)
.addOptionalTag(ItemTagRegistry.ALCHEMICAL_SULFURS.location())
.addOptionalTag(ItemTagRegistry.ALCHEMICAL_NITERS.location());

this.tag(ItemTagRegistry.SUGAR)
.add(Items.SUGAR);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class ItemTagRegistry {
//complementary tag to Tags.Items.ORES, Tags.Items.RAW_MATERIALS, Tags.Items.INGOTS and Tags.Items.GEMS
public static final TagKey<Item> OTHER_MINERALS = tag("other_minerals");

public static final TagKey<Item> ALCHEMICAL_SULFURS_AND_NITERS = tag("alchemical_sulfurs_and_niters");
public static final TagKey<Item> ALCHEMICAL_NITERS = tag("alchemical_niters");
public static final TagKey<Item> ALCHEMICAL_SULFURS = tag("alchemical_sulfurs");
public static final TagKey<Item> ALCHEMICAL_SULFURS_METALS = tag("alchemical_sulfurs/metals");
public static final TagKey<Item> ALCHEMICAL_SULFURS_METALS_ABUNDANT = tag("alchemical_sulfurs/metals/abundant");
Expand Down

0 comments on commit e72d89b

Please sign in to comment.