Skip to content

Package net.minecraft.world.level.saveddata.maps

Part 1/1


MapBanner

  • Full name: net.minecraft.world.level.saveddata.maps.MapBanner
  • Package: net.minecraft.world.level.saveddata.maps
  • Source: commonnet/minecraft/world/level/saveddata/maps/MapBanner.java
  • Type: record
  • Modifiers: public

net.minecraft.world.level.saveddata.maps.MapBanner#fromWorld(BlockGetter,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapBanner.java:27
  • Modifiers: public static
  • Return: MapBanner

คืออะไร

ดำเนินการ fromWorld ตาม implementation ของ MapBanner

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getBlockEntity(), getBaseColor(), ofNullable(), getCustomName(). สร้างออบเจ็กต์: MapBanner. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • BlockGetter blockGetter
  • BlockPos blockPos

ตัวอย่างใช้งาน

BlockGetter blockGetter = ...;
BlockPos blockPos = ...;
MapBanner result = MapBanner.fromWorld(blockGetter, blockPos);

net.minecraft.world.level.saveddata.maps.MapBanner#getDecoration()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapBanner.java:38
  • Modifiers: public
  • Return: Holder<MapDecorationType>

คืออะไร

อ่านค่า Decoration

ทำงานยังไง

แยกกรณีด้วย switch. คืนค่า: switch (this.color) { case WHITE -> MapDecorationTypes.WHITE_BANNER.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapBanner instance = ...;
Holder<MapDecorationType> result = instance.getDecoration();

net.minecraft.world.level.saveddata.maps.MapBanner#getId()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapBanner.java:59
  • Modifiers: public
  • Return: String

คืออะไร

อ่านค่า Id

ทำงานยังไง

เรียกต่อ: getX(), getY(), getZ(). คืนค่า: "banner-" + this.pos.getX() + "," + this.pos.getY() + "," + this.pos.getZ().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapBanner instance = ...;
String result = instance.getId();

MapDecoration

  • Full name: net.minecraft.world.level.saveddata.maps.MapDecoration
  • Package: net.minecraft.world.level.saveddata.maps
  • Source: commonnet/minecraft/world/level/saveddata/maps/MapDecoration.java
  • Type: record
  • Modifiers: public

net.minecraft.world.level.saveddata.maps.MapDecoration#getSpriteLocation()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapDecoration.java:31
  • Modifiers: public
  • Return: ResourceLocation

คืออะไร

อ่านค่า Sprite Location

ทำงานยังไง

เรียกต่อ: value(), assetId(). คืนค่า: this.type.value().assetId().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapDecoration instance = ...;
ResourceLocation result = instance.getSpriteLocation();

net.minecraft.world.level.saveddata.maps.MapDecoration#MapDecoration(Holder<MapDecorationType>,byte,byte,byte,Optional<Component>)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapDecoration.java:27
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ MapDecoration ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • Holder<MapDecorationType> type
  • byte x
  • byte y
  • byte rot
  • Optional<Component> name

ตัวอย่างใช้งาน

Holder<MapDecorationType> type = ...;
Optional<Component> name = ...;
MapDecoration instance = new MapDecoration(type, 0, 0, 0, name);

net.minecraft.world.level.saveddata.maps.MapDecoration#renderOnFrame()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapDecoration.java:35
  • Modifiers: public
  • Return: boolean

คืออะไร

เรนเดอร์ On Frame

ทำงานยังไง

เรียกต่อ: value(), showOnItemFrame(). คืนค่า: this.type.value().showOnItemFrame().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapDecoration instance = ...;
boolean result = instance.renderOnFrame();

MapDecorationType

  • Full name: net.minecraft.world.level.saveddata.maps.MapDecorationType
  • Package: net.minecraft.world.level.saveddata.maps
  • Source: commonnet/minecraft/world/level/saveddata/maps/MapDecorationType.java
  • Type: record
  • Modifiers: public

net.minecraft.world.level.saveddata.maps.MapDecorationType#hasMapColor()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapDecorationType.java:17
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่ามี Map Color

ทำงานยังไง

คืนค่า: this.mapColor != -1.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapDecorationType instance = ...;
boolean result = instance.hasMapColor();

MapDecorationTypes

  • Full name: net.minecraft.world.level.saveddata.maps.MapDecorationTypes
  • Package: net.minecraft.world.level.saveddata.maps
  • Source: commonnet/minecraft/world/level/saveddata/maps/MapDecorationTypes.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.saveddata.maps.MapDecorationTypes#bootstrap(Registry<MapDecorationType>)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapDecorationTypes.java:51
  • Modifiers: public static
  • Return: Holder<MapDecorationType>

คืออะไร

ดำเนินการ bootstrap ตาม implementation ของ MapDecorationTypes

ทำงานยังไง

คืนค่า: PLAYER.

Parameters

  • Registry<MapDecorationType> registry

ตัวอย่างใช้งาน

Registry<MapDecorationType> registry = ...;
Holder<MapDecorationType> result = MapDecorationTypes.bootstrap(registry);

MapFrame

  • Full name: net.minecraft.world.level.saveddata.maps.MapFrame
  • Package: net.minecraft.world.level.saveddata.maps
  • Source: commonnet/minecraft/world/level/saveddata/maps/MapFrame.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.saveddata.maps.MapFrame#frameId(BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapFrame.java:56
  • Modifiers: public static
  • Return: String

คืออะไร

ดำเนินการ frameId ตาม implementation ของ MapFrame

ทำงานยังไง

เรียกต่อ: getX(), getY(), getZ(). คืนค่า: "frame-" + blockPos.getX() + "," + blockPos.getY() + "," + blockPos.getZ().

Parameters

  • BlockPos blockPos

ตัวอย่างใช้งาน

BlockPos blockPos = ...;
String result = MapFrame.frameId(blockPos);

net.minecraft.world.level.saveddata.maps.MapFrame#getEntityId()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapFrame.java:48
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Entity Id

ทำงานยังไง

คืนค่า: this.entityId.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapFrame instance = ...;
int result = instance.getEntityId();

net.minecraft.world.level.saveddata.maps.MapFrame#getId()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapFrame.java:52
  • Modifiers: public
  • Return: String

คืออะไร

อ่านค่า Id

ทำงานยังไง

เรียกต่อ: frameId(). คืนค่า: frameId(this.pos).

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapFrame instance = ...;
String result = instance.getId();

net.minecraft.world.level.saveddata.maps.MapFrame#getPos()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapFrame.java:40
  • Modifiers: public
  • Return: BlockPos

คืออะไร

อ่านค่า Pos

ทำงานยังไง

คืนค่า: this.pos.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapFrame instance = ...;
BlockPos result = instance.getPos();

net.minecraft.world.level.saveddata.maps.MapFrame#getRotation()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapFrame.java:44
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Rotation

ทำงานยังไง

คืนค่า: this.rotation.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapFrame instance = ...;
int result = instance.getRotation();

net.minecraft.world.level.saveddata.maps.MapFrame#load(CompoundTag)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapFrame.java:20
  • Modifiers: public static
  • Return: MapFrame

คืออะไร

โหลด load

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: readBlockPos(), isEmpty(), getInt(), get(). สร้างออบเจ็กต์: MapFrame. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • CompoundTag compoundTag

ตัวอย่างใช้งาน

CompoundTag compoundTag = ...;
MapFrame result = MapFrame.load(compoundTag);

net.minecraft.world.level.saveddata.maps.MapFrame#MapFrame(BlockPos,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapFrame.java:14
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ MapFrame ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: pos, rotation, entityId.

Parameters

  • BlockPos blockPos
  • int i
  • int j

ตัวอย่างใช้งาน

BlockPos blockPos = ...;
MapFrame instance = new MapFrame(blockPos, 0, 0);

net.minecraft.world.level.saveddata.maps.MapFrame#save()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapFrame.java:32
  • Modifiers: public
  • Return: CompoundTag

คืออะไร

บันทึก save

ทำงานยังไง

เรียกต่อ: put(), writeBlockPos(), putInt(). สร้างออบเจ็กต์: CompoundTag. คืนค่า: compoundTag.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapFrame instance = ...;
CompoundTag result = instance.save();

MapId

  • Full name: net.minecraft.world.level.saveddata.maps.MapId
  • Package: net.minecraft.world.level.saveddata.maps
  • Source: commonnet/minecraft/world/level/saveddata/maps/MapId.java
  • Type: record
  • Modifiers: public

net.minecraft.world.level.saveddata.maps.MapId#key()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapId.java:12
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ key ตาม implementation ของ MapId

ทำงานยังไง

คืนค่า: "map_" + this.id.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapId instance = ...;
String result = instance.key();

MapIndex

  • Full name: net.minecraft.world.level.saveddata.maps.MapIndex
  • Package: net.minecraft.world.level.saveddata.maps
  • Source: commonnet/minecraft/world/level/saveddata/maps/MapIndex.java
  • Type: class
  • Modifiers: public
  • Extends: SavedData

net.minecraft.world.level.saveddata.maps.MapIndex#factory()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapIndex.java:15
  • Modifiers: public static
  • Return: SavedData.Factory<MapIndex>

คืออะไร

ดำเนินการ factory ตาม implementation ของ MapIndex

ทำงานยังไง

สร้างออบเจ็กต์: SavedData.Factory<>. คืนค่า: new SavedData.Factory<>(MapIndex::new, MapIndex::load, DataFixTypes.SAVED_DATA_MAP_INDEX).

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

SavedData.Factory<MapIndex> result = MapIndex.factory();

net.minecraft.world.level.saveddata.maps.MapIndex#getFreeAuxValueForMap()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapIndex.java:44
  • Modifiers: public
  • Return: MapId

คืออะไร

อ่านค่า Free Aux Value For Map

ทำงานยังไง

เรียกต่อ: getInt(), put(), setDirty(). สร้างออบเจ็กต์: MapId. คืนค่า: new MapId(i).

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapIndex instance = ...;
MapId result = instance.getFreeAuxValueForMap();

net.minecraft.world.level.saveddata.maps.MapIndex#load(CompoundTag,HolderLookup.Provider)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapIndex.java:23
  • Modifiers: public static
  • Return: MapIndex

คืออะไร

โหลด load

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getAllKeys(), contains(), put(), getInt(). สร้างออบเจ็กต์: MapIndex. คืนค่า: mapIndex.

Parameters

  • CompoundTag compoundTag
  • HolderLookup.Provider provider

ตัวอย่างใช้งาน

CompoundTag compoundTag = ...;
HolderLookup.Provider provider = ...;
MapIndex result = MapIndex.load(compoundTag, provider);

net.minecraft.world.level.saveddata.maps.MapIndex#MapIndex()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapIndex.java:19
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ MapIndex ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

เรียกต่อ: defaultReturnValue().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapIndex instance = new MapIndex();

net.minecraft.world.level.saveddata.maps.MapIndex#save(CompoundTag,HolderLookup.Provider)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapIndex.java:35
  • Modifiers: public
  • Return: CompoundTag

คืออะไร

บันทึก save

ทำงานยังไง

มีการวนลูป. เรียกต่อ: object2IntEntrySet(), putInt(), getKey(), getIntValue(). คืนค่า: compoundTag.

Parameters

  • CompoundTag compoundTag
  • HolderLookup.Provider provider

ตัวอย่างใช้งาน

MapIndex instance = ...;
CompoundTag compoundTag = ...;
HolderLookup.Provider provider = ...;
CompoundTag result = instance.save(compoundTag, provider);

MapItemSavedData

  • Full name: net.minecraft.world.level.saveddata.maps.MapItemSavedData
  • Package: net.minecraft.world.level.saveddata.maps
  • Source: commonnet/minecraft/world/level/saveddata/maps/MapItemSavedData.java
  • Type: class
  • Modifiers: public
  • Extends: SavedData

net.minecraft.world.level.saveddata.maps.MapItemSavedData#addClientSideDecorations(List<MapDecoration>)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:478
  • Modifiers: public
  • Return: void

คืออะไร

เพิ่ม Client Side Decorations

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. แก้ state: trackedDecorationCount. เรียกต่อ: clear(), size(), get(), put(), type(), value(), trackCount().

Parameters

  • List<MapDecoration> list

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
List<MapDecoration> list = ...;
instance.addClientSideDecorations(list);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#addTargetDecoration(ItemStack,BlockPos,String,Holder<MapDecorationType>)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:271
  • Modifiers: public static
  • Return: void

คืออะไร

เพิ่ม Target Decoration

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: Entry(), getX(), getZ(), update(), withDecoration(), value(), hasMapColor(), set(). สร้างออบเจ็กต์: MapDecorations.Entry, MapItemColor.

Parameters

  • ItemStack itemStack
  • BlockPos blockPos
  • String string
  • Holder<MapDecorationType> holder

ตัวอย่างใช้งาน

ItemStack itemStack = ...;
BlockPos blockPos = ...;
Holder<MapDecorationType> holder = ...;
MapItemSavedData.addTargetDecoration(itemStack, blockPos, "value", holder);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#checkBanners(BlockGetter,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:428
  • Modifiers: public
  • Return: void

คืออะไร

ตรวจสอบ Banners

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: values(), iterator(), hasNext(), next(), pos(), getX(), getZ(), fromWorld().

Parameters

  • BlockGetter blockGetter
  • int i
  • int j

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
BlockGetter blockGetter = ...;
instance.checkBanners(blockGetter, 0, 0);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#createForClient(byte,boolean,ResourceKey<Level>)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:96
  • Modifiers: public static
  • Return: MapItemSavedData

คืออะไร

สร้าง For Client

ทำงานยังไง

สร้างออบเจ็กต์: MapItemSavedData. คืนค่า: new MapItemSavedData(0, 0, b, false, false, bl, resourceKey).

Parameters

  • byte b
  • boolean bl
  • ResourceKey<Level> resourceKey

ตัวอย่างใช้งาน

ResourceKey<Level> resourceKey = ...;
MapItemSavedData result = MapItemSavedData.createForClient(0, true, resourceKey);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#createFresh(double,double,byte,boolean,boolean,ResourceKey<Level>)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:87
  • Modifiers: public static
  • Return: MapItemSavedData

คืออะไร

สร้าง Fresh

ทำงานยังไง

เรียกต่อ: floor(). สร้างออบเจ็กต์: MapItemSavedData. คืนค่า: new MapItemSavedData(l, m, b, bl, bl2, false, resourceKey).

Parameters

  • double d
  • double e
  • byte b
  • boolean bl
  • boolean bl2
  • ResourceKey<Level> resourceKey

ตัวอย่างใช้งาน

ResourceKey<Level> resourceKey = ...;
MapItemSavedData result = MapItemSavedData.createFresh(0.0D, 0.0D, 0, true, true, resourceKey);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#factory()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:71
  • Modifiers: public static
  • Return: SavedData.Factory<MapItemSavedData>

คืออะไร

ดำเนินการ factory ตาม implementation ของ MapItemSavedData

ทำงานยังไง

สร้างออบเจ็กต์: SavedData.Factory<>, IllegalStateException. คืนค่า: new SavedData.Factory<>(() -> { throw new IllegalStateException("Should never create an empty map saved data").

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

SavedData.Factory<MapItemSavedData> result = MapItemSavedData.factory();

net.minecraft.world.level.saveddata.maps.MapItemSavedData#getBanners()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:443
  • Modifiers: public
  • Return: Collection<MapBanner>

คืออะไร

อ่านค่า Banners

ทำงานยังไง

เรียกต่อ: values(). คืนค่า: this.bannerMarkers.values().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
Collection<MapBanner> result = instance.getBanners();

net.minecraft.world.level.saveddata.maps.MapItemSavedData#getDecorations()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:491
  • Modifiers: public
  • Return: Iterable<MapDecoration>

คืออะไร

อ่านค่า Decorations

ทำงานยังไง

เรียกต่อ: values(). คืนค่า: this.decorations.values().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
Iterable<MapDecoration> result = instance.getDecorations();

net.minecraft.world.level.saveddata.maps.MapItemSavedData#getHoldingPlayer(Player)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:389
  • Modifiers: public
  • Return: MapItemSavedData.HoldingPlayer

คืออะไร

อ่านค่า Holding Player

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), HoldingPlayer(), put(), add(). สร้างออบเจ็กต์: MapItemSavedData.HoldingPlayer. คืนค่า: holdingPlayer.

Parameters

  • Player player

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
Player player = ...;
MapItemSavedData.HoldingPlayer result = instance.getHoldingPlayer(player);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#getUpdatePacket(MapId,Player)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:370
  • Modifiers: public
  • Return: Packet<?>

คืออะไร

อ่านค่า Update Packet

ทำงานยังไง

เรียกต่อ: get(), nextUpdatePacket(). คืนค่า: holdingPlayer == null ? null : holdingPlayer.nextUpdatePacket(mapId).

Parameters

  • MapId mapId
  • Player player

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
MapId mapId = ...;
Player player = ...;
Packet<?> result = instance.getUpdatePacket(mapId, player);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#isExplorationMap()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:468
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Exploration Map

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: values(), type(), value(), explorationMapElement(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
boolean result = instance.isExplorationMap();

net.minecraft.world.level.saveddata.maps.MapItemSavedData#isTrackedCountOverLimit(int)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:495
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Tracked Count Over Limit

ทำงานยังไง

คืนค่า: this.trackedDecorationCount >= i.

Parameters

  • int i

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
boolean result = instance.isTrackedCountOverLimit(0);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#load(CompoundTag,HolderLookup.Provider)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:100
  • Modifiers: public static
  • Return: MapItemSavedData

คืออะไร

โหลด load

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: parseLegacy(), get(), resultOrPartial(), orElseThrow(), getInt(), clamp(), getByte(), contains(). สร้างออบเจ็กต์: Dynamic<>, IllegalArgumentException, MapItemSavedData. คืนค่า: mapItemSavedData.

Parameters

  • CompoundTag compoundTag
  • HolderLookup.Provider provider

ตัวอย่างใช้งาน

CompoundTag compoundTag = ...;
HolderLookup.Provider provider = ...;
MapItemSavedData result = MapItemSavedData.load(compoundTag, provider);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#locked()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:168
  • Modifiers: public
  • Return: MapItemSavedData

คืออะไร

ดำเนินการ locked ตาม implementation ของ MapItemSavedData

ทำงานยังไง

เรียกต่อ: putAll(), arraycopy(). สร้างออบเจ็กต์: MapItemSavedData. คืนค่า: mapItemSavedData.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
MapItemSavedData result = instance.locked();

net.minecraft.world.level.saveddata.maps.MapItemSavedData#removedFromFrame(BlockPos,int)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:447
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ removedFromFrame ตาม implementation ของ MapItemSavedData

ทำงานยังไง

เรียกต่อ: removeDecoration(), getFrameKey(), remove(), frameId(), setDirty().

Parameters

  • BlockPos blockPos
  • int i

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
BlockPos blockPos = ...;
instance.removedFromFrame(blockPos, 0);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#save(CompoundTag,HolderLookup.Provider)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:143
  • Modifiers: public
  • Return: CompoundTag

คืออะไร

บันทึก save

ทำงานยังไง

มีการวนลูป. เรียกต่อ: encodeStart(), location(), resultOrPartial(), ifPresent(), put(), putInt(), putByte(), putByteArray(). สร้างออบเจ็กต์: ListTag. คืนค่า: compoundTag.

Parameters

  • CompoundTag compoundTag
  • HolderLookup.Provider provider

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
CompoundTag compoundTag = ...;
HolderLookup.Provider provider = ...;
CompoundTag result = instance.save(compoundTag, provider);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#scaled()

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:179
  • Modifiers: public
  • Return: MapItemSavedData

คืออะไร

ดำเนินการ scaled ตาม implementation ของ MapItemSavedData

ทำงานยังไง

เรียกต่อ: createFresh(), clamp(). คืนค่า: createFresh(this.centerX, this.centerZ, (byte)Mth.clamp(this.scale + 1, 0, 4), this.trackingPosition, this.unlimitedTracking, this.dimension).

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
MapItemSavedData result = instance.scaled();

net.minecraft.world.level.saveddata.maps.MapItemSavedData#setColor(int,int,byte)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:463
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Color

ทำงานยังไง

เรียกต่อ: setColorsDirty().

Parameters

  • int i
  • int j
  • byte b

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
instance.setColor(0, 0, 0);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#tickCarriedBy(Player,ItemStack)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:188
  • Modifiers: public
  • Return: void

คืออะไร

ประมวลผล tick Carried By

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: containsKey(), HoldingPlayer(), put(), add(), mapMatcher(), getInventory(), contains(), removeDecoration(). สร้างออบเจ็กต์: MapItemSavedData.HoldingPlayer, MapFrame.

Parameters

  • Player player
  • ItemStack itemStack

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
Player player = ...;
ItemStack itemStack = ...;
instance.tickCarriedBy(player, itemStack);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#toggleBanner(LevelAccessor,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:400
  • Modifiers: public
  • Return: boolean

คืออะไร

ดำเนินการ toggleBanner ตาม implementation ของ MapItemSavedData

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getX(), getZ(), fromWorld(), remove(), getId(), removeDecoration(), isTrackedCountOverLimit(), put(). มีจุด return อย่างน้อย 4 จุด.

Parameters

  • LevelAccessor levelAccessor
  • BlockPos blockPos

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
LevelAccessor levelAccessor = ...;
BlockPos blockPos = ...;
boolean result = instance.toggleBanner(levelAccessor, blockPos);

net.minecraft.world.level.saveddata.maps.MapItemSavedData#updateColor(int,int,byte)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:453
  • Modifiers: public
  • Return: boolean

คืออะไร

อัปเดต Color

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: setColor(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • int i
  • int j
  • byte b

ตัวอย่างใช้งาน

MapItemSavedData instance = ...;
boolean result = instance.updateColor(0, 0, 0);

MapItemSavedData$MapPatch

  • Full name: net.minecraft.world.level.saveddata.maps.MapItemSavedData$MapPatch
  • Package: net.minecraft.world.level.saveddata.maps
  • Source: commonnet/minecraft/world/level/saveddata/maps/MapItemSavedData.java
  • Type: record
  • Modifiers: public

net.minecraft.world.level.saveddata.maps.MapItemSavedData$MapPatch#applyToMap(MapItemSavedData)

  • Origin: common
  • Source: net/minecraft/world/level/saveddata/maps/MapItemSavedData.java:611
  • Modifiers: public
  • Return: void

คืออะไร

นำไปใช้ To Map

ทำงานยังไง

มีการวนลูป. เรียกต่อ: setColor().

Parameters

  • MapItemSavedData mapItemSavedData

ตัวอย่างใช้งาน

MapItemSavedData.MapPatch instance = ...;
MapItemSavedData mapItemSavedData = ...;
instance.applyToMap(mapItemSavedData);