Skip to content

Package net.minecraft.world.level.redstone

Part 1/1


CollectingNeighborUpdater

  • Full name: net.minecraft.world.level.redstone.CollectingNeighborUpdater
  • Package: net.minecraft.world.level.redstone
  • Source: commonnet/minecraft/world/level/redstone/CollectingNeighborUpdater.java
  • Type: class
  • Modifiers: public
  • Implements: NeighborUpdater

net.minecraft.world.level.redstone.CollectingNeighborUpdater#CollectingNeighborUpdater(Level,int)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/CollectingNeighborUpdater.java:24
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: level, maxChainedNeighborUpdates.

Parameters

  • Level level
  • int i

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

Level level = ...;
CollectingNeighborUpdater instance = new CollectingNeighborUpdater(level, 0);

net.minecraft.world.level.redstone.CollectingNeighborUpdater#neighborChanged(BlockPos,Block,Orientation)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/CollectingNeighborUpdater.java:34
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ neighborChanged ตาม implementation ของ CollectingNeighborUpdater

ทำงานยังไง

เรียกต่อ: addAndRun(), SimpleNeighborUpdate(). สร้างออบเจ็กต์: CollectingNeighborUpdater.SimpleNeighborUpdate.

Parameters

  • BlockPos blockPos
  • Block block
  • Orientation orientation

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

CollectingNeighborUpdater instance = ...;
BlockPos blockPos = ...;
Block block = ...;
Orientation orientation = ...;
instance.neighborChanged(blockPos, block, orientation);

net.minecraft.world.level.redstone.CollectingNeighborUpdater#neighborChanged(BlockState,BlockPos,Block,Orientation,boolean)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/CollectingNeighborUpdater.java:39
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ neighborChanged ตาม implementation ของ CollectingNeighborUpdater

ทำงานยังไง

เรียกต่อ: addAndRun(), FullNeighborUpdate(), immutable(). สร้างออบเจ็กต์: CollectingNeighborUpdater.FullNeighborUpdate.

Parameters

  • BlockState blockState
  • BlockPos blockPos
  • Block block
  • Orientation orientation
  • boolean bl

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

CollectingNeighborUpdater instance = ...;
BlockState blockState = ...;
BlockPos blockPos = ...;
Block block = ...;
Orientation orientation = ...;
instance.neighborChanged(blockState, blockPos, block, orientation, true);

net.minecraft.world.level.redstone.CollectingNeighborUpdater#shapeUpdate(Direction,BlockState,BlockPos,BlockPos,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/CollectingNeighborUpdater.java:29
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ shapeUpdate ตาม implementation ของ CollectingNeighborUpdater

ทำงานยังไง

เรียกต่อ: addAndRun(), ShapeUpdate(), immutable(). สร้างออบเจ็กต์: CollectingNeighborUpdater.ShapeUpdate.

Parameters

  • Direction direction
  • BlockState blockState
  • BlockPos blockPos
  • BlockPos blockPos2
  • int i
  • int j

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

CollectingNeighborUpdater instance = ...;
Direction direction = ...;
BlockState blockState = ...;
BlockPos blockPos = ...;
BlockPos blockPos2 = ...;
instance.shapeUpdate(direction, blockState, blockPos, blockPos2, 0, 0);

net.minecraft.world.level.redstone.CollectingNeighborUpdater#updateNeighborsAtExceptFromFacing(BlockPos,Block,Direction,Orientation)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/CollectingNeighborUpdater.java:44
  • Modifiers: public
  • Return: void

คืออะไร

อัปเดต Neighbors At Except From Facing

ทำงานยังไง

เรียกต่อ: addAndRun(), MultiNeighborUpdate(), immutable(). สร้างออบเจ็กต์: CollectingNeighborUpdater.MultiNeighborUpdate.

Parameters

  • BlockPos blockPos
  • Block block
  • Direction direction
  • Orientation orientation

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

CollectingNeighborUpdater instance = ...;
BlockPos blockPos = ...;
Block block = ...;
Direction direction = ...;
Orientation orientation = ...;
instance.updateNeighborsAtExceptFromFacing(blockPos, block, direction, orientation);

DefaultRedstoneWireEvaluator

  • Full name: net.minecraft.world.level.redstone.DefaultRedstoneWireEvaluator
  • Package: net.minecraft.world.level.redstone
  • Source: commonnet/minecraft/world/level/redstone/DefaultRedstoneWireEvaluator.java
  • Type: class
  • Modifiers: public
  • Extends: RedstoneWireEvaluator

net.minecraft.world.level.redstone.DefaultRedstoneWireEvaluator#DefaultRedstoneWireEvaluator(RedStoneWireBlock)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/DefaultRedstoneWireEvaluator.java:13
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

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

Parameters

  • RedStoneWireBlock redStoneWireBlock

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

RedStoneWireBlock redStoneWireBlock = ...;
DefaultRedstoneWireEvaluator instance = new DefaultRedstoneWireEvaluator(redStoneWireBlock);

net.minecraft.world.level.redstone.DefaultRedstoneWireEvaluator#updatePowerStrength(Level,BlockPos,BlockState,Orientation,boolean)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/DefaultRedstoneWireEvaluator.java:17
  • Modifiers: public
  • Return: void

คืออะไร

อัปเดต Power Strength

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: calculateTargetStrength(), getValue(), getBlockState(), setBlock(), setValue(), newHashSet(), add(), values().

Parameters

  • Level level
  • BlockPos blockPos
  • BlockState blockState
  • Orientation orientation
  • boolean bl

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

DefaultRedstoneWireEvaluator instance = ...;
Level level = ...;
BlockPos blockPos = ...;
BlockState blockState = ...;
Orientation orientation = ...;
instance.updatePowerStrength(level, blockPos, blockState, orientation, true);

ExperimentalRedstoneUtils

  • Full name: net.minecraft.world.level.redstone.ExperimentalRedstoneUtils
  • Package: net.minecraft.world.level.redstone
  • Source: commonnet/minecraft/world/level/redstone/ExperimentalRedstoneUtils.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.redstone.ExperimentalRedstoneUtils#initialOrientation(Level,Direction,Direction)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/ExperimentalRedstoneUtils.java:9
  • Modifiers: public static
  • Return: Orientation

คืออะไร

ดำเนินการ initialOrientation ตาม implementation ของ ExperimentalRedstoneUtils

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: enabledFeatures(), contains(), random(), withSideBias(), withUp(), withFront(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • Level level
  • Direction direction
  • Direction direction2

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

Level level = ...;
Direction direction = ...;
Direction direction2 = ...;
Orientation result = ExperimentalRedstoneUtils.initialOrientation(level, direction, direction2);

net.minecraft.world.level.redstone.ExperimentalRedstoneUtils#withFront(Orientation,Direction)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/ExperimentalRedstoneUtils.java:27
  • Modifiers: public static
  • Return: Orientation

คืออะไร

ดำเนินการ withFront ตาม implementation ของ ExperimentalRedstoneUtils

ทำงานยังไง

คืนค่า: orientation == null ? null : orientation.withFront(direction).

Parameters

  • Orientation orientation
  • Direction direction

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

Orientation orientation = ...;
Direction direction = ...;
Orientation result = ExperimentalRedstoneUtils.withFront(orientation, direction);

ExperimentalRedstoneWireEvaluator

  • Full name: net.minecraft.world.level.redstone.ExperimentalRedstoneWireEvaluator
  • Package: net.minecraft.world.level.redstone
  • Source: commonnet/minecraft/world/level/redstone/ExperimentalRedstoneWireEvaluator.java
  • Type: class
  • Modifiers: public
  • Extends: RedstoneWireEvaluator

net.minecraft.world.level.redstone.ExperimentalRedstoneWireEvaluator#ExperimentalRedstoneWireEvaluator(RedStoneWireBlock)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/ExperimentalRedstoneWireEvaluator.java:23
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

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

Parameters

  • RedStoneWireBlock redStoneWireBlock

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

RedStoneWireBlock redStoneWireBlock = ...;
ExperimentalRedstoneWireEvaluator instance = new ExperimentalRedstoneWireEvaluator(redStoneWireBlock);

net.minecraft.world.level.redstone.ExperimentalRedstoneWireEvaluator#getWireSignal(BlockPos,BlockState)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/ExperimentalRedstoneWireEvaluator.java:204
  • Modifiers: protected
  • Return: int

คืออะไร

อ่านค่า Wire Signal

ทำงานยังไง

เรียกต่อ: getOrDefault(), unpackPower(). คืนค่า: i != -1 ? unpackPower(i) : super.getWireSignal(blockPos, blockState).

Parameters

  • BlockPos blockPos
  • BlockState blockState

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

BlockPos blockPos = ...;
BlockState blockState = ...;
@Override
protected int getWireSignal(BlockPos blockPos, BlockState blockState) {
    return super.getWireSignal(blockPos, blockState);
}

net.minecraft.world.level.redstone.ExperimentalRedstoneWireEvaluator#updatePowerStrength(Level,BlockPos,BlockState,Orientation,boolean)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/ExperimentalRedstoneWireEvaluator.java:27
  • Modifiers: public
  • Return: void

คืออะไร

อัปเดต Power Strength

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getInitialOrientation(), calculateCurrentChanges(), object2IntEntrySet(), iterator(), hasNext(), next(), getKey(), getIntValue().

Parameters

  • Level level
  • BlockPos blockPos
  • BlockState blockState
  • Orientation orientation
  • boolean bl

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

ExperimentalRedstoneWireEvaluator instance = ...;
Level level = ...;
BlockPos blockPos = ...;
BlockState blockState = ...;
Orientation orientation = ...;
instance.updatePowerStrength(level, blockPos, blockState, orientation, true);

InstantNeighborUpdater

  • Full name: net.minecraft.world.level.redstone.InstantNeighborUpdater
  • Package: net.minecraft.world.level.redstone
  • Source: commonnet/minecraft/world/level/redstone/InstantNeighborUpdater.java
  • Type: class
  • Modifiers: public
  • Implements: NeighborUpdater

net.minecraft.world.level.redstone.InstantNeighborUpdater#InstantNeighborUpdater(Level)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/InstantNeighborUpdater.java:13
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: level.

Parameters

  • Level level

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

Level level = ...;
InstantNeighborUpdater instance = new InstantNeighborUpdater(level);

net.minecraft.world.level.redstone.InstantNeighborUpdater#neighborChanged(BlockPos,Block,Orientation)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/InstantNeighborUpdater.java:22
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ neighborChanged ตาม implementation ของ InstantNeighborUpdater

ทำงานยังไง

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

Parameters

  • BlockPos blockPos
  • Block block
  • Orientation orientation

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

InstantNeighborUpdater instance = ...;
BlockPos blockPos = ...;
Block block = ...;
Orientation orientation = ...;
instance.neighborChanged(blockPos, block, orientation);

net.minecraft.world.level.redstone.InstantNeighborUpdater#neighborChanged(BlockState,BlockPos,Block,Orientation,boolean)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/InstantNeighborUpdater.java:28
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ neighborChanged ตาม implementation ของ InstantNeighborUpdater

ทำงานยังไง

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

Parameters

  • BlockState blockState
  • BlockPos blockPos
  • Block block
  • Orientation orientation
  • boolean bl

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

InstantNeighborUpdater instance = ...;
BlockState blockState = ...;
BlockPos blockPos = ...;
Block block = ...;
Orientation orientation = ...;
instance.neighborChanged(blockState, blockPos, block, orientation, true);

net.minecraft.world.level.redstone.InstantNeighborUpdater#shapeUpdate(Direction,BlockState,BlockPos,BlockPos,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/InstantNeighborUpdater.java:17
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ shapeUpdate ตาม implementation ของ InstantNeighborUpdater

ทำงานยังไง

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

Parameters

  • Direction direction
  • BlockState blockState
  • BlockPos blockPos
  • BlockPos blockPos2
  • int i
  • int j

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

InstantNeighborUpdater instance = ...;
Direction direction = ...;
BlockState blockState = ...;
BlockPos blockPos = ...;
BlockPos blockPos2 = ...;
instance.shapeUpdate(direction, blockState, blockPos, blockPos2, 0, 0);

NeighborUpdater

  • Full name: net.minecraft.world.level.redstone.NeighborUpdater
  • Package: net.minecraft.world.level.redstone
  • Source: commonnet/minecraft/world/level/redstone/NeighborUpdater.java
  • Type: interface
  • Modifiers: public

net.minecraft.world.level.redstone.NeighborUpdater#executeShapeUpdate(LevelAccessor,Direction,BlockPos,BlockPos,BlockState,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/NeighborUpdater.java:34
  • Modifiers: static
  • Return: void

คืออะไร

สั่งทำงาน Shape Update

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getBlockState(), is(), updateShape(), getRandom(), updateOrDestroy().

Parameters

  • LevelAccessor levelAccessor
  • Direction direction
  • BlockPos blockPos
  • BlockPos blockPos2
  • BlockState blockState
  • int i
  • int j

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

LevelAccessor levelAccessor = ...;
Direction direction = ...;
BlockPos blockPos = ...;
BlockPos blockPos2 = ...;
BlockState blockState = ...;
NeighborUpdater.executeShapeUpdate(levelAccessor, direction, blockPos, blockPos2, blockState, 0, 0);

net.minecraft.world.level.redstone.NeighborUpdater#executeUpdate(Level,BlockState,BlockPos,Block,Orientation,boolean)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/NeighborUpdater.java:42
  • Modifiers: static
  • Return: void

คืออะไร

สั่งทำงาน Update

ทำงานยังไง

มีการวนลูป ; มีการจัดการ exception. เรียกต่อ: handleNeighborChanged(), forThrowable(), addCategory(), setDetail(), format(), s(), getKey(), populateBlockDetails(). สร้างออบเจ็กต์: ReportedException. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • Level level
  • BlockState blockState
  • BlockPos blockPos
  • Block block
  • Orientation orientation
  • boolean bl

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

Level level = ...;
BlockState blockState = ...;
BlockPos blockPos = ...;
Block block = ...;
Orientation orientation = ...;
NeighborUpdater.executeUpdate(level, blockState, blockPos, block, orientation, true);

net.minecraft.world.level.redstone.NeighborUpdater#neighborChanged(BlockPos,Block,Orientation)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/NeighborUpdater.java:22
  • Modifiers: ``
  • Return: void

คืออะไร

ดำเนินการ neighborChanged ตาม implementation ของ NeighborUpdater

ทำงานยังไง

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

Parameters

  • BlockPos blockPos
  • Block block
  • Orientation orientation

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

NeighborUpdater instance = ...;
BlockPos blockPos = ...;
Block block = ...;
Orientation orientation = ...;
instance.neighborChanged(blockPos, block, orientation);

net.minecraft.world.level.redstone.NeighborUpdater#neighborChanged(BlockState,BlockPos,Block,Orientation,boolean)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/NeighborUpdater.java:24
  • Modifiers: ``
  • Return: void

คืออะไร

ดำเนินการ neighborChanged ตาม implementation ของ NeighborUpdater

ทำงานยังไง

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

Parameters

  • BlockState blockState
  • BlockPos blockPos
  • Block block
  • Orientation orientation
  • boolean bl

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

NeighborUpdater instance = ...;
BlockState blockState = ...;
BlockPos blockPos = ...;
Block block = ...;
Orientation orientation = ...;
instance.neighborChanged(blockState, blockPos, block, orientation, true);

net.minecraft.world.level.redstone.NeighborUpdater#shapeUpdate(Direction,BlockState,BlockPos,BlockPos,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/NeighborUpdater.java:20
  • Modifiers: ``
  • Return: void

คืออะไร

ดำเนินการ shapeUpdate ตาม implementation ของ NeighborUpdater

ทำงานยังไง

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

Parameters

  • Direction direction
  • BlockState blockState
  • BlockPos blockPos
  • BlockPos blockPos2
  • int i
  • int j

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

NeighborUpdater instance = ...;
Direction direction = ...;
BlockState blockState = ...;
BlockPos blockPos = ...;
BlockPos blockPos2 = ...;
instance.shapeUpdate(direction, blockState, blockPos, blockPos2, 0, 0);

net.minecraft.world.level.redstone.NeighborUpdater#updateNeighborsAtExceptFromFacing(BlockPos,Block,Direction,Orientation)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/NeighborUpdater.java:26
  • Modifiers: default
  • Return: void

คืออะไร

อัปเดต Neighbors At Except From Facing

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: neighborChanged(), relative().

Parameters

  • BlockPos blockPos
  • Block block
  • Direction direction
  • Orientation orientation

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

NeighborUpdater instance = ...;
BlockPos blockPos = ...;
Block block = ...;
Direction direction = ...;
Orientation orientation = ...;
instance.updateNeighborsAtExceptFromFacing(blockPos, block, direction, orientation);

Orientation

  • Full name: net.minecraft.world.level.redstone.Orientation
  • Package: net.minecraft.world.level.redstone
  • Source: commonnet/minecraft/world/level/redstone/Orientation.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.redstone.Orientation#fromIndex(int)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:120
  • Modifiers: public static
  • Return: Orientation

คืออะไร

ดำเนินการ fromIndex ตาม implementation ของ Orientation

ทำงานยังไง

คืนค่า: ORIENTATIONS[i].

Parameters

  • int i

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

Orientation result = Orientation.fromIndex(0);

net.minecraft.world.level.redstone.Orientation#generateIndex(Direction,Direction,Orientation.SideBias)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:168
  • Modifiers: protected static
  • Return: int

คืออะไร

ดำเนินการ generateIndex ตาม implementation ของ Orientation

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getAxis(), getAxisDirection(), ordinal(). สร้างออบเจ็กต์: IllegalStateException. คืนค่า: ((direction.ordinal() << 2) + j << 1) + sideBias.ordinal().

Parameters

  • Direction direction
  • Direction direction2
  • Orientation.SideBias sideBias

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

Direction direction = ...;
Direction direction2 = ...;
Orientation.SideBias sideBias = ...;
@Override
protected int generateIndex(Direction direction, Direction direction2, Orientation.SideBias sideBias) {
    return super.generateIndex(direction, direction2, sideBias);
}

net.minecraft.world.level.redstone.Orientation#getDirections()

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:99
  • Modifiers: public
  • Return: List<Direction>

คืออะไร

อ่านค่า Directions

ทำงานยังไง

คืนค่า: this.neighbors.

Parameters

  • ไม่มี

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

Orientation instance = ...;
List<Direction> result = instance.getDirections();

net.minecraft.world.level.redstone.Orientation#getFront()

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:83
  • Modifiers: public
  • Return: Direction

คืออะไร

อ่านค่า Front

ทำงานยังไง

คืนค่า: this.front.

Parameters

  • ไม่มี

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

Orientation instance = ...;
Direction result = instance.getFront();

net.minecraft.world.level.redstone.Orientation#getHorizontalDirections()

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:103
  • Modifiers: public
  • Return: List<Direction>

คืออะไร

อ่านค่า Horizontal Directions

ทำงานยังไง

คืนค่า: this.horizontalNeighbors.

Parameters

  • ไม่มี

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

Orientation instance = ...;
List<Direction> result = instance.getHorizontalDirections();

net.minecraft.world.level.redstone.Orientation#getIndex()

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:116
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Index

ทำงานยังไง

คืนค่า: this.index.

Parameters

  • ไม่มี

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

Orientation instance = ...;
int result = instance.getIndex();

net.minecraft.world.level.redstone.Orientation#getSide()

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:91
  • Modifiers: public
  • Return: Direction

คืออะไร

อ่านค่า Side

ทำงานยังไง

คืนค่า: this.side.

Parameters

  • ไม่มี

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

Orientation instance = ...;
Direction result = instance.getSide();

net.minecraft.world.level.redstone.Orientation#getSideBias()

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:95
  • Modifiers: public
  • Return: Orientation.SideBias

คืออะไร

อ่านค่า Side Bias

ทำงานยังไง

คืนค่า: this.sideBias.

Parameters

  • ไม่มี

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

Orientation instance = ...;
Orientation.SideBias result = instance.getSideBias();

net.minecraft.world.level.redstone.Orientation#getUp()

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:87
  • Modifiers: public
  • Return: Direction

คืออะไร

อ่านค่า Up

ทำงานยังไง

คืนค่า: this.up.

Parameters

  • ไม่มี

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

Orientation instance = ...;
Direction result = instance.getUp();

net.minecraft.world.level.redstone.Orientation#getVerticalDirections()

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:107
  • Modifiers: public
  • Return: List<Direction>

คืออะไร

อ่านค่า Vertical Directions

ทำงานยังไง

คืนค่า: this.verticalNeighbors.

Parameters

  • ไม่มี

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

Orientation instance = ...;
List<Direction> result = instance.getVerticalDirections();

net.minecraft.world.level.redstone.Orientation#of(Direction,Direction,Orientation.SideBias)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:54
  • Modifiers: public static
  • Return: Orientation

คืออะไร

ดำเนินการ of ตาม implementation ของ Orientation

ทำงานยังไง

เรียกต่อ: generateIndex(). คืนค่า: ORIENTATIONS[generateIndex(direction, direction2, sideBias)].

Parameters

  • Direction direction
  • Direction direction2
  • Orientation.SideBias sideBias

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

Direction direction = ...;
Direction direction2 = ...;
Orientation.SideBias sideBias = ...;
Orientation result = Orientation.of(direction, direction2, sideBias);

net.minecraft.world.level.redstone.Orientation#random(RandomSource)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:124
  • Modifiers: public static
  • Return: Orientation

คืออะไร

ดำเนินการ random ตาม implementation ของ Orientation

ทำงานยังไง

เรียกต่อ: getRandom(). คืนค่า: Util.getRandom(ORIENTATIONS, randomSource).

Parameters

  • RandomSource randomSource

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

RandomSource randomSource = ...;
Orientation result = Orientation.random(randomSource);

net.minecraft.world.level.redstone.Orientation#toString()

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:111
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ toString ตาม implementation ของ Orientation

ทำงานยังไง

คืนค่า: "[up=" + this.up + ",front=" + this.front + ",sideBias=" + this.sideBias + "]".

Parameters

  • ไม่มี

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

Orientation instance = ...;
String result = instance.toString();

net.minecraft.world.level.redstone.Orientation#withFront(Direction)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:62
  • Modifiers: public
  • Return: Orientation

คืออะไร

ดำเนินการ withFront ตาม implementation ของ Orientation

ทำงานยังไง

เรียกต่อ: get(). คืนค่า: this.withFront.get(direction).

Parameters

  • Direction direction

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

Orientation instance = ...;
Direction direction = ...;
Orientation result = instance.withFront(direction);

net.minecraft.world.level.redstone.Orientation#withFrontAdjustSideBias(Direction)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:70
  • Modifiers: public
  • Return: Orientation

คืออะไร

ดำเนินการ withFrontAdjustSideBias ตาม implementation ของ Orientation

ทำงานยังไง

แก้ state: front. เรียกต่อ: withFront(), withMirror(). คืนค่า: this.front == orientation.side ? orientation.withMirror() : orientation.

Parameters

  • Direction direction

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

Orientation instance = ...;
Direction direction = ...;
Orientation result = instance.withFrontAdjustSideBias(direction);

net.minecraft.world.level.redstone.Orientation#withFrontPreserveUp(Direction)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:66
  • Modifiers: public
  • Return: Orientation

คืออะไร

ดำเนินการ withFrontPreserveUp ตาม implementation ของ Orientation

ทำงานยังไง

เรียกต่อ: getAxis(), get(). คืนค่า: direction.getAxis() == this.up.getAxis() ? this : this.withFront.get(direction).

Parameters

  • Direction direction

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

Orientation instance = ...;
Direction direction = ...;
Orientation result = instance.withFrontPreserveUp(direction);

net.minecraft.world.level.redstone.Orientation#withMirror()

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:79
  • Modifiers: public
  • Return: Orientation

คืออะไร

ดำเนินการ withMirror ตาม implementation ของ Orientation

ทำงานยังไง

เรียกต่อ: withSideBias(), getOpposite(). คืนค่า: this.withSideBias(this.sideBias.getOpposite()).

Parameters

  • ไม่มี

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

Orientation instance = ...;
Orientation result = instance.withMirror();

net.minecraft.world.level.redstone.Orientation#withSideBias(Orientation.SideBias)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:75
  • Modifiers: public
  • Return: Orientation

คืออะไร

ดำเนินการ withSideBias ตาม implementation ของ Orientation

ทำงานยังไง

เรียกต่อ: get(). คืนค่า: this.withSideBias.get(sideBias).

Parameters

  • Orientation.SideBias sideBias

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

Orientation instance = ...;
Orientation.SideBias sideBias = ...;
Orientation result = instance.withSideBias(sideBias);

net.minecraft.world.level.redstone.Orientation#withUp(Direction)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:58
  • Modifiers: public
  • Return: Orientation

คืออะไร

ดำเนินการ withUp ตาม implementation ของ Orientation

ทำงานยังไง

เรียกต่อ: get(). คืนค่า: this.withUp.get(direction).

Parameters

  • Direction direction

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

Orientation instance = ...;
Direction direction = ...;
Orientation result = instance.withUp(direction);

Orientation$SideBias

  • Full name: net.minecraft.world.level.redstone.Orientation$SideBias
  • Package: net.minecraft.world.level.redstone
  • Source: commonnet/minecraft/world/level/redstone/Orientation.java
  • Type: enum
  • Modifiers: public

net.minecraft.world.level.redstone.Orientation$SideBias#getOpposite()

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:195
  • Modifiers: public
  • Return: Orientation.SideBias

คืออะไร

อ่านค่า Opposite

ทำงานยังไง

คืนค่า: this == LEFT ? RIGHT : LEFT.

Parameters

  • ไม่มี

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

Orientation.SideBias instance = ...;
Orientation.SideBias result = instance.getOpposite();

net.minecraft.world.level.redstone.Orientation$SideBias#toString()

  • Origin: common
  • Source: net/minecraft/world/level/redstone/Orientation.java:199
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ toString ตาม implementation ของ Orientation$SideBias

ทำงานยังไง

คืนค่า: this.name.

Parameters

  • ไม่มี

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

Orientation.SideBias instance = ...;
String result = instance.toString();

RedstoneWireEvaluator

  • Full name: net.minecraft.world.level.redstone.RedstoneWireEvaluator
  • Package: net.minecraft.world.level.redstone
  • Source: commonnet/minecraft/world/level/redstone/RedstoneWireEvaluator.java
  • Type: class
  • Modifiers: public abstract

net.minecraft.world.level.redstone.RedstoneWireEvaluator#getBlockSignal(Level,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/RedstoneWireEvaluator.java:19
  • Modifiers: protected
  • Return: int

คืออะไร

อ่านค่า Block Signal

ทำงานยังไง

คืนค่า: this.wireBlock.getBlockSignal(level, blockPos).

Parameters

  • Level level
  • BlockPos blockPos

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

Level level = ...;
BlockPos blockPos = ...;
@Override
protected int getBlockSignal(Level level, BlockPos blockPos) {
    return super.getBlockSignal(level, blockPos);
}

net.minecraft.world.level.redstone.RedstoneWireEvaluator#getIncomingWireSignal(Level,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/RedstoneWireEvaluator.java:27
  • Modifiers: protected
  • Return: int

คืออะไร

อ่านค่า Incoming Wire Signal

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: relative(), getBlockState(), max(), getWireSignal(), above(), isRedstoneConductor(), below(). คืนค่า: Math.max(0, i - 1).

Parameters

  • Level level
  • BlockPos blockPos

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

Level level = ...;
BlockPos blockPos = ...;
@Override
protected int getIncomingWireSignal(Level level, BlockPos blockPos) {
    return super.getIncomingWireSignal(level, blockPos);
}

net.minecraft.world.level.redstone.RedstoneWireEvaluator#getWireSignal(BlockPos,BlockState)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/RedstoneWireEvaluator.java:23
  • Modifiers: protected
  • Return: int

คืออะไร

อ่านค่า Wire Signal

ทำงานยังไง

เรียกต่อ: is(), getValue(). คืนค่า: blockState.is(this.wireBlock) ? blockState.getValue(RedStoneWireBlock.POWER) : 0.

Parameters

  • BlockPos blockPos
  • BlockState blockState

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

BlockPos blockPos = ...;
BlockState blockState = ...;
@Override
protected int getWireSignal(BlockPos blockPos, BlockState blockState) {
    return super.getWireSignal(blockPos, blockState);
}

net.minecraft.world.level.redstone.RedstoneWireEvaluator#RedstoneWireEvaluator(RedStoneWireBlock)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/RedstoneWireEvaluator.java:13
  • Modifiers: protected
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: wireBlock.

Parameters

  • RedStoneWireBlock redStoneWireBlock

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

RedStoneWireBlock redStoneWireBlock = ...;
RedstoneWireEvaluator instance = new RedstoneWireEvaluator(redStoneWireBlock);

net.minecraft.world.level.redstone.RedstoneWireEvaluator#updatePowerStrength(Level,BlockPos,BlockState,Orientation,boolean)

  • Origin: common
  • Source: net/minecraft/world/level/redstone/RedstoneWireEvaluator.java:17
  • Modifiers: public abstract
  • Return: void

คืออะไร

อัปเดต Power Strength

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • Level level
  • BlockPos blockPos
  • BlockState blockState
  • Orientation orientation
  • boolean bl

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

RedstoneWireEvaluator instance = ...;
Level level = ...;
BlockPos blockPos = ...;
BlockState blockState = ...;
Orientation orientation = ...;
instance.updatePowerStrength(level, blockPos, blockState, orientation, true);