Package net.minecraft.item
Class FilledMapItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.NetworkSyncedItem
net.minecraft.item.FilledMapItem
- All Implemented Interfaces:
ItemConvertible
public class FilledMapItem extends NetworkSyncedItem
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.Settings -
Field Summary
Fields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group, RANDOM -
Constructor Summary
Constructors Constructor Description FilledMapItem(Item.Settings settings) -
Method Summary
Modifier and Type Method Description voidappendTooltip(ItemStack stack, World world, List<Text> tooltip, TooltipContext context)static voidcopyMap(World world, ItemStack stack)static ItemStackcreateMap(World world, int x, int z, byte scale, boolean showIcons, boolean unlimitedTracking)private static MapStatecreateMapState(ItemStack stack, World world, int x, int z, int scale, boolean showIcons, boolean unlimitedTracking, RegistryKey<World> dimension)Packet<?>createSyncPacket(ItemStack stack, World world, PlayerEntity player)Creates a packet that syncs additional item data to the client.static voidfillExplorationMap(ServerWorld serverWorld, ItemStack map)private BlockStategetFluidStateIfVisible(World world, BlockState state, BlockPos pos)static intgetMapColor(ItemStack stack)static intgetMapId(ItemStack stack)static StringgetMapName(int mapId)static MapStategetMapState(ItemStack stack, World world)static MapStategetOrCreateMapState(ItemStack map, World world)private static booleanhasPositiveDepth(Biome[] biomes, int scale, int x, int z)voidinventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected)voidonCraft(ItemStack stack, World world, PlayerEntity player)Called when a player acquires the item by crafting, smelting, smithing, etc.protected static voidscale(ItemStack map, World world, int amount)voidupdateColors(World world, Entity entity, MapState state)ActionResultuseOnBlock(ItemUsageContext context)Called when an item is used on a block.Methods inherited from class net.minecraft.item.NetworkSyncedItem
isNetworkSyncedMethods inherited from class net.minecraft.item.Item
appendStacks, asItem, byRawId, canMine, canRepair, damage, finishUsing, fromBlock, getAttributeModifiers, getDefaultStack, getDrinkSound, getEatSound, getEnchantability, getFoodComponent, getGroup, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, isDamageable, isEffectiveOn, isEnchantable, isFireproof, isFood, isIn, isIn, isUsedOnRelease, onStoppedUsing, postHit, postMine, postProcessTag, raycast, shouldSyncTagToClient, toString, usageTick, use, useOnEntity
-
Constructor Details
-
FilledMapItem
-
-
Method Details
-
createMap
-
getMapState
-
getOrCreateMapState
-
getMapId
-
createMapState
private static MapState createMapState(ItemStack stack, World world, int x, int z, int scale, boolean showIcons, boolean unlimitedTracking, RegistryKey<World> dimension) -
getMapName
-
updateColors
-
getFluidStateIfVisible
-
hasPositiveDepth
-
fillExplorationMap
-
inventoryTick
- Overrides:
inventoryTickin classItem
-
createSyncPacket
Creates a packet that syncs additional item data to the client.- Overrides:
createSyncPacketin classNetworkSyncedItem
-
onCraft
Called when a player acquires the item by crafting, smelting, smithing, etc. -
scale
-
copyMap
-
appendTooltip
@Environment(CLIENT) public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context)- Overrides:
appendTooltipin classItem
-
getMapColor
-
useOnBlock
Called when an item is used on a block.This method is called on both the logical client and logical server, so take caution when using this method. The logical side can be checked using
context.getWorld().isClient().- Overrides:
useOnBlockin classItem- Parameters:
context- the usage context- Returns:
- an action result that specifies if using the item on a block was successful.
-