Skip to content

Commit

Permalink
finish drop of evil yipee
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcat101 committed Dec 3, 2023
1 parent 47d2fa2 commit 595633a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceResult;
Expand Down Expand Up @@ -73,6 +75,7 @@ public ActionResult<ItemStack> use(World world, PlayerEntity player, Hand hand)
if (!player.isCreative()) heldItem.shrink(1);
world.setBlock(pos, Blocks.CURSED_EARTH.get().defaultBlockState().setValue(CursedEarthBlock.SPREADING_DISTANCE_LEFT, CursedEarthBlock.MAX_DISTANCE), Constants.BlockFlags.DEFAULT);

world.playSound(null, pos, SoundEvents.ZOMBIE_VILLAGER_CONVERTED, SoundCategory.BLOCKS, 1, 1);
return ActionResult.success(heldItem);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public void tick(BlockState state, ServerWorld world, BlockPos pos, java.util.Ra
}
if (dirtPos==null) return;

world.levelEvent(2001, dirtPos, Block.getId(world.getBlockState(dirtPos))); // TODO: add config option to disable this
world.setBlock(dirtPos, state.setValue(SPREADING_DISTANCE_LEFT, state.getValue(SPREADING_DISTANCE_LEFT)-1), Constants.BlockFlags.DEFAULT);
});
world.setBlock(pos, state.setValue(SPREADING_DISTANCE_LEFT, 0), Constants.BlockFlags.DEFAULT);
Expand Down

0 comments on commit 595633a

Please sign in to comment.