Skip to content

Commit

Permalink
Revert "Undeprecate ContainerItemContext.withInitial"
Browse files Browse the repository at this point in the history
This reverts commit dcf123e.
  • Loading branch information
Technici4n committed Feb 20, 2023
1 parent b637ee8 commit 5072d15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,26 @@ static ContainerItemContext withConstant(ItemVariant constantVariant, long const

/**
* Return a context that can accept anything, and will accept (and destroy) any overflow items, with some initial content.
* The context is backed by a single slot storage that can be freely mutated.
* This can typically be used to check if a stack provides an API, or simulate operations on the returned API,
* for example to simulate how much fluid could be extracted from the stack.
*
* <p>Note that the stack can never be mutated by this function: its contents are copied directly.
*
* @deprecated Use {@link #withConstant(ItemStack)} instead.
*/
@Deprecated(forRemoval = true)
static ContainerItemContext withInitial(ItemStack initialContent) {
return withInitial(ItemVariant.of(initialContent), initialContent.getCount());
}

/**
* Return a context that can accept anything, and will accept (and destroy) any overflow items, with some initial variant and amount.
* The context is backed by a single slot storage that can be freely mutated.
* This can typically be used to check if a variant provides an API, or simulate operations on the returned API,
* for example to simulate how much fluid could be extracted from the variant and amount.
*
* @deprecated Use {@link #withConstant(ItemVariant, long)} instead.
*/
@Deprecated(forRemoval = true)
static ContainerItemContext withInitial(ItemVariant initialVariant, long initialAmount) {
StoragePreconditions.notNegative(initialAmount);
return new InitialContentsContainerItemContext(initialVariant, initialAmount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleVariantStorage;
import net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext;

@Deprecated(forRemoval = true)
public class InitialContentsContainerItemContext implements ContainerItemContext {
private final SingleVariantStorage<ItemVariant> backingSlot = new SingleVariantStorage<>() {
@Override
Expand Down

0 comments on commit 5072d15

Please sign in to comment.