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.