Skip to content

Commit

Permalink
Merge pull request #21 from KurtThiemann/master
Browse files Browse the repository at this point in the history
Add support for Minecraft Bedrock Edition content log files
  • Loading branch information
matthi4s authored May 11, 2022
2 parents 7cdd681 + b24e5f5 commit 63a7805
Show file tree
Hide file tree
Showing 5 changed files with 801 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Analyser/BedrockContentAnalyser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Aternos\Codex\Minecraft\Analyser;

class BedrockContentAnalyser extends MinecraftAnalyser
{

}
2 changes: 2 additions & 0 deletions src/Detective/Detective.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Aternos\Codex\Minecraft\Detective;

use Aternos\Codex\Minecraft\Log\BedrockContentLog;
use Aternos\Codex\Minecraft\Log\BedrockLog;
use Aternos\Codex\Minecraft\Log\BungeeCordLog;
use Aternos\Codex\Minecraft\Log\CraftBukkitLog;
Expand Down Expand Up @@ -47,6 +48,7 @@ class Detective extends \Aternos\Codex\Detective\Detective
ForgeLog::class,
PocketmineLog::class,
BedrockLog::class,
BedrockContentLog::class,
FabricLog::class,
BungeeCordLog::class,
WaterfallLog::class,
Expand Down
41 changes: 41 additions & 0 deletions src/Log/BedrockContentLog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace Aternos\Codex\Minecraft\Log;

use Aternos\Codex\Analyser\AnalyserInterface;
use Aternos\Codex\Minecraft\Analyser\BedrockAnalyser;
use Aternos\Codex\Minecraft\Analyser\BedrockContentAnalyser;
use Aternos\Codex\Minecraft\Parser\Parser;
use Aternos\Codex\Parser\ParserInterface;

class BedrockContentLog extends MinecraftServerLog
{
protected static $pattern = '/^(((?:\d{2}:){2}(?:\d{2}))\[\w+\]\[(\w+)\]).*$/';

/**
* @return ParserInterface
*/
public static function getDefaultParser()
{
return (new Parser())
->setPattern(static::$pattern)
->setTimeFormat('H:i:s')
->setMatches([Parser::PREFIX, Parser::TIME, Parser::LEVEL]);
}

/**
* @inheritDoc
*/
public static function getDefaultAnalyser()
{
return new BedrockContentAnalyser();
}

/**
* @inheritDoc
*/
public function getServerSoftware(): string
{
return "Bedrock";
}
}
56 changes: 56 additions & 0 deletions test/data/bedrock/bedrock-content.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
10:25:19[Blocks][inform]-block_definitions | development_behavior_packs/Ores Plus Add-On [BP] v2.1.0 | blocks/deepslate_sapphire_ore.json | oresplus:deepslate_sapphire_ore | components | minecraft:creative_category | {
"category" : "Nature",
"group" : "itemGroup.name.ore"
}


10:25:19[Blocks][error]-block_definitions | development_behavior_packs/Ores Plus Add-On [BP] v2.1.0 | blocks/deepslate_sapphire_ore.json | oresplus:deepslate_sapphire_ore | components | minecraft:creative_category | child 'minecraft:creative_category' not valid here.

10:25:19[Blocks][inform]-block_definitions | development_behavior_packs/Ores Plus Add-On [BP] v2.1.0 | blocks/deepslate_sapphire_ore.json | oresplus:deepslate_sapphire_ore | components | minecraft:on_player_destroyed | {
"event" : "destroyed",
"target" : "self"
}


10:25:19[Blocks][error]-block_definitions | development_behavior_packs/Ores Plus Add-On [BP] v2.1.0 | blocks/deepslate_sapphire_ore.json | oresplus:deepslate_sapphire_ore | components | minecraft:on_player_destroyed | child 'minecraft:on_player_destroyed' not valid here.

10:25:19[Blocks][inform]-block_definitions | development_behavior_packs/Ores Plus Add-On [BP] v2.1.0 | blocks/deepslate_sapphire_ore.json | oresplus:deepslate_sapphire_ore | events | destroyed | run_command | {
"command" : [ "summon xp_orb ~ ~ ~" ],
"target" : "self"
}

10:25:19[Blocks][error]-block_definitions | development_behavior_packs/Ores Plus Add-On [BP] v2.1.0 | blocks/deepslate_silver_ore.json | oresplus:deepslate_silver_ore | components | minecraft:creative_category | child 'minecraft:creative_category' not valid here.

10:25:19[Item][error]-To use item 'oresplus:pyrite_knife' turn on the Holiday Creator Features toggle in settings

10:25:19[Item][error]-To use item 'oresplus:ambar_helmet' turn on the Holiday Creator Features toggle in settings

10:25:19[Json][error]-upgrade items/alexandrite_boots.json | failed to parse file into a json document: Missing a name for object member.


10:25:20[Recipes][error]-recipes/pyrite_knife.json | oresplus:pyrite_knife | The Item: oresplus:pyrite_knife is missing, cant make the recipe


10:25:20[Recipes][error]-recipes/pyrite_knife.json | oresplus:pyrite_knife | Recipe result malformed


10:25:20[Recipes][error]-recipes/pyrite_knife.json | oresplus:pyrite_knife | Recipe has no result item(s)


10:25:21[Commands][warning]-Function jade_totem failed to load correctly with error(s):

10:25:21[Commands][warning]-Error on line 5: command failed to parse with error 'commands.generic.syntax'

10:25:21[Commands][warning]-Function wither_totem failed to load correctly with error(s):

10:25:21[Commands][warning]-Error on line 5: command failed to parse with error 'commands.generic.syntax'

10:25:21[Commands][warning]-Function cryo_totem failed to load correctly with error(s):

10:25:21[Commands][warning]-Error on line 5: command failed to parse with error 'commands.generic.syntax'

10:25:21[Commands][warning]-Function infernal_totem failed to load correctly with error(s):

10:25:21[Commands][warning]-Error on line 5: command failed to parse with error 'commands.generic.syntax'

10:25:21[Commands][warning]-Function spinel_totem failed to load correctly with error(s):
Loading

0 comments on commit 63a7805

Please sign in to comment.