Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
4432e34
Due to the new custom components, this cheat is no longer necessary!
ImperaZim Mar 1, 2025
bf8ac94
Due to the new custom components, this cheat is no longer necessary!
ImperaZim Mar 1, 2025
764b89a
Fixes the icon texture not showing up
ImperaZim Mar 1, 2025
0020ce9
Modifiera component added.
ImperaZim Mar 1, 2025
c721455
Modifiers component added.
ImperaZim Mar 1, 2025
c4b7f2e
BundleInteractionComponent Added.
ImperaZim Mar 2, 2025
04ec087
DamageAbsorptionComponent Added.
ImperaZim Mar 2, 2025
6dad8b1
DamageComponent Added.
ImperaZim Mar 2, 2025
ec74505
DyeableComponent Added.
ImperaZim Mar 2, 2025
4cdb2c5
EnchantableSlotComponent Added.
ImperaZim Mar 2, 2025
40e3743
EnchantableValueComponent Added.
ImperaZim Mar 2, 2025
72b2cea
GlintComponent Added.
ImperaZim Mar 2, 2025
3405d0c
HoverTextColorComponent Added.
ImperaZim Mar 2, 2025
b55c892
InteractButtonComponent Added.
ImperaZim Mar 2, 2025
b7b5999
LiquidClippedComponent Added.
ImperaZim Mar 2, 2025
5b53fb6
RecordComponent Added.
ImperaZim Mar 2, 2025
17b5e5f
ShooterComponent Added.
ImperaZim Mar 2, 2025
293ee7e
ShouldDespawnComponent Added.
ImperaZim Mar 2, 2025
df9d5aa
StackedByDataComponent Added.
ImperaZim Mar 2, 2025
f2f8a7c
RenderOffsetsComponent Removed.
ImperaZim Mar 2, 2025
7f6f85b
KnockbackResistanceComponent Removed.
ImperaZim Mar 2, 2025
ff6c009
FoilComponent Removed.
ImperaZim Mar 2, 2025
8e95b9c
ArmorComponent Removed.
ImperaZim Mar 2, 2025
4e858b7
AttackDamageComponent Removed.
ImperaZim Mar 2, 2025
497c0d5
ChargeableComponent Removed.
ImperaZim Mar 2, 2025
f0c1514
ItemComponentsTrait Modified.
ImperaZim Mar 2, 2025
f72db4e
AllowOffHand Modified.
ImperaZim Mar 2, 2025
0611182
BlockPlacer Modified.
ImperaZim Mar 2, 2025
17d8d5b
Cooldown Modified.
ImperaZim Mar 2, 2025
fae20d7
Digger Modified.
ImperaZim Mar 2, 2025
d6827e9
DisplayName Modified.
ImperaZim Mar 2, 2025
2b03c53
Durability Modified.
ImperaZim Mar 2, 2025
a39624f
Food Modified.
ImperaZim Mar 2, 2025
bee9a64
Fuel Modified.
ImperaZim Mar 2, 2025
cdae091
HandEquipped Modified.
ImperaZim Mar 2, 2025
1f265ec
Icon Modified.
ImperaZim Mar 2, 2025
69ecae0
MaxStackSize Modified.
ImperaZim Mar 2, 2025
427b28f
Projectile Modified.
ImperaZim Mar 2, 2025
f68bc1c
Rarity Modified.
ImperaZim Mar 2, 2025
157e276
Throwable Modified.
ImperaZim Mar 2, 2025
3e6ee29
UseAnimation Modified.
ImperaZim Mar 2, 2025
c8edd14
UseDuration Modified.
ImperaZim Mar 2, 2025
99ae862
UseModifiers Modified.
ImperaZim Mar 2, 2025
5a8d8c5
Wearable Modified.
ImperaZim Mar 2, 2025
a0ec1b6
Update changelogs
ImperaZim Mar 2, 2025
41ac6e5
New Trigger: ItemTrigger
ImperaZim Mar 3, 2025
ad46c55
New Customies ItemComponent: ItemTaskComponent
ImperaZim Mar 3, 2025
87fb0b5
changelogs update
ImperaZim Mar 3, 2025
8134b60
This is a bugfix update.
ImperaZim Mar 3, 2025
05c8de1
Removed component.
ImperaZim Mar 3, 2025
cdd23d8
Item tasks have been optimized.
ImperaZim Mar 3, 2025
84da94f
RFC Command: PluginsCommand
ImperaZim Mar 8, 2025
06748d7
[BETA] All types are accepted in the file class, but not all accept s…
ImperaZim Apr 17, 2025
4875ed8
Starting refactoring of the forms sub library.
ImperaZim May 19, 2025
0e6ad56
Patch files moved into vendor.
ImperaZim May 25, 2025
91c0d98
LibForm has been removed from the source to a single repository.
ImperaZim Jun 3, 2025
1d923bc
Squashed 'src/imperazim/form/' content from commit f42701b
ImperaZim Jun 3, 2025
afc35fe
Merge commit '1d923bc6781b7b891212ef67bd0b6af736d9bebe' as 'src/imper…
ImperaZim Jun 3, 2025
429e531
Third party components (Commando & SimplePacketHandler) removed.
ImperaZim Jun 25, 2025
f3c296e
Squashed 'src/imperazim/packet/' content from commit 0a0ad1a
ImperaZim Jun 25, 2025
71e1719
Merge commit 'f3c296e9d4e65b41c6a01d8b69919a4eb1e83858' as 'src/imper…
ImperaZim Jun 25, 2025
db7d00b
Merge commit '0af9aa163400782c44e521130a78a5a448c41ccf' as 'src/imper…
ImperaZim Jun 25, 2025
0af9aa1
Squashed 'src/imperazim/command/' content from commit 17cba80
ImperaZim Jun 25, 2025
243a929
CommandHook fixed
ImperaZim Jun 25, 2025
93d9e72
Squashed 'src/imperazim/command/' changes from 17cba80..5c42bb7
ImperaZim Jun 25, 2025
259a529
CommandHooker fixed
ImperaZim Jun 25, 2025
3d6beb3
Fixed command uses
ImperaZim Jun 25, 2025
e6d7577
Squashed 'src/imperazim/command/' changes from 5c42bb7..23f9dc7
ImperaZim Jun 25, 2025
161d0ef
Added PluginBase uses on hooker
ImperaZim Jun 25, 2025
207387f
Removed old command versions.
ImperaZim Jun 26, 2025
2496a0c
Added new comands with LibCommand
ImperaZim Jun 26, 2025
96bb3ea
Update docs
ImperaZim Jun 29, 2025
c5d2bb0
ModuleLoader update
ImperaZim Jun 29, 2025
062bf19
feat(Path): Add file system inspection methods
ImperaZim Jul 16, 2025
a7dadf9
feat(File): Add essential methods for island management
ImperaZim Jul 16, 2025
30c88c7
Squashed 'src/imperazim/command/' changes from 23f9dc7..2488f40
ImperaZim Jul 27, 2025
05d8eac
LibCommand: Subcommands do not inherit constraints from their parent …
ImperaZim Jul 27, 2025
bc968e6
LibCommand: Now the constraint check is done after the sub-command ch…
ImperaZim Jul 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ _The `EasyLibrary` is a powerful plugin for PocketMine-MP that serves as a colle

To use EasyLibrary's features you can do it in 2 ways, use the one you find most interesting, I recommend using it as a plug for greater ease!
- **As a plugin:** Being the simplest way where you just need to add EasyLibrary.phar to your server and it will start all the library components, you can modify which components you want to keep active in the plugin's `config.yml` if you want!
- **As a inyernal library:** You must add it inside the plugin's src, keeping it in the root src folder for everything to work normally. Using this method, you will have to start the components yourself in your main.
- **As a internal library:** You must add it inside the plugin's src, keeping it in the root src folder for everything to work normally. Using this method, you will have to start the components yourself in your main.

### Examples

Example PocketMine-MP plugin with EasyLibrary, showing some basic features of the Library: [PluginExample](https://github.com/ImperaZim/EasyLibrary-Plugin-Example).
Example PocketMine-MP plugin with EasyLibrary, showing some basic features of the Library: [LibForm Docs](https://github.com/ImperaZim/LibForm), [LibCommand Docs](https://github.com/ImperaZim/LibCommand).

## Licensing information
This project is licensed under MIT. Please see the [LICENSE](/LICENSE) file for details.

## Credits
Public libraries integrated into the source code to facilitate the use of EasyLibrary. I do not have any rights to the libraries below!
- [CortexPE/Commando](https://github.com/CortexPE/Commando)
- [Muqsit/InvMenu](https://github.com/Muqsit/InvMenu)
- [Muqsit/SimplePacketHandler](https://github.com/Muqsit/SimplePacketHandler)
- [CustomiesDevs/Customies](https://github.com/CustomiesDevs/Customies)
152 changes: 147 additions & 5 deletions changelogs/1.3.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# 1.3.0
**Versions:** [1.3.0](https://github.com/ImperaZim/EasyLibrary/blob/development/changelogs/1.3.md#13) | [1.3.1](https://github.com/ImperaZim/EasyLibrary/blob/development/changelogs/1.3.md#131) | [1.3.2](https://github.com/ImperaZim/EasyLibrary/blob/development/changelogs/1.3.md#132)

# 1.3

Released February 14, 2025

**For PocketMine-MP 5.24.0**
**For PocketMine-MP 5.24.X**

1.3.0 is a major feature update to EasyLibrary, including support for PocketMine-MP 5.24.0 plugins, bringing a large list of features and improvements over the previous version.
1.3.0 is a major feature update to EasyLibrary, including support for PocketMine-MP 5.24.X plugins, bringing a large list of features and improvements over the previous version.

It is **not** compatible with plugins written for version 1.2.0 or lower, and plugins may require code changes to work with it.
It is **not** compatible with plugins written for version 1.2.X or lower, and plugins may require code changes to work with it.

**As this changelog is quite large, its accuracy and completeness cannot be guaranteed. Make sure you're looking at the [latest revision](https://github.com/ImperaZim/EasyLibrary/blob/development/changelogs/1.3.md), as it may be amended after relatest**

Expand Down Expand Up @@ -912,8 +914,148 @@ echo "Current time: " . TimeUtils::GetCurrentTime();
---
# 1.3.1

**For PocketMine-MP 5.25.0**
**For PocketMine-MP 5.25.X**

This is an update to fix changes made and bugs caused by PocketMine-MP 5.25x.

It is not compatible with plugins written for version 1.3.0 or lower, and plugins may require code changes to work with it.


# 1.3.2
**For PocketMine-MP 5.25.X**

## Components

### General

### `imperazim\components\trigger`

- **`ItemTrigger:`** Creates a trigger that executes an action for players who have a specific item in their inventory.
Example usage:
```php
use imperazim\components\trigger\ItemTrigger;
use pocketmine\item\GoldenApple;

// Automatically checks if the player has the item and executes the action
$itemTrigger = new ItemTrigger(
GoldenApple::class,
function(Player $player, PlayerInventory $inventory): void {
$player->sendMessage("You have a golden apple in your inventory!");
// Optional: Interact with the inventory
$inventory->removeItem($inventory->getItem(0)); // Removes first slot item
}
);
```
No need to manually write item-checking conditions - simply provide the item class and callback.


## Vendor

### `imperazim\vendor\customies\item`

### Core Mechanics
- **`StackedByDataComponent`**: Controls item stacking behavior for variants with different aux values.
**Example:**
```php
$item->addComponent(new StackedByDataComponent(true)); // Allows stacking of items with different aux values
```

- **`ShouldDespawnComponent`**: Toggles item despawn mechanics for floating entities.
**Example:**
```php
$item->addComponent(new ShouldDespawnComponent(false)); // Prevents the item from despawning
```

- **`ShooterComponent`**: Enables projectile launching (requires `UseModifiersComponent`).
**Example:**
```php
$item->addComponent(new ShooterComponent("arrow", ...view component)); // Shoots arrows with a speed of 1.5
```

- **`RecordComponent`**: Adds music playback functionality to items.
**Example:**
```php
$item->addComponent(new RecordComponent(1, 60, "record.song")); // Plays a specific music record
```

- **`ItemTaskComponent`**: Creates a new ItemTaskComponent to define a task that checks for specific items in a player's inventory.
**Example:**
```php
$item->addComponent(new ItemTaskComponent(
self::class,
function(Player $player, Item $item): void {
$player->sendMessage("You are holding a Diamond Sword!");
},
ItemTaskComponent::FILTER_HAND
));
```

### Visual & Interaction
- **`HoverTextColorComponent`**: Sets custom color for item name hover text.
**Example:**
```php
$item->addComponent(new HoverTextColorComponent("color")); // Sets hover text color to red. See: https://minecraft.wiki/w/Formatting_codes#Color_codes
```

- **`GlintComponent`**: Toggles enchantment glow effect.
**Example:**
```php
$item->addComponent(new GlintComponent(true)); // Adds an enchantment glow to the item
```

- **`InteractButtonComponent`**: Configures touch control interaction button (supports custom text).
**Example:**
```php
$item->addComponent(new InteractButtonComponent("Use Item")); // Displays "Use Item" on the interact button
```

- **`LiquidClippedComponent`**: Defines liquid block interaction behavior.
**Example:**
```php
$item->addComponent(new LiquidClippedComponent(true)); // Allows interaction with liquid blocks
```

### Item Customization
- **`DyeableComponent`**: Enables cauldron-based dyeing (requires `dyed` texture definition).
**Example:**
```php
$item->addComponent(new DyeableComponent("#hex")); // Allows the item to be dyed in a cauldron
```

- **`EnchantableSlotComponent`**: Restricts applicable enchantment types (e.g., bow-only enchants).
**Example:**
```php
$item->addComponent(new EnchantableSlotComponent(self::SLOT_NAME)); // Allows only slot_name enchantments
```

- **`EnchantableValueComponent`**: Sets base enchantment strength.
**Example:**
```php
$item->addComponent(new EnchantableValueComponent(10)); // Sets base enchantment strength to 10
```

### Combat & Durability
- **`DamageComponent`**: Increases attack damage (positive values only).
**Example:**
```php
$item->addComponent(new DamageComponent(5)); // Adds 5 extra damage to the item
```

- **`DamageAbsorptionComponent`**: Reduces incoming damage when equipped as armor (requires durability).
**Example:**
```php
$item->addComponent(new DamageAbsorptionComponent(3)); // Absorbs 3 points of damage
```

### Specialized Systems
- **`BundleInteractionComponent`**: Enables bundle storage mechanics (requires `storage_item` component).
**Example:**
```php
$item->addComponent(new BundleInteractionComponent(4)); // Enables Bundle Interactions with 4 slots
```

- **`UseModifiersComponent`**: Configures item usage timing for food/throwable/shooter items.
**Example:**
```php
$item->addComponent(new UseModifiersComponent(1.0, 1.5)); // Sets item usage modifiers +1.0 with duration to 1.5 seconds
```
48 changes: 29 additions & 19 deletions src/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,38 @@
use imperazim\components\plugin\PluginToolkit;
use imperazim\components\plugin\traits\PluginToolkitTrait;

use imperazim\components\commands\PluginsCommand;
use imperazim\components\commands\VersionCommand;

/**
* Class Library
* TODO: This class should not be called in other plugins!
*/
final class Library extends PluginToolkit {
use PluginToolkitTrait;

public LibraryComponents $componentsManager;

/**
* This method is called when the plugin is enabled.
*/
protected function onEnable(): void {
self::setInstance($this);
$this->componentsManager = new LibraryComponents($this);
$this->componentsManager->enableComponents();
}

/**
* This method is called when the plugin is disabled.
*/
protected function onDisable(): void {
$this->componentsManager->disableComponents();
}
use PluginToolkitTrait;

public LibraryComponents $componentsManager;

/**
* This method is called when the plugin is enabled.
*/
protected function onEnable(): void {
self::setInstance($this);
LibraryModules::loadModules($this);

$this->componentsManager = new LibraryComponents($this);
$this->componentsManager->enableComponents();

$this->overwriteCommands($this, [
'plugins' => PluginsCommand::class,
'version' => VersionCommand::class,
]);
}

/**
* This method is called when the plugin is disabled.
*/
protected function onDisable(): void {
$this->componentsManager->disableComponents();
}
}
6 changes: 1 addition & 5 deletions src/LibraryComponents.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@

declare(strict_types = 1);

use imperazim\bugfixes\BugFixesManager;
use imperazim\vendor\fix\BugFixesManager;

use imperazim\components\filesystem\File;
use imperazim\components\world\WorldManager;
use imperazim\components\plugin\PluginToolkit;
use imperazim\components\trigger\TriggerManager;
use imperazim\components\command\CommandManager;
use imperazim\components\hud\bossbar\BossBarManager;

use imperazim\vendor\invmenu\InvMenuManager;
use imperazim\vendor\commando\CommandoManager;
use imperazim\vendor\customies\CustomiesManager;
use imperazim\vendor\customies\enchantment\CustomiesEchantmentManager;

Expand All @@ -30,10 +28,8 @@ final class LibraryComponents {
'World' => WorldManager::class,
'BossBar' => BossBarManager::class,
'InvMenu' => InvMenuManager::class,
'Command' => CommandManager::class,
'Triggers' => TriggerManager::class,
'BugFixes' => BugFixesManager::class,
'Commando' => CommandoManager::class,
'Customies' => CustomiesManager::class,
'CustomiesEnchantment' => CustomiesEchantmentManager::class,
];
Expand Down
24 changes: 24 additions & 0 deletions src/LibraryModules.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types = 1);

use pocketmine\plugin\PluginBase;
use imperazim\command\LibCommandHooker;

/**
* Class LibraryModules
* TODO: This class should not be called in other plugins!
*/
final class LibraryModules {

/**
* Load all modules.
*/
public static function loadModules(PluginBase $plugin): void {
$pluginManager = $plugin->getServer()->getPluginManager();
if ($pluginManager->getPlugin('LibCommand') !== null) {
LibCommandHooker::registerInterceptor($plugin);
}
}

}
Loading