Git Product home page Git Product logo

magiccrates's People

Contributors

hebbinkpro avatar poggit-bot avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

magiccrates's Issues

Change crate type creation to JSON

Currently crate types are created in the config.yml file. While YAML is a great file type for config files, it isn't for large data structures because of the indentation.
To resolve the unclarity of using YAML, crate type creation will move to JSON.

So for example, the yaml file below

types:
  common:
    name: Common Crate
    item: 
        id: minecraft:diamond

Will change into the following

{
    "common": {
        "name": "Common Crate",
        "item": {
            "id": "minecraft:diamond"
        }
    }
}

I hope this change will resolve some of the issues which can occur while creating crates.

To make this change not break servers that already have set up their crates properly, all crates in the config.yml will be converted to JSON automatically.

Keyall Command

I want to suggest a keyall argument. Currently you can only give a key to one palyer at a time, you could add a argument for the player that allows you to give a key to everyone online (if that's possible, idk).

Example: Instead of for instance doing /mc or /magiccrates key common 1 {player name}, you could do /mc or /magiccrates key common 1 all or make a new command such as /mc or /magiccrates keyall common 1.
I personally think this would be a nice addition as currently MagicCrates to my knowldege offers no way to give everyone online a key without having to type out everyones names individually.

Internal Server Error

15:23:39] [Server thread/CRITICAL]: ErrorException: "Undefined index: change" (EXCEPTION) in "plugins/MagicCrates.phar/src/Hebbinkpro/MagicCrates/EventListener" at line 325

[15:23:39] [Server thread/CRITICAL]: #0 plugins/MagicCrates.phar/src/Hebbinkpro/MagicCrates/EventListener(325): pocketmine\utils\Utils::errorExceptionHandler(integer 8, string[23] Undefined index: change, string[92] phar:///home/minecraft/plugins/MagicCrates.phar/src/Hebbinkpro/MagicCrates/Event, integer 325, array[5])

[15:23:39] [Server thread/CRITICAL]: #1 plugins/MagicCrates.phar/src/Hebbinkpro/MagicCrates/EventListener(131): Hebbinkpro\MagicCrates\EventListener->getReward(array[3])

[15:23:39] [Server thread/CRITICAL]: #2 pmsrc/src/pocketmine/plugin/MethodEventExecutor(42): Hebbinkpro\MagicCrates\EventListener->onInteractChest(object pocketmine\event\player\PlayerInteractEvent)

[15:23:39] [Server thread/CRITICAL]: #3 pmsrc/src/pocketmine/plugin/RegisteredListener(80): pocketmine\plugin\MethodEventExecutor->execute(object Hebbinkpro\MagicCrates\EventListener, object pocketmine\event\player\PlayerInteractEvent)

[15:23:39] [Server thread/CRITICAL]: #4 pmsrc/src/pocketmine/event/Event(88): pocketmine\plugin\RegisteredListener->callEvent(object pocketmine\event\player\PlayerInteractEvent)

[15:23:39] [Server thread/CRITICAL]: #5 pmsrc/src/pocketmine/level/Level(1872): pocketmine\event\Event->call()

[15:23:39] [Server thread/CRITICAL]: #6 pmsrc/src/pocketmine/Player(2515): pocketmine\level\Level->useItemOn(object pocketmine\math\Vector3, object pocketmine\item\Item, integer 3, object pocketmine\math\Vector3, object pocketmine\Player, boolean 1)

[15:23:39] [Server thread/CRITICAL]: #7 pmsrc/src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(149): pocketmine\Player->handleInventoryTransaction(object pocketmine\network\mcpe\protocol\InventoryTransactionPacket)

[15:23:39] [Server thread/CRITICAL]: #8 pmsrc/src/pocketmine/network/mcpe/protocol/InventoryTransactionPacket(173): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleInventoryTransaction(object pocketmine\network\mcpe\protocol\InventoryTransactionPacket)

[15:23:39] [Server thread/CRITICAL]: #9 pmsrc/src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(109): pocketmine\network\mcpe\protocol\InventoryTransactionPacket->handle(object pocketmine\network\mcpe\PlayerNetworkSessionAdapter)

[15:23:39] [Server thread/CRITICAL]: #10 pmsrc/src/pocketmine/network/mcpe/protocol/BatchPacket(130): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(object pocketmine\network\mcpe\protocol\InventoryTransactionPacket)

[15:23:39] [Server thread/CRITICAL]: #11 pmsrc/src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(109): pocketmine\network\mcpe\protocol\BatchPacket->handle(object pocketmine\network\mcpe\PlayerNetworkSessionAdapter)

[15:23:39] [Server thread/CRITICAL]: #12 pmsrc/src/pocketmine/Player(3273): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(object pocketmine\network\mcpe\protocol\BatchPacket)

[15:23:39] [Server thread/CRITICAL]: #13 pmsrc/src/pocketmine/network/mcpe/RakLibInterface(169): pocketmine\Player->handleDataPacket(object pocketmine\network\mcpe\protocol\BatchPacket)

[15:23:39] [Server thread/CRITICAL]: #14 pmsrc/vendor/pocketmine/raklib/src/server/ServerHandler(95): pocketmine\network\mcpe\RakLibInterface->handleEncapsulated(string[20] 84.156.207.177 53130, object raklib\protocol\EncapsulatedPacket, integer 0)

[15:23:39] [Server thread/CRITICAL]: #15 pmsrc/src/pocketmine/network/mcpe/RakLibInterface(109): raklib\server\ServerHandler->handlePacket()

[15:23:39] [Server thread/CRITICAL]: #16 pmsrc/src/pocketmine/network/mcpe/RakLibInterface(99): pocketmine\network\mcpe\RakLibInterface->process()

[15:23:39] [Server thread/CRITICAL]: #17 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\network\mcpe\RakLibInterface->pocketmine\network\mcpe{closure}()

[15:23:39] [Server thread/CRITICAL]: #18 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(85): pocketmine\snooze\SleeperHandler->processNotifications()

[15:23:39] [Server thread/CRITICAL]: #19 pmsrc/src/pocketmine/Server(2156): pocketmine\snooze\SleeperHandler->sleepUntil(double 1610807019.8594)

[15:23:39] [Server thread/CRITICAL]: #20 pmsrc/src/pocketmine/Server(1993): pocketmine\Server->tickProcessor()

[15:23:39] [Server thread/CRITICAL]: #21 pmsrc/src/pocketmine/Server(1587): pocketmine\Server->start()

[15:23:39] [Server thread/CRITICAL]: #22 pmsrc/src/pocketmine/PocketMine(272): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[16] /home/minecraft/, string[24] /home/minecraft/plugins/)

[15:23:39] [Server thread/CRITICAL]: #23 pmsrc/src/pocketmine/PocketMine(302): pocketmine\server()

[15:23:39] [Server thread/CRITICAL]: #24 pmsrc(11): require(string[68] phar:///home/minecraft/pocketmine.phar/src/pocketmine/PocketMine.php)

Pocketmine 3.17.2
Magic Crates Dev 31 Latest Build

Configuration is unclear

So i can't configure the chance and the amount separately?
Your plugin has dynamic chances, but it is not clear how to set static chances (if possible)

The default configuration format is also weird, look at dirt, it has two "amount" properties, also, i think the "rewards" property should be an array of objects and not an object of objects, since you don't need a key-value system there.

Consider refactoring the configuration because its so confusing

  "common": {
    "name": "§cCommon §6Crate",
    "rewards": {
      "iron": {
        "name": "Common Iron",
        "amount": 5,
        "item": {
          "id": "iron_ingot"
        }
      },
      "dirt": {
        "name": "Dirt",
        "amount": 15,
        "item": {
          "id": "dirt",
          "amount": 2
        }
      }
    }
  },

[Suggestion] Add multiworld support!!

So here is a suggestion add multiworld support means each world has different crates and keys and make a command which gives player keys in different world like this ex command /magiccrate (cratekeyname) (player) (world)
and also i have perworldinv plugin so does that issue with the plugin if no pls tell and if yes pls even tell and pls add this suggestion it will resolve my 80% issue on my server !!

the key is not lost

The paper key does not disappear when i use it to the crate, but the gacha is working, is it just me experiencing this?

probleme

Whene i place plugin in .zip server crash

Server Crash

[22:51:06.078] [Server thread/INFO]: Enabling MagicCrates v3.1.0
[22:51:06.084] [Server thread/CRITICAL]: Hebbinkpro\MagicCrates\libs\poggit\libasynql\ConfigException: "Config problem: Database settings are missing or incorrect" (EXCEPTION) in "plugins/MagicCrates/src/Hebbinkpro/MagicCrates/libs/poggit/libasynql/libasynql" at line 80
--- Stack trace ---
#0 plugins/MagicCrates/src/Hebbinkpro/MagicCrates/db/DBController(43): Hebbinkpro\MagicCrates\libs\poggit\libasynql\libasynql::create(object Hebbinkpro\MagicCrates\MagicCrates#52122, false, array[2])
#1 plugins/MagicCrates/src/Hebbinkpro/MagicCrates/MagicCrates(123): Hebbinkpro\MagicCrates\db\DBController->__construct(object Hebbinkpro\MagicCrates\MagicCrates#52122)
#2 pmsrc/src/plugin/PluginBase(119): Hebbinkpro\MagicCrates\MagicCrates->onEnable()
#3 pmsrc/src/plugin/PluginManager(454): pocketmine\plugin\PluginBase->onEnableStateChange(true)
#4 pmsrc/src/Server(1404): pocketmine\plugin\PluginManager->enablePlugin(object Hebbinkpro\MagicCrates\MagicCrates#52122)
#5 pmsrc/src/Server(1035): pocketmine\Server->enablePlugins(object pocketmine\plugin\PluginEnableOrder#45232)
#6 pmsrc/src/PocketMine(350): pocketmine\Server->__construct(object pocketmine\thread\ThreadSafeClassLoader#6, object pocketmine\utils\MainLogger#3, string[16] /home/container/, string[24] /home/container/plugins/)
#7 pmsrc/src/PocketMine(373): pocketmine\server()
#8 pmsrc(11): require(string[60] phar:///home/container/PocketMine-MP.phar/src/PocketMine.php)
--- End of exception information ---
[22:51:06.084] [Server thread/EMERGENCY]: An unrecoverable error has occurred and the server has crashed. Creating a crash dump
[22:51:06.089] [Server thread/EMERGENCY]: Please upload the "/home/container/crashdumps/Fri_Mar_29-22.51.06-UTC_2024.log" file to the Crash Archive and submit the link to the Bug Reporting page. Give as much info as you can.

Databases for data storage

Make use of a database to store data like created crates and rewarded players.

This will probably be implemented using the libasynql virion.

This was already planned for a later release, but is required for v3.0.0 to be released on Poggit.

Issues with setting up new crate types

Hi I Am having issues Ettington up new crate types can you show me an example of what it would look like to get 2 or more crate types to appear on the drop down menu

CrateKey duplication glitch

When the user claims the key by interacting with the crate(chest), the key itself doesn’t disappear but it still opens the crate thus allowing users to open unlimited crates.

libs problem

Fatal error: Declaration of Hebbinkpro\MagicCrates\libs\CortexPE\Commando\args\TargetPlayerArgument::parse(string $argument, pocketmine\command\CommandSender $sender) must be compatible with Hebbinkpro\MagicCrates\libs\CortexPE\Commando\args\BaseArgument::parse(string $argument, pocketmine\command\CommandSender $sender): mixed in phar:///root/plugins/MagicCrates_dev-43.phar/src/Hebbinkpro/MagicCrates/libs/CortexPE/Commando/args/TargetPlayerArgument.php on line 31
[12:03:06.284] [Server thread/EMERGENCY]: An unrecoverable error has occurred and the server has crashed. Creating a crash dump
[12:03:06.286] [Server thread/CRITICAL]: TypeError: "Cannot assign null to property pocketmine\crash\CrashDumpData::$thread of type string" (EXCEPTION) in "pmsrc/src/crash/CrashDump" at line 237
--- Stack trace ---
  #0 pmsrc/src/crash/CrashDump(101): pocketmine\crash\CrashDump->baseCrash()
  #1 pmsrc/src/Server(1592): pocketmine\crash\CrashDump->__construct(object pocketmine\Server#13, object pocketmine\plugin\PluginManager#44063)
  #2 (): pocketmine\Server->crashDump()

any idea for this problem? sorry i don't understand.

[Suggestion] One Time Rewards

Can you make it where if someone claims one of the items the player cannot claim it again. This is very helpful for Hub servers with Cosmetics, or when you have a rank in a crate. This should be an optional thing that you can set in the config/form!

add preview menu

best plugin but just doesn't have previews, Can you add preview prize in future features?.

Crate stays locked when inventory is full

I tried opening a crate with a full inventory, so obviously the item couldn't be added to my inventory. The problem is that when I click again on the crate it constantly tells me "You have to wait. Mohagames205 is opening a crate". It's stuck at opening a crate.

crash

Thread: Main
Error: Hebbinkpro\MagicCrates\event\CrateRewardEvent::__construct(): Argument #2 ($player) must be of type pocketmine\player\Player, null given, called in /root/plugins/MagicCrates_dev-44/src/Hebbinkpro/MagicCrates/entity/CrateItem.php on line 75
File: plugins/MagicCrates_dev-44/src/Hebbinkpro/MagicCrates/event/CrateRewardEvent
Line: 17
Type: TypeError
Backtrace:
#0 plugins/MagicCrates_dev-44/src/Hebbinkpro/MagicCrates/entity/CrateItem(75): Hebbinkpro\MagicCrates\event\CrateRewardEvent->__construct(object Hebbinkpro\MagicCrates\crate\Crate#43145, null, object Hebbinkpro\MagicCrates\crate\CrateReward#43201)
#1 pmsrc/src/entity/Entity(1009): Hebbinkpro\MagicCrates\entity\CrateItem->entityBaseTick(int 1)
#2 pmsrc/src/world/World(1055): pocketmine\entity\Entity->onUpdate(int 5426)
#3 pmsrc/src/world/World(978): pocketmine\world\World->actuallyDoTick(int 5426)
#4 pmsrc/src/world/WorldManager(351): pocketmine\world\World->doTick(int 5426)
#5 pmsrc/src/Server(1818): pocketmine\world\WorldManager->tick(int 5426)
#6 pmsrc/src/Server(1700): pocketmine\Server->tick()
#7 pmsrc/src/Server(1076): pocketmine\Server->tickProcessor()
#8 pmsrc/src/PocketMine(334): pocketmine\Server->__construct(object pocketmine\thread\ThreadSafeClassLoader#3, object pocketmine\utils\MainLogger#6, string[6] /root/, string[14] /root/plugins/)
#9 pmsrc/src/PocketMine(357): pocketmine\server()
#10 pmsrc(11): require(string[50] phar:///root/PocketMine-MP.phar/src/PocketMine.php)

Code:
[8]
[9] /**
[10] * Called when the crate reward is given to the player after the opening animation.
[11] /
[12] class CrateRewardEvent extends CrateEvent
[13] {
[14] private Player $player;
[15] private CrateReward $reward;
[16]
[17] public function __construct(Crate $crate, Player $player, CrateReward $reward)
[18] {
[19] parent::__construct($crate);
[20]
[21] $this->player = $player;
[22] $this->reward = $reward;
[23]
[24] }
[25]
[26] /
*
[27] * @return Player

when people try open crate, then i shutdown the server and i turn on again when people joining the crash showing this.

Undefined array key "amount"

[Server thread/CRITICAL]: ErrorException: "Undefined array key "amount"" (EXCEPTION) in "plugins/MagicCrates-main/src/Hebbinkpro/MagicCrates/crate/CrateReward" at line 43
--- Stack trace ---
#0 plugins/MagicCrates-main/src/Hebbinkpro/MagicCrates/crate/CrateReward(43): pocketmine\errorhandler\ErrorToExceptionHandler::handle(int 2, string[28] Undefined array key "amount", string[88] /root/survival/plugins/MagicCrates-main/src/Hebbinkpro/MagicCrates/crate/CrateRe, int 43)
#1 plugins/MagicCrates-main/src/Hebbinkpro/MagicCrates/crate/CrateType(53): Hebbinkpro\MagicCrates\crate\CrateReward::decode(array[3])
#2 plugins/MagicCrates-main/src/Hebbinkpro/MagicCrates/MagicCrates(64): Hebbinkpro\MagicCrates\crate\CrateType::decode(string[5] check, array[2])
#3 plugins/MagicCrates-main/src/Hebbinkpro/MagicCrates/MagicCrates(48): Hebbinkpro\MagicCrates\MagicCrates->loadAllCrates()

[Suggestion] 10x Easier Crate Creation & Alias

Alias

Instead of having to right, /magiccrates, make it easier with, /mc, or /mcs. But still keep /magiccrates!

Crate Creation

This is not adding the crate into the game. This is creating the crate into the game. What I mean by it is when you do /magiccrates edit, you can choose a different subcommand, it opens up a menu showing three options. It'll also kinda remove the purpose of config.yml, but keep it for data storing I guess!
First Option
Creating a crate, this will make it where a crate is created, once clicked it'll open up a text thingy telling you what the name of the crate should be, with color code support.
Second Option
Deleting a crate, this will make it where a crate is removed, once clicked it'll show all the crates in order from how it is in the config.yml. If you click one of the options, it'll it, "Are you sure you want to remove, (crate)", with a yes and no option. If click yes, it'll remove that crate and all the in-game crates that are connected to that crate.
Third Option
Editing a crate, this will make it where a crate is edited, once clicked it'll show all the crates in order from how it is in the config.yml. If you click one of the options it'll open up another three more options, Name, is where you can edit the name and the text of the crate. Add Reward Where you can add a reward, would also be nice if you can add a reward from your inventory. Add Command will add a command from the bottom thingy.

You can also add option one and two into three and make it where you have to do /magiccrates edit (crate) to save you some time!

Problem making muiltpal crates

I dont know if im doing this wrong but when i try putting a 2nd crate in config its just overights the first crate in game and it doesn't show up on the drop down box in /mc create

If you could can you put 2 crates in the config not just 1 as a guide because im not really a coder and it would help a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.