Skip to content

Commit

Permalink
feat(flesh-mound): decrease volume of growth
Browse files Browse the repository at this point in the history
  • Loading branch information
Elenterius committed Nov 19, 2023
1 parent 8175714 commit e528ba8
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ public void entityInside(BlockState state, Level level, BlockPos pos, Entity ent

stack.shrink(1);
setCharge(level, pos, state, charge);
level.playSound(null, pos, ModSoundEvents.DECOMPOSER_EAT.get(), SoundSource.BLOCKS, 1f, 0.15f + level.random.nextFloat() * 0.5f);
level.playSound(null, pos, ModSoundEvents.DECOMPOSER_EAT.get(), SoundSource.BLOCKS, 0.6f, 0.15f + level.random.nextFloat() * 0.5f);
}
else if (stack.isEdible()) {
int nutrition = Optional.ofNullable(stack.getFoodProperties(null))
Expand All @@ -466,7 +466,7 @@ else if (stack.isEdible()) {
stack.shrink(amount);
charge += amount * nutrition;
setCharge(level, pos, state, charge);
level.playSound(null, pos, ModSoundEvents.DECOMPOSER_EAT.get(), SoundSource.BLOCKS, 1f, 0.15f + level.random.nextFloat() * 0.5f);
level.playSound(null, pos, ModSoundEvents.DECOMPOSER_EAT.get(), SoundSource.BLOCKS, 0.6f, 0.15f + level.random.nextFloat() * 0.5f);
}
}
}
Expand Down Expand Up @@ -518,7 +518,7 @@ else if (energyHandler != null && energyHandler.drainPrimalEnergy(1) > 0) {
float conversionChance = charge / (CHARGE.getMax() + 5f) + populationPct * 0.5f;

if (random.nextFloat() < conversionChance && convert(state, level, pos, directNeighbors, chamber, nearChamberCenterPct)) {
level.playSound(null, pos, ModSoundEvents.FLESH_BLOCK_STEP.get(), SoundSource.BLOCKS, 1.2f, 0.15f + random.nextFloat() * 0.5f);
level.playSound(null, pos, ModSoundEvents.FLESH_BLOCK_STEP.get(), SoundSource.BLOCKS, 0.8f, 0.15f + random.nextFloat() * 0.5f);
//return; //TODO: exiting early hampers growth to a very extreme degree. reevaluate which conversions should return true or be ignored
}

Expand All @@ -527,14 +527,14 @@ else if (energyHandler != null && energyHandler.drainPrimalEnergy(1) > 0) {
if (growthAmount > 0) {
charge -= growthAmount * 2;
state = level.getBlockState(pos);
level.playSound(null, pos, ModSoundEvents.FLESH_BLOCK_STEP.get(), SoundSource.BLOCKS, 1f, 0.15f + random.nextFloat() * 0.5f);
level.playSound(null, pos, ModSoundEvents.FLESH_BLOCK_STEP.get(), SoundSource.BLOCKS, 0.6f, 0.15f + random.nextFloat() * 0.5f);
}
}
else {
if (getSpreader().spreadFromRandomFaceTowardRandomDirection(state, level, pos, random).isPresent()) {
charge -= 2;
state = level.getBlockState(pos);
level.playSound(null, pos, ModSoundEvents.FLESH_BLOCK_STEP.get(), SoundSource.BLOCKS, 1f, 0.15f + random.nextFloat() * 0.5f);
level.playSound(null, pos, ModSoundEvents.FLESH_BLOCK_STEP.get(), SoundSource.BLOCKS, 0.6f, 0.15f + random.nextFloat() * 0.5f);
}
}

Expand Down

0 comments on commit e528ba8

Please sign in to comment.