BlockFlow is a lightweight and flexible library for creating client-side block arenas using packets. It's perfect for minigames, arenas, or any system where you want dynamic, per-match changes such as placed / broken blocks without having a big performance impact.
<dependency>
<groupId>dev.lrxh</groupId>
<artifactId>blockflow</artifactId>
<version>1.0.0</version>
</dependency>BlockFlow blockFlow = new BlockFlow(plugin);
Location min = ...;
Location max = ...;
// Create a stage, this copies all the blocks between both locations
FlowStage stage = blockFlow.createStage(min, max);
// Offset the stage by 100 blocks on the X axis
stage.offset(100, 0, 0);
// Add a player to view the stage
stage.addViewer(player);
// Remove a player from viewing the stage
stage.removeViewer(player);
// Clone the stage to create a new instance with the same blocks
FlowStage stage = stage.clone();Fired when a player breaks a block in a FlowStage.
Fields:
Player playerβ the player breaking the blockFlowPosition positionβ the position of the blockFlowBlock blockβ the block being brokenFlowStage stageβ the stage where the event occursboolean cancelledβ whether the event is cancelled
Fired when a player places a block in a FlowStage.
Fields:
Player playerβ the player placing the blockFlowPosition positionβ the position of the placed blockBlockData blockDataβ the data of the block being placedFlowStage stageβ the stage where the event occursboolean cancelledβ whether the event is cancelled
Fired when a block drops an item in a FlowStage.
Fields:
Player playerβ the player responsible for the dropFlowPosition positionβ the blockβs positionMaterial materialβ the dropped materialFlowStage stageβ the stage where the event occursboolean cancelledβ whether the event is cancelled
Fired when a player picks up an item in a FlowStage.
Fields:
Player playerβ the player picking up the itemItemStack itemStackβ the item being picked upFlowStage stageβ the stage where the event occursboolean cancelledβ whether the event is cancelled
Fired when a player drops an item in a FlowStage.
Fields:
Player playerβ the player who dropped the itemFlowPosition positionβ the playerβs position when dropping the itemMaterial materialβ the material of the item being droppedFlowStage stageβ the stage where the event occursboolean cancelledβ whether the event is cancelled
- Item drop simulation
- Item pickup handling
- Block placing
- Block breaking
- Explosion handling
- Ender pearl interactions
- Liquid flow support
- Block ticking
- Knockback
- PacketEvents - For packet manipulation
- EntityLib - For entity handling
This project is licensed under the MIT License - see the LICENSE file for details.