Dreamworld
Dreamworld
Looking for maintainer!
The plugin is quite outdated. Unfortunly I am too buisy with other projects currently. So if you want to help out by picking up this project and fixing its issues, let me know.
What is this?
Dreamworld gives players the chance to wake up in an other, specified "dream" world when they leave their bed.
The dream world has to be specified in the config. If the plugin does not find a world with the specified name, it will automatically attempt to load or even create this world at startup. The default worldname is "dreamworld".
If you want to use a custom world generator for your dream world, I suggest you to first create the world via one of the popular world management plugins (like for example Multiverse).
By default, when a player starts dreaming, their stuff (inventory and other player-state-information) is stored in memory, they are cleared, teleported to a random spawn location (or the dreamworld's spawn location, if you didn't set up random spawn locations yet) and they get assigned some potion effects (high jump, short view range, speed, confusion, etc..) to create some sort of dreaming-impression.
You can configure those potion effects in the config file by the way, together with a lot of other stuff. See below for a complete overview of the configurable features.
After a random time (specified by the config) they get teleported back and restored to their old state.
To handle quits or server restarts during dreams, the plugin ends the dream in those situations (the player gets teleported back and restored). But before that happens the plugin saves the player's current dream-state (his items, effects, location, remaining dream duration, etc.) to file for later continuation (when the player logs back in or the plugin gets enabled again).
In the config there is a option which determines after how many minutes the plugin shall purge those saved dream-states (default: after about 3 days).
If you want to edit the messages which are print to the normal users in certain situations, take a look at the messages.yml file.
What next?
This are the very first basic features for now. But the potential for additional features are endless for that dream scenario. Possible ideas are:
nightmares, dream escapes, treasures, scenarios, tasks, option to make dreaming players invisible for each other, blocking chat, etc..
If I get the time I might add some of them in future releases.
Or if you want to add something: the source code is on github and you are free to make pull requests.
Commands
Not needed in general but maybe helpful..
- /dw help - Command list.
- /dw setspawn - Sets the spawn location of your current world.
- /dw dspawn - Teleports you to the dream world.
- /dw spawn - Teleports you to the main world's spawn.
- /dw addspawn - Adds your current location to the list of random dream spawns.
- /dw clearspawns - Clears the list of random dream spawns.
Permissions
- dreamworld.dream: Ability to dream. default: true
- dreamworld.admin: Access to the admin commands. default: op
The default configuration file with explanations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
#--------------------------------# # Dreamworld | #--------------------------------# # All dream settings: dream: # If no world with this name exists, it will create one. # If you want to use a custom generator, I suggest you to first generate the dream world with a plugin like Multiverse. world name: 'dreamworld' # Whether or not animals and monsters shall spawn: no animal spawning: true no monster spawning: false # The chance that leaving a bed leads to a dream (between 0 and 100): chance: 25 # The minimal and maximal durations for dreams in seconds: min duration in seconds: 25 max duration in seconds: 300 # Whether or not the player shall spawn at one of the random spawns when he starts dreaming, instead of the dream worlds spawn: spawn randomly each time: true random spawns: [] # The gamemode, health, hunger and potion effects a player starts with: gamemode: apply: true initial gamemode: 2 health: apply: true initial health: 20.0 hunger: apply: true initial hunger: 20 potion effects: apply: true initial potion effects: SLOW_DIGGING: duration: 2147483647 level: 20 JUMP: duration: 2147483647 level: 10 SPEED: duration: 2147483647 level: 2 CONFUSION: duration: 2147483647 level: 1 NIGHT_VISION: duration: 2147483647 level: 100 BLINDNESS: duration: 2147483647 level: 100 # Whether or not the player shall be completely cleared on enter and restored on exit: clear and restore player: true # Purge saved dream data after this amount of minutes (should be higher than the max dream duration): purge saved dream data after x minutes: 4320 # If the remaining dream seconds are less than those of this setting, the player will skips those remaining seconds if he disconnects or attempts to continue his dream on login: ignore if remaining seconds is lower than: 10 # Whether or not the player's personal visual time shall be modified: fake client time: enabled: true # The time to which the client will be set: time (in ticks): 12000 # Set the time randomly instead? These bounds determine how much the time will randomly differ from the time defined above: random bounds: 0 # The client's time will not change during the dream with this enabled: fixed time: true # Whether or not it shall rain for the dreaming player: fake client weather: raining: true # Whether or not it shall randomly pick one of the sounds from the list below and play it at dream start: dream start sound: enabled: true # format: "sound;volumn;pitch" random sounds list: - "AMBIENCE_CAVE;1.0;1.0;" - "WITHER_SPAWN;1.0;1.0" # Disable various stuff for the dreaming player: disabled: hunger: true # Damage settings: If the player dies, he leaves his dream. If the player falls into the void but all damage is disable, he will be respawned at some dream spawn. fall damage: true entity damage: true all damage: true item dropping: false item pickup: false weather: false block placing: false block breaking: false # A list of allowed commands. All other commands are blocked for non-admin players. Make sure to not put any kind of teleportation command in here: allowed commands: - '/list' - '/msg' - '/m' - '/r' - '/reply' - '/tell' - '/whisper' - '/login' - '/register' |
Bugs found? Or having an idea?
Then please create a ticket.
Morning! I've checked your suggestion and it seems to be working fine ;].
It's a good solution for now, but later on please try to fix it all together, because in the very rare case, when my users will try to sleep while in creative world or creative area, it might get messed up.
Edit:
On the other hand why would they care about their inventory in creative...
@MikeGold
4:47 in the morning here for me ;)
Good one. I'll check it out... In the morning. It's 2:27 here.
@MikeGold
Hm.. strange. I will probably have to do some testing myself.
For now you could probably fix for your cases by setting the dream gamemode to survival (0) instead of adventure (2). So if a player dreams (and is in survival mode) the gamemode shouldn't change when he switches to his dream, and therefore limited creative shouldn't have to change inventories either.
It's still messed up with limited creative on. After removing l.c. your plugin works as it should.
v1.2
@nullschritt
Will be fixed in the next version.
Will look into this now, if I find a problem, it will be fixed too in the next version.
@MikeGold
The "random bounds" option doesn't seem to have any effect either/
@nullschritt
Leave the blindness in the config, just set the time and level of it as 1.
@blablubbabc
I got it working but the plugin seems to force blindness on the dream user even if it's not specified in the config file.
Thanks. I'll be waiting for an update ;].
@MikeGold
LimitedCreative is properly saving and restoring the inventory himself, when the players gamemode changes.
I guess I can fix this problem by changing the order how dreamworld clears the inventory and changes the gamemode on dream start and end.
Ok. I've finished checking it out. I've got two news.
Good one is that I've checked your plugin against 42 others and it worked perfectly with 41 of them.
Bad news is that the plugin causing problems is "limited creative" which is quite important on my server. Limited creative lets you pick the cuboids in a survival world which are creative. You can't place anything out of those cuboids without changing game mode or take anything out from them. I'm a bit clueless about how to overcome that issue... I'll try to see if the author posted any update on that plugin first.
Edit: I've checked the most recent version and it's still messed up.
@MikeGold
Maybe you have something running like Multiverse-Inventories, wjhich switches inventories on world change?
If this is the case, you can disable this by grouping worlds together with multiverse inventories, somehow.
And additionally I will try to move code execution order (first teleport, then save, etc.) a bit, maybe that helps.
Or you just disable "save/restore inventory" if you use Multiverse Inventories for that anyways.
Ok. I've checked it on my test server with no extra plugins and it worked.
On my main server there is a strange issue though:
1. You fall asleep and all your items disappear.
2. You wake up they don't reappear.
3. You fall asleep and all your items reappear... in the dream just to disappear again when you wake up.
Now I'll be switching off plugins one after another to find the one that is glitching yours.
@MikeGold
I just tested it by jumping into the void with all damage enabled, and it properly restored my inventory and spawned me at my bed.
Maybe you have disable inventory storing/restoring in the config? Or do you have any other error or warning in your log which could expaling the different behavior?
@nullschritt
For me changing sutff in the config works, as long as the config has no mistakes in it.
Your config seems to have a mistake and it should print a giant error in the log because of that:
You added the potion effect of type "STRENGTH", but in bukkit there is no potion effect type STRENGTH (i guess you meant "INCREASE_DAMAGE" instead).
You can find a full list of valid potion effect types here: http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html
I will print a proper error message in the next version, if a potion effect type is invalid.
@blablubbabc
It seems any config other than the default config causes the plugin to stop working....
here is another formatted example:
http://pastebin.com/hqBqN4xF
Ok. I'm not dying after waking up anymore, which is cool, but I'm not getting my inventory back either, which is not so cool.
@MikeGold
Dieing should be fixed in v1.1 Would help me, if you can confirm that.