GameMode Inventories
Downloads
I'm too lazy to upload GMI files to Bukkit anymore, as builds are automatically created when the plugin is updated and changes pushed to GitHub.
For 1.18.x, please download GMI from the TARDIS Jenkins server: http://tardisjenkins.duckdns.org:8080/job/GameModeInventories/
Features
GameMode Inventories allows you to have separate inventories for Creative and Survival game modes (it also works for Adventure!).
- Inventories are saved and switched automatically
- Configurable option to save and restore inventories on player death
- Configurable option to also switch XP amount automatically (enabled by default)
- Configurable option to also switch armor automatically (enabled by default)
- Configurable option to also switch Ender Chest inventories automatically (enabled by default)
- Configurable option to restrict inventory opening for Chests, Ender Chests, Enchantment Tables, Anvils, Furnaces and Dispensers in CREATIVE game mode
- Configurable option to disable players dropping items from their inventories in CREATIVE game mode
- Configurable option to disable players from picking up items in CREATIVE game mode
- Configurable option to remove potion effects when switching from CREATIVE to SURVIVAL
- Configurable option turn off the plugin's messages which can get excessive when
no_pickups
andno_drops
are enabled - Configurable option to track the placement of CREATIVE gamemode placed blocks, then either: disable them from being broken, or, allow them to be broken but not drop anything - and also prevent pistons from moving them and deny the block dropping if the attached block is broken - this MUST be enabled for a world to work. You can specify a list of blocks you don't want to track as well
- Configurable option to prevents drops from falling blocks e.g. anvils, gravel, sand
- Configurable option to prevent the breaking of bedrock in CREATIVE, set to false to prevent breaks below Y<5 in all worlds, and Y>122 in the Nether
- Configurable blacklist of blocks that cannot be placed in CREATIVE (use Spigot Material names)
- Configurable blacklist of commands that cannot be used in CREATIVE
- Configurable option to preserve custom attributes when switching inventories (player and armour only)
- Configurable options to set which GMI features can be bypassed
- Configurable option to restrict spectator gamemode access
- Configurable option to switch to a creative world when changing to gamemode CREATIVE
- Localisable messages - edit messages.yml
- Support for using a MySQL database
Created in response to this plugin request: http:forums.bukkit.org/threads/separate-inventories-creative-survival.112187/
Featured in Curse's Minecraft Spotlights
How it works
Add the GameModeInventories.jar file to your server's plugins directory and start up the server. A config file will be created automatically with the default values.
Then all you have to do is switch game modes and your current inventory, armor and XP will be saved and your new game mode inventory will take its place.
What it doesn't do
GameMode Inventories is not a replacement for the Creative Control plugin:
- its primary purpose is an inventory management tool
- this is NOT likely to change anytime soon
- please stop asking
GameMode Inventories is an open sourced project, if you want to make the changes yourself, you are free to do so, as long as the plugin is released under the same license and conditions as GameMode Inventories.
Timings
Please do not bother posting timings for this plugin, here's why:
- See above
- I don't use any of the plugins' 'restriction' features
- You should expect to see GMI working hard if you have
track_creative_place
enabled, this is normal, after all, GMI is watching all your players all the time, and is keeping them all in line while not bothering you. Any server owner will eventually have a problem if he pushes his hardware too much, for example by running lots of heavyweight plugins. - If you do have a problem, the solutions are to either add more RAM/cpu power, re-prioritize your plugins to drop a few you don't desperately need, reduce your max players or seriously think about why you are letting your players have Creative gamemode at all (if you can't trust them not to abuse it, then don't let them have it, or set up a creative only world).
- Finally, don't expect SQLite to be able to handle big loads - if you are running this plugin on a server with
track_creative_place
enabled, you should probably be using MySQL as the GMI database provider
Commands/Configuration
There are several config options:
save_on_death: [true|false] xp: [true|false] armor: [true|false] enderchest: [true|false] remove_potions: [true|false] restrict_creative: [true|false] no_drops: [true|false] no_falling_drops: [true|false] no_pickups: [true|false] dont_spam_chat: [true|false] track_creative_place: enabled: [true|false] break_no_drop: [true|false] no_piston_move: [true|false] attached_block: [true|false] worlds: - world dont_track: - STONE - DIRT creative_blacklist: [true|false] blacklist: - TNT - BEDROCK - LAVA_BUCKET break_bedrock: [true|false] command_blacklist: [true|false] commands: - give - i - buy - sell custom_attributes: [true|false] bypass: inventories: [true|false] items: [true|false] blacklist: [true|false] survival: [true|false] commands: [true|false] restrict_spectator: [true|false]
You can enable/disable the options with a command (all options are available via tab completion):
/gmi save_on_death /gmi xp /gmi armor /gmi enderchest /gmi remove_potions /gmi restrict_creative /gmi restrict_spectator /gmi no_drops /gmi no_pickups /gmi dont_spam_chat /gmi track_creative_place /gmi break_no_drop /gmi attached_block /gmi break_bedrock /gmi creative_blacklist /gmi command_blacklist /gmi no_falling_drops /gmi custom_attributes /gmi bypass.inventories /gmi bypass.items /gmi bypass.blacklist /gmi bypass.survival /gmi bypass.commands
Permissions
There are four:
gamemodeinventories.use
Default: true - Allow players to have separate inventories for each game mode
gamemodeinventories.death
Default: op - Allow players to save their inventories on death, and restore them on respawn
gamemodeinventories.bypass
Default: op - Allow players to bypass inventory opening restrictions in CREATIVE (when restrict_creative: true
). Also allow players to bypass the no items drops / no item pickups restriction (when no_drops: true
or no_pickups: true
). As of version 2.5.4, you can configure which features can be bypassed:
inventories
- if true players can bypass not being able to open inventories in creativeitems
- if true players can bypass not being able to pick up and drop items in creativeblacklist
- if true players can bypass not being able to place and use restricted block and items in creativesurvival
- if true players can bypass being forced into survival gamemode when changing worldscommands
- if true players can bypass not being able to place and use restricted commands- If any of the bypass options are set to false, then nobody will be able to bypass them (regardless of whether they have the permission or not)
gamemodeinventories.admin
Default: op - Allow players to change config options
Source code
Dev builds
Development builds of this project can be acquired at the provided continuous integration server.
These builds have not been approved by the BukkitDev staff. Use them at your own risk.
@cuddyier
This: a major risk for e.g. players doing any creative actions right after it booting
Question, is your MySQL server on the same server as the Minecraft server, or are you using a remote one?
I watched the server processes pretty closely on my test server when running your million+ block records. It peaked quite high for about a minute at startup, then the mysqld process settled down to a maximum of 4% as it loaded the rest of the blocks gradually. There were no problems logging in, or placing / breaking blocks / switching gamemodes. In my case MySQL runs on the same machine.
@eccentricnz
I tried it again today and still unusable unfortunately.
I set the pool to 30 but it just sits on this on startup:
[Server thread] INFO com.zaxxer.hikari.HikariDataSource - HikariCP pool HikariPool-0 is starting.
Older versions don't have any delay on startup at all, continued booting after around a minute or two. Was impossible to actually join once booted. MySQL process showed using 700% CPU for 10 minutes but then calmed down and went back to normal which I assume was the caching process. Is there anyway to slow down that process so the server isn't affected so much when it is booting and has finished booting and gradually do it after it's booted or is that a major risk for e.g. players doing any creative actions right after it booting? I just tried to break a creative block and CPU went back to 700% for the MySQL process and finally brought up the message about it being a creative block after 30 seconds.
Edit: Tried all sorts of pool sizes, 7, 10, 30, 40 and they all seem to just spam http://pastie.org/pastes/10332219/text?key=dmrfas0orykeymwz1mjhjw and have MySQL CPU issues causing in game to be unplayable for all players when someone puts down e.g. a creative block or tries to switch gamemode.
@Adamon69
OR
If your survival and PVP worlds share an inventory, you probably don't need MVI at all, just let the gamemode change separate the inventories between the creative world and the other two survival worlds.
@Adamon69
multiverse-inventories and Gamemode-inventories are not really compatible together, I would suggest just using the gamemode features of MVI - in the MVI config set
use_game_mode_profiles: true
Using multiverse-inventories and Gamemode-inventories. I have 3 worlds: survival, pvp and creative. Players can set a home in survival do /spawn and goto creative fill up on diamonds then do /home. And everything works right. They do it again and they end up with diamonds in survival.
How can i fix this?
@eccentricnz
I'm using Spigot yeah, I'll test out the pooling option.
@cuddyier
Yes, that is what I have already done, it only loads the blocks for the loaded chunks, and then as other chunks load, it does those. In your case that initially still seems to be over 10,000 records...
I've done some further testing here, and it seems as though increasing the
pool_size
to 30 helped, as did using Spigot rather than CraftBukkit.@eccentricnz
Is there anyway you can add any sort of caching? I know that helped an awful lot with the creative control plugin that became inactive quite some time ago before I started using your plugin. (Or is that caching that occurs at the start already, if so, would slowing it down to only the chunks players are in help?)
@cuddyier
Looks like it is struggling to get a connection. I had similar issues working with your database for a while, but with the latest build I managed to get them to go away. The server will most likely be under load and pretty slow when the first player logs in (and it tries to get a lot of connections while it loads creative placed blocks for protection), but it should smooth out after that.
Here's the last log from my test server running your massive blocks table: https://dl.dropboxusercontent.com/u/53758864/latest.log
I'm not sure there is much more I can do, in the case where there are so many block records (you have millions). I've seriously reduced the initial load that was occurring at startup down to less than 10% of what it was (in your case).
@eccentricnz
It now loads fine on startup however when startup has finished, the server is joinable but frozen. Here is the errors that then spam: http://pastie.org/pastes/10324577/text?key=9pcoh7swzruu4f2tab75qq
@cuddyier
New build available on Jenkins
@eccentricnz
I've PMed you with table dumps.
@cuddyier
Would you be able to do a dump of your GMI MySQL tables and put them on DropBox or similar (or attach to a ticket). I'll then be able to import them into my server and and be able to troubleshoot what is going on much more easily.
You can ignore the
HikariCP pool HikariPool-0 is starting
warning that is normalWill see what is up with the test_connection setting, but it shouldn't affect the 100% CPU usage problem anyway. EDIT: test_connection error is now fixed
@eccentricnz
Thank you.
I just loaded it up and it said it was converting block data then:
[GameModeInventories] Blocks conversion successful :)
However my MySQL database seems to be in overdrive as the MySQL process is sitting at 100% CPU usage and no users can join.
I just restarted and it's not letting anyone join the server and MySQL is in overdrive again, I have an awful lot of block data stored.
[01:40:37 INFO]: [GameModeInventories] Enabling GameModeInventories v2.8 [01:40:37 WARN]: [Server thread] INFO com.zaxxer.hikari.HikariDataSource - HikariCP pool HikariPool-0 is starting.
Is the last it said on the 2nd restart.
EDIT: I checked the config and see the following values:
blocks_conversion_done: true uuid_conversion_done: true
What is it trying to do now then if it has finished converting?
EDIT 2: I restarted the mysql server while the server was starting and it continued booting and GMI functioned fine using MySQL. If I restart then the same scenario occurs where I have to restart MySQL for the server to become unstuck.
Enabling setting test_connection to true shows this error: http://pastie.org/pastes/10323165/text?key=1dypve4ymqjfuvwik5sq
@cuddyier
There is a new build on the Jenkins server that has updates for MySQL in it - it seems to work OK for me (but according to http://dev.bukkit.org/bukkit-plugins/gamemodeinventories/?comment=599 I have no idea what I'm talking about lol). Feedback welcome.
There are a couple of minor changes in the config, namely:
pool_size
should probably never be more than 10, lowering this value may help (if you want to know more read https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing)test_connection
- set this to true if the MySQL server seems to be dropping the connection (but it will be slower). Mine is set to false with no issues.url
option has been removed in favour of separate entries, but the config should update itself based on the old setting.@Nicky911
That plugin will dupe a players Inventory when logging out and back on...tried it.
@cuddyier
Plugin is very bad for 1.8 version. I have this problem, but remove this and use MultiInv. Better plugin than this. Normal load and no problems(no high cpu usage). I open ticket and mentor of this plugin say: I have zero lag, pffff he has zero lag od zero players. Witch plugin for creative use? CreativeControl/LimitedCreative? MultiInv: http://dev.bukkit.org/bukkit-plugins/multiinv/ Use and enjoy!
My server's TPS is getting to the point where everyone gets kicked: http://timings.aikar.co/?url=11732821
Is there absolutely nothing you can do? The server is unusable while the plugin is installed.
Problem with plugin GamemodeInventories. When you replace gamemode, survival / creative then the server breaks a few seconds and load increases, TPS falls, and I have a few things in plug config.yml, look at TIMINGS.
Timings: http://timings.aikar.co/?url=11702090
My config.yml: http://pastebin.com/pbpYf3wp
Please tell me how to fix, or update new version, which will be a problem repaired. Problem is when shifted gamemode, shows TIMINGS. Version 2.7.3 Version2: 2.8 - Jenkins, NO CHANGES.
@windowsxp925
track_creative_place.dont_track_is_whitelist
isfalse