feat: arcane crafting in infusion workbench

This commit is contained in:
Timo Ley 2022-11-21 10:23:30 +01:00
parent b1533278c6
commit 9569858bc8
4 changed files with 28 additions and 29 deletions

View file

@ -42,7 +42,7 @@ repositories {
dependencies {
implementation "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:deobf"
implementation "dev.tilera:auracore:1.0.0-SNAPSHOT:deobf"
implementation "dev.tilera:auracore:1.1.1:deobf"
implementation "com.github.tox1cozZ:mixin-booter-legacy:1.1.2"
}

View file

@ -1,6 +1,8 @@
package net.anvilcraft.classiccasting.container;
import dev.tilera.auracore.api.IWand;
import dev.tilera.auracore.api.crafting.IInfusionRecipe;
import dev.tilera.auracore.crafting.AuracoreCraftingManager;
import net.anvilcraft.classiccasting.WandManager;
import net.anvilcraft.classiccasting.recipes.InfusionCraftingManager;
import net.anvilcraft.classiccasting.tiles.TileInfusionWorkbench;
@ -13,8 +15,10 @@ import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.crafting.IArcaneRecipe;
import thaumcraft.common.container.ContainerDummy;
import thaumcraft.common.items.wands.ItemWandCasting;
import thaumcraft.common.tiles.TileMagicWorkbench;
public class ContainerInfusionWorkbench extends Container {
private TileInfusionWorkbench tileEntity;
@ -78,24 +82,18 @@ public class ContainerInfusionWorkbench extends Container {
)
);
// TODO: need arcane crafting stuff for this
//if (this.tileEntity.getStackInSlot(9) == null
// && this.tileEntity.getStackInSlot(10) != null
// && this.tileEntity.getStackInSlot(10).getItem() instanceof ItemWandCasting
// && WandManager.hasCharge(
// this.tileEntity.getStackInSlot(10),
// this.ip.player,
// ThaumcraftCraftingManager.findMatchingArcaneRecipeCost(
// (IInventory) this.tileEntity, this.ip.player
// )
// )) {
// this.tileEntity.setInventorySlotContentsSoftly(
// 9,
// ThaumcraftCraftingManager.findMatchingArcaneRecipe(
// (IInventory) this.tileEntity, this.ip.player
// )
// );
//}
if (this.tileEntity.getStackInSlot(9) == null
&& this.tileEntity.getStackInSlot(10) != null
&& this.tileEntity.getStackInSlot(10).getItem() instanceof IWand) {
TileMagicWorkbench bridge = AuracoreCraftingManager.createBridgeInventory(this.tileEntity, 0, 9);
IArcaneRecipe recipe = AuracoreCraftingManager.findMatchingArcaneRecipe(bridge, this.ip.player);
if (recipe != null && WandManager.hasCharge(this.tileEntity.getStackInSlot(10), this.ip.player, AuracoreCraftingManager.getArcaneRecipeVisCost(recipe, bridge))) {
this.tileEntity.setInventorySlotContentsSoftly(
9,
recipe.getCraftingResult(bridge)
);
}
}
if (this.tileEntity.getStackInSlot(9) == null
&& this.tileEntity.getStackInSlot(10) != null) {

View file

@ -2,6 +2,7 @@ package net.anvilcraft.classiccasting.container;
import cpw.mods.fml.common.FMLCommonHandler;
import dev.tilera.auracore.api.crafting.IInfusionRecipe;
import dev.tilera.auracore.crafting.AuracoreCraftingManager;
import net.anvilcraft.classiccasting.WandManager;
import net.anvilcraft.classiccasting.recipes.InfusionCraftingManager;
import net.anvilcraft.classiccasting.tiles.TileInfusionWorkbench;
@ -14,6 +15,8 @@ import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.aspects.IAspectSource;
import thaumcraft.api.crafting.IArcaneRecipe;
import thaumcraft.common.tiles.TileMagicWorkbench;
public class SlotCraftingInfusionWorkbench extends SlotCrafting {
private final IInventory craftMatrix;
@ -40,10 +43,10 @@ public class SlotCraftingInfusionWorkbench extends SlotCrafting {
);
this.onCrafting(par1ItemStack);
int cost;
//int cost = ThaumcraftCraftingManager.findMatchingArcaneRecipeCost(
// this.craftMatrix, this.thePlayer
//);
//if (cost == 0) {
TileMagicWorkbench bridge = AuracoreCraftingManager.createBridgeInventory(this.craftMatrix, 0, 9);
IArcaneRecipe recipe = AuracoreCraftingManager.findMatchingArcaneRecipe(bridge, this.thePlayer);
cost = AuracoreCraftingManager.getArcaneRecipeVisCost(recipe, bridge);
if (cost == 0) {
IInfusionRecipe rec = InfusionCraftingManager.INSTANCE.findMatchingInfusionRecipe(
this.craftMatrix, this.thePlayer
);
@ -60,13 +63,11 @@ public class SlotCraftingInfusionWorkbench extends SlotCrafting {
}
}
}
//}
if (cost > 0) {
WandManager.spendCharge(
this.craftMatrix.getStackInSlot(10), par1EntityPlayer, cost
);
}
}
if (cost > 0) {
WandManager.spendCharge(this.craftMatrix.getStackInSlot(10), par1EntityPlayer, cost);
}
for (int var2 = 0; var2 < 9; ++var2) {
final ItemStack var3 = this.craftMatrix.getStackInSlot(var2);
if (var3 != null) {

View file

@ -7,7 +7,7 @@
"mcversion": "${mcversion}",
"authorList": [
"LordMZTE",
"nicht tilera lol"
"tilera"
],
"requiredMods": [
"auracore",