Skip to content

Package net.minecraft.client.color.block

Part 1/1


BlockColor

  • Full name: net.minecraft.client.color.block.BlockColor
  • Package: net.minecraft.client.color.block
  • Source: clientOnlynet/minecraft/client/color/block/BlockColor.java
  • Type: interface
  • Modifiers: public

net.minecraft.client.color.block.BlockColor#getColor(BlockState,BlockAndTintGetter,BlockPos,int)

  • Origin: clientOnly
  • Source: net/minecraft/client/color/block/BlockColor.java:12
  • Modifiers: ``
  • Return: int

คืออะไร

อ่านค่า Color

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • BlockState blockState
  • BlockAndTintGetter blockAndTintGetter
  • BlockPos blockPos
  • int i

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

BlockColor instance = ...;
BlockState blockState = ...;
BlockAndTintGetter blockAndTintGetter = ...;
BlockPos blockPos = ...;
int result = instance.getColor(blockState, blockAndTintGetter, blockPos, 0);

BlockColors

  • Full name: net.minecraft.client.color.block.BlockColors
  • Package: net.minecraft.client.color.block
  • Source: clientOnlynet/minecraft/client/color/block/BlockColors.java
  • Type: class
  • Modifiers: public

net.minecraft.client.color.block.BlockColors#createDefault()

  • Origin: clientOnly
  • Source: net/minecraft/client/color/block/BlockColors.java:36
  • Modifiers: public static
  • Return: BlockColors

คืออะไร

สร้าง Default

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: register(), getAverageGrassColor(), getValue(), below(), getDefaultColor(), addColoringState(), getAverageFoliageColor(), getAverageWaterColor(). สร้างออบเจ็กต์: BlockColors. มีจุด return อย่างน้อย 4 จุด.

Parameters

  • ไม่มี

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

BlockColors result = BlockColors.createDefault();

net.minecraft.client.color.block.BlockColors#getColor(BlockState,BlockAndTintGetter,BlockPos,int)

  • Origin: clientOnly
  • Source: net/minecraft/client/color/block/BlockColors.java:114
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Color

ทำงานยังไง

เรียกต่อ: byId(), getId(), getBlock(). คืนค่า: blockColor == null ? -1 : blockColor.getColor(blockState, blockAndTintGetter, blockPos, i).

Parameters

  • BlockState blockState
  • BlockAndTintGetter blockAndTintGetter
  • BlockPos blockPos
  • int i

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

BlockColors instance = ...;
BlockState blockState = ...;
BlockAndTintGetter blockAndTintGetter = ...;
BlockPos blockPos = ...;
int result = instance.getColor(blockState, blockAndTintGetter, blockPos, 0);

net.minecraft.client.color.block.BlockColors#getColor(BlockState,Level,BlockPos)

  • Origin: clientOnly
  • Source: net/minecraft/client/color/block/BlockColors.java:104
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Color

ทำงานยังไง

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

Parameters

  • BlockState blockState
  • Level level
  • BlockPos blockPos

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

BlockColors instance = ...;
BlockState blockState = ...;
Level level = ...;
BlockPos blockPos = ...;
int result = instance.getColor(blockState, level, blockPos);

net.minecraft.client.color.block.BlockColors#getColoringProperties(Block)

  • Origin: clientOnly
  • Source: net/minecraft/client/color/block/BlockColors.java:135
  • Modifiers: public
  • Return: Set<Property<?>>

คืออะไร

อ่านค่า Coloring Properties

ทำงานยังไง

เรียกต่อ: getOrDefault(), of(). คืนค่า: this.coloringStates.getOrDefault(block, ImmutableSet.of()).

Parameters

  • Block block

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

BlockColors instance = ...;
Block block = ...;
Set<Property<?>> result = instance.getColoringProperties(block);

net.minecraft.client.color.block.BlockColors#register(BlockColor,Block[])

  • Origin: clientOnly
  • Source: net/minecraft/client/color/block/BlockColors.java:119
  • Modifiers: public
  • Return: void

คืออะไร

ลงทะเบียน register

ทำงานยังไง

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

Parameters

  • BlockColor blockColor
  • Block[] blocks

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

BlockColors instance = ...;
BlockColor blockColor = ...;
Block[] blocks = ...;
instance.register(blockColor, blocks);

BlockTintCache

  • Full name: net.minecraft.client.color.block.BlockTintCache
  • Package: net.minecraft.client.color.block
  • Source: clientOnlynet/minecraft/client/color/block/BlockTintCache.java
  • Type: class
  • Modifiers: public

net.minecraft.client.color.block.BlockTintCache#BlockTintCache(ToIntFunction<BlockPos>)

  • Origin: clientOnly
  • Source: net/minecraft/client/color/block/BlockTintCache.java:24
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: source.

Parameters

  • ToIntFunction<BlockPos> toIntFunction

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

ToIntFunction<BlockPos> toIntFunction = ...;
BlockTintCache instance = new BlockTintCache(toIntFunction);

net.minecraft.client.color.block.BlockTintCache#getColor(BlockPos)

  • Origin: clientOnly
  • Source: net/minecraft/client/color/block/BlockTintCache.java:28
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Color

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: blockToSectionCoord(), getX(), getZ(), get(), isInvalidated(), findOrCreateChunkCache(), getLayer(), getY(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • BlockPos blockPos

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

BlockTintCache instance = ...;
BlockPos blockPos = ...;
int result = instance.getColor(blockPos);

net.minecraft.client.color.block.BlockTintCache#invalidateAll()

  • Origin: clientOnly
  • Source: net/minecraft/client/color/block/BlockTintCache.java:70
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ invalidateAll ตาม implementation ของ BlockTintCache

ทำงานยังไง

มีการจัดการ exception. เรียกต่อ: writeLock(), lock(), values(), forEach(), clear(), unlock().

Parameters

  • ไม่มี

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

BlockTintCache instance = ...;
instance.invalidateAll();

net.minecraft.client.color.block.BlockTintCache#invalidateForChunk(int,int)

  • Origin: clientOnly
  • Source: net/minecraft/client/color/block/BlockTintCache.java:52
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ invalidateForChunk ตาม implementation ของ BlockTintCache

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป ; มีการจัดการ exception. เรียกต่อ: writeLock(), lock(), asLong(), remove(), invalidate(), unlock().

Parameters

  • int i
  • int j

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

BlockTintCache instance = ...;
instance.invalidateForChunk(0, 0);