From 742fbc25c3104ca1f4855b030339accbeb911c6a Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 20 Oct 2018 21:42:34 +0100 Subject: [PATCH 1/3] BlockFactory: fixed 0 being assumed to be default if used this defeated the whole point of adding this code ... --- src/pocketmine/block/BlockFactory.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/block/BlockFactory.php b/src/pocketmine/block/BlockFactory.php index 9fd5c8625..c793caae6 100644 --- a/src/pocketmine/block/BlockFactory.php +++ b/src/pocketmine/block/BlockFactory.php @@ -467,9 +467,8 @@ class BlockFactory{ if(!$override and self::isRegistered($id, $variant)){ throw new \InvalidArgumentException("Block registration conflicts with an existing block"); } - self::fillStaticArrays(($id << 4) | $variant, $block); //register default state mapped to variant, for blocks which don't use 0 as valid state - for($m = $variant + 1; $m <= ($variant | $stateMask); ++$m){ + for($m = $variant; $m <= ($variant | $stateMask); ++$m){ if(($m & ~$stateMask) !== $variant){ continue; } @@ -486,6 +485,10 @@ class BlockFactory{ self::fillStaticArrays($index, $v); } } + + if(!self::isRegistered($id, $variant)){ + self::fillStaticArrays(($id << 4) | $variant, $block); //register default state mapped to variant, for blocks which don't use 0 as valid state + } } private static function fillStaticArrays(int $index, Block $block) : void{ From 08cf7e489fe2957cf4b0831a0ab4dbe2f11d32db Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 21 Oct 2018 15:23:06 +0100 Subject: [PATCH 2/3] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..d3f95d40b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,59 @@ +--- +name: Bug report +about: Report a bug in PocketMine-MP (not plugins) + +--- + +### Issue description + + + + + +- Expected result: What were you expecting to happen? +- Actual result: What actually happened? + +### Steps to reproduce the issue + +1. ... +2. ... + +### OS and versions + +* PocketMine-MP: +* PHP: +* Server OS: +* Game version: PE/Win10 (delete as appropriate) + +### Plugins +- Test on a clean server without plugins: is the issue reproducible without any plugins loaded? + +If the issue is **not** reproducible without plugins: +- Have you asked for help on our forums before creating an issue? +- Can you provide sample, *minimal* reproducing code for the issue? If so, paste it in the bottom section +- Paste your list of plugins here (use the 'plugins' command in PocketMine-MP) + +### Crashdump, backtrace or other files +- Do not paste crashdumps into an issue - please use our Crash Archive at https://crash.pmmp.io for submitting crash reports to not spam the issue tracker. Add links to your reports in the Crash Archive here. +- Please use gist or anything else to add other files and add links here + +* ... From 62db7727c042cece8a79cfdca57c5c5d860a1ed0 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 21 Oct 2018 15:23:46 +0100 Subject: [PATCH 3/3] Remove legacy issue template --- .github/ISSUE_TEMPLATE.md | 53 --------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index b2d513eae..000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,53 +0,0 @@ -### Issue description - - - - - -- Expected result: What were you expecting to happen? -- Actual result: What actually happened? - -### Steps to reproduce the issue - -1. ... -2. ... - -### OS and versions - -* PocketMine-MP: -* PHP: -* Server OS: -* Game version: PE/Win10 (delete as appropriate) - -### Plugins -- Test on a clean server without plugins: is the issue reproducible without any plugins loaded? - -If the issue is **not** reproducible without plugins: -- Have you asked for help on our forums before creating an issue? -- Can you provide sample, *minimal* reproducing code for the issue? If so, paste it in the bottom section -- Paste your list of plugins here (use the 'plugins' command in PocketMine-MP) - -### Crashdump, backtrace or other files -- Do not paste crashdumps into an issue - please use our Crash Archive at https://crash.pmmp.io for submitting crash reports to not spam the issue tracker. Add links to your reports in the Crash Archive here. -- Please use gist or anything else to add other files and add links here - -* ...