Skip to content

Commit

Permalink
Bone meal particles are now working
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoMett committed Feb 4, 2024
1 parent 143db0d commit 7734222
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.mettsmirnov.mycology.effects;

import com.mojang.authlib.minecraft.client.MinecraftClient;
import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.RandomSource;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.animal.Sheep;
import net.minecraft.world.entity.vehicle.Minecart;
import net.minecraft.world.item.BoneMealItem;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.level.block.Blocks;
Expand Down Expand Up @@ -79,7 +82,9 @@ public class FungusEffects
BlockPos randomPos = pList2.get(new Random().nextInt(pList2.size()));
BonemealableBlock block = (BonemealableBlock) level.getBlockState(randomPos).getBlock();
block.performBonemeal(level, RandomSource.create(), randomPos, level.getBlockState(randomPos));
BoneMealItem.addGrowthParticles(level, randomPos, 100);//This is not working because it's a ServerLevel
//Particles are working with this patch, but I'm not sure about the quality of this code.
if (Minecraft.getInstance().player != null)
BoneMealItem.addGrowthParticles(Minecraft.getInstance().player.clientLevel, randomPos, 0);
}
});

Expand Down

0 comments on commit 7734222

Please sign in to comment.