001package net.tnemc.item.platform.check; 002/* 003 * The New Item Library 004 * Copyright (C) 2022 - 2025 Daniel "creatorfromhell" Vidmar 005 * 006 * This program is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU Lesser General Public 008 * License as published by the Free Software Foundation; either 009 * version 3 of the License, or (at your option) any later version. 010 * 011 * This program is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 * Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public License 017 * along with this program; if not, write to the Free Software Foundation, 018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 019 */ 020 021import net.tnemc.item.AbstractItemStack; 022 023/** 024 * LocaleItemCheck is used to check the locale item specifically, and is the priority check in platform checks. 025 * 026 * @author creatorfromhell 027 * @since 0.2.0.0 028 */ 029public interface LocaleItemCheck<T> extends ItemCheck<T> { 030 031 /** 032 * Checks if the given LocaleItemCheck applies based on the original item and the item to check. 033 * 034 * @param original the original item 035 * @param check the item to check 036 * 037 * @return true if the LocaleItemCheck applies, false otherwise 038 * @since 0.2.0.0 039 * @since 0.2.0.0 040 */ 041 boolean applies(final T original, final T check); 042 043 /** 044 * @param original the original stack 045 * @param check the stack to use for the check 046 * 047 * @return True if the check passes, otherwise false. 048 * @since 0.2.0.0 049 * @since 0.2.0.0 050 */ 051 boolean check(final T original, final T check); 052 053 /** 054 * @param original the original stack 055 * @param check the stack to use for the check 056 * 057 * @return True if the check passes, otherwise false. 058 * @since 0.2.0.0 059 * @since 0.2.0.0 060 */ 061 @Override 062 default boolean check(final AbstractItemStack<T> original, final AbstractItemStack<T> check) { 063 064 return true;//always return true because this shouldn't be used for locale checks. 065 } 066}