Skip to content

Commit 2bb34d5

Browse files
committed
- minor fixes
1 parent e785733 commit 2bb34d5

File tree

8 files changed

+18
-15
lines changed

8 files changed

+18
-15
lines changed

common/src/main/java/smartin/miapi/item/modular/items/ModularToolMaterial.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import net.minecraft.item.ToolMaterial;
44
import net.minecraft.recipe.Ingredient;
55

6-
public class ModularToolMaterial implements ToolMaterial{
6+
public class ModularToolMaterial implements ToolMaterial {
77
public static ModularToolMaterial toolMaterial = new ModularToolMaterial();
88

99
@Override

common/src/main/java/smartin/miapi/modules/material/GeneratedMaterial.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,17 +295,17 @@ public static void onReloadServer() {
295295
.filter(toolMaterial -> toolMaterial.getRepairIngredient() != null && toolMaterial.getRepairIngredient().getMatchingStacks() != null)
296296
.filter(toolMaterial -> toolMaterial.getRepairIngredient().getMatchingStacks().length > 0)
297297
.filter(toolMaterial -> !toolMaterial.getRepairIngredient().getMatchingStacks()[0].isIn(RegistryInventory.MIAPI_FORBIDDEN_TAG))
298-
.filter(toolMaterial -> Arrays.stream(toolMaterial.getRepairIngredient().getMatchingStacks()).allMatch(itemStack -> MaterialProperty.getMaterialFromIngredient(itemStack) != null && !itemStack.getItem().equals(Items.BARRIER)))
298+
.filter(toolMaterial -> toolMaterial.getRepairIngredient().getMatchingStacks()[0].getItem().equals(Items.BARRIER))
299299
.forEach(toolMaterial -> {
300300
Material material = MaterialProperty.getMaterialFromIngredient(toolMaterial.getRepairIngredient().getMatchingStacks()[0]);
301-
List<Item> toolMaterials = toolItems.stream()
302-
.filter(toolMat -> toolMaterial.equals(toolMat.getMaterial()))
303-
.filter(tool -> {
304-
ItemStack toolItem = tool.getDefaultStack();
305-
return ModularItemStackConverter.getModularVersion(toolItem)==toolItem;
306-
})
307-
.collect(Collectors.toList());
308301
if (material != null) {
302+
List<Item> toolMaterials = toolItems.stream()
303+
.filter(toolMat -> toolMaterial.equals(toolMat.getMaterial()))
304+
.filter(tool -> {
305+
ItemStack toolItem = tool.getDefaultStack();
306+
return ModularItemStackConverter.getModularVersion(toolItem)==toolItem;
307+
})
308+
.collect(Collectors.toList());
309309
if (material.generateConverters()) {
310310
try {
311311
MiapiEvents.GENERATE_MATERIAL_CONVERTERS.invoker().generated(material, toolMaterials, false);

common/src/main/java/smartin/miapi/wiki/datapack_data_types/converter.wiki.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@path /datapack_data_types/converter
33
@keywords modular converter, converter
44

5-
- a seperate JSON found in miapi/modular_converter
5+
- a separate JSON found in miapi/modular_converter
6+
- requires a unique file name/path for each converter file
67
- used to convert other items into modular Items
78
- Examples of Modular Converters can be found [here](https://github.com/Truly-Modular/Arsenal/tree/master/arsenal-common/src/main/resources/data/miapi/modular_converter).

common/src/main/java/smartin/miapi/wiki/datapack_data_types/create_options.wiki.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@path /datapack_data_types/create
33
@keywords create options, create option
44

5-
- a seperate JSON found in miapi/create_options
5+
- a separate JSON found in miapi/create_options
6+
- - requires a unique file name/path for each converter file
67
- Gives create options on the Plus button in the GUI
78
- Examples of Create Options can be found [here](https://github.com/Truly-Modular/Arsenal/tree/master/arsenal-common/src/main/resources/data/miapi/create_options).

common/src/main/java/smartin/miapi/wiki/datapack_data_types/materials.wiki.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
@path /datapack_data_types/modules
33
@keywords material, materials
44

5-
- a seperate JSON found in miapi/materials
5+
- a separate JSON found in miapi/materials
6+
- requires a unique file name/path for each converter file
67
- The API offers a diverse range of materials.
78
- Materials are loosely defined JSON files that serve as references for module statistics.
89
- Materials need to be added to data/miapi/materials/anyPathOrNameFromHere.json

common/src/main/java/smartin/miapi/wiki/datapack_data_types/modules.wiki.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
@path /datapack_data_types/modules
33
@keywords module, modules, module instance
44

5-
- a seperate JSON found in miapi/modules
5+
- a separate JSON found in miapi/modules
6+
- requires a unique file name/path for each converter file
67
- The API does not include any pre-built modules.
78
- Modules are not included within the API itself, but instead are outsourced to the addons to add.
89
- Modules need to be added to data/miapi/modules/anyPathOrNameFromHere.json

common/src/main/java/smartin/miapi/wiki/datapack_data_types/synergies.wiki.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@keywords synergy, synergies
44

55
- a separate JSON found in miapi/synergies
6+
- requires a unique file name/path for each converter file
67
- used to augment modules under certain conditions
78
- Examples of synergies can be found [here](https://github.com/Truly-Modular/Arsenal/tree/master/arsenal-common/src/main/resources/data/miapi/synergies).
89

forge/src/main/java/smartin/miapi/forge/TrulyModularForge.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import dev.architectury.registry.ReloadListenerRegistry;
77
import net.minecraft.client.MinecraftClient;
88
import net.minecraft.client.gui.DrawContext;
9-
import net.minecraft.enchantment.EnchantmentHelper;
109
import net.minecraft.entity.attribute.EntityAttributes;
1110
import net.minecraft.entity.player.PlayerEntity;
1211
import net.minecraft.item.Item;
@@ -64,7 +63,6 @@ public TrulyModularForge() {
6463
Miapi.LOGGER.info("couldnt load quark compat",e);
6564
}
6665
}
67-
EnchantmentHelper helper;
6866
bus.register(new ModEvents());
6967
MinecraftForge.EVENT_BUS.register(new ServerEvents());
7068
Miapi.init();

0 commit comments

Comments
 (0)