Skip to content

Latest commit

Β 

History

History
133 lines (92 loc) Β· 3.36 KB

File metadata and controls

133 lines (92 loc) Β· 3.36 KB

🧱 BlockFlow

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.


πŸ“¦ Installation

Maven

<dependency>
    <groupId>dev.lrxh</groupId>
    <artifactId>blockflow</artifactId>
    <version>1.0.0</version>
</dependency>

πŸš€ Example Usage

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();

πŸ“’ Events

πŸ”¨ FlowBreakEvent

Fired when a player breaks a block in a FlowStage.

Fields:

  • Player player – the player breaking the block
  • FlowPosition position – the position of the block
  • FlowBlock block – the block being broken
  • FlowStage stage – the stage where the event occurs
  • boolean cancelled – whether the event is cancelled

🧱 FlowPlaceEvent

Fired when a player places a block in a FlowStage.

Fields:

  • Player player – the player placing the block
  • FlowPosition position – the position of the placed block
  • BlockData blockData – the data of the block being placed
  • FlowStage stage – the stage where the event occurs
  • boolean cancelled – whether the event is cancelled

πŸ“¦ FlowBlockItemDropEvent

Fired when a block drops an item in a FlowStage.

Fields:

  • Player player – the player responsible for the drop
  • FlowPosition position – the block’s position
  • Material material – the dropped material
  • FlowStage stage – the stage where the event occurs
  • boolean cancelled – whether the event is cancelled

πŸ”„ FlowItemPickupEvent

Fired when a player picks up an item in a FlowStage.

Fields:

  • Player player – the player picking up the item
  • ItemStack itemStack – the item being picked up
  • FlowStage stage – the stage where the event occurs
  • boolean cancelled – whether the event is cancelled

πŸ“¦ FlowPlayerItemDropEvent

Fired when a player drops an item in a FlowStage.

Fields:

  • Player player – the player who dropped the item
  • FlowPosition position – the player’s position when dropping the item
  • Material material – the material of the item being dropped
  • FlowStage stage – the stage where the event occurs
  • boolean cancelled – whether the event is cancelled

πŸ—ΊοΈ Roadmap

  • Item drop simulation
  • Item pickup handling
  • Block placing
  • Block breaking
  • Explosion handling
  • Ender pearl interactions
  • Liquid flow support
  • Block ticking
  • Knockback

πŸ“„ Dependencies


πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.