First pass at coloring Sigil of Holding (#787)
This commit is contained in:
parent
513bb113e1
commit
4eda0d6caa
6 changed files with 83 additions and 8 deletions
|
@ -11,7 +11,10 @@ import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
|||
import WayofTime.bloodmagic.item.ItemInscriptionTool;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemBanner;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.event.AnvilUpdateEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
|
@ -57,6 +60,33 @@ public class CraftingHandler {
|
|||
}
|
||||
}
|
||||
|
||||
if (event.getLeft().getItem() == ModItems.sigilHolding) {
|
||||
if (event.getRight().getItem() == Items.NAME_TAG) {
|
||||
ItemStack output = event.getLeft().copy();
|
||||
if (!output.hasTagCompound())
|
||||
output.setTagCompound(new NBTTagCompound());
|
||||
output.getTagCompound().setString(Constants.NBT.COLOR, event.getRight().getDisplayName());
|
||||
event.setCost(1);
|
||||
|
||||
event.setOutput(output);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getRight().getItem() == Items.DYE) {
|
||||
EnumDyeColor dyeColor = ItemBanner.getBaseColor(event.getRight());
|
||||
ItemStack output = event.getLeft().copy();
|
||||
if (!output.hasTagCompound())
|
||||
output.setTagCompound(new NBTTagCompound());
|
||||
output.getTagCompound().setString(Constants.NBT.COLOR, String.valueOf(dyeColor.getMapColor().colorValue));
|
||||
event.setCost(1);
|
||||
|
||||
event.setOutput(output);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getLeft().getItem() == Items.BOOK && event.getRight().getItem() == Items.ELYTRA && !event.getRight().isItemDamaged())
|
||||
{
|
||||
ItemStack output = new ItemStack(ModItems.upgradeTome);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue