Allow to keep enchants only for TR items. Closes #1952
This commit is contained in:
parent
3e3ca8dd41
commit
416fbbf607
1 changed files with 5 additions and 0 deletions
|
@ -30,8 +30,10 @@ import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.inventory.CraftingInventory;
|
import net.minecraft.inventory.CraftingInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.registry.Registry;
|
||||||
import reborncore.api.events.ItemCraftCallback;
|
import reborncore.api.events.ItemCraftCallback;
|
||||||
import team.reborn.energy.Energy;
|
import team.reborn.energy.Energy;
|
||||||
|
import techreborn.TechReborn;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
@ -58,6 +60,9 @@ public final class PoweredCraftingHandler implements ItemCraftCallback {
|
||||||
Energy.of(stack).set(totalEnergy);
|
Energy.of(stack).set(totalEnergy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Registry.ITEM.getId(stack.getItem()).getNamespace().equalsIgnoreCase(TechReborn.MOD_ID)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Map<Enchantment, Integer> map = Maps.newLinkedHashMap();
|
Map<Enchantment, Integer> map = Maps.newLinkedHashMap();
|
||||||
for (int i = 0; i < craftingInventory.getInvSize(); i++){
|
for (int i = 0; i < craftingInventory.getInvSize(); i++){
|
||||||
ItemStack ingredient = craftingInventory.getInvStack(i);
|
ItemStack ingredient = craftingInventory.getInvStack(i);
|
||||||
|
|
Loading…
Add table
Reference in a new issue