mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 19:46:42 +01:00
Added an "apples" tag
This commit is contained in:
parent
9d52675a4b
commit
7ca95e34cf
3 changed files with 20 additions and 16 deletions
|
@ -8,6 +8,7 @@ import net.minecraft.util.Identifier;
|
|||
public interface UTags {
|
||||
Tag<Item> CURSED_ARTEFACTS = TagRegistry.item(new Identifier("unicopia", "cursed_artefacts"));
|
||||
Tag<Item> HAMMERPACE_IMMUNE = TagRegistry.item(new Identifier("unicopia", "hammerspace_immune"));
|
||||
Tag<Item> APPLES = TagRegistry.item(new Identifier("unicopia", "apples"));
|
||||
|
||||
static void bootstrap() { }
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.minelittlepony.unicopia.item;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.minelittlepony.unicopia.UTags;
|
||||
import com.minelittlepony.unicopia.toxin.Toxicity;
|
||||
import com.minelittlepony.unicopia.util.MagicalDamageSource;
|
||||
import com.minelittlepony.unicopia.util.VecHelper;
|
||||
|
@ -33,15 +31,6 @@ import net.minecraft.world.World;
|
|||
|
||||
public class ZapAppleItem extends AppleItem {
|
||||
|
||||
private static final List<Item> ALIASABLE_ITEMS = Lists.newArrayList(
|
||||
Items.APPLE,
|
||||
UItems.GREEN_APPLE,
|
||||
UItems.SWEET_APPLE,
|
||||
UItems.SOUR_APPLE,
|
||||
UItems.ROTTEN_APPLE,
|
||||
UItems.COOKED_ZAP_APPLE
|
||||
);
|
||||
|
||||
public ZapAppleItem(Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
@ -96,10 +85,12 @@ public class ZapAppleItem extends AppleItem {
|
|||
public void appendStacks(ItemGroup tab, DefaultedList<ItemStack> items) {
|
||||
super.appendStacks(tab, items);
|
||||
if (isIn(tab)) {
|
||||
ALIASABLE_ITEMS.forEach(item -> {
|
||||
ItemStack stack = new ItemStack(this);
|
||||
stack.getOrCreateTag().putString("appearance", Registry.ITEM.getId(item).toString());
|
||||
items.add(stack);
|
||||
UTags.APPLES.values().forEach(item -> {
|
||||
if (item != this) {
|
||||
ItemStack stack = new ItemStack(this);
|
||||
stack.getOrCreateTag().putString("appearance", Registry.ITEM.getId(item).toString());
|
||||
items.add(stack);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
12
src/main/resources/data/unicopia/tags/items/apples.json
Normal file
12
src/main/resources/data/unicopia/tags/items/apples.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:apple",
|
||||
"unicopia:apple_green",
|
||||
"unicopia:apple_sweet",
|
||||
"unicopia:apple_sour",
|
||||
"unicopia:rotten_apple",
|
||||
"unicopia:zap_apple",
|
||||
"unicopia:cooked_zap_apple"
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue