Skip to content

Commit

Permalink
Merge branch 'minor-next' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Nov 1, 2023
2 parents 68c6b87 + 9832fe8 commit a10e4b6
Show file tree
Hide file tree
Showing 251 changed files with 4,477 additions and 4,488 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ jobs:
- name: Regenerate KnownTranslation APIs
run: php build/generate-known-translation-apis.php

- name: Regenerate RuntimeEnum(De)serializer
run: php build/generate-runtime-enum-serializers.php

- name: Regenerate BedrockData available files constants
run: php build/generate-bedrockdata-path-consts.php

Expand Down
265 changes: 0 additions & 265 deletions build/generate-runtime-enum-serializers.php

This file was deleted.

1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon

rules:
- pocketmine\phpstan\rules\DeprecatedLegacyEnumAccessRule
- pocketmine\phpstan\rules\DisallowEnumComparisonRule
- pocketmine\phpstan\rules\DisallowForeachByReferenceRule
- pocketmine\phpstan\rules\UnsafeForeachArrayOfStringRule
Expand Down
12 changes: 6 additions & 6 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public function getServerUniqueId() : UuidInterface{
}

public function getGamemode() : GameMode{
return GameMode::fromString($this->configGroup->getConfigString(ServerProperties::GAME_MODE, GameMode::SURVIVAL()->name())) ?? GameMode::SURVIVAL();
return GameMode::fromString($this->configGroup->getConfigString(ServerProperties::GAME_MODE)) ?? GameMode::SURVIVAL;
}

public function getForceGamemode() : bool{
Expand Down Expand Up @@ -818,7 +818,7 @@ public function __construct(
ServerProperties::ENABLE_IPV6 => true,
ServerProperties::WHITELIST => false,
ServerProperties::MAX_PLAYERS => self::DEFAULT_MAX_PLAYERS,
ServerProperties::GAME_MODE => GameMode::SURVIVAL()->name(),
ServerProperties::GAME_MODE => GameMode::SURVIVAL->name, //TODO: this probably shouldn't use the enum name directly
ServerProperties::FORCE_GAME_MODE => false,
ServerProperties::HARDCORE => false,
ServerProperties::PVP => true,
Expand Down Expand Up @@ -1020,7 +1020,7 @@ public function __construct(
$this->forceShutdownExit();
return;
}
if(!$this->enablePlugins(PluginEnableOrder::STARTUP())){
if(!$this->enablePlugins(PluginEnableOrder::STARTUP)){
$this->logger->emergency($this->language->translate(KnownTranslationFactory::pocketmine_plugin_someEnableErrors()));
$this->forceShutdownExit();
return;
Expand All @@ -1031,7 +1031,7 @@ public function __construct(
return;
}

if(!$this->enablePlugins(PluginEnableOrder::POSTWORLD())){
if(!$this->enablePlugins(PluginEnableOrder::POSTWORLD)){
$this->logger->emergency($this->language->translate(KnownTranslationFactory::pocketmine_plugin_someEnableErrors()));
$this->forceShutdownExit();
return;
Expand Down Expand Up @@ -1387,14 +1387,14 @@ public function prepareBatch(string $buffer, Compressor $compressor, ?bool $sync
public function enablePlugins(PluginEnableOrder $type) : bool{
$allSuccess = true;
foreach($this->pluginManager->getPlugins() as $plugin){
if(!$plugin->isEnabled() && $plugin->getDescription()->getOrder()->equals($type)){
if(!$plugin->isEnabled() && $plugin->getDescription()->getOrder() === $type){
if(!$this->pluginManager->enablePlugin($plugin)){
$allSuccess = false;
}
}
}

if($type->equals(PluginEnableOrder::POSTWORLD())){
if($type === PluginEnableOrder::POSTWORLD){
$this->commandMap->registerServerAliases();
}

Expand Down
Loading

0 comments on commit a10e4b6

Please sign in to comment.