Package com.petrolpark.core.inventory
Record Class DummyContainer
java.lang.Object
java.lang.Record
com.petrolpark.core.inventory.DummyContainer
- All Implemented Interfaces:
net.minecraft.world.Clearable,net.minecraft.world.Container
-
Field Summary
Fields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
ConstructorsConstructorDescriptionDummyContainer(int size) Creates an instance of aDummyContainerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic final voidaddFakePlayerSlots(Consumer<net.minecraft.world.inventory.Slot> slotAdder) booleancanPlaceItem(int slot, net.minecraft.world.item.ItemStack stack) booleancanTakeItem(net.minecraft.world.Container target, int slot, net.minecraft.world.item.ItemStack stack) voidintcountItem(net.minecraft.world.item.Item item) final booleanIndicates whether some other object is "equal to" this one.intnet.minecraft.world.item.ItemStackgetItem(int slot) intbooleanhasAnyMatching(Predicate<net.minecraft.world.item.ItemStack> predicate) booleanfinal inthashCode()Returns a hash code value for this object.booleanisEmpty()net.minecraft.world.item.ItemStackremoveItem(int slot, int amount) net.minecraft.world.item.ItemStackremoveItemNoUpdate(int slot) voidvoidsetItem(int slot, net.minecraft.world.item.ItemStack stack) intsize()Returns the value of thesizerecord component.booleanstillValid(net.minecraft.world.entity.player.Player player) final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
getMaxStackSize, startOpen, stopOpen
-
Constructor Details
-
DummyContainer
public DummyContainer(int size) Creates an instance of aDummyContainerrecord class.- Parameters:
size- the value for thesizerecord component
-
-
Method Details
-
addFakePlayerSlots
-
clearContent
public void clearContent()- Specified by:
clearContentin interfacenet.minecraft.world.Clearable
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSizein interfacenet.minecraft.world.Container
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacenet.minecraft.world.Container
-
getItem
public net.minecraft.world.item.ItemStack getItem(int slot) - Specified by:
getItemin interfacenet.minecraft.world.Container
-
removeItem
public net.minecraft.world.item.ItemStack removeItem(int slot, int amount) - Specified by:
removeItemin interfacenet.minecraft.world.Container
-
removeItemNoUpdate
public net.minecraft.world.item.ItemStack removeItemNoUpdate(int slot) - Specified by:
removeItemNoUpdatein interfacenet.minecraft.world.Container
-
setItem
public void setItem(int slot, @Nonnull net.minecraft.world.item.ItemStack stack) - Specified by:
setItemin interfacenet.minecraft.world.Container
-
setChanged
public void setChanged()- Specified by:
setChangedin interfacenet.minecraft.world.Container
-
getMaxStackSize
public int getMaxStackSize()- Specified by:
getMaxStackSizein interfacenet.minecraft.world.Container
-
stillValid
public boolean stillValid(@Nonnull net.minecraft.world.entity.player.Player player) - Specified by:
stillValidin interfacenet.minecraft.world.Container
-
canPlaceItem
public boolean canPlaceItem(int slot, @Nonnull net.minecraft.world.item.ItemStack stack) - Specified by:
canPlaceItemin interfacenet.minecraft.world.Container
-
canTakeItem
public boolean canTakeItem(@Nonnull net.minecraft.world.Container target, int slot, @Nonnull net.minecraft.world.item.ItemStack stack) - Specified by:
canTakeItemin interfacenet.minecraft.world.Container
-
countItem
public int countItem(@Nonnull net.minecraft.world.item.Item item) - Specified by:
countItemin interfacenet.minecraft.world.Container
-
hasAnyOf
- Specified by:
hasAnyOfin interfacenet.minecraft.world.Container
-
hasAnyMatching
- Specified by:
hasAnyMatchingin interfacenet.minecraft.world.Container
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 with '=='. -
size
public int size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-