Skip to content

Package net.minecraft.core.cauldron

Part 1/1


CauldronInteraction

  • Full name: net.minecraft.core.cauldron.CauldronInteraction
  • Package: net.minecraft.core.cauldron
  • Source: commonnet/minecraft/core/cauldron/CauldronInteraction.java
  • Type: interface
  • Modifiers: public

net.minecraft.core.cauldron.CauldronInteraction#addDefaultInteractions(Map<Item, CauldronInteraction>)

  • Origin: common
  • Source: net/minecraft/core/cauldron/CauldronInteraction.java:188
  • Modifiers: static
  • Return: void

คืออะไร

เพิ่ม Default Interactions

ทำงานยังไง

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

Parameters

  • Map<Item, CauldronInteraction> map

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

Map<Item, CauldronInteraction> map = ...;
CauldronInteraction.addDefaultInteractions(map);

net.minecraft.core.cauldron.CauldronInteraction#bootStrap()

  • Origin: common
  • Source: net/minecraft/core/cauldron/CauldronInteraction.java:53
  • Modifiers: static
  • Return: void

คืออะไร

ดำเนินการ bootStrap ตาม implementation ของ CauldronInteraction

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: map(), addDefaultInteractions(), put(), get(), is(), getItem(), setItemInHand(), createFilledResult(). สร้างออบเจ็กต์: ItemStack. มีจุด return อย่างน้อย 6 จุด.

Parameters

  • ไม่มี

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

CauldronInteraction.bootStrap();

net.minecraft.core.cauldron.CauldronInteraction#emptyBucket(Level,BlockPos,Player,InteractionHand,ItemStack,BlockState,SoundEvent)

  • Origin: common
  • Source: net/minecraft/core/cauldron/CauldronInteraction.java:222
  • Modifiers: static
  • Return: InteractionResult

คืออะไร

ดำเนินการ emptyBucket ตาม implementation ของ CauldronInteraction

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItem(), setItemInHand(), createFilledResult(), awardStat(), get(), setBlockAndUpdate(), playSound(), gameEvent(). สร้างออบเจ็กต์: ItemStack. คืนค่า: InteractionResult.SUCCESS.

Parameters

  • Level level
  • BlockPos blockPos
  • Player player
  • InteractionHand interactionHand
  • ItemStack itemStack
  • BlockState blockState
  • SoundEvent soundEvent

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

Level level = ...;
BlockPos blockPos = ...;
Player player = ...;
InteractionHand interactionHand = ...;
ItemStack itemStack = ...;
BlockState blockState = ...;
SoundEvent soundEvent = ...;
InteractionResult result = CauldronInteraction.emptyBucket(level, blockPos, player, interactionHand, itemStack, blockState, soundEvent);

net.minecraft.core.cauldron.CauldronInteraction#fillBucket(BlockState,Level,BlockPos,Player,InteractionHand,ItemStack,ItemStack,Predicate<BlockState>,SoundEvent)

  • Origin: common
  • Source: net/minecraft/core/cauldron/CauldronInteraction.java:194
  • Modifiers: static
  • Return: InteractionResult

คืออะไร

ดำเนินการ fillBucket ตาม implementation ของ CauldronInteraction

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: test(), getItem(), setItemInHand(), createFilledResult(), awardStat(), get(), setBlockAndUpdate(), defaultBlockState(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • BlockState blockState
  • Level level
  • BlockPos blockPos
  • Player player
  • InteractionHand interactionHand
  • ItemStack itemStack
  • ItemStack itemStack2
  • Predicate<BlockState> predicate
  • SoundEvent soundEvent

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

BlockState blockState = ...;
Level level = ...;
BlockPos blockPos = ...;
Player player = ...;
InteractionHand interactionHand = ...;
ItemStack itemStack = ...;
ItemStack itemStack2 = ...;
Predicate<BlockState> predicate = ...;
SoundEvent soundEvent = ...;
InteractionResult result = CauldronInteraction.fillBucket(blockState, level, blockPos, player, interactionHand, itemStack, itemStack2, predicate, soundEvent);

net.minecraft.core.cauldron.CauldronInteraction#interact(BlockState,Level,BlockPos,Player,InteractionHand,ItemStack)

  • Origin: common
  • Source: net/minecraft/core/cauldron/CauldronInteraction.java:51
  • Modifiers: ``
  • Return: InteractionResult

คืออะไร

จัดการ interaction interact

ทำงานยังไง

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

Parameters

  • BlockState blockState
  • Level level
  • BlockPos blockPos
  • Player player
  • InteractionHand interactionHand
  • ItemStack itemStack

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

CauldronInteraction instance = ...;
BlockState blockState = ...;
Level level = ...;
BlockPos blockPos = ...;
Player player = ...;
InteractionHand interactionHand = ...;
ItemStack itemStack = ...;
InteractionResult result = instance.interact(blockState, level, blockPos, player, interactionHand, itemStack);

net.minecraft.core.cauldron.CauldronInteraction#newInteractionMap(String)

  • Origin: common
  • Source: net/minecraft/core/cauldron/CauldronInteraction.java:43
  • Modifiers: static
  • Return: CauldronInteraction.InteractionMap

คืออะไร

ดำเนินการ newInteractionMap ตาม implementation ของ CauldronInteraction

ทำงานยังไง

เรียกต่อ: defaultReturnValue(), InteractionMap(), put(). สร้างออบเจ็กต์: Object2ObjectOpenHashMap<>, CauldronInteraction.InteractionMap. คืนค่า: interactionMap.

Parameters

  • String string

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

CauldronInteraction.InteractionMap result = CauldronInteraction.newInteractionMap("value");