public class FilledMapItem extends NetworkSyncedItem
Item.Settings
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group, RANDOM
Constructor and Description |
---|
FilledMapItem(Item.Settings settings) |
Modifier and Type | Method and Description |
---|---|
void |
appendTooltip(ItemStack stack,
World world,
List<Text> tooltip,
TooltipContext context) |
static void |
copyMap(World world,
ItemStack stack) |
static ItemStack |
createMap(World world,
int x,
int z,
byte scale,
boolean showIcons,
boolean unlimitedTracking) |
private static MapState |
createMapState(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 void |
fillExplorationMap(ServerWorld serverWorld,
ItemStack map) |
private BlockState |
getFluidStateIfVisible(World world,
BlockState state,
BlockPos pos) |
static int |
getMapColor(ItemStack stack) |
static int |
getMapId(ItemStack stack) |
static String |
getMapName(int mapId) |
static MapState |
getMapState(ItemStack stack,
World world) |
static MapState |
getOrCreateMapState(ItemStack map,
World world) |
private static boolean |
hasPositiveDepth(Biome[] biomes,
int scale,
int x,
int z) |
void |
inventoryTick(ItemStack stack,
World world,
Entity entity,
int slot,
boolean selected) |
void |
onCraft(ItemStack stack,
World world,
PlayerEntity player)
Called when a player acquires the item by crafting, smelting, smithing, etc.
|
protected static void |
scale(ItemStack map,
World world,
int amount) |
void |
updateColors(World world,
Entity entity,
MapState state) |
ActionResult |
useOnBlock(ItemUsageContext context)
Called when an item is used on a block.
|
isNetworkSynced
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
public FilledMapItem(Item.Settings settings)
public static ItemStack createMap(World world, int x, int z, byte scale, boolean showIcons, boolean unlimitedTracking)
@Nullable public static MapState getOrCreateMapState(ItemStack map, World world)
public static int getMapId(ItemStack stack)
private static MapState createMapState(ItemStack stack, World world, int x, int z, int scale, boolean showIcons, boolean unlimitedTracking, RegistryKey<World> dimension)
public static String getMapName(int mapId)
private BlockState getFluidStateIfVisible(World world, BlockState state, BlockPos pos)
private static boolean hasPositiveDepth(Biome[] biomes, int scale, int x, int z)
public static void fillExplorationMap(ServerWorld serverWorld, ItemStack map)
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected)
inventoryTick
in class Item
@Nullable public Packet<?> createSyncPacket(ItemStack stack, World world, PlayerEntity player)
createSyncPacket
in class NetworkSyncedItem
public void onCraft(ItemStack stack, World world, PlayerEntity player)
@Environment(value=CLIENT) public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context)
appendTooltip
in class Item
@Environment(value=CLIENT) public static int getMapColor(ItemStack stack)
public ActionResult useOnBlock(ItemUsageContext context)
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()
.
useOnBlock
in class Item
context
- the usage context