You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can either create the `JacksonBukkit` and `JacksonPaper` module directly or use the builder for easy modification.
99
+
You can either create the `JacksonBukkit` and `JacksonPaper` module directly or use the builder for easy modification.
41
100
Usage of the builder is recommended.
42
-
Builder for spigot and paper can both be accessed via the `JacksonBukkit` class.
101
+
Builder for spigot and paper can both be accessed via the corresponding class.
43
102
44
103
### Creating a Spigot/Bukkit Module
45
104
46
105
```java
47
-
ObjectMapperJSON=JsonMapper.builder()
48
-
.addModule(JacksonBukkit.spigot().build())
49
-
.build();
106
+
ObjectMapperJSON=JsonMapper.builder()
107
+
.addModule(JacksonBukkit.builder().build())
108
+
.build();
50
109
```
51
110
52
111
### Creating a Paper Module
53
112
54
113
```java
55
-
ObjectMapperJSON=JsonMapper.builder()
56
-
.addModule(JacksonBukkit.paper().build())
57
-
.build();
114
+
ObjectMapperJSON=JsonMapper.builder()
115
+
.addModule(JacksonPaper.builer().build())
116
+
.build();
58
117
```
59
118
119
+
Of course, you can use TOML or YAML or whatever else jackson supports as well
120
+
60
121
### Difference between Paper and Bukkit module
61
122
123
+
The paper module tries to support all features available by paper.
124
+
The deserializer will automatically detect the current format when a legacy format is used and convert it into the new format when saved.
125
+
Therefore, a config created on 1.15 will contain the legacy map and once teh server is running on 1.16 the byte array will be used instead.
126
+
62
127
Paper serializes `ItemStack`s to a Base64 encoded byte array instead of using spigots serialization.
63
-
This will only work on paper servers and not on spigot servers.
64
-
The builder allows to use spigots serialization on paper servers as well, but this is not recommended.
128
+
This will only work on paper servers on 1.16 or newer and not on spigot servers.
129
+
The builder allows to use spigots serialization on paper servers as well, but this is not recommended.
130
+
131
+
When creating a [paper plugin](https://docs.papermc.io/paper/reference/paper-plugins) the `JacksonBukkit` module is no longer able to serialize `ItemStacks`.
132
+
You need to use `JacksonPaper` in that case and make sure that you are not using legacy serialization.
65
133
66
-
When creating a paper plugin the `JacksonBukkit` module is no longer able to serialize `ItemStacks`.
67
-
you need to use `JacksonPaper` in that case and make sure that you are not using legacy serialization.
0 commit comments