generated from KessokuTeaTime/Example-Mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
62 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 4 additions & 11 deletions
15
src/main/java/band/kessokuteatime/nightautoconfig/serde/NightDeserializers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
src/main/java/band/kessokuteatime/nightautoconfig/serde/NightSerializers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/band/kessokuteatime/nightautoconfig/serde/deserializers/ColorDeserializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package band.kessokuteatime.nightautoconfig.serde.deserializers; | ||
|
||
import com.electronwill.nightconfig.core.Config; | ||
import com.electronwill.nightconfig.core.serde.DeserializerContext; | ||
import com.electronwill.nightconfig.core.serde.TypeConstraint; | ||
import com.electronwill.nightconfig.core.serde.ValueDeserializer; | ||
|
||
import java.awt.*; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
public class ColorDeserializer implements ValueDeserializer<Config, Color> { | ||
@Override | ||
public Color deserialize(Config value, Optional<TypeConstraint> resultType, DeserializerContext ctx) { | ||
int red = value.get("red"); | ||
int green = value.get("green"); | ||
int blue = value.get("blue"); | ||
int alpha = value.get("alpha"); | ||
return new Color(red, green, blue, alpha); | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
...band/kessokuteatime/nightautoconfig/serde/deserializers/ColorFromIntegerDeserializer.java
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
...ava/band/kessokuteatime/nightautoconfig/serde/deserializers/ColorFromMapDeserializer.java
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
src/main/java/band/kessokuteatime/nightautoconfig/serde/serializers/ColorSerializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package band.kessokuteatime.nightautoconfig.serde.serializers; | ||
|
||
import com.electronwill.nightconfig.core.Config; | ||
import com.electronwill.nightconfig.core.serde.*; | ||
|
||
import java.awt.*; | ||
import java.util.Map; | ||
|
||
public class ColorSerializer implements ValueSerializer<Color, Config> { | ||
@Override | ||
public Config serialize(Color value, SerializerContext ctx) { | ||
Config config = ctx.createConfig(); | ||
config.set("red", value.getRed()); | ||
config.set("green", value.getGreen()); | ||
config.set("blue", value.getBlue()); | ||
config.set("alpha", value.getAlpha()); | ||
return config; | ||
} | ||
} |
13 changes: 0 additions & 13 deletions
13
.../java/band/kessokuteatime/nightautoconfig/serde/serializers/ColorToIntegerSerializer.java
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
...main/java/band/kessokuteatime/nightautoconfig/serde/serializers/ColorToMapSerializer.java
This file was deleted.
Oops, something went wrong.