Class StorageMinecartEntity

All Implemented Interfaces:
DataTracked, VehicleInventory, Inventory, ScoreHolder, NamedScreenHandlerFactory, ScreenHandlerFactory, CommandOutput, Clearable, Nameable, EntityLike
Direct Known Subclasses:
ChestMinecartEntity, HopperMinecartEntity

public abstract class StorageMinecartEntity extends AbstractMinecartEntity implements VehicleInventory
Mappings:
Namespace Name
named net/minecraft/entity/vehicle/StorageMinecartEntity
intermediary net/minecraft/class_1693
official cow
  • Field Details

    • inventory

      private DefaultedList<ItemStack> inventory
      Mappings:
      Namespace Name Mixin selector
      named inventory Lnet/minecraft/entity/vehicle/StorageMinecartEntity;inventory:Lnet/minecraft/util/collection/DefaultedList;
      intermediary field_7735 Lnet/minecraft/class_1693;field_7735:Lnet/minecraft/class_2371;
      official c Lcow;c:Ljr;
    • lootTable

      Mappings:
      Namespace Name Mixin selector
      named lootTable Lnet/minecraft/entity/vehicle/StorageMinecartEntity;lootTable:Lnet/minecraft/registry/RegistryKey;
      intermediary field_7734 Lnet/minecraft/class_1693;field_7734:Lnet/minecraft/class_5321;
      official d Lcow;d:Lale;
    • lootSeed

      private long lootSeed
      Mappings:
      Namespace Name Mixin selector
      named lootSeed Lnet/minecraft/entity/vehicle/StorageMinecartEntity;lootSeed:J
      intermediary field_7732 Lnet/minecraft/class_1693;field_7732:J
      official e Lcow;e:J
  • Constructor Details

    • StorageMinecartEntity

      protected StorageMinecartEntity(EntityType<?> type, World world)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/entity/Entity;<init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)V
      intermediary <init> Lnet/minecraft/class_1297;<init>(Lnet/minecraft/class_1299;Lnet/minecraft/class_1937;)V
      official <init> Lbsw;<init>(Lbtc;Ldca;)V
    • StorageMinecartEntity

      protected StorageMinecartEntity(EntityType<?> type, double x, double y, double z, World world)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/entity/vehicle/StorageMinecartEntity;<init>(Lnet/minecraft/entity/EntityType;DDDLnet/minecraft/world/World;)V
      intermediary <init> Lnet/minecraft/class_1693;<init>(Lnet/minecraft/class_1299;DDDLnet/minecraft/class_1937;)V
      official <init> Lcow;<init>(Lbtc;DDDLdca;)V
  • Method Details

    • killAndDropSelf

      public void killAndDropSelf(DamageSource source)
      Overrides:
      killAndDropSelf in class VehicleEntity
      Mappings:
      Namespace Name Mixin selector
      named killAndDropSelf Lnet/minecraft/entity/vehicle/VehicleEntity;killAndDropSelf(Lnet/minecraft/entity/damage/DamageSource;)V
      intermediary method_7516 Lnet/minecraft/class_8836;method_7516(Lnet/minecraft/class_1282;)V
      official a Lcpi;a(Lbrp;)V
    • getStack

      public ItemStack getStack(int slot)
      Returns the stack currently stored at slot.

      If the slot is empty, or is outside the bounds of this inventory, this returns ItemStack.EMPTY.

      Specified by:
      getStack in interface Inventory
      Returns:
      the stack currently stored at slot
      Mappings:
      Namespace Name Mixin selector
      named getStack Lnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;
      intermediary method_5438 Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;
      official a Lbqp;a(I)Lcur;
    • removeStack

      public ItemStack removeStack(int slot, int amount)
      Removes a specific number of items from slot.
      Specified by:
      removeStack in interface Inventory
      Returns:
      the removed items as a stack
      Mappings:
      Namespace Name Mixin selector
      named removeStack Lnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;
      intermediary method_5434 Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;
      official a Lbqp;a(II)Lcur;
    • removeStack

      public ItemStack removeStack(int slot)
      Removes the stack currently stored at slot.
      Specified by:
      removeStack in interface Inventory
      Returns:
      the stack previously stored at the indicated slot
      Mappings:
      Namespace Name Mixin selector
      named removeStack Lnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;
      intermediary method_5441 Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;
      official b Lbqp;b(I)Lcur;
    • setStack

      public void setStack(int slot, ItemStack stack)
      Sets the stack stored at slot to stack.
      Specified by:
      setStack in interface Inventory
      Mappings:
      Namespace Name Mixin selector
      named setStack Lnet/minecraft/inventory/Inventory;setStack(ILnet/minecraft/item/ItemStack;)V
      intermediary method_5447 Lnet/minecraft/class_1263;method_5447(ILnet/minecraft/class_1799;)V
      official a Lbqp;a(ILcur;)V
    • getStackReference

      public StackReference getStackReference(int mappedIndex)
      Obtains a stack reference to be modified. Used by commands like /loot or /item.
      Overrides:
      getStackReference in class Entity
      Parameters:
      mappedIndex - the mapped index as given by the item slot argument
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getStackReference Lnet/minecraft/entity/Entity;getStackReference(I)Lnet/minecraft/inventory/StackReference;
      intermediary method_32318 Lnet/minecraft/class_1297;method_32318(I)Lnet/minecraft/class_5630;
      official a_ Lbsw;a_(I)Lbuj;
    • markDirty

      public void markDirty()
      Marks the inventory as modified. Implementations should call this method every time the inventory is changed in any way.
      Specified by:
      markDirty in interface Inventory
      See Also:
      API Note:
      Implementations should mark the inventory for synchronization or saving in this method. Since this is called frequently, it is not recommended to synchronize or save the inventory directly in this method. If this inventory is implemented in a block entity, then it should always call super.markDirty(); to ensure the block entity gets saved.
      Mappings:
      Namespace Name Mixin selector
      named markDirty Lnet/minecraft/inventory/Inventory;markDirty()V
      intermediary method_5431 Lnet/minecraft/class_1263;method_5431()V
      official e Lbqp;e()V
    • canPlayerUse

      public boolean canPlayerUse(PlayerEntity player)
      Specified by:
      canPlayerUse in interface Inventory
      Returns:
      whether player can use this inventory
      See Also:
      API Note:
      Implementations should check the distance between the inventory holder and player. For convenience, this interface offers two methods used by block entities to implement this check.
      Mappings:
      Namespace Name Mixin selector
      named canPlayerUse Lnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
      intermediary method_5443 Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Z
      official a Lbqp;a(Lcmz;)Z
    • remove

      public void remove(Entity.RemovalReason reason)
      Removes the entity.
      Overrides:
      remove in class Entity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named remove Lnet/minecraft/entity/Entity;remove(Lnet/minecraft/entity/Entity$RemovalReason;)V
      intermediary method_5650 Lnet/minecraft/class_1297;method_5650(Lnet/minecraft/class_1297$class_5529;)V
      official a Lbsw;a(Lbsw$c;)V
    • writeCustomDataToNbt

      protected void writeCustomDataToNbt(NbtCompound nbt)
      Writes custom data to nbt. Subclasses have to implement this.

      NBT is a storage format; therefore, a data from NBT is loaded to an entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the entity.

      Overrides:
      writeCustomDataToNbt in class AbstractMinecartEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named writeCustomDataToNbt Lnet/minecraft/entity/Entity;writeCustomDataToNbt(Lnet/minecraft/nbt/NbtCompound;)V
      intermediary method_5652 Lnet/minecraft/class_1297;method_5652(Lnet/minecraft/class_2487;)V
      official b Lbsw;b(Lus;)V
    • readCustomDataFromNbt

      protected void readCustomDataFromNbt(NbtCompound nbt)
      Reads custom data from nbt. Subclasses have to implement this.

      NBT is a storage format; therefore, a data from NBT is loaded to an entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the entity.

      nbt might not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.

      Overrides:
      readCustomDataFromNbt in class AbstractMinecartEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named readCustomDataFromNbt Lnet/minecraft/entity/Entity;readCustomDataFromNbt(Lnet/minecraft/nbt/NbtCompound;)V
      intermediary method_5749 Lnet/minecraft/class_1297;method_5749(Lnet/minecraft/class_2487;)V
      official a Lbsw;a(Lus;)V
    • interact

      public ActionResult interact(PlayerEntity player, Hand hand)
      Called when a player interacts with this entity.
      Overrides:
      interact in class Entity
      Parameters:
      player - the player
      hand - the hand the player used to interact with this entity
      Mappings:
      Namespace Name Mixin selector
      named interact Lnet/minecraft/entity/Entity;interact(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;
      intermediary method_5688 Lnet/minecraft/class_1297;method_5688(Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1269;
      official a Lbsw;a(Lcmz;Lbqv;)Lbqw;
    • applySlowdown

      protected void applySlowdown()
      Overrides:
      applySlowdown in class AbstractMinecartEntity
      Mappings:
      Namespace Name Mixin selector
      named applySlowdown Lnet/minecraft/entity/vehicle/AbstractMinecartEntity;applySlowdown()V
      intermediary method_7525 Lnet/minecraft/class_1688;method_7525()V
      official u Lcov;u()V
    • clear

      public void clear()
      Specified by:
      clear in interface Clearable
      Mappings:
      Namespace Name Mixin selector
      named clear Lnet/minecraft/util/Clearable;clear()V
      intermediary method_5448 Lnet/minecraft/class_3829;method_5448()V
      official a Lbqn;a()V
    • setLootTable

      public void setLootTable(RegistryKey<LootTable> lootTable, long lootSeed)
      Mappings:
      Namespace Name Mixin selector
      named setLootTable Lnet/minecraft/entity/vehicle/StorageMinecartEntity;setLootTable(Lnet/minecraft/registry/RegistryKey;J)V
      intermediary method_7562 Lnet/minecraft/class_1693;method_7562(Lnet/minecraft/class_5321;J)V
      official a Lcow;a(Lale;J)V
    • createMenu

      @Nullable public @Nullable ScreenHandler createMenu(int syncId, PlayerInventory playerInventory, PlayerEntity player)
      Specified by:
      createMenu in interface ScreenHandlerFactory
      Mappings:
      Namespace Name Mixin selector
      named createMenu Lnet/minecraft/screen/ScreenHandlerFactory;createMenu(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/screen/ScreenHandler;
      intermediary createMenu Lnet/minecraft/class_1270;createMenu(ILnet/minecraft/class_1661;Lnet/minecraft/class_1657;)Lnet/minecraft/class_1703;
      official createMenu Lcrc;createMenu(ILcmy;Lcmz;)Lcpw;
    • getScreenHandler

      protected abstract ScreenHandler getScreenHandler(int syncId, PlayerInventory playerInventory)
      Mappings:
      Namespace Name Mixin selector
      named getScreenHandler Lnet/minecraft/entity/vehicle/StorageMinecartEntity;getScreenHandler(ILnet/minecraft/entity/player/PlayerInventory;)Lnet/minecraft/screen/ScreenHandler;
      intermediary method_17357 Lnet/minecraft/class_1693;method_17357(ILnet/minecraft/class_1661;)Lnet/minecraft/class_1703;
      official a Lcow;a(ILcmy;)Lcpw;
    • getLootTable

      @Nullable public @Nullable RegistryKey<LootTable> getLootTable()
      Specified by:
      getLootTable in interface VehicleInventory
      Mappings:
      Namespace Name Mixin selector
      named getLootTable Lnet/minecraft/entity/vehicle/VehicleInventory;getLootTable()Lnet/minecraft/registry/RegistryKey;
      intermediary method_42276 Lnet/minecraft/class_7265;method_42276()Lnet/minecraft/class_5321;
      official B Lcoz;B()Lale;
    • setLootTable

      public void setLootTable(@Nullable @Nullable RegistryKey<LootTable> lootTable)
      Specified by:
      setLootTable in interface VehicleInventory
      Mappings:
      Namespace Name Mixin selector
      named setLootTable Lnet/minecraft/entity/vehicle/VehicleInventory;setLootTable(Lnet/minecraft/registry/RegistryKey;)V
      intermediary method_42275 Lnet/minecraft/class_7265;method_42275(Lnet/minecraft/class_5321;)V
      official a Lcoz;a(Lale;)V
    • getLootTableSeed

      public long getLootTableSeed()
      Specified by:
      getLootTableSeed in interface VehicleInventory
      Mappings:
      Namespace Name Mixin selector
      named getLootTableSeed Lnet/minecraft/entity/vehicle/VehicleInventory;getLootTableSeed()J
      intermediary method_42277 Lnet/minecraft/class_7265;method_42277()J
      official C Lcoz;C()J
    • setLootTableSeed

      public void setLootTableSeed(long lootTableSeed)
      Specified by:
      setLootTableSeed in interface VehicleInventory
      Mappings:
      Namespace Name Mixin selector
      named setLootTableSeed Lnet/minecraft/entity/vehicle/VehicleInventory;setLootTableSeed(J)V
      intermediary method_42274 Lnet/minecraft/class_7265;method_42274(J)V
      official a Lcoz;a(J)V
    • getInventory

      public DefaultedList<ItemStack> getInventory()
      Specified by:
      getInventory in interface VehicleInventory
      Mappings:
      Namespace Name Mixin selector
      named getInventory Lnet/minecraft/entity/vehicle/VehicleInventory;getInventory()Lnet/minecraft/util/collection/DefaultedList;
      intermediary method_42278 Lnet/minecraft/class_7265;method_42278()Lnet/minecraft/class_2371;
      official D Lcoz;D()Ljr;
    • resetInventory

      public void resetInventory()
      Specified by:
      resetInventory in interface VehicleInventory
      Mappings:
      Namespace Name Mixin selector
      named resetInventory Lnet/minecraft/entity/vehicle/VehicleInventory;resetInventory()V
      intermediary method_42273 Lnet/minecraft/class_7265;method_42273()V
      official E Lcoz;E()V