Class BundleContents.Mutable
java.lang.Object
net.minecraft.world.item.component.SimpleMutableContainer<BundleContents>
net.minecraft.world.item.component.GrowableMutableContainer<BundleContents>
net.minecraft.world.item.component.BundleContents.Mutable
- All Implemented Interfaces:
ContainerComponent.Mutable<BundleContents>, SlotCollection
- Enclosing class:
BundleContents
-
Nested Class Summary
Nested classes/interfaces inherited from interface SlotCollection
SlotCollection.Filtered, SlotCollection.FlatMapped, SlotCollection.Limited -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate intprivate org.apache.commons.lang3.math.FractionFields inherited from class SimpleMutableContainer
itemsFields inherited from interface SlotCollection
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddSlotWithItem(ItemProvider newItems) booleanprivate intfindStackIndex(ItemStack itemsToAdd) private intfindStackIndexWithinRange(ItemStack itemsToAdd, int minInclusive, int maxExclusive) private intgetMaxAmountToAdd(org.apache.commons.lang3.math.Fraction itemWeight) private static org.apache.commons.lang3.math.FractiongetStackedWeight(ItemStack stack) private static org.apache.commons.lang3.math.FractiongetStackedWeight(org.apache.commons.lang3.math.Fraction weight, int count) private static @Nullable org.apache.commons.lang3.math.FractiongetWeightWithAddedItems(org.apache.commons.lang3.math.Fraction weight, ItemStack itemsToAdd) private booleanindexIsOutsideAllowedBounds(int selectedItem) private voidvoidmodifySlots(Consumer<? super SlotAccess> consumer, SlotSelector slotSelector) intreplaceSlotItems(ItemProvider newItems, SlotSelector slotSelector) protected booleanvoidtoggleSelectedItem(int selectedItem) intinttryTransfer(Slot slot, Player player) org.apache.commons.lang3.math.Fractionweight()Methods inherited from class SimpleMutableContainer
itemCopies, sizeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SlotCollection
filter, flatMap, limit, modifySlots, replaceSlotItems
-
Field Details
-
weight
private org.apache.commons.lang3.math.Fraction weight -
selectedItem
private int selectedItem -
needsFlattening
private boolean needsFlattening
-
-
Constructor Details
-
Mutable
-
Mutable
public Mutable()
-
-
Method Details
-
clearItems
-
findStackIndexWithinRange
-
findStackIndex
-
getMaxAmountToAdd
private int getMaxAmountToAdd(org.apache.commons.lang3.math.Fraction itemWeight) -
tryInsert
-
tryTransfer
-
toggleSelectedItem
public void toggleSelectedItem(int selectedItem) -
indexIsOutsideAllowedBounds
private boolean indexIsOutsideAllowedBounds(int selectedItem) -
removeOne
-
getStackedWeight
private static org.apache.commons.lang3.math.Fraction getStackedWeight(org.apache.commons.lang3.math.Fraction weight, int count) -
getStackedWeight
-
weight
public org.apache.commons.lang3.math.Fraction weight() -
replaceSlotItems
- Specified by:
replaceSlotItemsin interfaceSlotCollection- Overrides:
replaceSlotItemsin classGrowableMutableContainer<BundleContents>
-
modifySlots
- Specified by:
modifySlotsin interfaceSlotCollection- Overrides:
modifySlotsin classSimpleMutableContainer<BundleContents>
-
setItem
- Overrides:
setItemin classSimpleMutableContainer<BundleContents>
-
addSlotWithItem
- Overrides:
addSlotWithItemin classGrowableMutableContainer<BundleContents>
-
getWeightWithAddedItems
-
canInsertNewSlots
public boolean canInsertNewSlots()- Specified by:
canInsertNewSlotsin classGrowableMutableContainer<BundleContents>
-
mergeIdenticalStacks
private void mergeIdenticalStacks() -
toImmutable
-