Skip to content

Commit

Permalink
gave those selector tag results shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoriusT committed Jun 25, 2023
1 parent 728080e commit 747b073
Showing 1 changed file with 66 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,76 @@ public ItemStack getCraftingOutput(boolean aAllowCache) {
if (IL.Paper_Blueprint_Used.equal(slot(30), F, T)) {
ItemStack[] tRecipe = UT.NBT.getBlueprintCrafting(slot(30));
if (tRecipe != ZL_IS) for (int i = 0; i < tRecipe.length; i++) if (!slotHas(i+21)) slot(i+21, ST.amount(0, tRecipe[i]));
} else if (IL.Circuit_Selector.equal(slot(30), F, T)) {
} else if (IL.Circuit_Selector.equal(slot(30), T, T)) {
int tDestination = SLOTS_CRAFTING[3];
for (int i : SLOTS_CRAFTING) {
slotNull(i);
if (i == SLOTS_CRAFTING[0]) continue;
if (slotHas(i)) ST.move(this, i, SLOTS_CRAFTING[0]);
if (i == SLOTS_CRAFTING[3]) continue;
if (slotHas(i)) ST.move(this, i, tDestination);
if (slotHas(i)) for (int j : SLOTS_STORAGE) if (ST.equal(slot(i), slot(j))) ST.move(this, i, j);
if (slotHas(i)) for (int j : SLOTS_STORAGE) if (!slotHas(j)) ST.move(this, i, j);
}
for (int i = 1, j = (int)UT.Code.bind(2, 9, ST.meta(slot(30))); i < j; i++) if (!slotHas(i)) {
slot(SLOTS_CRAFTING[i], ST.amount(0, slot(SLOTS_CRAFTING[0])));
switch(ST.meta(slot(30))) {
case 9:
// Literally no other choice than filling all 9 Slots.
if (!slotHas(SLOTS_CRAFTING[8])) slot(SLOTS_CRAFTING[8], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[7])) slot(SLOTS_CRAFTING[7], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[6])) slot(SLOTS_CRAFTING[6], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[5])) slot(SLOTS_CRAFTING[5], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[4])) slot(SLOTS_CRAFTING[4], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[2])) slot(SLOTS_CRAFTING[2], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[1])) slot(SLOTS_CRAFTING[1], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[0])) slot(SLOTS_CRAFTING[0], ST.amount(0, slot(tDestination)));
break;
case 8:
// Because of the original Furnace Recipe.
if (!slotHas(SLOTS_CRAFTING[8])) slot(SLOTS_CRAFTING[8], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[7])) slot(SLOTS_CRAFTING[7], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[6])) slot(SLOTS_CRAFTING[6], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[5])) slot(SLOTS_CRAFTING[5], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[2])) slot(SLOTS_CRAFTING[2], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[1])) slot(SLOTS_CRAFTING[1], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[0])) slot(SLOTS_CRAFTING[0], ST.amount(0, slot(tDestination)));
break;
case 7:
// Honestly, no reason for this specific choice, apart from avoiding the Armor Recipes.
if (!slotHas(SLOTS_CRAFTING[7])) slot(SLOTS_CRAFTING[7], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[5])) slot(SLOTS_CRAFTING[5], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[4])) slot(SLOTS_CRAFTING[4], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[2])) slot(SLOTS_CRAFTING[2], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[1])) slot(SLOTS_CRAFTING[1], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[0])) slot(SLOTS_CRAFTING[0], ST.amount(0, slot(tDestination)));
break;
case 6:
// 3x2 because of the original Wall and Trapdoor Recipes.
if (!slotHas(SLOTS_CRAFTING[5])) slot(SLOTS_CRAFTING[5], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[4])) slot(SLOTS_CRAFTING[4], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[2])) slot(SLOTS_CRAFTING[2], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[1])) slot(SLOTS_CRAFTING[1], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[0])) slot(SLOTS_CRAFTING[0], ST.amount(0, slot(tDestination)));
break;
case 5:
// Star Shape because X Shape isn't used often.
if (!slotHas(SLOTS_CRAFTING[7])) slot(SLOTS_CRAFTING[7], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[5])) slot(SLOTS_CRAFTING[5], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[4])) slot(SLOTS_CRAFTING[4], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[1])) slot(SLOTS_CRAFTING[1], ST.amount(0, slot(tDestination)));
break;
case 4:
// 2x2 because a lot of Recipes do this.
if (!slotHas(SLOTS_CRAFTING[4])) slot(SLOTS_CRAFTING[4], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[1])) slot(SLOTS_CRAFTING[1], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[0])) slot(SLOTS_CRAFTING[0], ST.amount(0, slot(tDestination)));
break;
case 3:
// Horizontal because Slab Recipe
if (!slotHas(SLOTS_CRAFTING[5])) slot(SLOTS_CRAFTING[5], ST.amount(0, slot(tDestination)));
if (!slotHas(SLOTS_CRAFTING[4])) slot(SLOTS_CRAFTING[4], ST.amount(0, slot(tDestination)));
break;
default:
// Vertical because Stick Recipe
if (!slotHas(SLOTS_CRAFTING[6])) slot(SLOTS_CRAFTING[6], ST.amount(0, slot(tDestination)));
break;
}
}
ItemStack rStack = CR.getany(worldObj, aAllowCache, slot(21), slot(22), slot(23), slot(24), slot(25), slot(26), slot(27), slot(28), slot(29));
Expand Down Expand Up @@ -452,7 +512,7 @@ public boolean consumeSlot(int aSlot) {
@Override public ItemStack[] getDefaultInventory(NBTTagCompound aNBT) {return new ItemStack[71];}
@Override public int getInventoryStackLimitGUI(int aSlot) {return aSlot == 30 ? 1 : 64;}
@Override public boolean allowCovers(byte aSide) {return SIDES_BOTTOM_HORIZONTAL[aSide] && !ALONG_AXIS[aSide][mFacing];}
@Override public boolean isItemValidForSlotGUI(int aSlot, ItemStack aStack) {return aSlot != 30 || ST.invalid(aStack) || IL.Paper_Blueprint_Empty.equal(aStack, F, T) || IL.Paper_Blueprint_Used.equal(aStack, F, T) || (IL.Circuit_Selector.equal(aStack, F, T) && UT.Code.inside(2, 9, ST.meta(aStack)));}
@Override public boolean isItemValidForSlotGUI(int aSlot, ItemStack aStack) {return aSlot != 30 || ST.invalid(aStack) || IL.Paper_Blueprint_Empty.equal(aStack, F, T) || IL.Paper_Blueprint_Used.equal(aStack, F, T) || (IL.Circuit_Selector.equal(aStack, T, T) && UT.Code.inside(2, 9, ST.meta(aStack)));}

@Override
public boolean canInsertItem2(int aSlot, ItemStack aStack, byte aSide) {
Expand Down

0 comments on commit 747b073

Please sign in to comment.