Skip to content

Commit

Permalink
feat(flesh-mound): prevent flesh veins from eating living flesh
Browse files Browse the repository at this point in the history
  • Loading branch information
Elenterius committed Dec 4, 2023
1 parent e127cf6 commit 36b6e65
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.github.elenterius.biomancy.block.malignantbloom.MalignantBloomBlock;
import com.github.elenterius.biomancy.init.ModBlockProperties;
import com.github.elenterius.biomancy.init.ModBlocks;
import com.github.elenterius.biomancy.init.ModItems;
import com.github.elenterius.biomancy.init.ModSoundEvents;
import com.github.elenterius.biomancy.init.tags.ModBlockTags;
import com.github.elenterius.biomancy.util.ArrayUtil;
Expand Down Expand Up @@ -465,17 +464,7 @@ public void entityInside(BlockState state, Level level, BlockPos pos, Entity ent

ItemStack stack = itemEntity.getItem();

if (stack.is(ModItems.LIVING_FLESH.get())) {
charge = CHARGE.getMax();

Vec3 motion = new Vec3((level.random.nextFloat() - 0.5d) * 0.1d, level.random.nextFloat() * 0.1d + 0.15d, (level.random.nextFloat() - 0.5d) * 0.1d);
((ServerLevel) level).sendParticles(new ItemParticleOption(ParticleTypes.ITEM, stack), itemEntity.getX(), itemEntity.getY(), itemEntity.getZ(), 8, motion.x, motion.y, motion.z, 0.05f);

stack.shrink(1);
setCharge(level, pos, state, charge);
level.playSound(null, pos, ModSoundEvents.DECOMPOSER_EAT.get(), SoundSource.BLOCKS, 0.6f, 0.15f + level.random.nextFloat() * 0.5f);
}
else if (stack.isEdible()) {
if (stack.isEdible()) {
int nutrition = Optional.ofNullable(stack.getFoodProperties(null))
.filter(FoodProperties::isMeat)
.map(FoodProperties::getNutrition).orElse(0);
Expand Down

0 comments on commit 36b6e65

Please sign in to comment.