Fill in values for the item tags

This commit is contained in:
Sollace 2020-04-15 18:34:42 +02:00
parent 989d64540e
commit 21e52c750e
6 changed files with 34 additions and 22 deletions

View file

@ -6,8 +6,8 @@ import net.minecraft.tag.Tag;
import net.minecraft.util.Identifier;
public interface UTags {
// TODO: includes unicopia:alicorn_amulet
Tag<Item> CURSED_ARTEFACTS = TagRegistry.item(new Identifier(UnicopiaCore.MODID, "cursed_artefacts"));
Tag<Item> HAMMERPACE_IMMUNE = TagRegistry.item(new Identifier(UnicopiaCore.MODID, "hammerspace_immune"));
static void bootstrap() {}
static void bootstrap() { }
}

View file

@ -5,8 +5,8 @@ import java.util.List;
import java.util.Optional;
import java.util.function.BiFunction;
import com.minelittlepony.unicopia.UTags;
import com.minelittlepony.unicopia.advancement.BOHDeathCriterion;
import com.minelittlepony.unicopia.magic.MagicalItem;
import com.minelittlepony.unicopia.util.HeavyInventoryUtils;
import com.minelittlepony.unicopia.util.NbtSerialisable;
import com.minelittlepony.unicopia.util.MagicalDamageSource;
@ -15,13 +15,11 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.EnderChestBlock;
import net.minecraft.block.ShulkerBoxBlock;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.BasicInventory;
import net.minecraft.inventory.Inventory;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
@ -156,10 +154,8 @@ public class BagOfHoldingInventory extends BasicInventory implements NbtSerialis
CompoundTag compound = stack.getSubTag("inventory");
return isIllegalBlock(Block.getBlockFromItem(stack.getItem()))
// TODO: tag for items that are invalid for the inventory of holding
|| stack.getItem() instanceof BlockItem && (((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock)
|| (compound != null && compound.containsKey("invalid"))
|| (stack.getItem() instanceof MagicalItem && ((MagicalItem) stack.getItem()).hasInnerSpace());
|| stack.getItem().isIn(UTags.HAMMERPACE_IMMUNE)
|| (compound != null && compound.containsKey("invalid"));
}
protected boolean isIllegalBlock(Block block) {

View file

@ -122,11 +122,6 @@ public class BagOfHoldingItem extends Item implements MagicalItem {
return Affinity.NEUTRAL;
}
@Override
public boolean hasInnerSpace() {
return true;
}
public static class ContainerProvider implements NameableContainerProvider {
private Text customname = null;

View file

@ -3,14 +3,6 @@ package com.minelittlepony.unicopia.magic;
import net.minecraft.item.ItemStack;
public interface MagicalItem extends Affine {
/**
* If true this item serves as host to its own inner dimensional space.
* Bag of Holding will explode if you try to store items of this kind inside of it.
*/
default boolean hasInnerSpace() {
return false;
}
/**
* Gets the affinity of this magical artifact. Either good, bad, or unaligned.
* What this returns may have effects on the behaviour of certain spells and effects.

View file

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"unicopia:alicorn_amulet"
]
}

View file

@ -0,0 +1,23 @@
{
"replace": false,
"values": [
"minecraft:shulker_box",
"minecraft:white_shulker_box",
"minecraft:orange_shulker_box",
"minecraft:magenta_shulker_box",
"minecraft:light_blue_shulker_box",
"minecraft:yellow_shulker_box",
"minecraft:lime_shulker_box",
"minecraft:pink_shulker_box",
"minecraft:gray_shulker_box",
"minecraft:light_gray_shulker_box",
"minecraft:cyan_shulker_box",
"minecraft:purple_shulker_box",
"minecraft:blue_shulker_box",
"minecraft:brown_shulker_box",
"minecraft:green_shulker_box",
"minecraft:red_shulker_box",
"minecraft:black_shulker_box",
"unicopia:bag_of_holding"
]
}