Skip to content

Commit 1674d21

Browse files
committed
Update providers
1 parent 20ed4b3 commit 1674d21

9 files changed

Lines changed: 13 additions & 9 deletions

File tree

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plugins {
1313
object Project {
1414
const val NAME = "ConfigAPI"
1515
const val GROUP = "net.j4c0b3y"
16-
const val VERSION = "1.2.6"
16+
const val VERSION = "1.2.8"
1717
}
1818

1919
allprojects {

paper/src/main/java/net/j4c0b3y/api/config/platform/paper/provider/ItemStackProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public ItemStack load(@NotNull LoadContext context) {
104104

105105
return result.ensureServerConversions(); // Paper
106106
}
107-
throw new IllegalStateException("Failed to parse ItemStack");
107+
throw new IllegalStateException("Failed to parse ItemStack: " + context.getObject().getClass().getName());
108108
}
109109

110110
@Nullable

paper/src/main/java/net/j4c0b3y/api/config/platform/paper/provider/LocationProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public Location load(@NotNull LoadContext context) {
2626
}
2727
return new Location(world, (double) map.get("x"), (double) map.get("y"), (double) map.get("z"), (float) map.get("yaw"), (float) map.get("pitch"));
2828
}
29-
throw new IllegalStateException("Failed to parse Location");
29+
throw new IllegalStateException("Failed to parse Location, provided: " + context.getObject().getClass().getName());
3030
}
3131

3232
@NotNull

paper/src/main/java/net/j4c0b3y/api/config/platform/paper/provider/PotionEffectProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ public PotionEffect load(@NotNull LoadContext context) {
3434
(boolean) map.get("has-icon")
3535
);
3636
}
37-
throw new IllegalStateException("Failed to parse PotionEffect");
37+
throw new IllegalStateException("Failed to parse PotionEffect: " + context.getObject().getClass().getName());
3838
}
3939

4040
@Nullable
4141
@Override
4242
public Object save(@NotNull SaveContext<PotionEffect> context) {
4343
Map<String, Object> map = new LinkedHashMap<>();
44-
map.put("effect", context.getObject().getType());
44+
map.put("effect", context.getObject().getType().getKey().asString());
4545
map.put("duration", context.getObject().getDuration());
4646
map.put("amplifier", context.getObject().getAmplifier());
4747
map.put("ambient", context.getObject().isAmbient());

paper/src/main/java/net/j4c0b3y/api/config/platform/paper/provider/PotionEffectTypeProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public PotionEffectType load(@NotNull LoadContext context) {
2525
}
2626
return effect;
2727
}
28-
throw new IllegalStateException("Failed to parse PotionEffectType");
28+
throw new IllegalStateException("Failed to parse PotionEffectType: " + context.getObject().getClass().getName());
2929
}
3030

3131
@Nullable

paper/src/main/java/net/j4c0b3y/api/config/platform/paper/provider/SoundProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public Sound load(@NotNull LoadContext context) {
2525
}
2626
return sound;
2727
}
28-
throw new IllegalStateException("Failed to parse Sound");
28+
throw new IllegalStateException("Failed to parse Sound: " + context.getObject().getClass().getName());
2929
}
3030

3131
@Nullable

paper/src/main/java/net/j4c0b3y/api/config/platform/paper/provider/VectorProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public Vector load(@NotNull LoadContext context) {
3131

3232
return new Vector(x, y, z);
3333
}
34-
throw new IllegalStateException("Failed to parse Vector");
34+
throw new IllegalStateException("Failed to parse Vector: " + context.getObject().getClass().getName());
3535
}
3636

3737
@Nullable

paper/src/main/java/net/j4c0b3y/api/config/platform/paper/provider/WorldProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public WorldReference load(@NotNull LoadContext context) {
1515
if (context.getObject() instanceof String) {
1616
return new WorldReference((String) context.getObject());
1717
}
18-
throw new IllegalArgumentException("Failed to parse world");
18+
throw new IllegalArgumentException("Failed to parse world: " + context.getObject().getClass().getName());
1919
}
2020

2121
@Nullable

0 commit comments

Comments
 (0)