From f4164e5a43fd071a02bfb797c4bddeda14d053ad Mon Sep 17 00:00:00 2001 From: Mgazul Date: Sun, 28 Jan 2024 12:40:01 +0700 Subject: [PATCH] Fixed #220 --- .../com/mohistmc/banner/mixin/world/level/MixinLevel.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/mohistmc/banner/mixin/world/level/MixinLevel.java b/src/main/java/com/mohistmc/banner/mixin/world/level/MixinLevel.java index 19aa5302e..cf3a0bb1d 100644 --- a/src/main/java/com/mohistmc/banner/mixin/world/level/MixinLevel.java +++ b/src/main/java/com/mohistmc/banner/mixin/world/level/MixinLevel.java @@ -132,8 +132,10 @@ public abstract class MixinLevel implements LevelAccessor, AutoCloseable, Inject @Inject(method = "", at = @At("RETURN")) private void banner$init(WritableLevelData info, ResourceKey dimension, RegistryAccess registryAccess, Holder dimType, Supplier profiler, boolean isRemote, boolean isDebug, long seed, int maxNeighborUpdates, CallbackInfo ci) { - this.banner$setSpigotConfig(new SpigotWorldConfig(BukkitExtraConstants.getServer().storageSource.getDimensionPath(dimension).getFileName().toFile().getName())); - this.banner$setBannerConfig(new BannerWorldConfig(BukkitExtraConstants.getServer().storageSource.getDimensionPath(dimension).getFileName().toFile().getName())); + if ((Object) this instanceof ServerLevel) { + this.banner$setSpigotConfig(new SpigotWorldConfig(BukkitExtraConstants.getServer().storageSource.getDimensionPath(dimension).getFileName().toFile().getName())); + this.banner$setBannerConfig(new BannerWorldConfig(BukkitExtraConstants.getServer().storageSource.getDimensionPath(dimension).getFileName().toFile().getName())); + } for (SpawnCategory spawnCategory : SpawnCategory.values()) { if (CraftSpawnCategory.isValidForLimits(spawnCategory)) { this.ticksPerSpawnCategory.put(spawnCategory, this.getCraftServer().getTicksPerSpawns(spawnCategory));