VirtualChest - A sponge plugin providing virtual chest GUIs for menus like ChestCommands


#62

I know it says placeholderAPI is recommended, but the examples that are currently up use it and cause warnings.

[00:03:34] [Server thread/WARN] [virtualchest]: Cannot apply field 'RepresentedPlayer' to the item, ignore it.
org.spongepowered.api.data.persistence.InvalidDataException: ninja.leaping.configurate.objectmapping.ObjectMappingException: Invalid UUID string: %player_uuid%
        at com.github.ustc_zzzz.virtualchest.inventory.item.VirtualChestItemStackSerializer.deserializeForKeys(VirtualChestItemStackSerializer.java:104) ~[VirtualChestItemStackSerializer.class:?]
        at com.github.ustc_zzzz.virtualchest.inventory.item.VirtualChestItemStackSerializer.deserializeItemFrom(VirtualChestItemStackSerializer.java:185) ~[VirtualChestItemStackSerializer.class:?]
        at com.github.ustc_zzzz.virtualchest.inventory.item.VirtualChestItemStackSerializer.apply(VirtualChestItemStackSerializer.java:151) ~[VirtualChestItemStackSerializer.class:?]
        at com.github.ustc_zzzz.virtualchest.inventory.item.VirtualChestItem.fillInventory(VirtualChestItem.java:135) ~[VirtualChestItem.class:?]
        at com.github.ustc_zzzz.virtualchest.inventory.VirtualChestInventory.setItemInInventory(VirtualChestInventory.java:150) ~[VirtualChestInventory.class:?]
        at com.github.ustc_zzzz.virtualchest.inventory.VirtualChestInventory.updateInventory(VirtualChestInventory.java:138) ~[VirtualChestInventory.class:?]
        at com.github.ustc_zzzz.virtualchest.inventory.VirtualChestInventory.access$400(VirtualChestInventory.java:45) ~[VirtualChestInventory.class:?]
        at com.github.ustc_zzzz.virtualchest.inventory.VirtualChestInventory$EventListener.lambda$fireOpenEvent$0(VirtualChestInventory.java:284) ~[VirtualChestInventory$EventListener.class:?]
        at org.spongepowered.common.scheduler.SchedulerBase.lambda$startTask$0(SchedulerBase.java:186) ~[SchedulerBase.class:1.12.2-2611-7.1.0-BETA-3002]
        at org.spongepowered.common.scheduler.SyncScheduler.executeTaskRunnable(SyncScheduler.java:70) ~[SyncScheduler.class:1.12.2-2611-7.1.0-BETA-3002]
        at org.spongepowered.common.scheduler.SchedulerBase.startTask(SchedulerBase.java:179) ~[SchedulerBase.class:1.12.2-2611-7.1.0-BETA-3002]
        at org.spongepowered.common.scheduler.SchedulerBase.processTask(SchedulerBase.java:165) ~[SchedulerBase.class:1.12.2-2611-7.1.0-BETA-3002]
        at java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4707) [?:1.8.0_151]
        at org.spongepowered.common.scheduler.SchedulerBase.runTick(SchedulerBase.java:108) [SchedulerBase.class:1.12.2-2611-7.1.0-BETA-3002]
        at org.spongepowered.common.scheduler.SyncScheduler.tick(SyncScheduler.java:44) [SyncScheduler.class:1.12.2-2611-7.1.0-BETA-3002]
        at org.spongepowered.common.scheduler.SpongeScheduler.tickSyncScheduler(SpongeScheduler.java:185) [SpongeScheduler.class:1.12.2-2611-7.1.0-BETA-3002]
        at org.spongepowered.mod.SpongeMod.onTick(SpongeMod.java:278) [SpongeMod.class:1.12.2-2611-7.1.0-BETA-3002]
        at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_24_SpongeMod_onTick_ServerTickEvent.invoke(.dynamic) [?:?]
        at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) [ASMEventHandler.class:?]
        at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:651) [EventBus.class:?]
        at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:589) [EventBus.class:?]
        at net.minecraftforge.fml.common.FMLCommonHandler.onPreServerTick(FMLCommonHandler.java:278) [FMLCommonHandler.class:?]
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:655) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:524) [MinecraftServer.class:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
Caused by: ninja.leaping.configurate.objectmapping.ObjectMappingException: Invalid UUID string: %player_uuid%
        at com.github.ustc_zzzz.virtualchest.inventory.item.VirtualChestItemStackSerializer$GameProfileSerializer.getUUIDByString(VirtualChestItemStackSerializer.java:311) ~[VirtualChestItemStackSerializer$GameProfileSerializer.class:?]
        at com.github.ustc_zzzz.virtualchest.inventory.item.VirtualChestItemStackSerializer$GameProfileSerializer.deserialize(VirtualChestItemStackSerializer.java:323) ~[VirtualChestItemStackSerializer$GameProfileSerializer.class:?]
        at com.github.ustc_zzzz.virtualchest.inventory.item.VirtualChestItemStackSerializer$GameProfileSerializer.deserialize(VirtualChestItemStackSerializer.java:269) ~[VirtualChestItemStackSerializer$GameProfileSerializer.class:?]
        at ninja.leaping.configurate.SimpleConfigurationNode.getValue(SimpleConfigurationNode.java:226) ~[spongeforge-1.12.2-2611-7.1.0-BETA-3002.jar:1.12.2-2611-7.1.0-BETA-3002]
        at ninja.leaping.configurate.ConfigurationNode.getValue(ConfigurationNode.java:356) ~[spongeforge-1.12.2-2611-7.1.0-BETA-3002.jar:1.12.2-2611-7.1.0-BETA-3002]
        at com.github.ustc_zzzz.virtualchest.inventory.item.VirtualChestItemStackSerializer.deserializeForKeys(VirtualChestItemStackSerializer.java:99) ~[VirtualChestItemStackSerializer.class:?]
        ... 24 more

Think should make some examples without placeholder API, cause or else new server owners could freak at the warning spam not knowing what to make of it.


#63

Wondering if its possible to open a menu with a command like /warps where it would open a menu with warps instead of trigger items


#64

Yep, this is my /worlds command for my server, can do something similar for warps.


#65

@tridaak Can you please show me a screenshot of how you managed to do that please


#66

https://paste.md-5.net/degiqedose.cpp
So that’s the config file, saved as worlds.conf

Then on virtualchest.conf I have

command-aliases {
  worlds=worlds
}

And lastly on spoge’s global.conf have

    aliases {
        worlds=virtualchest
    }

I did the same thing with https://ore.spongepowered.org/HDR/Player-Glow
Here’s the result

That’s the great thing about this plugin, you’re able to make item GUIs for plugins that don’t have them and often gives you better control over options than the regular plugin. I can adjust it so only certain people see certain items, adjust costs, cooldowns, run various commands at once, etc. And the great thing is that it doesn’t take a whole lot of work; players appreciate that extra bit of effort that owners put in and makes your server stand out.


#67
Slot10 = [{
    Item {
        Count = 1
        ItemType = "pixelmon:pixelmon_sprite"
        UnsafeDamage = 0
        DisplayName = "&b%trainer_team_1% &8&l: &eLvl %trainer_team_1_level%"
        ItemLore = [
			"&7Slot ID: &e1"
			"&7Owner: &e%player%"
			""
			"&7Ability: &e%trainer_team_1_ability%"
			"&7Nature: &e%trainer_team_1_nature%"
			""
			"&7Holding: &e%trainer_team_1_helditem%"
			"&7Gender: &e%trainer_team_1_gender%"
			"&7Size: &e%trainer_team_1_growth%"
        ]
    UnsafeData {
        SpriteName = "%trainer_team_1_texturelocation%"
    }
    }
    KeepOpen = false
    PrimaryAction {
        Command = "console: virtualchest open wtslot1 %player%"
        KeepInventoryOpen = true
    }
    Requirements = "%trainer_team_1% != ''"
}, {
    Item {
        Count = 1
        ItemType = "minecraft:barrier"
        UnsafeDamage = 0
        DisplayName = "&cNo Pokemon in Party Slot: &71"
    }
}]

Here is an example of how I done it for Wondertrade GUI. Hope it helps.


#68

Will this ever get a way to make your gui’s in-game instead of in the config?


#69

A new version has been released for VirtualChest, it is available for download here.


  • Fix a bug caused by connecting to the database in the main thread
  • Add filtering (blacklist mode or whitelist mode) for recording actions

#70

A new version has been released for VirtualChest, it is available for download here.


  • Make the update warning messages look better (please refer to 5133379)
  • Add the first version of VirtualChestAPI, which could be obtained by maven repository or direct download (please refer to the wiki)
  • Forcely depend on PlaceholderAPI v4.0+, so v1.0.0-rc-1 and future versions will not support servers without PlaceholderAPI or with PlaceholderAPI v3.x only

#71

https://pastebin.com/gzvmgRCb

any help with this crash