1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

SRegionProtector

Discussion in 'Plugin Help' started by WylSmart, Dec 4, 2021.

  1. WylSmart

    WylSmart Slime

    Messages:
    93
    Help me, how to fix plugin > SRegionProtector > https://github.com/SergeyDertan/SRegionProtector-pmmp
    it needs to be translated from api 3.8.3 to 4.0.0
    who will help or suggest which code to fix?

    Server.log
    Code:
    2021-12-04 [13:16:26.126] [Server thread/CRITICAL]: Error: "Call to a member function save() on null" (EXCEPTION) in "plugins/SRegionProtector.phar/src/sergeydertan/sregionprotector/main/SRegionProtectorMain" at line 313
    --- Stack trace ---
      #0 plugins/SRegionProtector.phar/src/sergeydertan/sregionprotector/main/SRegionProtectorMain(357): sergeydertan\sregionprotector\main\SRegionProtectorMain->save(integer 2)
      #1 pmsrc/src/plugin/PluginBase(139): sergeydertan\sregionprotector\main\SRegionProtectorMain->onDisable()
      #2 pmsrc/src/plugin/PluginManager(459): pocketmine\plugin\PluginBase->onEnableStateChange(false)
      #3 pmsrc/src/plugin/PluginManager(448): pocketmine\plugin\PluginManager->disablePlugin(object sergeydertan\sregionprotector\main\SRegionProtectorMain#23482)
      #4 pmsrc/src/Server(1430): pocketmine\plugin\PluginManager->disablePlugins()
      #5 pmsrc/src/Server(1614): pocketmine\Server->forceShutdown()
      #6 (): pocketmine\Server->crashDump()
    --- End of exception information ---
    2021-12-04 [13:16:26.127] [Server thread/EMERGENCY]: Crashed while crashing, killing process
    
    and crash.log
    Code:
    File: plugins/SRegionProtector.phar/src/sergeydertan/sregionprotector/messenger/Messenger
    Line: 109
    Type: E_COMPILE_ERROR
    
    THIS CRASH WAS CAUSED BY A PLUGIN
    BAD PLUGIN: SRegionProtector
    
    Code:
    [100]                 }
    [101]                 $target->sendPopup($msg);
    [102]                 break;
    [103]         }
    [104]     }
    [105]
    [106]     public function getMessage(string $msg, array $search = [], array $replace = []): string
    [107]     {
    [108]         foreach ($search as $key => $value) {
    [109]             if ($value{0} !== '{') $value = '{' . $value;
    [110]             if ($value{strlen($value) - 1} !== '}') $value .= '}';
    [111]             $search[$key] = $value;
    [112]         }
    [113]         return isset($this->messages[$msg]) ?
    [114]             str_replace($search, $replace, $this->messages[$msg])
    [115]             : $msg;
    [116]     }
    [117]
    [118]     public function getLanguage(): string
    [119]     {
    
    line 109 messenger.php
    Code:
    public function getMessage(string $msg, array $search = [], array $replace = []): string
        {
            foreach ($search as $key => $value) {
                if ($value{0} !== '{') $value = '{' . $value;
                if ($value{strlen($value) - 1} !== '}') $value .= '}';
                $search[$key] = $value;
            }
            return isset($this->messages[$msg]) ?
                str_replace($search, $replace, $this->messages[$msg])
                : $msg;
        }
    
        public function getLanguage(): string
        {
            return $this->language;
        }
    }
     
  2. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Ask the creators to fix it
     
  3. WylSmart

    WylSmart Slime

    Messages:
    93
    The creator does not have time, and he no longer deals with plugins, he said.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.