Skip to content
Open

V1.5 #167

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f68ffe6
- fixed alot of item components
jeantkg Sep 25, 2025
1d139bb
blocks part 1
jeantkg Sep 30, 2025
156ec2a
Refactor block components to use VanillaBlockComponents registry
jeantkg Oct 3, 2025
699b95a
Implement fromJson method for item components and add VanillaItemComp…
jeantkg Oct 4, 2025
18ea86c
Remove unused custom slime block and allowoffhand item JSON files; ad…
jeantkg Oct 4, 2025
517b53d
Refactor item and block component traits; remove unused ItemComponent…
jeantkg Oct 6, 2025
0595dc1
feat: Introduce BlockBreakInfoComponent and enhance block component s…
jeantkg Oct 16, 2025
7b2d3f0
readded src-namespace-prefix
jeantkg Nov 14, 2025
3b4c910
clean up
jeantkg Dec 14, 2025
1516329
Refactor item and block component handling
jeantkg Dec 14, 2025
a3fb86b
feat: Implement CollisionBoxComponent and Box class for enhanced coll…
jeantkg Dec 14, 2025
7566fc9
Update Components
HydroGames-dev Dec 14, 2025
bd3507a
Update RotatableTrait.php
HydroGames-dev Dec 14, 2025
65bd1c6
Update StorageItemComponent.php
HydroGames-dev Dec 14, 2025
0b0d374
remove these
HydroGames-dev Dec 14, 2025
c1b8dce
PHPDocs (AI), Implemented some data driven stuff
HydroGames-dev Dec 15, 2025
56b5d97
phpstan fix
HydroGames-dev Dec 15, 2025
867e2d9
Merge pull request #3 from Amblydia/v2-Copy
jeantkg Dec 15, 2025
f94fa9a
Refactor: Clean up code by removing unused components and simplifying…
jeantkg Dec 15, 2025
57c8636
a better solution
jeantkg Dec 16, 2025
c032ab2
Fix: Update FlowerPottableComponent name and simplify SingletonTrait …
jeantkg Dec 16, 2025
ad9e6b7
Refactor: Enhance DefaultTrait to initialize components with texture …
jeantkg Dec 16, 2025
00acd28
temp fix untill jean checks this
HydroGames-dev Dec 17, 2025
239d54e
update CustomiesBlockFactory.php
HydroGames-dev Dec 17, 2025
abf72e8
update CustomiesBlockFactory.php
HydroGames-dev Dec 17, 2025
6044cb3
Remove Debugging
HydroGames-dev Dec 17, 2025
d2826b0
Works somehow
HydroGames-dev Dec 17, 2025
f1094a7
Refactor block components to use CompoundTag for packed_bools and imp…
jeantkg Dec 17, 2025
05b67f8
Implement TransformationComponent and CardinalDirectionRotationTrait;…
jeantkg Dec 17, 2025
cd1c89e
Refactor NBT handling to replace CompoundTag with ByteTag for packed_…
jeantkg Dec 19, 2025
4ce3c74
Refactor RotatableTrait to use TransformationComponent instead of Com…
jeantkg Dec 19, 2025
464143b
right way to do materials
jeantkg Dec 20, 2025
06e569f
Implement new block traits and states system; refactor block componen…
jeantkg Dec 25, 2025
9acd7c0
Refactor block state and trait systems
jeantkg Dec 26, 2025
11e74d4
Enhance block and item registration systems; add new state and trait …
jeantkg Dec 26, 2025
aba178e
Revert version number to 1.5.0 in plugin.yml
jeantkg Dec 26, 2025
7671f06
Refactor block permutations and states
jeantkg Dec 27, 2025
63d0448
remove JSON loader
jeantkg Dec 27, 2025
68145a7
removed the resource folder
jeantkg Dec 27, 2025
08b5583
Refactor block components and improve block factory
HydroGames-dev Dec 28, 2025
a8cf8d2
Update Customies.php
HydroGames-dev Dec 28, 2025
9f00215
Move ExampleBlock to examples directory
HydroGames-dev Dec 28, 2025
91e9af2
Refactor creative group and permutation handling
HydroGames-dev Dec 30, 2025
a9bc84d
Move properties classes to utils namespaces
HydroGames-dev Dec 30, 2025
8782f22
Prevent duplicate component initialization in traits
HydroGames-dev Dec 30, 2025
cbd22cd
Refactor block/item utils to properties, improve components
HydroGames-dev Dec 31, 2025
ec178ee
Update CustomiesItemFactory.php
HydroGames-dev Dec 31, 2025
caaa960
Refactor creative inventory registration logic
HydroGames-dev Dec 31, 2025
bfa86f7
improve collision handling
HydroGames-dev Dec 31, 2025
0e3f86e
Add validation and enhancements to item/block components
HydroGames-dev Jan 4, 2026
226ae46
Remove unused CreativeGroup imports
HydroGames-dev Jan 9, 2026
b6f3585
Remove deprecated block state classes and add new rotation traits for…
jeantkg Jan 14, 2026
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
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# http://editorconfig.org/
root = yes

[*]
indent_size = 4
indent_style = tab
charset = utf-8
end_of_line = LF
insert_final_newline = true
trim_trailing_whitespace = true

[composer.json]
indent_size = 4

[{*.json,*.yml,*.yaml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Auto detect text files and perform LF normalization
* text=auto
*.php text eol=lf
*.txt text eol=lf
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ A PocketMine-MP plugin that implements support for custom blocks, items and enti

<a href="https://discord.gg/Tm6wGxWqgh"><img src="https://img.shields.io/discord/989466131305754625?label=discord&color=7289DA&logo=discord" alt="Discord" /></a>

Official Discord community chat for socializing, receiving help with the plugin, and sharing creations. Join in on the
fun!
Official Discord community chat for socializing, receiving help with the plugin, and sharing creations. Join in on the fun!

## Usage

The usage guides have been moved to the [Customies Wiki](https://github.com/CustomiesDevs/Customies/wiki)!

[![Mojang Item Docs](https://img.shields.io/badge/📖-Microsoft_Docs-blue)](https://learn.microsoft.com/en-us/minecraft/creator/reference/content/itemreference/examples/itemcomponentlist?view=minecraft-bedrock-stable)
[![Mojang Block Docs](https://img.shields.io/badge/📖-Microsoft_Docs-blue)](https://learn.microsoft.com/en-us/minecraft/creator/reference/content/blockreference/examples/blockcomponents/blockcomponentslist?view=minecraft-bedrock-stable)

## Important Contributors

| Name | Contribution |
Expand Down
6 changes: 3 additions & 3 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ description: A PocketMine-MP plugin that implements support for custom blocks, i

main: customiesdevs\customies\Customies
src-namespace-prefix: customiesdevs\customies
version: 1.4.0
api: 5.1.3
version: 1.5.0
api: 5.37.0

authors:
- DenielWorld
- TwistedAsylumMC
contributors:
- JackNoordhuis
- Unickorn
- abimek
- abimek
15 changes: 10 additions & 5 deletions src/Customies.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@
use customiesdevs\customies\block\CustomiesBlockFactory;
use pocketmine\plugin\PluginBase;
use pocketmine\scheduler\ClosureTask;
use pocketmine\utils\SingletonTrait;

final class Customies extends PluginBase {
use SingletonTrait;

public function onLoad(): void{
self::setInstance($this);
}

protected function onEnable(): void {
$this->getServer()->getPluginManager()->registerEvents(new CustomiesListener(), $this);

$cachePath = $this->getDataFolder() . "idcache";
$this->getScheduler()->scheduleDelayedTask(new ClosureTask(static function () use ($cachePath): void {
$this->getScheduler()->scheduleDelayedTask(new ClosureTask(static function (): void {
// This task is scheduled with a 0-tick delay so it runs as soon as the server has started. Plugins should
// register their custom blocks and entities in onEnable() before this is executed.
CustomiesBlockFactory::getInstance()->addWorkerInitHook($cachePath);
// register their custom blocks and entities in onEnable() before this is executed
CustomiesBlockFactory::getInstance()->addWorkerInitHook();
}), 0);
}
}
}
14 changes: 8 additions & 6 deletions src/CustomiesListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,33 @@
use function count;

final class CustomiesListener implements Listener {

/** @var BlockPaletteEntry[] */
private array $cachedBlockPalette = [];
private Experiments $experiments;

public function __construct() {
$this->experiments = new Experiments([
// "data_driven_items" is required for custom blocks to render in-game. With this disabled, they will be
// shown as the UPDATE texture block.
// "data_driven_items" is required for custom blocks to render in-game.
// With this disabled, custom blocks will appear as the UPDATE texture block.
"data_driven_items" => true,
"upcoming_creator_features" => true
], true);
}

public function onDataPacketSend(DataPacketSendEvent $event): void {
foreach($event->getPackets() as $packet){
if($packet instanceof StartGamePacket) {
if(count($this->cachedBlockPalette) === 0) {
if($packet instanceof StartGamePacket){
if(count($this->cachedBlockPalette) === 0){
// Wait for the data to be needed before it is actually cached. Allows for all blocks and items to be
// registered before they are cached for the rest of the runtime.
$this->cachedBlockPalette = CustomiesBlockFactory::getInstance()->getBlockPaletteEntries();
}
$packet->levelSettings->experiments = $this->experiments;
$packet->blockPalette = $this->cachedBlockPalette;
} elseif($packet instanceof ResourcePackStackPacket) {
}elseif($packet instanceof ResourcePackStackPacket) {
$packet->experiments = $this->experiments;
}
}
}
}
}
67 changes: 0 additions & 67 deletions src/block/BlockComponentsTrait.php

This file was deleted.

9 changes: 8 additions & 1 deletion src/block/BlockPalette.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ public function __construct() {
}

/**
* Returns all block states in the palette.
* @return BlockStateDictionaryEntry[]
*/
public function getStates(): array {
return $this->states;
}

/**
* Returns all custom block states.
* @return BlockStateDictionaryEntry[]
*/
public function getCustomStates(): array {
Expand All @@ -60,6 +62,9 @@ public function getCustomStates(): array {

/**
* Inserts the provided state in to the correct position of the palette.
* @param CompoundTag $state
* @param int $meta
* @return void
*/
public function insertState(CompoundTag $state, int $meta = 0): void {
if(($name = $state->getString(BlockStateData::TAG_NAME, "")) === "") {
Expand All @@ -74,6 +79,8 @@ public function insertState(CompoundTag $state, int $meta = 0): void {

/**
* Sorts the palette's block states in the correct order, also adding the provided state to the array.
* @param BlockStateDictionaryEntry $newState
* @return void
*/
private function sortWith(BlockStateDictionaryEntry $newState): void {
// To sort the block palette we first have to split the palette up in to groups of states. We only want to sort
Expand Down Expand Up @@ -112,4 +119,4 @@ private function sortWith(BlockStateDictionaryEntry $newState): void {
throw new AssumptionFailedError(BlockTypeNames::INFO_UPDATE . " should always exist")
);
}
}
}
Loading