Skip to content

Commit

Permalink
try to fix ExtremeCraftingTableCategory
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlimiter committed May 16, 2022
1 parent ec5e282 commit 6ad2c34
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ private static String[] patternFromJson(JsonArray jsonArr) {
return astring;
}

public int getWidth() {
return width;
}

public int getHeight() {
return height;
}

@Override
public ItemStack getResultItem() {
return this.output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ public void setRecipe(IRecipeLayout layout, ICraftRecipe recipe, IIngredients in

if (recipe instanceof ShapedExtremeCraftingRecipe shaped) {
int stackIndex = 0;
int heightOffset = Math.floorDiv(9 - shaped.getHeight(), 2);
int widthOffset = Math.floorDiv(9 - shaped.getWidth(), 2);

for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
for (int i = heightOffset; i < shaped.getHeight() + heightOffset; i++) {
for (int j = widthOffset; j < shaped.getWidth() + widthOffset; j++) {
int index = 1 + (i * 9) + j;

stacks.set(index, inputs.get(stackIndex));
Expand Down
31 changes: 31 additions & 0 deletions src/main/resources/data/avaritia/recipes/endest_pearl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"type": "avaritia:shaped_extreme_craft",
"pattern": [
" EEE ",
" EEPPPEE ",
" EPPPPPE ",
"EPPPNPPPE",
"EPPNSNPPE",
"EPPPNPPPE",
" EPPPPPE ",
" EEPPPEE ",
" EEE "
],
"key": {
"E": {
"item": "minecraft:end_stone"
},
"P": {
"item": "minecraft:ender_pearl"
},
"S": {
"item": "minecraft:nether_star"
},
"N": {
"item": "avaritia:neutronium_ingot"
}
},
"result": {
"item": "avaritia:endest_pearl"
}
}
20 changes: 14 additions & 6 deletions src/main/resources/data/avaritia/recipes/infinity_ingot.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"type": "avaritia:shaped_extreme_craft",
"pattern": [
"xxx",
"xxx",
"xxx"
"NNNNNNNNN",
"NCXXCXXCN",
"NXCCXCCXN",
"NCXXCXXCN",
"NNNNNNNNN"
],
"key": {
"x": {
"item": "avaritia:infinity_nugget"
"X": {
"item": "avaritia:infinity_catalyst"
},
"C": {
"item": "avaritia:crystal_matrix_ingot"
},
"N": {
"item": "avaritia:neutronium_ingot"
}
},
"result": {
Expand Down
31 changes: 31 additions & 0 deletions src/main/resources/data/avaritia/recipes/neutron_collector.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"type": "avaritia:shaped_extreme_craft",
"pattern": [
"IIQQQQQII",
"I QQQQQ I",
"I RRR I",
"X RRRRR X",
"I RRXRR I",
"X RRRRR X",
"I RRR I",
"I I",
"IIIXIXIII"
],
"key": {
"X": {
"item": "avaritia:crystal_matrix_ingot"
},
"I": {
"item": "minecraft:iron_block"
},
"Q": {
"item": "minecraft:quartz_block"
},
"R": {
"item": "minecraft:redstone_block"
}
},
"result": {
"item": "avaritia:neutron_collector"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"type": "avaritia:shaped_extreme_craft",
"pattern": [
"IIIHHHIII",
"X N N X",
"I N N I",
"X N N X",
"RNN O NNR",
"X N N X",
"I N N I",
"X N N X",
"IIIXIXIII"
],
"key": {
"X": {
"item": "avaritia:crystal_matrix_ingot"
},
"N": {
"item": "avaritia:neutronium_ingot"
},
"I": {
"item": "minecraft:iron_block"
},
"H": {
"item": "minecraft:hopper"
},
"O": {
"item": "avaritia:neutronium"
},
"R": {
"item": "minecraft:redstone_block"
}
},
"result": {
"item": "avaritia:neutronium_compressor"
}
}

0 comments on commit 6ad2c34

Please sign in to comment.