mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 20:22:33 +00:00
Replace IBurstViewerBauble with a tag
This commit is contained in:
1 parent
34956960b6
commit
4862da11be
5 files changed
+14
-22
No files matched your search
@@ -1,18 +0,0 @@
|
||||
/*
|
||||
* This class is distributed as part of the Botania Mod.
|
||||
* Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
/**
|
||||
* Base Interface for the Manaseer Monocle and items of the sort.
|
||||
* Having an accessory of this type equipped
|
||||
* will draw bursts without depth testing and allow the player to see magical flower radiuses.
|
||||
*/
|
||||
public interface IBurstViewerBauble {
|
||||
|
||||
}
|
||||
@@ -34,12 +34,12 @@ import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import vazkii.botania.api.item.IBurstViewerBauble;
|
||||
import vazkii.botania.api.item.ICosmeticAttachable;
|
||||
import vazkii.botania.api.item.ICosmeticBauble;
|
||||
import vazkii.botania.common.core.handler.EquipmentHandler;
|
||||
import vazkii.botania.common.lib.ModTags;
|
||||
|
||||
public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosmeticBauble {
|
||||
public class ItemMonocle extends ItemBauble implements ICosmeticBauble {
|
||||
|
||||
public ItemMonocle(Properties props) {
|
||||
super(props);
|
||||
@@ -96,13 +96,13 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosm
|
||||
return !EquipmentHandler.findOrEmpty(stack -> {
|
||||
if (!stack.isEmpty()) {
|
||||
Item item = stack.getItem();
|
||||
if (item instanceof IBurstViewerBauble) {
|
||||
if (item.isIn(ModTags.Items.BURST_VIEWERS)) {
|
||||
return true;
|
||||
}
|
||||
if (item instanceof ICosmeticAttachable) {
|
||||
ICosmeticAttachable attach = (ICosmeticAttachable) item;
|
||||
ItemStack cosmetic = attach.getCosmeticItem(stack);
|
||||
return !cosmetic.isEmpty() && cosmetic.getItem() instanceof IBurstViewerBauble;
|
||||
return !cosmetic.isEmpty() && cosmetic.getItem().isIn(ModTags.Items.BURST_VIEWERS);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -100,6 +100,8 @@ public class ModTags {
|
||||
public static final ITag.INamedTag<Item> RUNES_WINTER = tag("runes/winter");
|
||||
public static final ITag.INamedTag<Item> RUNES_WRATH = tag("runes/wrath");
|
||||
|
||||
public static final ITag.INamedTag<Item> BURST_VIEWERS = tag("burst_viewers");
|
||||
|
||||
public static ITag.INamedTag<Item> getFlowerTag(DyeColor color) {
|
||||
switch (color) {
|
||||
default:
|
||||
|
||||
@@ -54,6 +54,8 @@ public class ItemTagProvider extends ItemTagsProvider {
|
||||
this.func_240522_a_(ItemTags.TALL_FLOWERS).func_240531_a_(ModTags.Items.DOUBLE_MYSTICAL_FLOWERS);
|
||||
this.func_240522_a_(ItemTags.SMALL_FLOWERS).func_240531_a_(ModTags.Items.MYSTICAL_FLOWERS);
|
||||
this.func_240522_a_(ItemTags.FLOWERS).func_240531_a_(ModTags.Items.SPECIAL_FLOWERS);
|
||||
|
||||
this.func_240522_a_(ModTags.Items.BURST_VIEWERS).func_240532_a_(ModItems.monocle);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
Reference in new issue
Block a user