diff --git a/src/main/java/com/mohistmc/banner/mixin/server/level/MixinServerLevel.java b/src/main/java/com/mohistmc/banner/mixin/server/level/MixinServerLevel.java index 9b0c7d028..ac86681cb 100644 --- a/src/main/java/com/mohistmc/banner/mixin/server/level/MixinServerLevel.java +++ b/src/main/java/com/mohistmc/banner/mixin/server/level/MixinServerLevel.java @@ -258,11 +258,6 @@ public int sendParticles(ServerPlayer sender, T t0, return strikeLightning(entityIn, LightningStrikeEvent.Cause.WEATHER); } - @Redirect(method = "tickChunk", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;isThundering()Z")) - private boolean banner$thunderChance(ServerLevel instance) { - return this.isRaining() && this.isThundering() && this.bridge$spigotConfig().thunderChance > 0; - } - @ModifyConstant(method = "tickChunk", constant = @Constant(intValue = 100000)) private int banner$configChane(int constant) { return this.bridge$spigotConfig().thunderChance; 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 0682bba70..bb01c183a 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 @@ -384,6 +384,13 @@ public void notifyAndUpdatePhysics(BlockPos blockposition, LevelChunk chunk, Blo // CraftBukkit end } + @Inject(method = "isThundering", at = @At("HEAD"), cancellable = true) + private void banner$isThundering(CallbackInfoReturnable cir) { + if (spigotConfig != null && spigotConfig.thunderChance <= 0) { + cir.setReturnValue(false); + } + } + @Inject(method = "setBlockEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;getChunkAt(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/chunk/LevelChunk;",