Record Class BlockItemAccessor
java.lang.Object
java.lang.Record
net.minecraft.server.commands.item.BlockItemAccessor
- All Implemented Interfaces:
ItemAccessor<BlockPos>
-
Nested Class Summary
Nested classes/interfaces inherited from interface ItemAccessor
ItemAccessor.SetterFunction<Target> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockPosThe field for theposrecord component.static final ArgProvider.Factory<ItemAccessor<?>> private static final CommandResponseTracker.Messages<BlockPos> private static final CommandResponseTracker.Messages<BlockPos> private static final CommandResponseTracker.MessagesWithArg<BlockPos, ItemStack> -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aBlockItemAccessorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.private SlotCollectiongetBlockSlots(CommandSourceStack source, SlotSource slotSource, com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType exceptionType) static ContainergetContainer(CommandSourceStack source, BlockPos pos, com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType exceptionType) intgetModifySuccess(CommandSourceStack source, CommandResponseTracker<BlockPos> tracker) intgetReplaceSuccess(CommandSourceStack source, CommandResponseTracker<BlockPos> tracker, @Nullable ItemStack knownItem) getSlots(CommandSourceStack source, SlotSource slotSource) final inthashCode()Returns a hash code value for this object.pos()Returns the value of theposrecord component.voidsetItems(CommandSourceStack source, SlotSource slotSource, ItemAccessor.SetterFunction<BlockPos> function) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
pos
The field for theposrecord component. -
PROVIDER
-
RESPONSE_SET
-
RESPONSE_SET_KNOWN_ITEM
private static final CommandResponseTracker.MessagesWithArg<BlockPos, ItemStack> RESPONSE_SET_KNOWN_ITEM -
RESPONSE_MODIFY
-
-
Constructor Details
-
BlockItemAccessor
Creates an instance of aBlockItemAccessorrecord class.- Parameters:
pos- the value for theposrecord component
-
-
Method Details
-
getSlots
public SlotCollection getSlots(CommandSourceStack source, SlotSource slotSource) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
getSlotsin interfaceItemAccessor<BlockPos>- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getBlockSlots
private SlotCollection getBlockSlots(CommandSourceStack source, SlotSource slotSource, com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType exceptionType) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
setItems
public void setItems(CommandSourceStack source, SlotSource slotSource, ItemAccessor.SetterFunction<BlockPos> function) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
setItemsin interfaceItemAccessor<BlockPos>- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getReplaceSuccess
public int getReplaceSuccess(CommandSourceStack source, CommandResponseTracker<BlockPos> tracker, @Nullable ItemStack knownItem) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
getReplaceSuccessin interfaceItemAccessor<BlockPos>- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getModifySuccess
public int getModifySuccess(CommandSourceStack source, CommandResponseTracker<BlockPos> tracker) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
getModifySuccessin interfaceItemAccessor<BlockPos>- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getContainer
public static Container getContainer(CommandSourceStack source, BlockPos pos, com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType exceptionType) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
toString
-
hashCode
-
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). -
pos
Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-