Class ContainerMinecartEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<Entity>
net.minecraft.entity.Entity
net.minecraft.entity.item.minecart.AbstractMinecartEntity
net.minecraft.entity.item.minecart.ContainerMinecartEntity
- All Implemented Interfaces:
ICommandSource
,IContainerProvider
,INamedContainerProvider
,IClearable
,IInventory
,INameable
,ICapabilityProvider
,ICapabilitySerializable<CompoundNBT>
,IForgeEntity
,IForgeEntityMinecart
,INBTSerializable<CompoundNBT>
- Direct Known Subclasses:
ChestMinecartEntity
,HopperMinecartEntity
public abstract class ContainerMinecartEntity
extends AbstractMinecartEntity
implements IInventory, INamedContainerProvider
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.item.minecart.AbstractMinecartEntity
AbstractMinecartEntity.Type
Nested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.IMoveCallback
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private LazyOptional<?>
private NonNullList<ItemStack>
private ResourceLocation
private long
Fields inherited from class net.minecraft.entity.Entity
blocksBuilding, boardingCooldown, DATA_POSE, DATA_SHARED_FLAGS_ID, ENTITY_COUNTER, entityData, fallDistance, firstTick, fluidHeight, fluidOnEyes, forcedLoading, glowing, hasImpulse, horizontalCollision, hurtMarked, inChunk, invulnerableTime, isInsidePortal, level, LOGGER, maxUpStep, moveDist, noCulling, noPhysics, onGround, portalEntrancePos, portalTime, pushthrough, random, removed, stringUUID, stuckSpeedMultiplier, tickCount, uuid, verticalCollision, walkDist, walkDistO, wasEyeInWater, wasTouchingWater, xChunk, xo, xOld, xRot, xRotO, yChunk, yo, yOld, yRot, yRotO, zChunk, zo, zOld
Fields inherited from interface net.minecraft.command.ICommandSource
NULL
Fields inherited from interface net.minecraftforge.common.extensions.IForgeEntityMinecart
DEFAULT_AIR_DRAG, DEFAULT_MAX_SPEED_AIR_LATERAL, DEFAULT_MAX_SPEED_AIR_VERTICAL
-
Constructor Summary
ModifierConstructorDescriptionprotected
ContainerMinecartEntity
(EntityType<?> p_i48537_1_, double p_i48537_2_, double p_i48537_4_, double p_i48537_6_, World p_i48537_8_) protected
ContainerMinecartEntity
(EntityType<?> p_i48536_1_, World p_i48536_2_) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAdditionalSaveData
(CompoundNBT p_213281_1_) protected void
changeDimension
(ServerWorld p_241206_1_, ITeleporter teleporter) void
protected abstract Container
createMenu
(int p_213968_1_, PlayerInventory p_213968_2_) createMenu
(int p_createMenu_1_, PlayerInventory p_createMenu_2_, PlayerEntity p_createMenu_3_) void
destroy
(DamageSource p_94095_1_) void
dropContentsWhenDead
(boolean value) <T> LazyOptional<T>
getCapability
(Capability<T> capability, Direction facing) Retrieves the Optional handler for the capability requested on the specific side.getItem
(int p_70301_1_) interact
(PlayerEntity p_184230_1_, Hand p_184230_2_) protected void
boolean
isEmpty()
protected void
readAdditionalSaveData
(CompoundNBT p_70037_1_) void
remove
(boolean keepData) removeItem
(int p_70298_1_, int p_70298_2_) removeItemNoUpdate
(int p_70304_1_) void
void
void
setLootTable
(ResourceLocation p_184289_1_, long p_184289_2_) boolean
boolean
stillValid
(PlayerEntity p_70300_1_) void
unpackLootTable
(PlayerEntity p_184288_1_) Methods inherited from class net.minecraft.entity.item.minecart.AbstractMinecartEntity
activateMinecart, animateHurt, canCollideWith, canUseRail, comeOffTrack, createMinecart, defineSynchedData, getAddEntityPacket, getBlockSpeedFactor, getBoundingBoxForCulling, getCollisionHandler, getCurrentCartSpeedCapOnRail, getDamage, getDefaultDisplayBlockState, getDefaultDisplayOffset, getDismountLocationForPassenger, getDisplayBlockState, getDisplayOffset, getDragAir, getHurtDir, getHurtTime, getMaxSpeed, getMaxSpeedAirLateral, getMaxSpeedAirVertical, getMaxSpeedWithRail, getMinecartType, getMotionDirection, getPassengersRidingOffset, getPos, getPosOffs, getRelativePortalPosition, hasCustomDisplay, hurt, isMovementNoisy, isPickable, isPushable, lerpMotion, lerpTo, moveAlongTrack, moveMinecartOnRail, push, registerCollisionHandler, setCanUseRail, setCurrentCartSpeedCapOnRail, setCustomDisplay, setDamage, setDisplayBlockState, setDisplayOffset, setDragAir, setHurtDir, setHurtTime, setMaxSpeedAirLateral, setMaxSpeedAirVertical, tick
Methods inherited from class net.minecraft.entity.Entity
absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addPassenger, addTag, awardKillScore, baseTick, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canChangeDimensions, canEnterPose, canRide, canSpawnSprintParticle, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, causeFallDamage, changeDimension, checkAndResetForcedChunkAdditionFlag, checkAndResetUpdateChunkPos, checkDespawn, checkFallDamage, checkInsideBlocks, clearFire, closerThan, collideBoundingBox, collideBoundingBoxHeuristically, collideBoundingBoxLegacy, copyPosition, createCommandSourceStack, createHoverEvent, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, fillCrashReportCategory, findDimensionEntryPoint, fireImmune, getAirSupply, getAllSlots, getArmorSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBoundingBox, getBoundingBoxForPose, getBrightness, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControllingPassenger, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDimensions, getDirection, getDisplayName, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyePosition, getEyeY, getFireImmuneTicks, getFluidHeight, getFluidJumpThreshold, getForward, getHandSlots, getHorizontalDistanceSqr, getId, getIndirectPassengers, getLeashOffset, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxFallDistance, getMyRidingOffset, getName, getOnPos, getPacketCoordinates, getPassengers, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalWaitTime, getPose, getPosition, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getType, getTypeName, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getViewXRot, getViewYRot, getX, getX, getY, getY, getYHeadRot, getZ, getZ, handleEntityEvent, handleInsidePortal, handleNetherPortal, hasCustomName, hashCode, hasIndirectPassenger, hasOnePlayerPassenger, hasPassenger, hasPassenger, hasPermissions, ignoreExplosion, interactAt, is, isAddedToWorld, isAlive, isAlliedTo, isAlliedTo, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFree, isGlowing, isIgnoringBlockTriggers, isInLava, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWall, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnGround, isOnPortalCooldown, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, isVisuallySwimming, kill, killed, lavaHurt, lerpHeadTo, limitPistonMovement, load, lookAt, makeFlySound, makeStuckInBlock, markHurt, maybeBackOffFromEdge, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, onSyncedDataUpdated, outOfWorld, pick, playerTouch, playFlySound, playSound, playStepSound, playSwimSound, position, positionRider, processPortalCooldown, push, reapplyPosition, refreshDimensions, remove, removeAfterChangingDimensions, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetPos, restoreFrom, revive, rideableUnderWater, rideTick, rotate, save, saveAsPassenger, saveWithoutId, sendMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setGlowing, setId, setInvisible, setInvulnerable, setItemSlot, setLevel, setLocationFromBoundingbox, setNoGravity, setOnGround, setPacketCoordinates, setPacketCoordinates, setPortalCooldown, setPos, setPosAndOldPos, setPose, setPosRaw, setRemainingFireTicks, setRot, setSecondsOnFire, setSharedFlag, setShiftKeyDown, setSilent, setSprinting, setSwimming, setUUID, setViewScale, setYBodyRot, setYHeadRot, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, shouldShowName, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopRiding, stopSeenByPlayer, teleportTo, teleportToWithTicket, thunderHit, toString, turn, unRide, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, reviveCaps, serializeCaps
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeEntity
canBeRiddenInWater, canRiderInteract, deserializeNBT, getClassification, getDimensionsForge, getEntity, getEyeHeightForge, getParts, getPickedResult, isMultipartEntity, serializeNBT, shouldRiderSit
Methods inherited from interface net.minecraftforge.common.extensions.IForgeEntityMinecart
canBeRidden, getCartItem, getComparatorLevel, getCurrentRailPosition, getMaxCartSpeedOnRail, getMinecart, getSlopeAdjustment, isPoweredCart, shouldDoRailFunctions
Methods inherited from interface net.minecraft.inventory.IInventory
canPlaceItem, countItem, getContainerSize, getMaxStackSize, hasAnyOf, startOpen, stopOpen
Methods inherited from interface net.minecraft.inventory.container.INamedContainerProvider
getDisplayName
-
Field Details
-
itemStacks
-
dropEquipment
private boolean dropEquipment -
lootTable
-
lootTableSeed
private long lootTableSeed -
itemHandler
-
-
Constructor Details
-
ContainerMinecartEntity
-
ContainerMinecartEntity
protected ContainerMinecartEntity(EntityType<?> p_i48537_1_, double p_i48537_2_, double p_i48537_4_, double p_i48537_6_, World p_i48537_8_)
-
-
Method Details
-
destroy
- Overrides:
destroy
in classAbstractMinecartEntity
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceIInventory
-
getItem
- Specified by:
getItem
in interfaceIInventory
-
removeItem
- Specified by:
removeItem
in interfaceIInventory
-
removeItemNoUpdate
- Specified by:
removeItemNoUpdate
in interfaceIInventory
-
setItem
- Specified by:
setItem
in interfaceIInventory
-
setSlot
-
setChanged
public void setChanged()- Specified by:
setChanged
in interfaceIInventory
-
stillValid
- Specified by:
stillValid
in interfaceIInventory
-
changeDimension
- Overrides:
changeDimension
in classEntity
-
remove
public void remove(boolean keepData) -
addAdditionalSaveData
- Overrides:
addAdditionalSaveData
in classAbstractMinecartEntity
-
readAdditionalSaveData
- Overrides:
readAdditionalSaveData
in classAbstractMinecartEntity
-
interact
-
applyNaturalSlowdown
protected void applyNaturalSlowdown()- Overrides:
applyNaturalSlowdown
in classAbstractMinecartEntity
-
unpackLootTable
-
clearContent
public void clearContent()- Specified by:
clearContent
in interfaceIClearable
-
setLootTable
-
createMenu
@Nullable public Container createMenu(int p_createMenu_1_, PlayerInventory p_createMenu_2_, PlayerEntity p_createMenu_3_) - Specified by:
createMenu
in interfaceIContainerProvider
-
createMenu
-
getCapability
Description copied from interface:ICapabilityProvider
Retrieves the Optional handler for the capability requested on the specific side. The return value CAN be the same for multiple faces. Modders are encouraged to cache this value, using the listener capabilities of the Optional to be notified if the requested capability get lost.- Specified by:
getCapability
in interfaceICapabilityProvider
- Overrides:
getCapability
in classCapabilityProvider<Entity>
- Returns:
- The requested an optional holding the requested capability.
-
invalidateCaps
protected void invalidateCaps()- Overrides:
invalidateCaps
in classCapabilityProvider<Entity>
-
dropContentsWhenDead
public void dropContentsWhenDead(boolean value)
-