generated from tilera/1710mod
feat: arcane crafting in infusion workbench
This commit is contained in:
parent
b1533278c6
commit
9569858bc8
4 changed files with 28 additions and 29 deletions
|
@ -42,7 +42,7 @@ repositories {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:deobf"
|
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"
|
implementation "com.github.tox1cozZ:mixin-booter-legacy:1.1.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package net.anvilcraft.classiccasting.container;
|
package net.anvilcraft.classiccasting.container;
|
||||||
|
|
||||||
|
import dev.tilera.auracore.api.IWand;
|
||||||
import dev.tilera.auracore.api.crafting.IInfusionRecipe;
|
import dev.tilera.auracore.api.crafting.IInfusionRecipe;
|
||||||
|
import dev.tilera.auracore.crafting.AuracoreCraftingManager;
|
||||||
import net.anvilcraft.classiccasting.WandManager;
|
import net.anvilcraft.classiccasting.WandManager;
|
||||||
import net.anvilcraft.classiccasting.recipes.InfusionCraftingManager;
|
import net.anvilcraft.classiccasting.recipes.InfusionCraftingManager;
|
||||||
import net.anvilcraft.classiccasting.tiles.TileInfusionWorkbench;
|
import net.anvilcraft.classiccasting.tiles.TileInfusionWorkbench;
|
||||||
|
@ -13,8 +15,10 @@ import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.CraftingManager;
|
import net.minecraft.item.crafting.CraftingManager;
|
||||||
import thaumcraft.api.aspects.AspectList;
|
import thaumcraft.api.aspects.AspectList;
|
||||||
|
import thaumcraft.api.crafting.IArcaneRecipe;
|
||||||
import thaumcraft.common.container.ContainerDummy;
|
import thaumcraft.common.container.ContainerDummy;
|
||||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||||
|
import thaumcraft.common.tiles.TileMagicWorkbench;
|
||||||
|
|
||||||
public class ContainerInfusionWorkbench extends Container {
|
public class ContainerInfusionWorkbench extends Container {
|
||||||
private TileInfusionWorkbench tileEntity;
|
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
|
||||||
//if (this.tileEntity.getStackInSlot(9) == null
|
&& this.tileEntity.getStackInSlot(10) != null
|
||||||
// && this.tileEntity.getStackInSlot(10) != null
|
&& this.tileEntity.getStackInSlot(10).getItem() instanceof IWand) {
|
||||||
// && this.tileEntity.getStackInSlot(10).getItem() instanceof ItemWandCasting
|
TileMagicWorkbench bridge = AuracoreCraftingManager.createBridgeInventory(this.tileEntity, 0, 9);
|
||||||
// && WandManager.hasCharge(
|
IArcaneRecipe recipe = AuracoreCraftingManager.findMatchingArcaneRecipe(bridge, this.ip.player);
|
||||||
// this.tileEntity.getStackInSlot(10),
|
if (recipe != null && WandManager.hasCharge(this.tileEntity.getStackInSlot(10), this.ip.player, AuracoreCraftingManager.getArcaneRecipeVisCost(recipe, bridge))) {
|
||||||
// this.ip.player,
|
this.tileEntity.setInventorySlotContentsSoftly(
|
||||||
// ThaumcraftCraftingManager.findMatchingArcaneRecipeCost(
|
9,
|
||||||
// (IInventory) this.tileEntity, this.ip.player
|
recipe.getCraftingResult(bridge)
|
||||||
// )
|
);
|
||||||
// )) {
|
}
|
||||||
// this.tileEntity.setInventorySlotContentsSoftly(
|
}
|
||||||
// 9,
|
|
||||||
// ThaumcraftCraftingManager.findMatchingArcaneRecipe(
|
|
||||||
// (IInventory) this.tileEntity, this.ip.player
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (this.tileEntity.getStackInSlot(9) == null
|
if (this.tileEntity.getStackInSlot(9) == null
|
||||||
&& this.tileEntity.getStackInSlot(10) != null) {
|
&& this.tileEntity.getStackInSlot(10) != null) {
|
||||||
|
|
|
@ -2,6 +2,7 @@ package net.anvilcraft.classiccasting.container;
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import dev.tilera.auracore.api.crafting.IInfusionRecipe;
|
import dev.tilera.auracore.api.crafting.IInfusionRecipe;
|
||||||
|
import dev.tilera.auracore.crafting.AuracoreCraftingManager;
|
||||||
import net.anvilcraft.classiccasting.WandManager;
|
import net.anvilcraft.classiccasting.WandManager;
|
||||||
import net.anvilcraft.classiccasting.recipes.InfusionCraftingManager;
|
import net.anvilcraft.classiccasting.recipes.InfusionCraftingManager;
|
||||||
import net.anvilcraft.classiccasting.tiles.TileInfusionWorkbench;
|
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.Aspect;
|
||||||
import thaumcraft.api.aspects.AspectList;
|
import thaumcraft.api.aspects.AspectList;
|
||||||
import thaumcraft.api.aspects.IAspectSource;
|
import thaumcraft.api.aspects.IAspectSource;
|
||||||
|
import thaumcraft.api.crafting.IArcaneRecipe;
|
||||||
|
import thaumcraft.common.tiles.TileMagicWorkbench;
|
||||||
|
|
||||||
public class SlotCraftingInfusionWorkbench extends SlotCrafting {
|
public class SlotCraftingInfusionWorkbench extends SlotCrafting {
|
||||||
private final IInventory craftMatrix;
|
private final IInventory craftMatrix;
|
||||||
|
@ -40,10 +43,10 @@ public class SlotCraftingInfusionWorkbench extends SlotCrafting {
|
||||||
);
|
);
|
||||||
this.onCrafting(par1ItemStack);
|
this.onCrafting(par1ItemStack);
|
||||||
int cost;
|
int cost;
|
||||||
//int cost = ThaumcraftCraftingManager.findMatchingArcaneRecipeCost(
|
TileMagicWorkbench bridge = AuracoreCraftingManager.createBridgeInventory(this.craftMatrix, 0, 9);
|
||||||
// this.craftMatrix, this.thePlayer
|
IArcaneRecipe recipe = AuracoreCraftingManager.findMatchingArcaneRecipe(bridge, this.thePlayer);
|
||||||
//);
|
cost = AuracoreCraftingManager.getArcaneRecipeVisCost(recipe, bridge);
|
||||||
//if (cost == 0) {
|
if (cost == 0) {
|
||||||
IInfusionRecipe rec = InfusionCraftingManager.INSTANCE.findMatchingInfusionRecipe(
|
IInfusionRecipe rec = InfusionCraftingManager.INSTANCE.findMatchingInfusionRecipe(
|
||||||
this.craftMatrix, this.thePlayer
|
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) {
|
for (int var2 = 0; var2 < 9; ++var2) {
|
||||||
final ItemStack var3 = this.craftMatrix.getStackInSlot(var2);
|
final ItemStack var3 = this.craftMatrix.getStackInSlot(var2);
|
||||||
if (var3 != null) {
|
if (var3 != null) {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"mcversion": "${mcversion}",
|
"mcversion": "${mcversion}",
|
||||||
"authorList": [
|
"authorList": [
|
||||||
"LordMZTE",
|
"LordMZTE",
|
||||||
"nicht tilera lol"
|
"tilera"
|
||||||
],
|
],
|
||||||
"requiredMods": [
|
"requiredMods": [
|
||||||
"auracore",
|
"auracore",
|
||||||
|
|
Loading…
Reference in a new issue