|
@@ -18,8 +18,6 @@ import net.minecraft.item.Items;
|
|
|
import net.minecraft.tags.BlockTags;
|
|
import net.minecraft.tags.BlockTags;
|
|
|
import net.minecraft.util.IWorldPosCallable;
|
|
import net.minecraft.util.IWorldPosCallable;
|
|
|
import net.minecraft.util.IntReferenceHolder;
|
|
import net.minecraft.util.IntReferenceHolder;
|
|
|
-import net.minecraftforge.api.distmarker.Dist;
|
|
|
|
|
-import net.minecraftforge.api.distmarker.OnlyIn;
|
|
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
|
import net.minecraftforge.common.MinecraftForge;
|
|
|
import net.minecraftforge.event.AnvilUpdateEvent;
|
|
import net.minecraftforge.event.AnvilUpdateEvent;
|
|
|
|
|
|
|
@@ -28,9 +26,6 @@ import java.util.Map;
|
|
|
|
|
|
|
|
public class AnvilContainerRe extends Container {
|
|
public class AnvilContainerRe extends Container {
|
|
|
|
|
|
|
|
- // 本次合成消耗的物品合成原料个数
|
|
|
|
|
- public int materialCost;
|
|
|
|
|
-
|
|
|
|
|
// 输入与输出物品槽
|
|
// 输入与输出物品槽
|
|
|
private final IInventory inputInventory = new Inventory(2) {
|
|
private final IInventory inputInventory = new Inventory(2) {
|
|
|
public void markDirty() {
|
|
public void markDirty() {
|
|
@@ -51,7 +46,7 @@ public class AnvilContainerRe extends Container {
|
|
|
}
|
|
}
|
|
|
// 确认玩家能否拿走物品
|
|
// 确认玩家能否拿走物品
|
|
|
public boolean canTakeStack(PlayerEntity player) {
|
|
public boolean canTakeStack(PlayerEntity player) {
|
|
|
- return (player.abilities.isCreativeMode || player.experienceLevel >= maximumCost.get()) && maximumCost.get() > 0;
|
|
|
|
|
|
|
+ return (player.abilities.isCreativeMode || player.experienceLevel >= totalCost.get()) && totalCost.get() > 0;
|
|
|
}
|
|
}
|
|
|
// 触发玩家拿走物品的事件
|
|
// 触发玩家拿走物品的事件
|
|
|
public ItemStack onTake(PlayerEntity thePlayer, ItemStack stack) {
|
|
public ItemStack onTake(PlayerEntity thePlayer, ItemStack stack) {
|
|
@@ -71,10 +66,15 @@ public class AnvilContainerRe extends Container {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 消耗的物品合成原料个数
|
|
|
|
|
+ public int materialCost;
|
|
|
|
|
+ // 消耗的等级
|
|
|
|
|
+ public final IntReferenceHolder totalCost = IntReferenceHolder.single();
|
|
|
|
|
+
|
|
|
// 在玩家从输出格拿走物品时触发:铁砧损坏、减少经验等
|
|
// 在玩家从输出格拿走物品时触发:铁砧损坏、减少经验等
|
|
|
private ItemStack onTakeOutput(PlayerEntity player, ItemStack itemStack) {
|
|
private ItemStack onTakeOutput(PlayerEntity player, ItemStack itemStack) {
|
|
|
if (!player.abilities.isCreativeMode) {
|
|
if (!player.abilities.isCreativeMode) {
|
|
|
- player.addExperienceLevel(-this.maximumCost.get());
|
|
|
|
|
|
|
+ player.addExperienceLevel(-this.totalCost.get());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
float breakChance = net.minecraftforge.common.ForgeHooks.onAnvilRepair(player, itemStack, AnvilContainerRe.this.inputInventory.getStackInSlot(0), AnvilContainerRe.this.inputInventory.getStackInSlot(1));
|
|
float breakChance = net.minecraftforge.common.ForgeHooks.onAnvilRepair(player, itemStack, AnvilContainerRe.this.inputInventory.getStackInSlot(0), AnvilContainerRe.this.inputInventory.getStackInSlot(1));
|
|
@@ -92,7 +92,7 @@ public class AnvilContainerRe extends Container {
|
|
|
this.inputInventory.setInventorySlotContents(1, ItemStack.EMPTY);
|
|
this.inputInventory.setInventorySlotContents(1, ItemStack.EMPTY);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.maximumCost.set(0);
|
|
|
|
|
|
|
+ this.totalCost.set(0);
|
|
|
this.worldPosCallable.consume((p_234633_1_, p_234633_2_) -> {
|
|
this.worldPosCallable.consume((p_234633_1_, p_234633_2_) -> {
|
|
|
BlockState blockstate = p_234633_1_.getBlockState(p_234633_2_);
|
|
BlockState blockstate = p_234633_1_.getBlockState(p_234633_2_);
|
|
|
if (!player.abilities.isCreativeMode && blockstate.isIn(BlockTags.ANVIL) && player.getRNG().nextFloat() < breakChance) {
|
|
if (!player.abilities.isCreativeMode && blockstate.isIn(BlockTags.ANVIL) && player.getRNG().nextFloat() < breakChance) {
|
|
@@ -114,167 +114,162 @@ public class AnvilContainerRe extends Container {
|
|
|
|
|
|
|
|
// 当输入物品改变时更新输出
|
|
// 当输入物品改变时更新输出
|
|
|
public void updateRepairOutput() {
|
|
public void updateRepairOutput() {
|
|
|
|
|
+
|
|
|
ItemStack itemstack = this.inputInventory.getStackInSlot(0);
|
|
ItemStack itemstack = this.inputInventory.getStackInSlot(0);
|
|
|
- this.maximumCost.set(1);
|
|
|
|
|
- int cost = 0;
|
|
|
|
|
- int j = 0;
|
|
|
|
|
- int k = 0;
|
|
|
|
|
if (itemstack.isEmpty()) {
|
|
if (itemstack.isEmpty()) {
|
|
|
this.outputInventory.setInventorySlotContents(0, ItemStack.EMPTY);
|
|
this.outputInventory.setInventorySlotContents(0, ItemStack.EMPTY);
|
|
|
- this.maximumCost.set(0);
|
|
|
|
|
- } else {
|
|
|
|
|
- ItemStack itemstack1 = itemstack.copy();
|
|
|
|
|
- ItemStack itemstack2 = this.inputInventory.getStackInSlot(1);
|
|
|
|
|
- Map<Enchantment, Integer> map = EnchantmentHelper.getEnchantments(itemstack1);
|
|
|
|
|
- j = j + itemstack.getRepairCost() + (itemstack2.isEmpty() ? 0 : itemstack2.getRepairCost());
|
|
|
|
|
- this.materialCost = 0;
|
|
|
|
|
- boolean flag = false;
|
|
|
|
|
-
|
|
|
|
|
- if (!itemstack2.isEmpty()) {
|
|
|
|
|
- if (!onAnvilChange(this, itemstack, itemstack2, outputInventory, itemstack.getDisplayName().getString(), j))
|
|
|
|
|
|
|
+ this.totalCost.set(0);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.totalCost.set(1);
|
|
|
|
|
+ int cost1 = 0;
|
|
|
|
|
+ int cost2 = 0;
|
|
|
|
|
+ int k = 0;
|
|
|
|
|
+ ItemStack itemstack1 = itemstack.copy();
|
|
|
|
|
+ ItemStack itemstack2 = this.inputInventory.getStackInSlot(1);
|
|
|
|
|
+ Map<Enchantment, Integer> map = EnchantmentHelper.getEnchantments(itemstack1);
|
|
|
|
|
+ cost2 = cost2 + itemstack.getRepairCost() + (itemstack2.isEmpty() ? 0 : itemstack2.getRepairCost());
|
|
|
|
|
+ this.materialCost = 0;
|
|
|
|
|
+ boolean flag = false;
|
|
|
|
|
+
|
|
|
|
|
+ if (!itemstack2.isEmpty()) {
|
|
|
|
|
+ if (!onAnvilChange(this, itemstack, itemstack2, outputInventory, itemstack.getDisplayName().getString(), cost2))
|
|
|
|
|
+ return;
|
|
|
|
|
+ flag = itemstack2.getItem() == Items.ENCHANTED_BOOK && !EnchantedBookItem.getEnchantments(itemstack2).isEmpty();
|
|
|
|
|
+ if (itemstack1.isDamageable() && itemstack1.getItem().getIsRepairable(itemstack, itemstack2)) {
|
|
|
|
|
+ int l2 = Math.min(itemstack1.getDamage(), itemstack1.getMaxDamage() / 4);
|
|
|
|
|
+ if (l2 <= 0) {
|
|
|
|
|
+ this.outputInventory.setInventorySlotContents(0, ItemStack.EMPTY);
|
|
|
|
|
+ this.totalCost.set(0);
|
|
|
return;
|
|
return;
|
|
|
- flag = itemstack2.getItem() == Items.ENCHANTED_BOOK && !EnchantedBookItem.getEnchantments(itemstack2).isEmpty();
|
|
|
|
|
- if (itemstack1.isDamageable() && itemstack1.getItem().getIsRepairable(itemstack, itemstack2)) {
|
|
|
|
|
- int l2 = Math.min(itemstack1.getDamage(), itemstack1.getMaxDamage() / 4);
|
|
|
|
|
- if (l2 <= 0) {
|
|
|
|
|
- this.outputInventory.setInventorySlotContents(0, ItemStack.EMPTY);
|
|
|
|
|
- this.maximumCost.set(0);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- int i3;
|
|
|
|
|
- for (i3 = 0; l2 > 0 && i3 < itemstack2.getCount(); ++i3) {
|
|
|
|
|
- int j3 = itemstack1.getDamage() - l2;
|
|
|
|
|
- itemstack1.setDamage(j3);
|
|
|
|
|
- ++cost;
|
|
|
|
|
- l2 = Math.min(itemstack1.getDamage(), itemstack1.getMaxDamage() / 4);
|
|
|
|
|
|
|
+ int i3;
|
|
|
|
|
+ for (i3 = 0; l2 > 0 && i3 < itemstack2.getCount(); ++i3) {
|
|
|
|
|
+ int j3 = itemstack1.getDamage() - l2;
|
|
|
|
|
+ itemstack1.setDamage(j3);
|
|
|
|
|
+ ++cost1;
|
|
|
|
|
+ l2 = Math.min(itemstack1.getDamage(), itemstack1.getMaxDamage() / 4);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.materialCost = i3;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.isDamageable())) {
|
|
|
|
|
+ this.outputInventory.setInventorySlotContents(0, ItemStack.EMPTY);
|
|
|
|
|
+ this.totalCost.set(0);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (itemstack1.isDamageable() && !flag) {
|
|
|
|
|
+ int l = itemstack.getMaxDamage() - itemstack.getDamage();
|
|
|
|
|
+ int i1 = itemstack2.getMaxDamage() - itemstack2.getDamage();
|
|
|
|
|
+ int j1 = i1 + itemstack1.getMaxDamage() * 12 / 100;
|
|
|
|
|
+ int k1 = l + j1;
|
|
|
|
|
+ int l1 = itemstack1.getMaxDamage() - k1;
|
|
|
|
|
+ if (l1 < 0) {
|
|
|
|
|
+ l1 = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.materialCost = i3;
|
|
|
|
|
- } else {
|
|
|
|
|
- if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.isDamageable())) {
|
|
|
|
|
- this.outputInventory.setInventorySlotContents(0, ItemStack.EMPTY);
|
|
|
|
|
- this.maximumCost.set(0);
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ if (l1 < itemstack1.getDamage()) {
|
|
|
|
|
+ itemstack1.setDamage(l1);
|
|
|
|
|
+ cost1 += 2;
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (itemstack1.isDamageable() && !flag) {
|
|
|
|
|
- int l = itemstack.getMaxDamage() - itemstack.getDamage();
|
|
|
|
|
- int i1 = itemstack2.getMaxDamage() - itemstack2.getDamage();
|
|
|
|
|
- int j1 = i1 + itemstack1.getMaxDamage() * 12 / 100;
|
|
|
|
|
- int k1 = l + j1;
|
|
|
|
|
- int l1 = itemstack1.getMaxDamage() - k1;
|
|
|
|
|
- if (l1 < 0) {
|
|
|
|
|
- l1 = 0;
|
|
|
|
|
|
|
+ Map<Enchantment, Integer> map1 = EnchantmentHelper.getEnchantments(itemstack2);
|
|
|
|
|
+ boolean flag2 = false;
|
|
|
|
|
+ boolean flag3 = false;
|
|
|
|
|
+
|
|
|
|
|
+ for (Enchantment enchantment1 : map1.keySet()) {
|
|
|
|
|
+ if (enchantment1 != null) {
|
|
|
|
|
+ int i2 = map.getOrDefault(enchantment1, 0);
|
|
|
|
|
+ int j2 = map1.get(enchantment1);
|
|
|
|
|
+ j2 = i2 == j2 ? j2 + 1 : Math.max(j2, i2);
|
|
|
|
|
+ boolean flag1 = enchantment1.canApply(itemstack);
|
|
|
|
|
+ if (this.player.abilities.isCreativeMode || itemstack.getItem() == Items.ENCHANTED_BOOK) {
|
|
|
|
|
+ flag1 = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (l1 < itemstack1.getDamage()) {
|
|
|
|
|
- itemstack1.setDamage(l1);
|
|
|
|
|
- cost += 2;
|
|
|
|
|
|
|
+ for (Enchantment enchantment : map.keySet()) {
|
|
|
|
|
+ if (enchantment != enchantment1 && !enchantment1.isCompatibleWith(enchantment)) {
|
|
|
|
|
+ flag1 = false;
|
|
|
|
|
+ ++cost1;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- Map<Enchantment, Integer> map1 = EnchantmentHelper.getEnchantments(itemstack2);
|
|
|
|
|
- boolean flag2 = false;
|
|
|
|
|
- boolean flag3 = false;
|
|
|
|
|
-
|
|
|
|
|
- for (Enchantment enchantment1 : map1.keySet()) {
|
|
|
|
|
- if (enchantment1 != null) {
|
|
|
|
|
- int i2 = map.getOrDefault(enchantment1, 0);
|
|
|
|
|
- int j2 = map1.get(enchantment1);
|
|
|
|
|
- j2 = i2 == j2 ? j2 + 1 : Math.max(j2, i2);
|
|
|
|
|
- boolean flag1 = enchantment1.canApply(itemstack);
|
|
|
|
|
- if (this.player.abilities.isCreativeMode || itemstack.getItem() == Items.ENCHANTED_BOOK) {
|
|
|
|
|
- flag1 = true;
|
|
|
|
|
|
|
+ if (!flag1) {
|
|
|
|
|
+ flag3 = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ flag2 = true;
|
|
|
|
|
+ if (j2 > enchantment1.getMaxLevel()) {
|
|
|
|
|
+ j2 = enchantment1.getMaxLevel();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ map.put(enchantment1, j2);
|
|
|
|
|
+ int k3 = 0;
|
|
|
|
|
+ switch (enchantment1.getRarity()) {
|
|
|
|
|
+ case COMMON:
|
|
|
|
|
+ k3 = 1;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case UNCOMMON:
|
|
|
|
|
+ k3 = 2;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case RARE:
|
|
|
|
|
+ k3 = 4;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case VERY_RARE:
|
|
|
|
|
+ k3 = 8;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- for (Enchantment enchantment : map.keySet()) {
|
|
|
|
|
- if (enchantment != enchantment1 && !enchantment1.isCompatibleWith(enchantment)) {
|
|
|
|
|
- flag1 = false;
|
|
|
|
|
- ++cost;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (flag) {
|
|
|
|
|
+ k3 = Math.max(1, k3 / 2);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!flag1) {
|
|
|
|
|
- flag3 = true;
|
|
|
|
|
- } else {
|
|
|
|
|
- flag2 = true;
|
|
|
|
|
- if (j2 > enchantment1.getMaxLevel()) {
|
|
|
|
|
- j2 = enchantment1.getMaxLevel();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- map.put(enchantment1, j2);
|
|
|
|
|
- int k3 = 0;
|
|
|
|
|
- switch (enchantment1.getRarity()) {
|
|
|
|
|
- case COMMON:
|
|
|
|
|
- k3 = 1;
|
|
|
|
|
- break;
|
|
|
|
|
- case UNCOMMON:
|
|
|
|
|
- k3 = 2;
|
|
|
|
|
- break;
|
|
|
|
|
- case RARE:
|
|
|
|
|
- k3 = 4;
|
|
|
|
|
- break;
|
|
|
|
|
- case VERY_RARE:
|
|
|
|
|
- k3 = 8;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (flag) {
|
|
|
|
|
- k3 = Math.max(1, k3 / 2);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- cost += k3 * j2;
|
|
|
|
|
- if (itemstack.getCount() > 1) {
|
|
|
|
|
- cost = 100;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ cost1 += k3 * j2;
|
|
|
|
|
+ if (itemstack.getCount() > 1) {
|
|
|
|
|
+ cost1 = 100;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (flag3 && !flag2) {
|
|
|
|
|
- this.outputInventory.setInventorySlotContents(0, ItemStack.EMPTY);
|
|
|
|
|
- this.maximumCost.set(0);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (flag3 && !flag2) {
|
|
|
|
|
+ this.outputInventory.setInventorySlotContents(0, ItemStack.EMPTY);
|
|
|
|
|
+ this.totalCost.set(0);
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (flag && !itemstack1.isBookEnchantable(itemstack2)) itemstack1 = ItemStack.EMPTY;
|
|
|
|
|
|
|
+ if (flag && !itemstack1.isBookEnchantable(itemstack2)) itemstack1 = ItemStack.EMPTY;
|
|
|
|
|
|
|
|
- this.maximumCost.set(j + cost);
|
|
|
|
|
- if (cost <= 0) {
|
|
|
|
|
- itemstack1 = ItemStack.EMPTY;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.totalCost.set(cost2 + cost1);
|
|
|
|
|
+ if (cost1 <= 0) {
|
|
|
|
|
+ itemstack1 = ItemStack.EMPTY;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (this.totalCost.get() >= 100 && !this.player.abilities.isCreativeMode) {
|
|
|
|
|
+ itemstack1 = ItemStack.EMPTY;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (this.maximumCost.get() >= 100 && !this.player.abilities.isCreativeMode) {
|
|
|
|
|
- itemstack1 = ItemStack.EMPTY;
|
|
|
|
|
|
|
+ if (!itemstack1.isEmpty()) {
|
|
|
|
|
+ int k2 = itemstack1.getRepairCost();
|
|
|
|
|
+ if (!itemstack2.isEmpty() && k2 < itemstack2.getRepairCost()) {
|
|
|
|
|
+ k2 = itemstack2.getRepairCost();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!itemstack1.isEmpty()) {
|
|
|
|
|
- int k2 = itemstack1.getRepairCost();
|
|
|
|
|
- if (!itemstack2.isEmpty() && k2 < itemstack2.getRepairCost()) {
|
|
|
|
|
- k2 = itemstack2.getRepairCost();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ k2 = k2 * 2 + 1; // new repair cost
|
|
|
|
|
|
|
|
- k2 = k2 * 2 + 1; // new repair cost
|
|
|
|
|
|
|
+ itemstack1.setRepairCost(k2);
|
|
|
|
|
+ EnchantmentHelper.setEnchantments(map, itemstack1);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- itemstack1.setRepairCost(k2);
|
|
|
|
|
- EnchantmentHelper.setEnchantments(map, itemstack1);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.outputInventory.setInventorySlotContents(0, itemstack1);
|
|
|
|
|
+ this.detectAndSendChanges();
|
|
|
|
|
|
|
|
- this.outputInventory.setInventorySlotContents(0, itemstack1);
|
|
|
|
|
- this.detectAndSendChanges();
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 关于 maximumCost 的 I/O
|
|
|
|
|
- private final IntReferenceHolder maximumCost = IntReferenceHolder.single();
|
|
|
|
|
- @OnlyIn(Dist.CLIENT) public int getMaximumCost() {
|
|
|
|
|
- return this.maximumCost.get();
|
|
|
|
|
- }
|
|
|
|
|
- public void setMaximumCost(int value) {
|
|
|
|
|
- this.maximumCost.set(value);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -295,7 +290,7 @@ public class AnvilContainerRe extends Container {
|
|
|
this.worldPosCallable = worldPosCallable;
|
|
this.worldPosCallable = worldPosCallable;
|
|
|
this.player = playerInventory.player;
|
|
this.player = playerInventory.player;
|
|
|
Constuct(playerInventory);
|
|
Constuct(playerInventory);
|
|
|
- this.trackInt(this.maximumCost);
|
|
|
|
|
|
|
+ this.trackInt(this.totalCost);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 接口: 当输入物品改变时触发更新
|
|
// 接口: 当输入物品改变时触发更新
|
|
@@ -363,7 +358,7 @@ public class AnvilContainerRe extends Container {
|
|
|
if (MinecraftForge.EVENT_BUS.post(e)) return false;
|
|
if (MinecraftForge.EVENT_BUS.post(e)) return false;
|
|
|
if (e.getOutput().isEmpty()) return true;
|
|
if (e.getOutput().isEmpty()) return true;
|
|
|
outputSlot.setInventorySlotContents(0, e.getOutput());
|
|
outputSlot.setInventorySlotContents(0, e.getOutput());
|
|
|
- container.setMaximumCost(e.getCost());
|
|
|
|
|
|
|
+ container.totalCost.set(e.getCost());
|
|
|
container.materialCost = e.getMaterialCost();
|
|
container.materialCost = e.getMaterialCost();
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|