diff --git a/src/main/java/com/ticticboooom/mods/mm/block/tile/ControllerBlockEntity.java b/src/main/java/com/ticticboooom/mods/mm/block/tile/ControllerBlockEntity.java index ca1662b..e9fc220 100644 --- a/src/main/java/com/ticticboooom/mods/mm/block/tile/ControllerBlockEntity.java +++ b/src/main/java/com/ticticboooom/mods/mm/block/tile/ControllerBlockEntity.java @@ -17,7 +17,6 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TranslationTextComponent; @@ -43,20 +42,21 @@ public class ControllerBlockEntity extends UpdatableTile implements ITickableTil @Override public void tick() { - if (world.isRemote()){ + if (world.isRemote()) { return; } + update.setMsg("Failed to construct \nthe machine"); - List recipes = world.getRecipeManager().getRecipesForType(RecipeTypes.MACHINE_STRUCTURE); - for (MachineStructureRecipe recipe : recipes) { - int index = recipe.matches(this.pos, world, controllerId); + List structures = world.getRecipeManager().getRecipesForType(RecipeTypes.MACHINE_STRUCTURE); + for (MachineStructureRecipe structure : structures) { + int index = structure.matches(this.pos, world, controllerId); if (index != -1) { - if (!update.getSid().equals(recipe.getId().toString())){ + if (!update.getSid().equals(structure.getId().toString())) { update.setTicksTaken(0); } - update.setSid(recipe.getId().toString()); + update.setSid(structure.getId().toString()); update.setMsg("Found structure"); - onStructureFound(recipe, index); + onStructureFound(structure, index); break; } } @@ -88,7 +88,7 @@ public class ControllerBlockEntity extends UpdatableTile implements ITickableTil boolean processed = false; for (MachineProcessRecipe recipe : processRecipes) { if (recipe.matches(inputPorts, structure.getStructureId(), update)) { - if (!update.getId().equals(recipe.getId().toString())){ + if (!update.getId().equals(recipe.getId().toString())) { update.setTicksTaken(0); } this.update.setId(recipe.getId().toString()); diff --git a/src/main/java/com/ticticboooom/mods/mm/client/jei/category/MachineStructureRecipeCategory.java b/src/main/java/com/ticticboooom/mods/mm/client/jei/category/MachineStructureRecipeCategory.java index f88d521..ffecccf 100644 --- a/src/main/java/com/ticticboooom/mods/mm/client/jei/category/MachineStructureRecipeCategory.java +++ b/src/main/java/com/ticticboooom/mods/mm/client/jei/category/MachineStructureRecipeCategory.java @@ -1,6 +1,7 @@ package com.ticticboooom.mods.mm.client.jei.category; import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.IVertexBuilder; import com.ticticboooom.mods.mm.MM; import com.ticticboooom.mods.mm.block.ControllerBlock; import com.ticticboooom.mods.mm.block.MachinePortBlock; @@ -22,6 +23,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.DirectionalBlock; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderType; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import net.minecraft.state.Property; @@ -29,6 +31,7 @@ import net.minecraft.tags.BlockTags; import net.minecraft.tags.ITag; import net.minecraft.util.Direction; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.vector.Quaternion; import net.minecraft.util.math.vector.Vector3f; @@ -108,8 +111,8 @@ public class MachineStructureRecipeCategory implements IRecipeCategory { boolean canTick = true; - - index = 0; for (PortState input : inputs) { if (input.isConsumePerTick()) { diff --git a/src/test/resources/data/mm/recipes/output_dupe.json b/src/test/resources/data/mm/recipes/output_dupe.json new file mode 100644 index 0000000..c783b19 --- /dev/null +++ b/src/test/resources/data/mm/recipes/output_dupe.json @@ -0,0 +1,23 @@ +{ + "type": "masterfulmachinery:machine_process", + "structureId": "test_all", + "controllerId": "basic", + "ticks": 1, + "inputs": [ + { + "type": "masterfulmachinery:fluids", + "data": { + "fluid": "mekanism:steam", + "amount": 5 + } + } + ], + "outputs": [ + { + "type": "masterfulmachinery:energy", + "data": { + "amount": 10 + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/data/mm/recipes/structures/botanist_furnace.json b/src/test/resources/data/mm/recipes/structures/botanist_furnace.json new file mode 100644 index 0000000..91ae518 --- /dev/null +++ b/src/test/resources/data/mm/recipes/structures/botanist_furnace.json @@ -0,0 +1,82 @@ +{ + "type": "masterfulmachinery:machine_structure", + "id": "botanist_furnace_structure", + "controllerId": "botanist_furnace", + "name": "Botanist's Furnace", + "layout": [ + [ + ")))))", + ")***)", + "+++++", + ",))))" + ], + [ + "-----", + ".///0", + "1 1", + "2333C" + ], + [ + "4---4", + "5 5", + "1 1", + "13331" + ], + [ + " 4-4 ", + " 676 ", + " 181 ", + " 111 " + ] + ], + "legend": { + ")": { + "block": "botania:livingrock" + }, + "*": { + "block": "minecraft:redstone_block" + }, + "+": { + "block": "create:belt" + }, + ",": { + "block": "create:gearbox" + }, + "-": { + "block": "minecraft:cobblestone" + }, + ".": { + "block": "masterfulmachinery:botanist_furnace_botanist_furnace_item_port_items_input" + }, + "/": { + "block": "minecraft:campfire" + }, + "0": { + "block": "masterfulmachinery:botanist_furnace_botanist_furnace_item_port_items_output" + }, + "1": { + "block": "botania:livingrock_stairs" + }, + "2": { + "block": "masterfulmachinery:botanist_furnace_botanist_furnace_rotation_port_create_rotation_input" + }, + "3": { + "block": "create:framed_glass" + }, + "4": { + "block": "minecraft:cobblestone" + }, + "5": { + "block": "minecraft:jack_o_lantern" + }, + "6": { + "block": "minecraft:cobblestone" + }, + "7": { + "block": "botania:mana_spreader" + }, + "8": { + "block": "masterfulmachinery:botanist_furnace_botanist_furnace_mana_port_botania_mana_input" + } + } +} \ No newline at end of file diff --git a/src/test/resources/data/mm/recipes/structures/botanist_rotational_generator.json b/src/test/resources/data/mm/recipes/structures/botanist_rotational_generator.json new file mode 100644 index 0000000..94e818b --- /dev/null +++ b/src/test/resources/data/mm/recipes/structures/botanist_rotational_generator.json @@ -0,0 +1,40 @@ +{ + "type": "masterfulmachinery:machine_structure", + "id": "botanist_rotational_generator_structure", + "controllerId": "botanist_rotational_generator", + "name": "botanist's Rotational Generator", + "layout": [ + [ + " ", + ")))", + " " + ], + [ + ")))", + "*+,", + ")C)" + ], + [ + " ", + ")1)", + " " + ] + ], + "legend": { + ")": { + "block": "create:andesite_casing" + }, + "*": { + "block": "masterfulmachinery:botanist_rotational_generator_botanist_rotational_generator_mana_port_botania_mana_input" + }, + "+": { + "block": "create:shaft" + }, + ",": { + "block": "masterfulmachinery:botanist_rotational_generator_botanist_rotational_generator_rotation_port_create_rotation_output" + }, + "1": { + "block": "create:framed_glass" + } + } +} \ No newline at end of file diff --git a/src/test/resources/data/mm/recipes/structures/test_rotation.json b/src/test/resources/data/mm/recipes/structures/test_rotation.json index 65988b8..4dfd45a 100644 --- a/src/test/resources/data/mm/recipes/structures/test_rotation.json +++ b/src/test/resources/data/mm/recipes/structures/test_rotation.json @@ -6,6 +6,9 @@ "layout": [ [ "1C2" + ], + [ + " T " ] ], "legend": { @@ -14,6 +17,9 @@ }, "2": { "block": "masterfulmachinery:basic_simple_port_create_rotation_output" + }, + "T": { + "block": "create:deployer" } } } \ No newline at end of file diff --git a/src/test/resources/data/mm/recipes/structures/test_variable_ios.json b/src/test/resources/data/mm/recipes/structures/test_variable_ios.json index c964f55..07a13de 100644 --- a/src/test/resources/data/mm/recipes/structures/test_variable_ios.json +++ b/src/test/resources/data/mm/recipes/structures/test_variable_ios.json @@ -5,9 +5,9 @@ "name": "Variable IO", "layout": [ [ - ")C)", + ")*)", "*+*", - ")*)" + ")C)" ], [ "),)", diff --git a/src/test/resources/data/mm/recipes/structures/weak_coke_oven.json b/src/test/resources/data/mm/recipes/structures/weak_coke_oven.json new file mode 100644 index 0000000..e122c13 --- /dev/null +++ b/src/test/resources/data/mm/recipes/structures/weak_coke_oven.json @@ -0,0 +1,55 @@ +{ + "type": "masterfulmachinery:machine_structure", + "id": "weak_coke_oven_structure", + "controllerId": "weak_coke_oven", + "name": "Weak Coke Oven", + "layout": [ + [ + ")*)", + "+,-", + ".,/" + ], + [ + ")))", + "0 0", + "1C1" + ], + [ + ")))", + "212", + " " + ] + ], + "legend": { + "0": { + "block": "botania:drum_wild" + }, + "1": { + "block": "botania:livingwood_planks_stairs" + }, + "2": { + "block": "botania:livingrock_stairs" + }, + ")": { + "block": "botania:livingrock_bricks" + }, + "*": { + "block": "masterfulmachinery:weak_coke_oven_weak_coke_oven_mana_port_botania_mana_input" + }, + "+": { + "block": "masterfulmachinery:weak_coke_oven_weak_coke_oven_fluid_port_fluids_input" + }, + ",": { + "block": "botania:livingwood_planks" + }, + "-": { + "block": "masterfulmachinery:weak_coke_oven_weak_coke_oven_fluid_port_fluids_output" + }, + ".": { + "block": "masterfulmachinery:weak_coke_oven_weak_coke_oven_item_port_items_input" + }, + "/": { + "block": "masterfulmachinery:weak_coke_oven_weak_coke_oven_item_port_items_output" + } + } +} \ No newline at end of file diff --git a/version.properties b/version.properties index a9bc8c1..edba4fb 100644 --- a/version.properties +++ b/version.properties @@ -1,2 +1,2 @@ -#Thu Oct 21 09:55:37 BST 2021 -VERSION_CODE=851 +#Fri Oct 29 13:28:32 BST 2021 +VERSION_CODE=858