Interface ResourceContainerInsertStrategy
- All Known Implementing Classes:
FluidResourceContainerInsertStrategy
@API(status=STABLE,
since="2.0.0-milestone.4.5")
public interface ResourceContainerInsertStrategy
Defines how a resource can be extracted from a resource slot into a container.
For fluids, this maps to how a fluid is inserted into a fluid container like a bucket.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final record
static final record
-
Method Summary
Modifier and TypeMethodDescriptiongetConversionInfo
(ResourceKey resource, net.minecraft.world.item.ItemStack carriedStack) insert
(net.minecraft.world.item.ItemStack container, ResourceAmount resourceAmount)
-
Method Details
-
insert
Optional<ResourceContainerInsertStrategy.InsertResult> insert(net.minecraft.world.item.ItemStack container, ResourceAmount resourceAmount) - Parameters:
container
- the container to insert the resource intoresourceAmount
- the resource to insert into the container- Returns:
- the result of the insertion, if any. If no result is present, the next insertion strategy will be tried.
-
getConversionInfo
Optional<ResourceContainerInsertStrategy.ConversionInfo> getConversionInfo(ResourceKey resource, net.minecraft.world.item.ItemStack carriedStack)
-