dev.polymodloader.api.event.block
이 페이지는 소스의 Javadoc에서 ./gradlew apiReference로 만든 것입니다. 설명은 코드에 적힌 영어 그대로입니다. 직접 고치지 말고 소스의 주석을 고친 뒤 다시 만드세요.
| 형식 | 종류 | 설명 |
|---|---|---|
BlockBreakListener | 함수형 인터페이스 | Listener for BlockEvents.BREAK. |
BlockBrokenListener | 함수형 인터페이스 | Listener for BlockEvents.BROKEN. |
BlockEvents | 클래스 | Block events, fired on the server thread. |
BlockPlaceListener | 함수형 인터페이스 | Listener for BlockEvents.PLACE. |
BlockPlacedListener | 함수형 인터페이스 | Listener for BlockEvents.PLACED. |
BlockBreakListener
함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface BlockBreakListener
Listener for BlockEvents.BREAK.
onBlockBreak(WorldView, BlockPos, ResourceId, PlayerView)
EventResult onBlockBreak(WorldView world, BlockPos pos, ResourceId block, PlayerView player)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Called on the server thread before the block is removed. The views are valid only during the call.
| 인자 | 타입 | 설명 |
|---|---|---|
world | WorldView | the world the block is in |
pos | BlockPos | where it is |
block | ResourceId | the block about to be broken |
player | PlayerView | who breaks it |
반환 EventResult — DENY to keep the block (the player's client is told the block is still there); PASS or ALLOW to let the game break it
BlockBrokenListener
함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface BlockBrokenListener
Listener for BlockEvents.BROKEN.
onBlockBroken(WorldView, BlockPos, ResourceId, PlayerView)
void onBlockBroken(WorldView world, BlockPos pos, ResourceId block, PlayerView player)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Called on the server thread after the block was removed and its drops spawned.
| 인자 | 타입 | 설명 |
|---|---|---|
world | WorldView | the world the block was in |
pos | BlockPos | where it was |
block | ResourceId | the block that was broken |
player | PlayerView | who broke it |
BlockEvents
클래스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public final class BlockEvents
Block events, fired on the server thread.
| 상수·필드 | 타입 | 설명 |
|---|---|---|
BREAK | EventKey<BlockBreakListener> | A player is about to break a block (survival or creative); a decision event (see EventResult): DENY keeps the block. Fired before the game's own checks for the held item, game master blocks, and adventure mode, so it also fires for breaks the game then refuses. Fabric API: PlayerBlockBreakEvents.BEFORE; NeoForge: BlockEvent.BreakEvent. |
BROKEN | EventKey<BlockBrokenListener> | A player broke a block (survival or creative). |
PLACE | EventKey<BlockPlaceListener> | A player is about to place a block from a block item (including beds and doors); a decision event: DENY refuses it. NeoForge: BlockEvent.EntityPlaceEvent for players. |
PLACED | EventKey<BlockPlacedListener> | A player placed a block from a block item. |
BlockPlaceListener
함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface BlockPlaceListener
Listener for BlockEvents.PLACE.
onBlockPlace(WorldView, BlockPos, ResourceId, PlayerView)
EventResult onBlockPlace(WorldView world, BlockPos pos, ResourceId block, PlayerView player)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Called on the server thread after the game checked that the block fits, before it is set. The views are valid only during the call.
| 인자 | 타입 | 설명 |
|---|---|---|
world | WorldView | the world |
pos | BlockPos | where the block goes |
block | ResourceId | the block about to be placed |
player | PlayerView | who places it |
반환 EventResult — DENY to refuse the placement (the item is not used up and the player's client is resynchronised); PASS or ALLOW to let it happen
BlockPlacedListener
함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface BlockPlacedListener
Listener for BlockEvents.PLACED.
onBlockPlaced(WorldView, BlockPos, ResourceId, PlayerView)
void onBlockPlaced(WorldView world, BlockPos pos, ResourceId block, PlayerView player)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Called on the server thread after the block was placed, its block entity data applied, and the item used up. The views are valid only during the call.
| 인자 | 타입 | 설명 |
|---|---|---|
world | WorldView | the world |
pos | BlockPos | where the block is |
block | ResourceId | the placed block |
player | PlayerView | who placed it |