Record Class BlockBlockItemHolder<T extends net.minecraft.world.level.block.Block,K extends net.minecraft.world.item.BlockItem>
java.lang.Object
java.lang.Record
team.lodestar.lodestone.modules.toolkit.block.BlockBlockItemHolder<T,K>
- All Implemented Interfaces:
Supplier<T>,net.minecraft.world.level.ItemLike
public record BlockBlockItemHolder<T extends net.minecraft.world.level.block.Block,K extends net.minecraft.world.item.BlockItem> (net.neoforged.neoforge.registries.DeferredBlock<T extends net.minecraft.world.level.block.Block> block, net.neoforged.neoforge.registries.DeferredItem<K extends net.minecraft.world.item.BlockItem> item)
extends Record
implements Supplier<T>, net.minecraft.world.level.ItemLike
-
Constructor Summary
ConstructorsConstructorDescriptionBlockBlockItemHolder(net.neoforged.neoforge.registries.DeferredBlock<T> block, net.neoforged.neoforge.registries.DeferredItem<K> item) Creates an instance of aBlockBlockItemHolderrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull net.minecraft.world.item.ItemasItem()net.neoforged.neoforge.registries.DeferredBlock<T> block()Returns the value of theblockrecord component.final booleanIndicates whether some other object is "equal to" this one.get()net.neoforged.neoforge.registries.DeferredHolder<net.minecraft.world.level.block.Block, T> net.minecraft.world.item.ItemStacknet.minecraft.world.level.block.state.BlockStategetItem()net.neoforged.neoforge.registries.DeferredHolder<net.minecraft.world.item.Item, K> final inthashCode()Returns a hash code value for this object.booleanis(net.minecraft.world.item.ItemStack stack) booleanis(net.minecraft.world.level.block.Block block) booleanis(net.minecraft.world.level.block.state.BlockState state) booleanis(net.minecraft.world.level.ItemLike item) net.neoforged.neoforge.registries.DeferredItem<K> item()Returns the value of theitemrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BlockBlockItemHolder
public BlockBlockItemHolder(net.neoforged.neoforge.registries.DeferredBlock<T> block, net.neoforged.neoforge.registries.DeferredItem<K> item) Creates an instance of aBlockBlockItemHolderrecord class.- Parameters:
block- the value for theblockrecord componentitem- the value for theitemrecord component
-
-
Method Details
-
get
-
asItem
@NotNull public @NotNull net.minecraft.world.item.Item asItem()- Specified by:
asItemin interfacenet.minecraft.world.level.ItemLike
-
getDefaultState
public net.minecraft.world.level.block.state.BlockState getDefaultState() -
getDefaultInstance
public net.minecraft.world.item.ItemStack getDefaultInstance() -
getItem
-
getBlockHolder
public net.neoforged.neoforge.registries.DeferredHolder<net.minecraft.world.level.block.Block,T> getBlockHolder() -
getItemHolder
public net.neoforged.neoforge.registries.DeferredHolder<net.minecraft.world.item.Item,K> getItemHolder() -
is
public boolean is(net.minecraft.world.item.ItemStack stack) -
is
public boolean is(net.minecraft.world.level.ItemLike item) -
is
public boolean is(net.minecraft.world.level.block.state.BlockState state) -
is
public boolean is(net.minecraft.world.level.block.Block block) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
block
Returns the value of theblockrecord component.- Returns:
- the value of the
blockrecord component
-
item
Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-