public class ShoppingBasket
extends java.lang.Object
implements java.lang.Iterable<net.minecraft.util.ResourceLocation>
| Constructor and Description |
|---|
ShoppingBasket() |
| Modifier and Type | Method and Description |
|---|---|
void |
addUnitsToOffer(net.minecraft.util.ResourceLocation offerId,
int toAdd) |
ContainerAmadron.EnumProblemState |
cap(net.minecraft.item.ItemStack tablet,
boolean allOffers)
Go through all items & fluids in the basket and ensure that:
the providing inventory/tank exists
there's enough of the offer in stock, where applicable
the providing inventory/tank contains enough resources to fund all of the offers
the Amadrone has space to carry all resources (36 itemstacks and/or 576000mB fluid)
there's enough space in the output
|
void |
clear() |
static ShoppingBasket |
fromNBT(net.minecraft.nbt.CompoundNBT subTag) |
int |
getUnits(net.minecraft.util.ResourceLocation offerId) |
void |
halve(net.minecraft.util.ResourceLocation offerId) |
boolean |
isEmpty() |
java.util.Iterator<net.minecraft.util.ResourceLocation> |
iterator() |
void |
remove(net.minecraft.util.ResourceLocation offerId) |
void |
setUnits(net.minecraft.util.ResourceLocation offerId,
int units) |
void |
syncToPlayer(net.minecraft.entity.player.ServerPlayerEntity player) |
net.minecraft.nbt.CompoundNBT |
toNBT() |
public static ShoppingBasket fromNBT(net.minecraft.nbt.CompoundNBT subTag)
public net.minecraft.nbt.CompoundNBT toNBT()
public int getUnits(net.minecraft.util.ResourceLocation offerId)
public void setUnits(net.minecraft.util.ResourceLocation offerId,
int units)
public void addUnitsToOffer(net.minecraft.util.ResourceLocation offerId,
int toAdd)
public void remove(net.minecraft.util.ResourceLocation offerId)
public void halve(net.minecraft.util.ResourceLocation offerId)
public void clear()
public java.util.Iterator<net.minecraft.util.ResourceLocation> iterator()
iterator in interface java.lang.Iterable<net.minecraft.util.ResourceLocation>public ContainerAmadron.EnumProblemState cap(net.minecraft.item.ItemStack tablet, boolean allOffers)
The basket may be modified to make the order(s) valid
tablet - the Amadron tablet, to get the inventory/tank locationsallOffers - true to check all offers as one, false to check each individuallypublic void syncToPlayer(net.minecraft.entity.player.ServerPlayerEntity player)
public boolean isEmpty()