mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Update to Official classnames Patchwork Make the game compile and run Merge in the new HUD overlay API Merge in the new render properties API PEEL Use Gradle 7.2 snapshot to fix eclipse integration bug in 7.1, Would use 7.0 but FG needs 7.1 for some reason. New FML installer Update to 1.17.1 Co-authored-by: LexManos <lexmanos@gmail.com> Co-authored-by: SizableShrimp <sizableshrimp@sizableshrimp.me> Co-authored-by: cpw <cpw+github@weeksfamily.ca> Co-authored-by: Curle <curle@gemwire.uk> Co-authored-by: Unnoen <Unnoen@users.noreply.github.com> Co-authored-by: covers1624 <laughlan.cov@internode.on.net> Co-authored-by: DaemonUmbra <daemon.umbra@gmail.com> Co-authored-by: gigaherz <gigaherz@gmail.com> Signed-off-by: SizableShrimp <sizableshrimp@sizableshrimp.me>
60 lines
1.9 KiB
Java
60 lines
1.9 KiB
Java
/*
|
|
* Minecraft Forge
|
|
* Copyright (c) 2016-2021.
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation version 2.1
|
|
* of the License.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
package net.minecraftforge.registries;
|
|
|
|
import net.minecraft.resources.ResourceLocation;
|
|
|
|
import java.util.function.Supplier;
|
|
|
|
|
|
/**
|
|
* A registry delegate for holding references to items or blocks
|
|
* These should be safe to use in things like lists though aliased items and blocks will not
|
|
* have object identity with respect to their delegate.
|
|
*
|
|
* @author cpw
|
|
*
|
|
* @param <T> the type of thing we're holding onto
|
|
*/
|
|
public interface IRegistryDelegate<T> extends Supplier<T> {
|
|
/**
|
|
* Get the referent pointed at by this delegate. This will be the currently active item or block, and will change
|
|
* as world saves come and go. Note that item.delegate.get() may NOT be the same object as item, due to item and
|
|
* block substitution.
|
|
*
|
|
* @return The referred object
|
|
*/
|
|
@Override
|
|
T get();
|
|
|
|
/**
|
|
* Get the unique resource location for this delegate. Completely static after registration has completed, and
|
|
* will never change.
|
|
* @return The name
|
|
*/
|
|
ResourceLocation name();
|
|
|
|
/**
|
|
* Get the delegate type. It will be dependent on the registry this delegate is sourced from.
|
|
* @return The type of delegate
|
|
*/
|
|
Class<T> type();
|
|
}
|