Snow! Real Magic! ⛄ (NeoForge)

Snow! Real Magic! ⛄ (NeoForge)

40M Downloads

[forge/1.19.2/6.1.0] Server Crash - SnowLayerBlockMixin uses client-only Minecraft class

TigerWalts opened this issue · 0 comments

commented

Mod loader

Forge

Minecraft version

1.19.2

Mod version

6.1.2

Modloader version

forge-43.2.0

Modpack info

Custom modpack

If bug:

  • Can you reproduce this issue with relevant mods only?

If bug: The latest.log file

https://pastebin.com/6VFu136H

Issue description

SnowLayerBlockMixin uses net.minecraft.client.Minecraft in its animateTick method.

[14Jan2023 17:07:39.324] [main/DEBUG] [mixin/]: Mixing SnowLayerBlockMixin from snowrealmagic.mixins.json into net.minecraft.world.level.block.SnowLayerBlock
[14Jan2023 17:07:39.325] [main/DEBUG] [mixin/]: snowrealmagic.mixins.json:SnowLayerBlockMixin: Class version 61 required is higher than the class version supported by the current version of Mixin (JAVA_16 supports class version 60)
[14Jan2023 17:07:39.336] [main/ERROR] [net.minecraftforge.fml.loading.RuntimeDistCleaner/DISTXFORM]: Attempted to load class net/minecraft/client/Minecraft for invalid dist DEDICATED_SERVER
[14Jan2023 17:07:39.336] [main/WARN] [mixin/]: Error loading class: net/minecraft/client/Minecraft (java.lang.RuntimeException: Attempted to load class net/minecraft/client/Minecraft for invalid dist DEDICATED_SERVER)

@Override
public void animateTick(BlockState stateIn, Level worldIn, BlockPos pos, RandomSource rand) {
if (!SnowClientConfig.particleThroughLeaves || rand.nextInt(32) > 0) {
return;
}
Entity entity = Minecraft.getInstance().getCameraEntity();
if (entity != null && entity.blockPosition().distSqr(pos) > 256) {
return;
}
BlockState stateDown = worldIn.getBlockState(pos.below());
if (stateDown.is(BlockTags.LEAVES)) {
double d0 = pos.getX() + rand.nextDouble();
double d1 = pos.getY() - 0.05D;
double d2 = pos.getZ() + rand.nextDouble();
worldIn.addParticle(ParticleTypes.SNOWFLAKE, d0, d1, d2, 0.0D, 0.0D, 0.0D);
}
}