summaryrefslogtreecommitdiffstats
path: root/Essentials/src/net/ess3/settings/Settings.java
blob: f5d87ba204198913382813055e801d1ab666698f (plain)
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
package net.ess3.settings;

import java.util.HashMap;
import java.util.Map;
import lombok.Data;
import lombok.EqualsAndHashCode;
import net.ess3.storage.Comment;
import net.ess3.storage.MapValueType;
import net.ess3.storage.StorageObject;


@Data
@EqualsAndHashCode(callSuper = false)
public class Settings implements StorageObject
{
	@Comment(
	{
		"##########################################################",
		"+------------------------------------------------------+ #",
		"|                 General Settings                     | #",
		"+------------------------------------------------------+ #",
		"##########################################################"
	})
	private General general = new General();
	@Comment(
	{
		"##########################################################",
		"+------------------------------------------------------+ #",
		"|                  Chat Settings                       | #",
		"+------------------------------------------------------+ #",
		"##########################################################"
	})
	private Chat chat = new Chat();
	@Comment(
	{
		"##########################################################",
		"+------------------------------------------------------+ #",
		"|                 Economy Settings                     | #",
		"+------------------------------------------------------+ #",
		"##########################################################"
	})
	private Economy economy = new Economy();
	@Comment(
	{
		"##########################################################",
		"+------------------------------------------------------+ #",
		"|                 Commands Settings                    | #",
		"+------------------------------------------------------+ #",
		"##########################################################"
	})
	private Commands commands = new Commands();
	@Comment(
	{
		"##########################################################",
		"+------------------------------------------------------+ #",
		"|                  Worlds Settings                     | #",
		"+------------------------------------------------------+ #",
		"##########################################################"
	})
	@MapValueType(WorldOptions.class)
	private Map<String, WorldOptions> worlds = new HashMap<String, WorldOptions>();

	public WorldOptions getWorldOptions(final String name)
	{
		if (worlds == null)
		{
			worlds = new HashMap<String, WorldOptions>();
		}
		final WorldOptions options = worlds.get(name);
		return (options == null) ? new WorldOptions() : options;
	}
}