DavyCraft648 / PM-NG

[No longer updated] A fork of NetherGames PocketMine-MP in PM6. Used by KirizaNetwork
GNU Lesser General Public License v3.0
22 stars 4 forks source link

Server crashed #16

Closed GabBiswajit closed 7 months ago

GabBiswajit commented 7 months ago

Frist error : THIS CRASH WAS CAUSED BY A PLUGIN

Thread: Main Error: Call to undefined method pocketmine\block\utils\DyeColor::ORANGE() File: plugins/MultiWorld (1).phar/src/czechpmdevs/multiworld/libs/muqsit/vanillagenerator/generator/ground/MesaGroundGenerator Line: 43

Second: Thread: Main Error: Call to undefined method pocketmine\item\ToolTier::WOOD() File: plugins/BuilderTools (1).phar/src/czechpmdevs/buildertools/BuilderTools Line: 239

GabBiswajit commented 7 months ago

@DavyCraft648

DavyCraft648 commented 7 months ago

This crash is because the deprecated features in PM5 have been removed in PM6, so this is normal

to fix it, you can use php native enums (remove () in that code)

GabBiswajit commented 7 months ago

@DavyCraft648 what about this :??


Error: Cannot make non static method pocketmine\entity\Entity::getNetworkTypeId() static in class muqsit\pmarmorstand\entity\ArmorStandEntity
File: plugins/PMArmorStand-master/src/muqsit/pmarmorstand/entity/ArmorStandEntity
Line: 40
Type: E_COMPILE_ERROR
Backtrace:

Code:
[31] use pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper;
[32] use pocketmine\player\Player;
[33] 
[34] class ArmorStandEntity extends Living{
[35] 
[36]    private const TAG_ARMOR_INVENTORY = "ArmorInventory";
[37]    private const TAG_HELD_ITEM = "HeldItem";
[38]    private const TAG_POSE = "Pose";
[39] 
[40]    public static function getNetworkTypeId() : string{
[41]        return EntityIds::ARMOR_STAND;
[42]    }
[43] 
[44]    protected int $maxDeadTicks = 0;
[45] 
[46]    private ArmorStandPose $pose;
[47]    protected Item $item_in_hand;
[48]    protected bool $can_be_moved_by_currents = true;
[49] 
[50]    /** @var ArmorStandEntityTicker[] */
GabBiswajit commented 7 months ago

There is any Changelogs .?

DavyCraft648 commented 7 months ago

Error: Cannot make non static method pocketmine\entity\Entity::getNetworkTypeId() static in class muqsit\pmarmorstand\entity\ArmorStandEntity

like what the error says, you have to make getNetworkTypeId() method non static

public function getNetworkTypeId() : string{
    return EntityIds::ARMOR_STAND;
}
GabBiswajit commented 7 months ago

I did it but I want to know what is new in this fork like new Coammnds and functions?

DavyCraft648 commented 7 months ago

There is any Changelogs .?

there isn't really an officially written changelog for the version. all you can do is look for it from the commit history

GabBiswajit commented 7 months ago

Ohk but i like this fork thanks for this fork I hope you update this in future also ♥️

GabBiswajit commented 7 months ago

Ahh @DavyCraft648 one more question What should I do now ?? Code : $resource = $plugin->getResource($file);

Error :


Error: Call to undefined method JaxkDev\DiscordAccount\Main::getResource()
File: plugins/FrostDiscord/src/libs/poggit/libasynql/libasynql
Line: 149
Type: Error
Backtrace:
#0 plugins/FrostDiscord/src/Main(51): JaxkDev\DiscordAccount\libs\poggit\libasynql\libasynql::create(object JaxkDev\DiscordAccount\Main#59206, array[4], array[2])
#1 pmsrc/src/plugin/PluginBase(122): JaxkDev\DiscordAccount\Main->onEnable()
#2 pmsrc/src/plugin/PluginManager(454): pocketmine\plugin\PluginBase->onEnableStateChange(true)
#3 pmsrc/src/Server(1450): pocketmine\plugin\PluginManager->enablePlugin(object JaxkDev\DiscordAccount\Main#59206)
#4 pmsrc/src/Server(1081): pocketmine\Server->enablePlugins(object pocketmine\plugin\PluginEnableOrder#45616)
#5 pmsrc/src/PocketMine(350): pocketmine\Server->__construct(object pocketmine\thread\ThreadSafeClassLoader#5, object pocketmine\utils\MainLogger#4, string[16] /home/container/, string[24] /home/container/plugins/)
#6 pmsrc/src/PocketMine(373): pocketmine\server()
#7 pmsrc(11): require(string[60] phar:///home/container/PocketMine-MP.phar/src/PocketMine.php)
DavyCraft648 commented 7 months ago

You can read the description in this commit 97700636c6692f65afd2f4f91e3bede7fe7ed45b

GabBiswajit commented 7 months ago

Can you give me libasynql which work with this fork ??

GabBiswajit commented 7 months ago

$resource = $plugin->getResourcePath("RankSystem/database/RankSystem.db");
            if($resource===null){
                throw new InvalidArgumentException("resources/$file does not exist");
            }
            $connector->loadQueryFile($resource);
        }
GabBiswajit commented 7 months ago

Like this ?? It's also not work

DavyCraft648 commented 7 months ago

um.. no...

depending on the code, you can use fopen() or file_get_contents()

GabBiswajit commented 7 months ago

Can you explain?? Like this : $plugin->file_get_contents($file);

DavyCraft648 commented 7 months ago
$path = $plugin->getResourcePath($file);
if(!file_exist($path)){
    throw new InvalidArgumentException("resources/$file does not exist");
}
$resource = fopen($path);
$connector->loadQueryFile($resource);
fclose($resource);

check this code

GabBiswajit commented 7 months ago

file_exist() method is unfined 😐

GabBiswajit commented 7 months ago

And also this not work ☠️


Thread: Main
Error: fopen() expects at least 2 arguments, 1 given
File: plugins/FrostVaults/src/muqsit/playervaults/libs/poggit/libasynql/libasynql
DavyCraft648 commented 7 months ago

you just need to fix it without waiting for a spoonfed

GabBiswajit commented 7 months ago

☠️ i don't understand what is happening my pc is also dead if you have the libasynql which compatible with this fork than please provide me.

GabBiswajit commented 7 months ago

Sorry for distributing @DavyCraft648 maybe this is the last issue with my plugin help me to slove it.

DavyCraft648 commented 7 months ago

try $resource = fopen($path, "rb");

GabBiswajit commented 7 months ago

Bro ☠️


Thread: Main
Error: fclose(): supplied resource is not a valid stream resource
File: plugins/FrostDiscord/src/libs/poggit/libasynql/libasynql
Line: 152
Type: TypeError
GabBiswajit commented 7 months ago

You don't use libasynql in your server ??

DavyCraft648 commented 7 months ago

https://github.com/poggit/libasynql/blob/master/libasynql/src/poggit/libasynql/generic/GenericStatementFileParser.php#L91

you can remove fclose() in that code because libasynql already closes it here

DavyCraft648 commented 7 months ago

You don't use libasynql in your server ??

From the start, we didn't discuss how to fix libasynql, but how to use getResourcePath() in a plugin

so I'm just giving you an example of how to use it

GabBiswajit commented 7 months ago

Ahhh


Thread: Main
Error: Class "pocketmine\item\enchantment\ItemFlags" not found
File: plugins/PiggyCustomEnchants-PM5/src/DaPigGuy/PiggyCustomEnchants/enchants/CustomEnchant
Line: 74
Type: Error
GabBiswajit commented 7 months ago

Why ItemFlags is removed @DavyCraft648 ?

DavyCraft648 commented 7 months ago

Why ItemFlags is removed

because it's useless. We already have a better enchantment tags system you should be able to safely delete that code, I think

GabBiswajit commented 7 months ago

Code : parent::__construct($this->name, $this->rarity, ItemFlags::ALL, ItemFlags::ALL, $this->maxLevel);

I removed the ItemFlags::ALL??

DavyCraft648 commented 7 months ago

I removed the ItemFlags::ALL

yes

GabBiswajit commented 7 months ago

Almost done last issue:


Thread: Main
Error: Declaration of diamondgold\DummyItemsBlocks\tile\DummyTile::addAdditionalSpawnData(pocketmine\nbt\tag\CompoundTag $nbt): void must be compatible with pocketmine\block\tile\Spawnable::addAdditionalSpawnData(pocketmine\nbt\tag\CompoundTag $nbt, pocketmine\network\mcpe\convert\TypeConverter $typeConverter): void
File: plugins/FrostFakeItems/src/diamondgold/DummyItemsBlocks/tile/DummyTile
Line: 14
Type: E_COMPILE_ERROR
Backtrace:
GabBiswajit commented 7 months ago

@DavyCraft648